merge_ruby_client 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/lib/merge_ruby_client/accounting/accounting_periods/client.rb +2 -2
  3. data/lib/merge_ruby_client/accounting/accounts/client.rb +2 -2
  4. data/lib/merge_ruby_client/accounting/attachments/client.rb +2 -2
  5. data/lib/merge_ruby_client/accounting/audit_trail/client.rb +2 -2
  6. data/lib/merge_ruby_client/accounting/balance_sheets/client.rb +2 -2
  7. data/lib/merge_ruby_client/accounting/bank_feed_accounts/client.rb +2 -2
  8. data/lib/merge_ruby_client/accounting/bank_feed_transactions/client.rb +2 -2
  9. data/lib/merge_ruby_client/accounting/cash_flow_statements/client.rb +2 -2
  10. data/lib/merge_ruby_client/accounting/client.rb +7 -0
  11. data/lib/merge_ruby_client/accounting/company_info/client.rb +2 -2
  12. data/lib/merge_ruby_client/accounting/contacts/client.rb +173 -4
  13. data/lib/merge_ruby_client/accounting/credit_notes/client.rb +2 -2
  14. data/lib/merge_ruby_client/accounting/employees/client.rb +35 -8
  15. data/lib/merge_ruby_client/accounting/expense_reports/client.rb +765 -0
  16. data/lib/merge_ruby_client/accounting/expense_reports/types/expense_reports_lines_list_request_expand.rb +73 -0
  17. data/lib/merge_ruby_client/accounting/expense_reports/types/expense_reports_list_request_expand.rb +25 -0
  18. data/lib/merge_ruby_client/accounting/expense_reports/types/expense_reports_retrieve_request_expand.rb +25 -0
  19. data/lib/merge_ruby_client/accounting/expenses/client.rb +6 -6
  20. data/lib/merge_ruby_client/accounting/general_ledger_transactions/client.rb +2 -2
  21. data/lib/merge_ruby_client/accounting/income_statements/client.rb +2 -2
  22. data/lib/merge_ruby_client/accounting/invoices/client.rb +6 -6
  23. data/lib/merge_ruby_client/accounting/issues/client.rb +2 -2
  24. data/lib/merge_ruby_client/accounting/items/client.rb +2 -2
  25. data/lib/merge_ruby_client/accounting/journal_entries/client.rb +6 -6
  26. data/lib/merge_ruby_client/accounting/linked_accounts/client.rb +2 -2
  27. data/lib/merge_ruby_client/accounting/payment_methods/client.rb +2 -2
  28. data/lib/merge_ruby_client/accounting/payment_terms/client.rb +2 -2
  29. data/lib/merge_ruby_client/accounting/payments/client.rb +6 -6
  30. data/lib/merge_ruby_client/accounting/projects/client.rb +35 -8
  31. data/lib/merge_ruby_client/accounting/purchase_orders/client.rb +6 -6
  32. data/lib/merge_ruby_client/accounting/sync_status/client.rb +2 -2
  33. data/lib/merge_ruby_client/accounting/tax_rates/client.rb +2 -2
  34. data/lib/merge_ruby_client/accounting/tracking_categories/client.rb +2 -2
  35. data/lib/merge_ruby_client/accounting/transactions/client.rb +2 -2
  36. data/lib/merge_ruby_client/accounting/transactions/types/transactions_list_request_expand.rb +32 -0
  37. data/lib/merge_ruby_client/accounting/transactions/types/transactions_retrieve_request_expand.rb +32 -0
  38. data/lib/merge_ruby_client/accounting/types/expense_report.rb +869 -0
  39. data/lib/merge_ruby_client/accounting/types/expense_report_company.rb +56 -0
  40. data/lib/merge_ruby_client/accounting/types/expense_report_line.rb +921 -0
  41. data/lib/merge_ruby_client/accounting/types/expense_report_line_account.rb +55 -0
  42. data/lib/merge_ruby_client/accounting/types/expense_report_line_company.rb +56 -0
  43. data/lib/merge_ruby_client/accounting/types/expense_report_line_contact.rb +55 -0
  44. data/lib/merge_ruby_client/accounting/types/expense_report_line_employee.rb +57 -0
  45. data/lib/merge_ruby_client/accounting/types/expense_report_line_project.rb +55 -0
  46. data/lib/merge_ruby_client/accounting/types/expense_report_line_request.rb +899 -0
  47. data/lib/merge_ruby_client/accounting/types/expense_report_line_request_account.rb +55 -0
  48. data/lib/merge_ruby_client/accounting/types/expense_report_line_request_company.rb +56 -0
  49. data/lib/merge_ruby_client/accounting/types/expense_report_line_request_contact.rb +55 -0
  50. data/lib/merge_ruby_client/accounting/types/expense_report_line_request_employee.rb +57 -0
  51. data/lib/merge_ruby_client/accounting/types/expense_report_line_request_project.rb +55 -0
  52. data/lib/merge_ruby_client/accounting/types/expense_report_line_request_tax_rate.rb +55 -0
  53. data/lib/merge_ruby_client/accounting/types/expense_report_line_tax_rate.rb +55 -0
  54. data/lib/merge_ruby_client/accounting/types/expense_report_request.rb +819 -0
  55. data/lib/merge_ruby_client/accounting/types/expense_report_request_accounting_period.rb +56 -0
  56. data/lib/merge_ruby_client/accounting/types/expense_report_request_company.rb +56 -0
  57. data/lib/merge_ruby_client/accounting/types/expense_report_request_employee.rb +57 -0
  58. data/lib/merge_ruby_client/accounting/types/expense_report_response.rb +101 -0
  59. data/lib/merge_ruby_client/accounting/types/expense_report_status_enum.rb +16 -0
  60. data/lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb +12 -1
  61. data/lib/merge_ruby_client/accounting/types/field_mapping_api_instance_response.rb +12 -1
  62. data/lib/merge_ruby_client/accounting/types/item.rb +18 -1
  63. data/lib/merge_ruby_client/accounting/types/paginated_expense_report_line_list.rb +80 -0
  64. data/lib/merge_ruby_client/accounting/types/paginated_expense_report_list.rb +80 -0
  65. data/lib/merge_ruby_client/accounting/types/patched_contact_request.rb +188 -0
  66. data/lib/merge_ruby_client/accounting/types/patched_contact_request_addresses_item.rb +55 -0
  67. data/lib/merge_ruby_client/accounting/types/remote_field_class.rb +9 -1
  68. data/lib/merge_ruby_client/accounting/vendor_credits/client.rb +2 -2
  69. data/lib/merge_ruby_client/ats/activities/client.rb +2 -2
  70. data/lib/merge_ruby_client/ats/applications/client.rb +2 -2
  71. data/lib/merge_ruby_client/ats/attachments/client.rb +2 -2
  72. data/lib/merge_ruby_client/ats/audit_trail/client.rb +2 -2
  73. data/lib/merge_ruby_client/ats/candidates/client.rb +2 -2
  74. data/lib/merge_ruby_client/ats/departments/client.rb +2 -2
  75. data/lib/merge_ruby_client/ats/eeocs/client.rb +2 -2
  76. data/lib/merge_ruby_client/ats/interviews/client.rb +2 -2
  77. data/lib/merge_ruby_client/ats/issues/client.rb +2 -2
  78. data/lib/merge_ruby_client/ats/job_interview_stages/client.rb +2 -2
  79. data/lib/merge_ruby_client/ats/job_postings/client.rb +2 -2
  80. data/lib/merge_ruby_client/ats/jobs/client.rb +4 -4
  81. data/lib/merge_ruby_client/ats/linked_accounts/client.rb +2 -2
  82. data/lib/merge_ruby_client/ats/offers/client.rb +2 -2
  83. data/lib/merge_ruby_client/ats/offices/client.rb +2 -2
  84. data/lib/merge_ruby_client/ats/reject_reasons/client.rb +2 -2
  85. data/lib/merge_ruby_client/ats/scorecards/client.rb +2 -2
  86. data/lib/merge_ruby_client/ats/sync_status/client.rb +2 -2
  87. data/lib/merge_ruby_client/ats/tags/client.rb +2 -2
  88. data/lib/merge_ruby_client/ats/types/event_type_enum.rb +1 -0
  89. data/lib/merge_ruby_client/ats/users/client.rb +2 -2
  90. data/lib/merge_ruby_client/crm/accounts/client.rb +4 -4
  91. data/lib/merge_ruby_client/crm/association_types/client.rb +2 -2
  92. data/lib/merge_ruby_client/crm/associations/client.rb +10 -2
  93. data/lib/merge_ruby_client/crm/audit_trail/client.rb +2 -2
  94. data/lib/merge_ruby_client/crm/contacts/client.rb +4 -4
  95. data/lib/merge_ruby_client/crm/custom_object_classes/client.rb +2 -2
  96. data/lib/merge_ruby_client/crm/custom_objects/client.rb +4 -4
  97. data/lib/merge_ruby_client/crm/engagement_types/client.rb +4 -4
  98. data/lib/merge_ruby_client/crm/engagements/client.rb +4 -4
  99. data/lib/merge_ruby_client/crm/issues/client.rb +2 -2
  100. data/lib/merge_ruby_client/crm/leads/client.rb +4 -4
  101. data/lib/merge_ruby_client/crm/linked_accounts/client.rb +2 -2
  102. data/lib/merge_ruby_client/crm/notes/client.rb +4 -4
  103. data/lib/merge_ruby_client/crm/opportunities/client.rb +4 -4
  104. data/lib/merge_ruby_client/crm/stages/client.rb +4 -4
  105. data/lib/merge_ruby_client/crm/sync_status/client.rb +2 -2
  106. data/lib/merge_ruby_client/crm/tasks/client.rb +4 -4
  107. data/lib/merge_ruby_client/crm/types/remote_field_class.rb +9 -1
  108. data/lib/merge_ruby_client/crm/users/client.rb +4 -4
  109. data/lib/merge_ruby_client/filestorage/audit_trail/client.rb +2 -2
  110. data/lib/merge_ruby_client/filestorage/drives/client.rb +2 -2
  111. data/lib/merge_ruby_client/filestorage/files/client.rb +28 -10
  112. data/lib/merge_ruby_client/filestorage/folders/client.rb +2 -2
  113. data/lib/merge_ruby_client/filestorage/groups/client.rb +2 -2
  114. data/lib/merge_ruby_client/filestorage/issues/client.rb +2 -2
  115. data/lib/merge_ruby_client/filestorage/linked_accounts/client.rb +2 -2
  116. data/lib/merge_ruby_client/filestorage/sync_status/client.rb +2 -2
  117. data/lib/merge_ruby_client/filestorage/users/client.rb +2 -2
  118. data/lib/merge_ruby_client/hris/audit_trail/client.rb +2 -2
  119. data/lib/merge_ruby_client/hris/bank_info/client.rb +2 -2
  120. data/lib/merge_ruby_client/hris/benefits/client.rb +2 -2
  121. data/lib/merge_ruby_client/hris/companies/client.rb +2 -2
  122. data/lib/merge_ruby_client/hris/dependents/client.rb +8 -4
  123. data/lib/merge_ruby_client/hris/employee_payroll_runs/client.rb +2 -2
  124. data/lib/merge_ruby_client/hris/employees/client.rb +8 -4
  125. data/lib/merge_ruby_client/hris/employer_benefits/client.rb +2 -2
  126. data/lib/merge_ruby_client/hris/employments/client.rb +2 -2
  127. data/lib/merge_ruby_client/hris/groups/client.rb +2 -2
  128. data/lib/merge_ruby_client/hris/issues/client.rb +2 -2
  129. data/lib/merge_ruby_client/hris/linked_accounts/client.rb +2 -2
  130. data/lib/merge_ruby_client/hris/locations/client.rb +2 -2
  131. data/lib/merge_ruby_client/hris/pay_groups/client.rb +2 -2
  132. data/lib/merge_ruby_client/hris/payroll_runs/client.rb +2 -2
  133. data/lib/merge_ruby_client/hris/sync_status/client.rb +2 -2
  134. data/lib/merge_ruby_client/hris/teams/client.rb +2 -2
  135. data/lib/merge_ruby_client/hris/time_off/client.rb +2 -2
  136. data/lib/merge_ruby_client/hris/time_off_balances/client.rb +2 -2
  137. data/lib/merge_ruby_client/hris/timesheet_entries/client.rb +2 -2
  138. data/lib/merge_ruby_client/hris/types/benefit.rb +9 -9
  139. data/lib/merge_ruby_client/ticketing/accounts/client.rb +2 -2
  140. data/lib/merge_ruby_client/ticketing/attachments/client.rb +2 -2
  141. data/lib/merge_ruby_client/ticketing/audit_trail/client.rb +2 -2
  142. data/lib/merge_ruby_client/ticketing/collections/client.rb +4 -4
  143. data/lib/merge_ruby_client/ticketing/comments/client.rb +2 -2
  144. data/lib/merge_ruby_client/ticketing/contacts/client.rb +2 -2
  145. data/lib/merge_ruby_client/ticketing/issues/client.rb +2 -2
  146. data/lib/merge_ruby_client/ticketing/linked_accounts/client.rb +2 -2
  147. data/lib/merge_ruby_client/ticketing/projects/client.rb +4 -4
  148. data/lib/merge_ruby_client/ticketing/roles/client.rb +2 -2
  149. data/lib/merge_ruby_client/ticketing/sync_status/client.rb +2 -2
  150. data/lib/merge_ruby_client/ticketing/tags/client.rb +2 -2
  151. data/lib/merge_ruby_client/ticketing/teams/client.rb +2 -2
  152. data/lib/merge_ruby_client/ticketing/tickets/client.rb +14 -10
  153. data/lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb +9 -9
  154. data/lib/merge_ruby_client/ticketing/types/remote_field_class.rb +9 -1
  155. data/lib/merge_ruby_client/ticketing/users/client.rb +2 -2
  156. data/lib/merge_ruby_client.rb +7 -7
  157. data/lib/requests.rb +2 -2
  158. data/lib/types_export.rb +230 -201
  159. metadata +32 -2
@@ -0,0 +1,765 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require "date"
5
+ require_relative "types/expense_reports_list_request_expand"
6
+ require_relative "../types/paginated_expense_report_list"
7
+ require_relative "../types/expense_report_request"
8
+ require_relative "../types/expense_report_response"
9
+ require_relative "types/expense_reports_lines_list_request_expand"
10
+ require_relative "../types/paginated_expense_report_line_list"
11
+ require_relative "types/expense_reports_retrieve_request_expand"
12
+ require_relative "../types/expense_report"
13
+ require_relative "../types/paginated_remote_field_class_list"
14
+ require_relative "../types/meta_response"
15
+ require "async"
16
+
17
+ module Merge
18
+ module Accounting
19
+ class ExpenseReportsClient
20
+ # @return [Merge::RequestClient]
21
+ attr_reader :request_client
22
+
23
+ # @param request_client [Merge::RequestClient]
24
+ # @return [Merge::Accounting::ExpenseReportsClient]
25
+ def initialize(request_client:)
26
+ @request_client = request_client
27
+ end
28
+
29
+ # Returns a list of `ExpenseReport` objects.
30
+ #
31
+ # @param company_id [String] If provided, will only return expense reports for this company.
32
+ # @param created_after [DateTime] If provided, will only return objects created after this datetime.
33
+ # @param created_before [DateTime] If provided, will only return objects created before this datetime.
34
+ # @param cursor [String] The pagination cursor value.
35
+ # @param expand [Merge::Accounting::ExpenseReports::ExpenseReportsListRequestExpand] Which relations should be returned in expanded form. Multiple relation names
36
+ # should be comma separated without spaces.
37
+ # @param include_deleted_data [Boolean] Indicates whether or not this object has been deleted in the third party
38
+ # platform. Full coverage deletion detection is a premium add-on. Native deletion
39
+ # detection is offered for free with limited coverage. [Learn
40
+ # more](https://docs.merge.dev/integrations/hris/supported-features/).
41
+ # @param include_remote_data [Boolean] Whether to include the original data Merge fetched from the third-party to
42
+ # produce these models.
43
+ # @param include_remote_fields [Boolean] Whether to include all remote fields, including fields that Merge did not map to
44
+ # common models, in a normalized format.
45
+ # @param include_shell_data [Boolean] Whether to include shell records. Shell records are empty records (they may
46
+ # contain some metadata but all other fields are null).
47
+ # @param modified_after [DateTime] If provided, only objects synced by Merge after this date time will be returned.
48
+ # @param modified_before [DateTime] If provided, only objects synced by Merge before this date time will be
49
+ # returned.
50
+ # @param page_size [Integer] Number of results to return per page.
51
+ # @param remote_id [String] The API provider's ID for the given object.
52
+ # @param request_options [Merge::RequestOptions]
53
+ # @return [Merge::Accounting::PaginatedExpenseReportList]
54
+ # @example
55
+ # api = Merge::Client.new(
56
+ # base_url: "https://api.example.com",
57
+ # environment: Merge::Environment::PRODUCTION,
58
+ # api_key: "YOUR_AUTH_TOKEN"
59
+ # )
60
+ # api.accounting.expense_reports.list(cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw")
61
+ def list(company_id: nil, created_after: nil, created_before: nil, cursor: nil, expand: nil,
62
+ include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, modified_after: nil, modified_before: nil, page_size: nil, remote_id: nil, request_options: nil)
63
+ response = @request_client.conn.get do |req|
64
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
65
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
66
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
67
+ req.headers = {
68
+ **(req.headers || {}),
69
+ **@request_client.get_headers,
70
+ **(request_options&.additional_headers || {})
71
+ }.compact
72
+ req.params = {
73
+ **(request_options&.additional_query_parameters || {}),
74
+ "company_id": company_id,
75
+ "created_after": created_after,
76
+ "created_before": created_before,
77
+ "cursor": cursor,
78
+ "expand": expand,
79
+ "include_deleted_data": include_deleted_data,
80
+ "include_remote_data": include_remote_data,
81
+ "include_remote_fields": include_remote_fields,
82
+ "include_shell_data": include_shell_data,
83
+ "modified_after": modified_after,
84
+ "modified_before": modified_before,
85
+ "page_size": page_size,
86
+ "remote_id": remote_id
87
+ }.compact
88
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
89
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
90
+ end
91
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports"
92
+ end
93
+ Merge::Accounting::PaginatedExpenseReportList.from_json(json_object: response.body)
94
+ end
95
+
96
+ # Creates an `ExpenseReport` object with the given values.
97
+ #
98
+ # @param is_debug_mode [Boolean] Whether to include debug fields (such as log file links) in the response.
99
+ # @param run_async [Boolean] Whether or not third-party updates should be run asynchronously.
100
+ # @param model [Hash] Request of type Merge::Accounting::ExpenseReportRequest, as a Hash
101
+ # * :report_date (DateTime)
102
+ # * :report_identifier (String)
103
+ # * :employee (Hash)
104
+ # * :status (Merge::Accounting::ExpenseReportStatusEnum)
105
+ # * :total_amount (Float)
106
+ # * :currency (Merge::Accounting::TransactionCurrencyEnum)
107
+ # * :description (String)
108
+ # * :accounting_period (Hash)
109
+ # * :company (Hash)
110
+ # * :tracking_categories (Array<String>)
111
+ # * :integration_params (Hash{String => Object})
112
+ # * :linked_account_params (Hash{String => Object})
113
+ # * :remote_fields (Array<Merge::Accounting::RemoteFieldRequest>)
114
+ # @param request_options [Merge::RequestOptions]
115
+ # @return [Merge::Accounting::ExpenseReportResponse]
116
+ # @example
117
+ # api = Merge::Client.new(
118
+ # base_url: "https://api.example.com",
119
+ # environment: Merge::Environment::PRODUCTION,
120
+ # api_key: "YOUR_AUTH_TOKEN"
121
+ # )
122
+ # api.accounting.expense_reports.create(model: { tracking_categories: ["a1b2c3d4-e5f6-4a5b-9c3d-2e1f0a9b8c7d", "d4c3b2a1-9e8f-7g6h-5i4j-3k2l1m0n9o8p"] })
123
+ def create(model:, is_debug_mode: nil, run_async: nil, request_options: nil)
124
+ response = @request_client.conn.post do |req|
125
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
126
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
127
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
128
+ req.headers = {
129
+ **(req.headers || {}),
130
+ **@request_client.get_headers,
131
+ **(request_options&.additional_headers || {})
132
+ }.compact
133
+ req.params = {
134
+ **(request_options&.additional_query_parameters || {}),
135
+ "is_debug_mode": is_debug_mode,
136
+ "run_async": run_async
137
+ }.compact
138
+ req.body = { **(request_options&.additional_body_parameters || {}), model: model }.compact
139
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports"
140
+ end
141
+ Merge::Accounting::ExpenseReportResponse.from_json(json_object: response.body)
142
+ end
143
+
144
+ # Returns a list of `ExpenseReportLine` objects that point to a `ExpenseReport`
145
+ # with the given id.
146
+ #
147
+ # @param expense_report_id [String]
148
+ # @param cursor [String] The pagination cursor value.
149
+ # @param expand [Merge::Accounting::ExpenseReports::ExpenseReportsLinesListRequestExpand] Which relations should be returned in expanded form. Multiple relation names
150
+ # should be comma separated without spaces.
151
+ # @param include_deleted_data [Boolean] Indicates whether or not this object has been deleted in the third party
152
+ # platform. Full coverage deletion detection is a premium add-on. Native deletion
153
+ # detection is offered for free with limited coverage. [Learn
154
+ # more](https://docs.merge.dev/integrations/hris/supported-features/).
155
+ # @param include_remote_data [Boolean] Whether to include the original data Merge fetched from the third-party to
156
+ # produce these models.
157
+ # @param include_remote_fields [Boolean] Whether to include all remote fields, including fields that Merge did not map to
158
+ # common models, in a normalized format.
159
+ # @param include_shell_data [Boolean] Whether to include shell records. Shell records are empty records (they may
160
+ # contain some metadata but all other fields are null).
161
+ # @param page_size [Integer] Number of results to return per page.
162
+ # @param request_options [Merge::RequestOptions]
163
+ # @return [Merge::Accounting::PaginatedExpenseReportLineList]
164
+ # @example
165
+ # api = Merge::Client.new(
166
+ # base_url: "https://api.example.com",
167
+ # environment: Merge::Environment::PRODUCTION,
168
+ # api_key: "YOUR_AUTH_TOKEN"
169
+ # )
170
+ # api.accounting.expense_reports.lines_list(expense_report_id: "expense_report_id", cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw")
171
+ def lines_list(expense_report_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil,
172
+ include_remote_fields: nil, include_shell_data: nil, page_size: nil, request_options: nil)
173
+ response = @request_client.conn.get do |req|
174
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
175
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
176
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
177
+ req.headers = {
178
+ **(req.headers || {}),
179
+ **@request_client.get_headers,
180
+ **(request_options&.additional_headers || {})
181
+ }.compact
182
+ req.params = {
183
+ **(request_options&.additional_query_parameters || {}),
184
+ "cursor": cursor,
185
+ "expand": expand,
186
+ "include_deleted_data": include_deleted_data,
187
+ "include_remote_data": include_remote_data,
188
+ "include_remote_fields": include_remote_fields,
189
+ "include_shell_data": include_shell_data,
190
+ "page_size": page_size
191
+ }.compact
192
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
193
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
194
+ end
195
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports/#{expense_report_id}/lines"
196
+ end
197
+ Merge::Accounting::PaginatedExpenseReportLineList.from_json(json_object: response.body)
198
+ end
199
+
200
+ # Returns an `ExpenseReport` object with the given `id`.
201
+ #
202
+ # @param id [String]
203
+ # @param expand [Merge::Accounting::ExpenseReports::ExpenseReportsRetrieveRequestExpand] Which relations should be returned in expanded form. Multiple relation names
204
+ # should be comma separated without spaces.
205
+ # @param include_remote_data [Boolean] Whether to include the original data Merge fetched from the third-party to
206
+ # produce these models.
207
+ # @param include_remote_fields [Boolean] Whether to include all remote fields, including fields that Merge did not map to
208
+ # common models, in a normalized format.
209
+ # @param include_shell_data [Boolean] Whether to include shell records. Shell records are empty records (they may
210
+ # contain some metadata but all other fields are null).
211
+ # @param request_options [Merge::RequestOptions]
212
+ # @return [Merge::Accounting::ExpenseReport]
213
+ # @example
214
+ # api = Merge::Client.new(
215
+ # base_url: "https://api.example.com",
216
+ # environment: Merge::Environment::PRODUCTION,
217
+ # api_key: "YOUR_AUTH_TOKEN"
218
+ # )
219
+ # api.accounting.expense_reports.retrieve(id: "id")
220
+ def retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil,
221
+ request_options: nil)
222
+ response = @request_client.conn.get do |req|
223
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
224
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
225
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
226
+ req.headers = {
227
+ **(req.headers || {}),
228
+ **@request_client.get_headers,
229
+ **(request_options&.additional_headers || {})
230
+ }.compact
231
+ req.params = {
232
+ **(request_options&.additional_query_parameters || {}),
233
+ "expand": expand,
234
+ "include_remote_data": include_remote_data,
235
+ "include_remote_fields": include_remote_fields,
236
+ "include_shell_data": include_shell_data
237
+ }.compact
238
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
239
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
240
+ end
241
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports/#{id}"
242
+ end
243
+ Merge::Accounting::ExpenseReport.from_json(json_object: response.body)
244
+ end
245
+
246
+ # Returns a list of `RemoteFieldClass` objects.
247
+ #
248
+ # @param cursor [String] The pagination cursor value.
249
+ # @param include_deleted_data [Boolean] Indicates whether or not this object has been deleted in the third party
250
+ # platform. Full coverage deletion detection is a premium add-on. Native deletion
251
+ # detection is offered for free with limited coverage. [Learn
252
+ # more](https://docs.merge.dev/integrations/hris/supported-features/).
253
+ # @param include_remote_data [Boolean] Whether to include the original data Merge fetched from the third-party to
254
+ # produce these models.
255
+ # @param include_shell_data [Boolean] Whether to include shell records. Shell records are empty records (they may
256
+ # contain some metadata but all other fields are null).
257
+ # @param is_common_model_field [Boolean] If provided, will only return remote field classes with this
258
+ # is_common_model_field value
259
+ # @param is_custom [Boolean] If provided, will only return remote fields classes with this is_custom value
260
+ # @param page_size [Integer] Number of results to return per page.
261
+ # @param request_options [Merge::RequestOptions]
262
+ # @return [Merge::Accounting::PaginatedRemoteFieldClassList]
263
+ # @example
264
+ # api = Merge::Client.new(
265
+ # base_url: "https://api.example.com",
266
+ # environment: Merge::Environment::PRODUCTION,
267
+ # api_key: "YOUR_AUTH_TOKEN"
268
+ # )
269
+ # api.accounting.expense_reports.lines_remote_field_classes_list(cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw")
270
+ def lines_remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil,
271
+ include_shell_data: nil, is_common_model_field: nil, is_custom: nil, page_size: nil, request_options: nil)
272
+ response = @request_client.conn.get do |req|
273
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
274
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
275
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
276
+ req.headers = {
277
+ **(req.headers || {}),
278
+ **@request_client.get_headers,
279
+ **(request_options&.additional_headers || {})
280
+ }.compact
281
+ req.params = {
282
+ **(request_options&.additional_query_parameters || {}),
283
+ "cursor": cursor,
284
+ "include_deleted_data": include_deleted_data,
285
+ "include_remote_data": include_remote_data,
286
+ "include_shell_data": include_shell_data,
287
+ "is_common_model_field": is_common_model_field,
288
+ "is_custom": is_custom,
289
+ "page_size": page_size
290
+ }.compact
291
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
292
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
293
+ end
294
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports/lines/remote-field-classes"
295
+ end
296
+ Merge::Accounting::PaginatedRemoteFieldClassList.from_json(json_object: response.body)
297
+ end
298
+
299
+ # Returns metadata for `ExpenseReport` POSTs.
300
+ #
301
+ # @param request_options [Merge::RequestOptions]
302
+ # @return [Merge::Accounting::MetaResponse]
303
+ # @example
304
+ # api = Merge::Client.new(
305
+ # base_url: "https://api.example.com",
306
+ # environment: Merge::Environment::PRODUCTION,
307
+ # api_key: "YOUR_AUTH_TOKEN"
308
+ # )
309
+ # api.accounting.expense_reports.meta_post_retrieve
310
+ def meta_post_retrieve(request_options: nil)
311
+ response = @request_client.conn.get do |req|
312
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
313
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
314
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
315
+ req.headers = {
316
+ **(req.headers || {}),
317
+ **@request_client.get_headers,
318
+ **(request_options&.additional_headers || {})
319
+ }.compact
320
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
321
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
322
+ end
323
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
324
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
325
+ end
326
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports/meta/post"
327
+ end
328
+ Merge::Accounting::MetaResponse.from_json(json_object: response.body)
329
+ end
330
+
331
+ # Returns a list of `RemoteFieldClass` objects.
332
+ #
333
+ # @param cursor [String] The pagination cursor value.
334
+ # @param include_deleted_data [Boolean] Indicates whether or not this object has been deleted in the third party
335
+ # platform. Full coverage deletion detection is a premium add-on. Native deletion
336
+ # detection is offered for free with limited coverage. [Learn
337
+ # more](https://docs.merge.dev/integrations/hris/supported-features/).
338
+ # @param include_remote_data [Boolean] Whether to include the original data Merge fetched from the third-party to
339
+ # produce these models.
340
+ # @param include_shell_data [Boolean] Whether to include shell records. Shell records are empty records (they may
341
+ # contain some metadata but all other fields are null).
342
+ # @param is_common_model_field [Boolean] If provided, will only return remote field classes with this
343
+ # is_common_model_field value
344
+ # @param is_custom [Boolean] If provided, will only return remote fields classes with this is_custom value
345
+ # @param page_size [Integer] Number of results to return per page.
346
+ # @param request_options [Merge::RequestOptions]
347
+ # @return [Merge::Accounting::PaginatedRemoteFieldClassList]
348
+ # @example
349
+ # api = Merge::Client.new(
350
+ # base_url: "https://api.example.com",
351
+ # environment: Merge::Environment::PRODUCTION,
352
+ # api_key: "YOUR_AUTH_TOKEN"
353
+ # )
354
+ # api.accounting.expense_reports.remote_field_classes_list(cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw")
355
+ def remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil,
356
+ include_shell_data: nil, is_common_model_field: nil, is_custom: nil, page_size: nil, request_options: nil)
357
+ response = @request_client.conn.get do |req|
358
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
359
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
360
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
361
+ req.headers = {
362
+ **(req.headers || {}),
363
+ **@request_client.get_headers,
364
+ **(request_options&.additional_headers || {})
365
+ }.compact
366
+ req.params = {
367
+ **(request_options&.additional_query_parameters || {}),
368
+ "cursor": cursor,
369
+ "include_deleted_data": include_deleted_data,
370
+ "include_remote_data": include_remote_data,
371
+ "include_shell_data": include_shell_data,
372
+ "is_common_model_field": is_common_model_field,
373
+ "is_custom": is_custom,
374
+ "page_size": page_size
375
+ }.compact
376
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
377
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
378
+ end
379
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports/remote-field-classes"
380
+ end
381
+ Merge::Accounting::PaginatedRemoteFieldClassList.from_json(json_object: response.body)
382
+ end
383
+ end
384
+
385
+ class AsyncExpenseReportsClient
386
+ # @return [Merge::AsyncRequestClient]
387
+ attr_reader :request_client
388
+
389
+ # @param request_client [Merge::AsyncRequestClient]
390
+ # @return [Merge::Accounting::AsyncExpenseReportsClient]
391
+ def initialize(request_client:)
392
+ @request_client = request_client
393
+ end
394
+
395
+ # Returns a list of `ExpenseReport` objects.
396
+ #
397
+ # @param company_id [String] If provided, will only return expense reports for this company.
398
+ # @param created_after [DateTime] If provided, will only return objects created after this datetime.
399
+ # @param created_before [DateTime] If provided, will only return objects created before this datetime.
400
+ # @param cursor [String] The pagination cursor value.
401
+ # @param expand [Merge::Accounting::ExpenseReports::ExpenseReportsListRequestExpand] Which relations should be returned in expanded form. Multiple relation names
402
+ # should be comma separated without spaces.
403
+ # @param include_deleted_data [Boolean] Indicates whether or not this object has been deleted in the third party
404
+ # platform. Full coverage deletion detection is a premium add-on. Native deletion
405
+ # detection is offered for free with limited coverage. [Learn
406
+ # more](https://docs.merge.dev/integrations/hris/supported-features/).
407
+ # @param include_remote_data [Boolean] Whether to include the original data Merge fetched from the third-party to
408
+ # produce these models.
409
+ # @param include_remote_fields [Boolean] Whether to include all remote fields, including fields that Merge did not map to
410
+ # common models, in a normalized format.
411
+ # @param include_shell_data [Boolean] Whether to include shell records. Shell records are empty records (they may
412
+ # contain some metadata but all other fields are null).
413
+ # @param modified_after [DateTime] If provided, only objects synced by Merge after this date time will be returned.
414
+ # @param modified_before [DateTime] If provided, only objects synced by Merge before this date time will be
415
+ # returned.
416
+ # @param page_size [Integer] Number of results to return per page.
417
+ # @param remote_id [String] The API provider's ID for the given object.
418
+ # @param request_options [Merge::RequestOptions]
419
+ # @return [Merge::Accounting::PaginatedExpenseReportList]
420
+ # @example
421
+ # api = Merge::Client.new(
422
+ # base_url: "https://api.example.com",
423
+ # environment: Merge::Environment::PRODUCTION,
424
+ # api_key: "YOUR_AUTH_TOKEN"
425
+ # )
426
+ # api.accounting.expense_reports.list(cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw")
427
+ def list(company_id: nil, created_after: nil, created_before: nil, cursor: nil, expand: nil,
428
+ include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, modified_after: nil, modified_before: nil, page_size: nil, remote_id: nil, request_options: nil)
429
+ Async do
430
+ response = @request_client.conn.get do |req|
431
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
432
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
433
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
434
+ req.headers = {
435
+ **(req.headers || {}),
436
+ **@request_client.get_headers,
437
+ **(request_options&.additional_headers || {})
438
+ }.compact
439
+ req.params = {
440
+ **(request_options&.additional_query_parameters || {}),
441
+ "company_id": company_id,
442
+ "created_after": created_after,
443
+ "created_before": created_before,
444
+ "cursor": cursor,
445
+ "expand": expand,
446
+ "include_deleted_data": include_deleted_data,
447
+ "include_remote_data": include_remote_data,
448
+ "include_remote_fields": include_remote_fields,
449
+ "include_shell_data": include_shell_data,
450
+ "modified_after": modified_after,
451
+ "modified_before": modified_before,
452
+ "page_size": page_size,
453
+ "remote_id": remote_id
454
+ }.compact
455
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
456
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
457
+ end
458
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports"
459
+ end
460
+ Merge::Accounting::PaginatedExpenseReportList.from_json(json_object: response.body)
461
+ end
462
+ end
463
+
464
+ # Creates an `ExpenseReport` object with the given values.
465
+ #
466
+ # @param is_debug_mode [Boolean] Whether to include debug fields (such as log file links) in the response.
467
+ # @param run_async [Boolean] Whether or not third-party updates should be run asynchronously.
468
+ # @param model [Hash] Request of type Merge::Accounting::ExpenseReportRequest, as a Hash
469
+ # * :report_date (DateTime)
470
+ # * :report_identifier (String)
471
+ # * :employee (Hash)
472
+ # * :status (Merge::Accounting::ExpenseReportStatusEnum)
473
+ # * :total_amount (Float)
474
+ # * :currency (Merge::Accounting::TransactionCurrencyEnum)
475
+ # * :description (String)
476
+ # * :accounting_period (Hash)
477
+ # * :company (Hash)
478
+ # * :tracking_categories (Array<String>)
479
+ # * :integration_params (Hash{String => Object})
480
+ # * :linked_account_params (Hash{String => Object})
481
+ # * :remote_fields (Array<Merge::Accounting::RemoteFieldRequest>)
482
+ # @param request_options [Merge::RequestOptions]
483
+ # @return [Merge::Accounting::ExpenseReportResponse]
484
+ # @example
485
+ # api = Merge::Client.new(
486
+ # base_url: "https://api.example.com",
487
+ # environment: Merge::Environment::PRODUCTION,
488
+ # api_key: "YOUR_AUTH_TOKEN"
489
+ # )
490
+ # api.accounting.expense_reports.create(model: { tracking_categories: ["a1b2c3d4-e5f6-4a5b-9c3d-2e1f0a9b8c7d", "d4c3b2a1-9e8f-7g6h-5i4j-3k2l1m0n9o8p"] })
491
+ def create(model:, is_debug_mode: nil, run_async: nil, request_options: nil)
492
+ Async do
493
+ response = @request_client.conn.post do |req|
494
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
495
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
496
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
497
+ req.headers = {
498
+ **(req.headers || {}),
499
+ **@request_client.get_headers,
500
+ **(request_options&.additional_headers || {})
501
+ }.compact
502
+ req.params = {
503
+ **(request_options&.additional_query_parameters || {}),
504
+ "is_debug_mode": is_debug_mode,
505
+ "run_async": run_async
506
+ }.compact
507
+ req.body = { **(request_options&.additional_body_parameters || {}), model: model }.compact
508
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports"
509
+ end
510
+ Merge::Accounting::ExpenseReportResponse.from_json(json_object: response.body)
511
+ end
512
+ end
513
+
514
+ # Returns a list of `ExpenseReportLine` objects that point to a `ExpenseReport`
515
+ # with the given id.
516
+ #
517
+ # @param expense_report_id [String]
518
+ # @param cursor [String] The pagination cursor value.
519
+ # @param expand [Merge::Accounting::ExpenseReports::ExpenseReportsLinesListRequestExpand] Which relations should be returned in expanded form. Multiple relation names
520
+ # should be comma separated without spaces.
521
+ # @param include_deleted_data [Boolean] Indicates whether or not this object has been deleted in the third party
522
+ # platform. Full coverage deletion detection is a premium add-on. Native deletion
523
+ # detection is offered for free with limited coverage. [Learn
524
+ # more](https://docs.merge.dev/integrations/hris/supported-features/).
525
+ # @param include_remote_data [Boolean] Whether to include the original data Merge fetched from the third-party to
526
+ # produce these models.
527
+ # @param include_remote_fields [Boolean] Whether to include all remote fields, including fields that Merge did not map to
528
+ # common models, in a normalized format.
529
+ # @param include_shell_data [Boolean] Whether to include shell records. Shell records are empty records (they may
530
+ # contain some metadata but all other fields are null).
531
+ # @param page_size [Integer] Number of results to return per page.
532
+ # @param request_options [Merge::RequestOptions]
533
+ # @return [Merge::Accounting::PaginatedExpenseReportLineList]
534
+ # @example
535
+ # api = Merge::Client.new(
536
+ # base_url: "https://api.example.com",
537
+ # environment: Merge::Environment::PRODUCTION,
538
+ # api_key: "YOUR_AUTH_TOKEN"
539
+ # )
540
+ # api.accounting.expense_reports.lines_list(expense_report_id: "expense_report_id", cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw")
541
+ def lines_list(expense_report_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil,
542
+ include_remote_fields: nil, include_shell_data: nil, page_size: nil, request_options: nil)
543
+ Async do
544
+ response = @request_client.conn.get do |req|
545
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
546
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
547
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
548
+ req.headers = {
549
+ **(req.headers || {}),
550
+ **@request_client.get_headers,
551
+ **(request_options&.additional_headers || {})
552
+ }.compact
553
+ req.params = {
554
+ **(request_options&.additional_query_parameters || {}),
555
+ "cursor": cursor,
556
+ "expand": expand,
557
+ "include_deleted_data": include_deleted_data,
558
+ "include_remote_data": include_remote_data,
559
+ "include_remote_fields": include_remote_fields,
560
+ "include_shell_data": include_shell_data,
561
+ "page_size": page_size
562
+ }.compact
563
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
564
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
565
+ end
566
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports/#{expense_report_id}/lines"
567
+ end
568
+ Merge::Accounting::PaginatedExpenseReportLineList.from_json(json_object: response.body)
569
+ end
570
+ end
571
+
572
+ # Returns an `ExpenseReport` object with the given `id`.
573
+ #
574
+ # @param id [String]
575
+ # @param expand [Merge::Accounting::ExpenseReports::ExpenseReportsRetrieveRequestExpand] Which relations should be returned in expanded form. Multiple relation names
576
+ # should be comma separated without spaces.
577
+ # @param include_remote_data [Boolean] Whether to include the original data Merge fetched from the third-party to
578
+ # produce these models.
579
+ # @param include_remote_fields [Boolean] Whether to include all remote fields, including fields that Merge did not map to
580
+ # common models, in a normalized format.
581
+ # @param include_shell_data [Boolean] Whether to include shell records. Shell records are empty records (they may
582
+ # contain some metadata but all other fields are null).
583
+ # @param request_options [Merge::RequestOptions]
584
+ # @return [Merge::Accounting::ExpenseReport]
585
+ # @example
586
+ # api = Merge::Client.new(
587
+ # base_url: "https://api.example.com",
588
+ # environment: Merge::Environment::PRODUCTION,
589
+ # api_key: "YOUR_AUTH_TOKEN"
590
+ # )
591
+ # api.accounting.expense_reports.retrieve(id: "id")
592
+ def retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil,
593
+ request_options: nil)
594
+ Async do
595
+ response = @request_client.conn.get do |req|
596
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
597
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
598
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
599
+ req.headers = {
600
+ **(req.headers || {}),
601
+ **@request_client.get_headers,
602
+ **(request_options&.additional_headers || {})
603
+ }.compact
604
+ req.params = {
605
+ **(request_options&.additional_query_parameters || {}),
606
+ "expand": expand,
607
+ "include_remote_data": include_remote_data,
608
+ "include_remote_fields": include_remote_fields,
609
+ "include_shell_data": include_shell_data
610
+ }.compact
611
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
612
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
613
+ end
614
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports/#{id}"
615
+ end
616
+ Merge::Accounting::ExpenseReport.from_json(json_object: response.body)
617
+ end
618
+ end
619
+
620
+ # Returns a list of `RemoteFieldClass` objects.
621
+ #
622
+ # @param cursor [String] The pagination cursor value.
623
+ # @param include_deleted_data [Boolean] Indicates whether or not this object has been deleted in the third party
624
+ # platform. Full coverage deletion detection is a premium add-on. Native deletion
625
+ # detection is offered for free with limited coverage. [Learn
626
+ # more](https://docs.merge.dev/integrations/hris/supported-features/).
627
+ # @param include_remote_data [Boolean] Whether to include the original data Merge fetched from the third-party to
628
+ # produce these models.
629
+ # @param include_shell_data [Boolean] Whether to include shell records. Shell records are empty records (they may
630
+ # contain some metadata but all other fields are null).
631
+ # @param is_common_model_field [Boolean] If provided, will only return remote field classes with this
632
+ # is_common_model_field value
633
+ # @param is_custom [Boolean] If provided, will only return remote fields classes with this is_custom value
634
+ # @param page_size [Integer] Number of results to return per page.
635
+ # @param request_options [Merge::RequestOptions]
636
+ # @return [Merge::Accounting::PaginatedRemoteFieldClassList]
637
+ # @example
638
+ # api = Merge::Client.new(
639
+ # base_url: "https://api.example.com",
640
+ # environment: Merge::Environment::PRODUCTION,
641
+ # api_key: "YOUR_AUTH_TOKEN"
642
+ # )
643
+ # api.accounting.expense_reports.lines_remote_field_classes_list(cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw")
644
+ def lines_remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil,
645
+ include_shell_data: nil, is_common_model_field: nil, is_custom: nil, page_size: nil, request_options: nil)
646
+ Async do
647
+ response = @request_client.conn.get do |req|
648
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
649
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
650
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
651
+ req.headers = {
652
+ **(req.headers || {}),
653
+ **@request_client.get_headers,
654
+ **(request_options&.additional_headers || {})
655
+ }.compact
656
+ req.params = {
657
+ **(request_options&.additional_query_parameters || {}),
658
+ "cursor": cursor,
659
+ "include_deleted_data": include_deleted_data,
660
+ "include_remote_data": include_remote_data,
661
+ "include_shell_data": include_shell_data,
662
+ "is_common_model_field": is_common_model_field,
663
+ "is_custom": is_custom,
664
+ "page_size": page_size
665
+ }.compact
666
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
667
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
668
+ end
669
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports/lines/remote-field-classes"
670
+ end
671
+ Merge::Accounting::PaginatedRemoteFieldClassList.from_json(json_object: response.body)
672
+ end
673
+ end
674
+
675
+ # Returns metadata for `ExpenseReport` POSTs.
676
+ #
677
+ # @param request_options [Merge::RequestOptions]
678
+ # @return [Merge::Accounting::MetaResponse]
679
+ # @example
680
+ # api = Merge::Client.new(
681
+ # base_url: "https://api.example.com",
682
+ # environment: Merge::Environment::PRODUCTION,
683
+ # api_key: "YOUR_AUTH_TOKEN"
684
+ # )
685
+ # api.accounting.expense_reports.meta_post_retrieve
686
+ def meta_post_retrieve(request_options: nil)
687
+ Async do
688
+ response = @request_client.conn.get do |req|
689
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
690
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
691
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
692
+ req.headers = {
693
+ **(req.headers || {}),
694
+ **@request_client.get_headers,
695
+ **(request_options&.additional_headers || {})
696
+ }.compact
697
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
698
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
699
+ end
700
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
701
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
702
+ end
703
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports/meta/post"
704
+ end
705
+ Merge::Accounting::MetaResponse.from_json(json_object: response.body)
706
+ end
707
+ end
708
+
709
+ # Returns a list of `RemoteFieldClass` objects.
710
+ #
711
+ # @param cursor [String] The pagination cursor value.
712
+ # @param include_deleted_data [Boolean] Indicates whether or not this object has been deleted in the third party
713
+ # platform. Full coverage deletion detection is a premium add-on. Native deletion
714
+ # detection is offered for free with limited coverage. [Learn
715
+ # more](https://docs.merge.dev/integrations/hris/supported-features/).
716
+ # @param include_remote_data [Boolean] Whether to include the original data Merge fetched from the third-party to
717
+ # produce these models.
718
+ # @param include_shell_data [Boolean] Whether to include shell records. Shell records are empty records (they may
719
+ # contain some metadata but all other fields are null).
720
+ # @param is_common_model_field [Boolean] If provided, will only return remote field classes with this
721
+ # is_common_model_field value
722
+ # @param is_custom [Boolean] If provided, will only return remote fields classes with this is_custom value
723
+ # @param page_size [Integer] Number of results to return per page.
724
+ # @param request_options [Merge::RequestOptions]
725
+ # @return [Merge::Accounting::PaginatedRemoteFieldClassList]
726
+ # @example
727
+ # api = Merge::Client.new(
728
+ # base_url: "https://api.example.com",
729
+ # environment: Merge::Environment::PRODUCTION,
730
+ # api_key: "YOUR_AUTH_TOKEN"
731
+ # )
732
+ # api.accounting.expense_reports.remote_field_classes_list(cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw")
733
+ def remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil,
734
+ include_shell_data: nil, is_common_model_field: nil, is_custom: nil, page_size: nil, request_options: nil)
735
+ Async do
736
+ response = @request_client.conn.get do |req|
737
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
738
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
739
+ req.headers["X-Account-Token"] = request_options.account_token unless request_options&.account_token.nil?
740
+ req.headers = {
741
+ **(req.headers || {}),
742
+ **@request_client.get_headers,
743
+ **(request_options&.additional_headers || {})
744
+ }.compact
745
+ req.params = {
746
+ **(request_options&.additional_query_parameters || {}),
747
+ "cursor": cursor,
748
+ "include_deleted_data": include_deleted_data,
749
+ "include_remote_data": include_remote_data,
750
+ "include_shell_data": include_shell_data,
751
+ "is_common_model_field": is_common_model_field,
752
+ "is_custom": is_custom,
753
+ "page_size": page_size
754
+ }.compact
755
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
756
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
757
+ end
758
+ req.url "#{@request_client.get_url(request_options: request_options)}/accounting/v1/expense-reports/remote-field-classes"
759
+ end
760
+ Merge::Accounting::PaginatedRemoteFieldClassList.from_json(json_object: response.body)
761
+ end
762
+ end
763
+ end
764
+ end
765
+ end