merge_ruby_client 1.1.0 → 2.0.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 (112) hide show
  1. checksums.yaml +4 -4
  2. data/lib/merge_ruby_client/accounting/accounts/client.rb +16 -8
  3. data/lib/merge_ruby_client/accounting/audit_trail/client.rb +6 -4
  4. data/lib/merge_ruby_client/accounting/client.rb +7 -0
  5. data/lib/merge_ruby_client/accounting/contacts/client.rb +14 -6
  6. data/lib/merge_ruby_client/accounting/expenses/client.rb +12 -4
  7. data/lib/merge_ruby_client/accounting/invoices/client.rb +12 -4
  8. data/lib/merge_ruby_client/accounting/items/client.rb +332 -0
  9. data/lib/merge_ruby_client/accounting/journal_entries/client.rb +12 -4
  10. data/lib/merge_ruby_client/accounting/payments/client.rb +12 -4
  11. data/lib/merge_ruby_client/accounting/projects/client.rb +224 -0
  12. data/lib/merge_ruby_client/accounting/projects/types/projects_list_request_expand.rb +13 -0
  13. data/lib/merge_ruby_client/accounting/projects/types/projects_retrieve_request_expand.rb +13 -0
  14. data/lib/merge_ruby_client/accounting/purchase_orders/client.rb +12 -4
  15. data/lib/merge_ruby_client/accounting/tracking_categories/client.rb +16 -8
  16. data/lib/merge_ruby_client/accounting/types/account_details_and_actions.rb +10 -2
  17. data/lib/merge_ruby_client/accounting/types/audit_log_event.rb +2 -0
  18. data/lib/merge_ruby_client/accounting/types/credit_note_line_item.rb +29 -1
  19. data/lib/merge_ruby_client/accounting/types/credit_note_line_item_contact.rb +56 -0
  20. data/lib/merge_ruby_client/accounting/types/credit_note_line_item_project.rb +55 -0
  21. data/lib/merge_ruby_client/accounting/types/credit_note_line_item_request.rb +29 -1
  22. data/lib/merge_ruby_client/accounting/types/credit_note_line_item_request_contact.rb +56 -0
  23. data/lib/merge_ruby_client/accounting/types/credit_note_line_item_request_project.rb +55 -0
  24. data/lib/merge_ruby_client/accounting/types/event_type_enum.rb +2 -0
  25. data/lib/merge_ruby_client/accounting/types/expense_line.rb +15 -1
  26. data/lib/merge_ruby_client/accounting/types/expense_line_project.rb +55 -0
  27. data/lib/merge_ruby_client/accounting/types/expense_line_request.rb +15 -1
  28. data/lib/merge_ruby_client/accounting/types/expense_line_request_project.rb +55 -0
  29. data/lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb +12 -1
  30. data/lib/merge_ruby_client/accounting/types/field_mapping_api_instance_response.rb +12 -1
  31. data/lib/merge_ruby_client/accounting/types/general_ledger_transaction_line.rb +15 -1
  32. data/lib/merge_ruby_client/accounting/types/general_ledger_transaction_line_project.rb +55 -0
  33. data/lib/merge_ruby_client/accounting/types/invoice_line_item.rb +29 -1
  34. data/lib/merge_ruby_client/accounting/types/invoice_line_item_contact.rb +56 -0
  35. data/lib/merge_ruby_client/accounting/types/invoice_line_item_project.rb +55 -0
  36. data/lib/merge_ruby_client/accounting/types/invoice_line_item_request.rb +29 -1
  37. data/lib/merge_ruby_client/accounting/types/invoice_line_item_request_contact.rb +56 -0
  38. data/lib/merge_ruby_client/accounting/types/invoice_line_item_request_project.rb +55 -0
  39. data/lib/merge_ruby_client/accounting/types/item_request_request.rb +202 -0
  40. data/lib/merge_ruby_client/accounting/types/item_request_request_company.rb +56 -0
  41. data/lib/merge_ruby_client/accounting/types/item_request_request_purchase_account.rb +56 -0
  42. data/lib/merge_ruby_client/accounting/types/item_request_request_purchase_tax_rate.rb +56 -0
  43. data/lib/merge_ruby_client/accounting/types/item_request_request_sales_account.rb +56 -0
  44. data/lib/merge_ruby_client/accounting/types/item_request_request_sales_tax_rate.rb +56 -0
  45. data/lib/merge_ruby_client/accounting/types/item_response.rb +101 -0
  46. data/lib/merge_ruby_client/accounting/types/journal_line.rb +15 -1
  47. data/lib/merge_ruby_client/accounting/types/journal_line_project.rb +55 -0
  48. data/lib/merge_ruby_client/accounting/types/journal_line_request.rb +15 -1
  49. data/lib/merge_ruby_client/accounting/types/journal_line_request_project.rb +55 -0
  50. data/lib/merge_ruby_client/accounting/types/paginated_project_list.rb +80 -0
  51. data/lib/merge_ruby_client/accounting/types/patched_item_request_request.rb +172 -0
  52. data/lib/merge_ruby_client/accounting/types/project.rb +162 -0
  53. data/lib/merge_ruby_client/accounting/types/project_company.rb +56 -0
  54. data/lib/merge_ruby_client/accounting/types/project_contact.rb +56 -0
  55. data/lib/merge_ruby_client/accounting/types/remote_field_api_response.rb +12 -1
  56. data/lib/merge_ruby_client/accounting/types/type_2_bb_enum.rb +16 -0
  57. data/lib/merge_ruby_client/accounting/types/vendor_credit_line.rb +29 -1
  58. data/lib/merge_ruby_client/accounting/types/vendor_credit_line_contact.rb +55 -0
  59. data/lib/merge_ruby_client/accounting/types/vendor_credit_line_project.rb +55 -0
  60. data/lib/merge_ruby_client/accounting/types/vendor_credit_line_request.rb +29 -1
  61. data/lib/merge_ruby_client/accounting/types/vendor_credit_line_request_contact.rb +55 -0
  62. data/lib/merge_ruby_client/accounting/types/vendor_credit_line_request_project.rb +55 -0
  63. data/lib/merge_ruby_client/ats/audit_trail/client.rb +6 -4
  64. data/lib/merge_ruby_client/ats/types/account_details_and_actions.rb +10 -2
  65. data/lib/merge_ruby_client/ats/types/audit_log_event.rb +2 -0
  66. data/lib/merge_ruby_client/ats/types/event_type_enum.rb +1 -0
  67. data/lib/merge_ruby_client/crm/accounts/client.rb +6 -2
  68. data/lib/merge_ruby_client/crm/audit_trail/client.rb +6 -4
  69. data/lib/merge_ruby_client/crm/contacts/client.rb +6 -2
  70. data/lib/merge_ruby_client/crm/custom_objects/client.rb +10 -2
  71. data/lib/merge_ruby_client/crm/engagement_types/client.rb +6 -2
  72. data/lib/merge_ruby_client/crm/engagements/client.rb +6 -2
  73. data/lib/merge_ruby_client/crm/leads/client.rb +6 -2
  74. data/lib/merge_ruby_client/crm/notes/client.rb +6 -2
  75. data/lib/merge_ruby_client/crm/opportunities/client.rb +6 -2
  76. data/lib/merge_ruby_client/crm/stages/client.rb +6 -2
  77. data/lib/merge_ruby_client/crm/sync_status/client.rb +20 -6
  78. data/lib/merge_ruby_client/crm/tasks/client.rb +6 -2
  79. data/lib/merge_ruby_client/crm/types/audit_log_event.rb +2 -0
  80. data/lib/merge_ruby_client/crm/types/custom_object_request.rb +26 -3
  81. data/lib/merge_ruby_client/crm/types/event_type_enum.rb +2 -0
  82. data/lib/merge_ruby_client/crm/users/client.rb +6 -2
  83. data/lib/merge_ruby_client/filestorage/audit_trail/client.rb +6 -4
  84. data/lib/merge_ruby_client/filestorage/files/client.rb +48 -12
  85. data/lib/merge_ruby_client/filestorage/files/types/files_download_request_meta_list_request_order_by.rb +14 -0
  86. data/lib/merge_ruby_client/filestorage/files/types/files_list_request_order_by.rb +14 -0
  87. data/lib/merge_ruby_client/filestorage/sync_status/client.rb +20 -6
  88. data/lib/merge_ruby_client/filestorage/types/account_details_and_actions.rb +10 -2
  89. data/lib/merge_ruby_client/filestorage/types/audit_log_event.rb +2 -0
  90. data/lib/merge_ruby_client/filestorage/types/download_request_meta.rb +2 -9
  91. data/lib/merge_ruby_client/filestorage/types/event_type_enum.rb +2 -0
  92. data/lib/merge_ruby_client/filestorage/types/file.rb +13 -1
  93. data/lib/merge_ruby_client/filestorage/types/file_request.rb +13 -1
  94. data/lib/merge_ruby_client/hris/audit_trail/client.rb +6 -4
  95. data/lib/merge_ruby_client/hris/types/account_details_and_actions.rb +10 -2
  96. data/lib/merge_ruby_client/hris/types/audit_log_event.rb +2 -0
  97. data/lib/merge_ruby_client/hris/types/event_type_enum.rb +2 -0
  98. data/lib/merge_ruby_client/ticketing/audit_trail/client.rb +6 -4
  99. data/lib/merge_ruby_client/ticketing/tickets/client.rb +26 -10
  100. data/lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb +10 -2
  101. data/lib/merge_ruby_client/ticketing/types/audit_log_event.rb +2 -0
  102. data/lib/merge_ruby_client/ticketing/types/collection.rb +18 -16
  103. data/lib/merge_ruby_client/ticketing/types/{access_level_enum.rb → collection_access_level_enum.rb} +3 -1
  104. data/lib/merge_ruby_client/ticketing/types/event_type_enum.rb +2 -0
  105. data/lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb +20 -1
  106. data/lib/merge_ruby_client/ticketing/types/ticket.rb +20 -1
  107. data/lib/merge_ruby_client/ticketing/types/ticket_access_level_enum.rb +16 -0
  108. data/lib/merge_ruby_client/ticketing/types/ticket_request.rb +20 -1
  109. data/lib/merge_ruby_client.rb +7 -7
  110. data/lib/requests.rb +2 -2
  111. data/lib/types_export.rb +243 -208
  112. metadata +39 -3
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require_relative "contact"
5
+
6
+ module Merge
7
+ module Accounting
8
+ # The supplier, or customer involved in the project.
9
+ class ProjectContact
10
+ # Deserialize a JSON object to an instance of ProjectContact
11
+ #
12
+ # @param json_object [String]
13
+ # @return [Merge::Accounting::ProjectContact]
14
+ def self.from_json(json_object:)
15
+ struct = JSON.parse(json_object, object_class: OpenStruct)
16
+ begin
17
+ struct.is_a?(String) != false || raise("Passed value for field struct is not the expected type, validation failed.")
18
+ return struct unless struct.nil?
19
+
20
+ return nil
21
+ rescue StandardError
22
+ # noop
23
+ end
24
+ begin
25
+ Merge::Accounting::Contact.validate_raw(obj: struct)
26
+ return Merge::Accounting::Contact.from_json(json_object: struct) unless struct.nil?
27
+
28
+ return nil
29
+ rescue StandardError
30
+ # noop
31
+ end
32
+ struct
33
+ end
34
+
35
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
36
+ # hash and check each fields type against the current object's property
37
+ # definitions.
38
+ #
39
+ # @param obj [Object]
40
+ # @return [Void]
41
+ def self.validate_raw(obj:)
42
+ begin
43
+ return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
44
+ rescue StandardError
45
+ # noop
46
+ end
47
+ begin
48
+ return Merge::Accounting::Contact.validate_raw(obj: obj)
49
+ rescue StandardError
50
+ # noop
51
+ end
52
+ raise("Passed value matched no type within the union, validation failed.")
53
+ end
54
+ end
55
+ end
56
+ end
@@ -54,6 +54,8 @@ module Merge
54
54
  # @return [Array<Merge::Accounting::RemoteFieldApi>]
55
55
  attr_reader :payment_method
56
56
  # @return [Array<Merge::Accounting::RemoteFieldApi>]
57
+ attr_reader :project
58
+ # @return [Array<Merge::Accounting::RemoteFieldApi>]
57
59
  attr_reader :payment_term
58
60
  # @return [OpenStruct] Additional properties unmapped to the current class definition
59
61
  attr_reader :additional_properties
@@ -86,11 +88,12 @@ module Merge
86
88
  # @param bank_feed_account [Array<Merge::Accounting::RemoteFieldApi>]
87
89
  # @param employee [Array<Merge::Accounting::RemoteFieldApi>]
88
90
  # @param payment_method [Array<Merge::Accounting::RemoteFieldApi>]
91
+ # @param project [Array<Merge::Accounting::RemoteFieldApi>]
89
92
  # @param payment_term [Array<Merge::Accounting::RemoteFieldApi>]
90
93
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
91
94
  # @return [Merge::Accounting::RemoteFieldApiResponse]
92
95
  def initialize(account: OMIT, accounting_attachment: OMIT, balance_sheet: OMIT, cash_flow_statement: OMIT,
93
- company_info: OMIT, contact: OMIT, income_statement: OMIT, credit_note: OMIT, item: OMIT, purchase_order: OMIT, tracking_category: OMIT, journal_entry: OMIT, tax_rate: OMIT, invoice: OMIT, payment: OMIT, expense: OMIT, vendor_credit: OMIT, transaction: OMIT, accounting_period: OMIT, general_ledger_transaction: OMIT, bank_feed_account: OMIT, employee: OMIT, payment_method: OMIT, payment_term: OMIT, additional_properties: nil)
96
+ company_info: OMIT, contact: OMIT, income_statement: OMIT, credit_note: OMIT, item: OMIT, purchase_order: OMIT, tracking_category: OMIT, journal_entry: OMIT, tax_rate: OMIT, invoice: OMIT, payment: OMIT, expense: OMIT, vendor_credit: OMIT, transaction: OMIT, accounting_period: OMIT, general_ledger_transaction: OMIT, bank_feed_account: OMIT, employee: OMIT, payment_method: OMIT, project: OMIT, payment_term: OMIT, additional_properties: nil)
94
97
  @account = account if account != OMIT
95
98
  @accounting_attachment = accounting_attachment if accounting_attachment != OMIT
96
99
  @balance_sheet = balance_sheet if balance_sheet != OMIT
@@ -114,6 +117,7 @@ module Merge
114
117
  @bank_feed_account = bank_feed_account if bank_feed_account != OMIT
115
118
  @employee = employee if employee != OMIT
116
119
  @payment_method = payment_method if payment_method != OMIT
120
+ @project = project if project != OMIT
117
121
  @payment_term = payment_term if payment_term != OMIT
118
122
  @additional_properties = additional_properties
119
123
  @_field_set = {
@@ -140,6 +144,7 @@ module Merge
140
144
  "BankFeedAccount": bank_feed_account,
141
145
  "Employee": employee,
142
146
  "PaymentMethod": payment_method,
147
+ "Project": project,
143
148
  "PaymentTerm": payment_term
144
149
  }.reject do |_k, v|
145
150
  v == OMIT
@@ -245,6 +250,10 @@ module Merge
245
250
  item = item.to_json
246
251
  Merge::Accounting::RemoteFieldApi.from_json(json_object: item)
247
252
  end
253
+ project = parsed_json["Project"]&.map do |item|
254
+ item = item.to_json
255
+ Merge::Accounting::RemoteFieldApi.from_json(json_object: item)
256
+ end
248
257
  payment_term = parsed_json["PaymentTerm"]&.map do |item|
249
258
  item = item.to_json
250
259
  Merge::Accounting::RemoteFieldApi.from_json(json_object: item)
@@ -273,6 +282,7 @@ module Merge
273
282
  bank_feed_account: bank_feed_account,
274
283
  employee: employee,
275
284
  payment_method: payment_method,
285
+ project: project,
276
286
  payment_term: payment_term,
277
287
  additional_properties: struct
278
288
  )
@@ -315,6 +325,7 @@ module Merge
315
325
  obj.bank_feed_account&.is_a?(Array) != false || raise("Passed value for field obj.bank_feed_account is not the expected type, validation failed.")
316
326
  obj.employee&.is_a?(Array) != false || raise("Passed value for field obj.employee is not the expected type, validation failed.")
317
327
  obj.payment_method&.is_a?(Array) != false || raise("Passed value for field obj.payment_method is not the expected type, validation failed.")
328
+ obj.project&.is_a?(Array) != false || raise("Passed value for field obj.project is not the expected type, validation failed.")
318
329
  obj.payment_term&.is_a?(Array) != false || raise("Passed value for field obj.payment_term is not the expected type, validation failed.")
319
330
  end
320
331
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Merge
4
+ module Accounting
5
+ # * `INVENTORY` - INVENTORY
6
+ # * `NON_INVENTORY` - NON_INVENTORY
7
+ # * `SERVICE` - SERVICE
8
+ # * `UNKNOWN` - UNKNOWN
9
+ class Type2BbEnum
10
+ INVENTORY = "INVENTORY"
11
+ NON_INVENTORY = "NON_INVENTORY"
12
+ SERVICE = "SERVICE"
13
+ UNKNOWN = "UNKNOWN"
14
+ end
15
+ end
16
+ end
@@ -2,6 +2,8 @@
2
2
 
3
3
  require "date"
4
4
  require_relative "vendor_credit_line_account"
5
+ require_relative "vendor_credit_line_project"
6
+ require_relative "vendor_credit_line_contact"
5
7
  require "ostruct"
6
8
  require "json"
7
9
 
@@ -34,6 +36,10 @@ module Merge
34
36
  attr_reader :account
35
37
  # @return [String] The company the line belongs to.
36
38
  attr_reader :company
39
+ # @return [Merge::Accounting::VendorCreditLineProject]
40
+ attr_reader :project
41
+ # @return [Merge::Accounting::VendorCreditLineContact]
42
+ attr_reader :contact
37
43
  # @return [String] The tax rate that applies to this line item.
38
44
  attr_reader :tax_rate
39
45
  # @return [String] The vendor credit line item's exchange rate.
@@ -61,6 +67,8 @@ module Merge
61
67
  # @param description [String] The line's description.
62
68
  # @param account [Merge::Accounting::VendorCreditLineAccount] The line's account.
63
69
  # @param company [String] The company the line belongs to.
70
+ # @param project [Merge::Accounting::VendorCreditLineProject]
71
+ # @param contact [Merge::Accounting::VendorCreditLineContact]
64
72
  # @param tax_rate [String] The tax rate that applies to this line item.
65
73
  # @param exchange_rate [String] The vendor credit line item's exchange rate.
66
74
  # @param remote_was_deleted [Boolean] Indicates whether or not this object has been deleted in the third party
@@ -70,7 +78,7 @@ module Merge
70
78
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
71
79
  # @return [Merge::Accounting::VendorCreditLine]
72
80
  def initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, net_amount: OMIT,
73
- tracking_category: OMIT, tracking_categories: OMIT, description: OMIT, account: OMIT, company: OMIT, tax_rate: OMIT, exchange_rate: OMIT, remote_was_deleted: OMIT, additional_properties: nil)
81
+ tracking_category: OMIT, tracking_categories: OMIT, description: OMIT, account: OMIT, company: OMIT, project: OMIT, contact: OMIT, tax_rate: OMIT, exchange_rate: OMIT, remote_was_deleted: OMIT, additional_properties: nil)
74
82
  @id = id if id != OMIT
75
83
  @remote_id = remote_id if remote_id != OMIT
76
84
  @created_at = created_at if created_at != OMIT
@@ -81,6 +89,8 @@ module Merge
81
89
  @description = description if description != OMIT
82
90
  @account = account if account != OMIT
83
91
  @company = company if company != OMIT
92
+ @project = project if project != OMIT
93
+ @contact = contact if contact != OMIT
84
94
  @tax_rate = tax_rate if tax_rate != OMIT
85
95
  @exchange_rate = exchange_rate if exchange_rate != OMIT
86
96
  @remote_was_deleted = remote_was_deleted if remote_was_deleted != OMIT
@@ -96,6 +106,8 @@ module Merge
96
106
  "description": description,
97
107
  "account": account,
98
108
  "company": company,
109
+ "project": project,
110
+ "contact": contact,
99
111
  "tax_rate": tax_rate,
100
112
  "exchange_rate": exchange_rate,
101
113
  "remote_was_deleted": remote_was_deleted
@@ -126,6 +138,18 @@ module Merge
126
138
  account = Merge::Accounting::VendorCreditLineAccount.from_json(json_object: account)
127
139
  end
128
140
  company = parsed_json["company"]
141
+ if parsed_json["project"].nil?
142
+ project = nil
143
+ else
144
+ project = parsed_json["project"].to_json
145
+ project = Merge::Accounting::VendorCreditLineProject.from_json(json_object: project)
146
+ end
147
+ if parsed_json["contact"].nil?
148
+ contact = nil
149
+ else
150
+ contact = parsed_json["contact"].to_json
151
+ contact = Merge::Accounting::VendorCreditLineContact.from_json(json_object: contact)
152
+ end
129
153
  tax_rate = parsed_json["tax_rate"]
130
154
  exchange_rate = parsed_json["exchange_rate"]
131
155
  remote_was_deleted = parsed_json["remote_was_deleted"]
@@ -140,6 +164,8 @@ module Merge
140
164
  description: description,
141
165
  account: account,
142
166
  company: company,
167
+ project: project,
168
+ contact: contact,
143
169
  tax_rate: tax_rate,
144
170
  exchange_rate: exchange_rate,
145
171
  remote_was_deleted: remote_was_deleted,
@@ -171,6 +197,8 @@ module Merge
171
197
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
172
198
  obj.account.nil? || Merge::Accounting::VendorCreditLineAccount.validate_raw(obj: obj.account)
173
199
  obj.company&.is_a?(String) != false || raise("Passed value for field obj.company is not the expected type, validation failed.")
200
+ obj.project.nil? || Merge::Accounting::VendorCreditLineProject.validate_raw(obj: obj.project)
201
+ obj.contact.nil? || Merge::Accounting::VendorCreditLineContact.validate_raw(obj: obj.contact)
174
202
  obj.tax_rate&.is_a?(String) != false || raise("Passed value for field obj.tax_rate is not the expected type, validation failed.")
175
203
  obj.exchange_rate&.is_a?(String) != false || raise("Passed value for field obj.exchange_rate is not the expected type, validation failed.")
176
204
  obj.remote_was_deleted&.is_a?(Boolean) != false || raise("Passed value for field obj.remote_was_deleted is not the expected type, validation failed.")
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require_relative "contact"
5
+
6
+ module Merge
7
+ module Accounting
8
+ class VendorCreditLineContact
9
+ # Deserialize a JSON object to an instance of VendorCreditLineContact
10
+ #
11
+ # @param json_object [String]
12
+ # @return [Merge::Accounting::VendorCreditLineContact]
13
+ def self.from_json(json_object:)
14
+ struct = JSON.parse(json_object, object_class: OpenStruct)
15
+ begin
16
+ struct.is_a?(String) != false || raise("Passed value for field struct is not the expected type, validation failed.")
17
+ return struct unless struct.nil?
18
+
19
+ return nil
20
+ rescue StandardError
21
+ # noop
22
+ end
23
+ begin
24
+ Merge::Accounting::Contact.validate_raw(obj: struct)
25
+ return Merge::Accounting::Contact.from_json(json_object: struct) unless struct.nil?
26
+
27
+ return nil
28
+ rescue StandardError
29
+ # noop
30
+ end
31
+ struct
32
+ end
33
+
34
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
35
+ # hash and check each fields type against the current object's property
36
+ # definitions.
37
+ #
38
+ # @param obj [Object]
39
+ # @return [Void]
40
+ def self.validate_raw(obj:)
41
+ begin
42
+ return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
43
+ rescue StandardError
44
+ # noop
45
+ end
46
+ begin
47
+ return Merge::Accounting::Contact.validate_raw(obj: obj)
48
+ rescue StandardError
49
+ # noop
50
+ end
51
+ raise("Passed value matched no type within the union, validation failed.")
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require_relative "project"
5
+
6
+ module Merge
7
+ module Accounting
8
+ class VendorCreditLineProject
9
+ # Deserialize a JSON object to an instance of VendorCreditLineProject
10
+ #
11
+ # @param json_object [String]
12
+ # @return [Merge::Accounting::VendorCreditLineProject]
13
+ def self.from_json(json_object:)
14
+ struct = JSON.parse(json_object, object_class: OpenStruct)
15
+ begin
16
+ struct.is_a?(String) != false || raise("Passed value for field struct is not the expected type, validation failed.")
17
+ return struct unless struct.nil?
18
+
19
+ return nil
20
+ rescue StandardError
21
+ # noop
22
+ end
23
+ begin
24
+ Merge::Accounting::Project.validate_raw(obj: struct)
25
+ return Merge::Accounting::Project.from_json(json_object: struct) unless struct.nil?
26
+
27
+ return nil
28
+ rescue StandardError
29
+ # noop
30
+ end
31
+ struct
32
+ end
33
+
34
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
35
+ # hash and check each fields type against the current object's property
36
+ # definitions.
37
+ #
38
+ # @param obj [Object]
39
+ # @return [Void]
40
+ def self.validate_raw(obj:)
41
+ begin
42
+ return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
43
+ rescue StandardError
44
+ # noop
45
+ end
46
+ begin
47
+ return Merge::Accounting::Project.validate_raw(obj: obj)
48
+ rescue StandardError
49
+ # noop
50
+ end
51
+ raise("Passed value matched no type within the union, validation failed.")
52
+ end
53
+ end
54
+ end
55
+ end
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "vendor_credit_line_request_account"
4
+ require_relative "vendor_credit_line_request_project"
5
+ require_relative "vendor_credit_line_request_contact"
4
6
  require "ostruct"
5
7
  require "json"
6
8
 
@@ -27,6 +29,10 @@ module Merge
27
29
  attr_reader :account
28
30
  # @return [String] The company the line belongs to.
29
31
  attr_reader :company
32
+ # @return [Merge::Accounting::VendorCreditLineRequestProject]
33
+ attr_reader :project
34
+ # @return [Merge::Accounting::VendorCreditLineRequestContact]
35
+ attr_reader :contact
30
36
  # @return [String] The tax rate that applies to this line item.
31
37
  attr_reader :tax_rate
32
38
  # @return [String] The vendor credit line item's exchange rate.
@@ -50,6 +56,8 @@ module Merge
50
56
  # @param description [String] The line's description.
51
57
  # @param account [Merge::Accounting::VendorCreditLineRequestAccount] The line's account.
52
58
  # @param company [String] The company the line belongs to.
59
+ # @param project [Merge::Accounting::VendorCreditLineRequestProject]
60
+ # @param contact [Merge::Accounting::VendorCreditLineRequestContact]
53
61
  # @param tax_rate [String] The tax rate that applies to this line item.
54
62
  # @param exchange_rate [String] The vendor credit line item's exchange rate.
55
63
  # @param integration_params [Hash{String => Object}]
@@ -57,7 +65,7 @@ module Merge
57
65
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
58
66
  # @return [Merge::Accounting::VendorCreditLineRequest]
59
67
  def initialize(remote_id: OMIT, net_amount: OMIT, tracking_category: OMIT, tracking_categories: OMIT,
60
- description: OMIT, account: OMIT, company: OMIT, tax_rate: OMIT, exchange_rate: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil)
68
+ description: OMIT, account: OMIT, company: OMIT, project: OMIT, contact: OMIT, tax_rate: OMIT, exchange_rate: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil)
61
69
  @remote_id = remote_id if remote_id != OMIT
62
70
  @net_amount = net_amount if net_amount != OMIT
63
71
  @tracking_category = tracking_category if tracking_category != OMIT
@@ -65,6 +73,8 @@ module Merge
65
73
  @description = description if description != OMIT
66
74
  @account = account if account != OMIT
67
75
  @company = company if company != OMIT
76
+ @project = project if project != OMIT
77
+ @contact = contact if contact != OMIT
68
78
  @tax_rate = tax_rate if tax_rate != OMIT
69
79
  @exchange_rate = exchange_rate if exchange_rate != OMIT
70
80
  @integration_params = integration_params if integration_params != OMIT
@@ -78,6 +88,8 @@ module Merge
78
88
  "description": description,
79
89
  "account": account,
80
90
  "company": company,
91
+ "project": project,
92
+ "contact": contact,
81
93
  "tax_rate": tax_rate,
82
94
  "exchange_rate": exchange_rate,
83
95
  "integration_params": integration_params,
@@ -106,6 +118,18 @@ module Merge
106
118
  account = Merge::Accounting::VendorCreditLineRequestAccount.from_json(json_object: account)
107
119
  end
108
120
  company = parsed_json["company"]
121
+ if parsed_json["project"].nil?
122
+ project = nil
123
+ else
124
+ project = parsed_json["project"].to_json
125
+ project = Merge::Accounting::VendorCreditLineRequestProject.from_json(json_object: project)
126
+ end
127
+ if parsed_json["contact"].nil?
128
+ contact = nil
129
+ else
130
+ contact = parsed_json["contact"].to_json
131
+ contact = Merge::Accounting::VendorCreditLineRequestContact.from_json(json_object: contact)
132
+ end
109
133
  tax_rate = parsed_json["tax_rate"]
110
134
  exchange_rate = parsed_json["exchange_rate"]
111
135
  integration_params = parsed_json["integration_params"]
@@ -118,6 +142,8 @@ module Merge
118
142
  description: description,
119
143
  account: account,
120
144
  company: company,
145
+ project: project,
146
+ contact: contact,
121
147
  tax_rate: tax_rate,
122
148
  exchange_rate: exchange_rate,
123
149
  integration_params: integration_params,
@@ -147,6 +173,8 @@ module Merge
147
173
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
148
174
  obj.account.nil? || Merge::Accounting::VendorCreditLineRequestAccount.validate_raw(obj: obj.account)
149
175
  obj.company&.is_a?(String) != false || raise("Passed value for field obj.company is not the expected type, validation failed.")
176
+ obj.project.nil? || Merge::Accounting::VendorCreditLineRequestProject.validate_raw(obj: obj.project)
177
+ obj.contact.nil? || Merge::Accounting::VendorCreditLineRequestContact.validate_raw(obj: obj.contact)
150
178
  obj.tax_rate&.is_a?(String) != false || raise("Passed value for field obj.tax_rate is not the expected type, validation failed.")
151
179
  obj.exchange_rate&.is_a?(String) != false || raise("Passed value for field obj.exchange_rate is not the expected type, validation failed.")
152
180
  obj.integration_params&.is_a?(Hash) != false || raise("Passed value for field obj.integration_params is not the expected type, validation failed.")
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require_relative "contact"
5
+
6
+ module Merge
7
+ module Accounting
8
+ class VendorCreditLineRequestContact
9
+ # Deserialize a JSON object to an instance of VendorCreditLineRequestContact
10
+ #
11
+ # @param json_object [String]
12
+ # @return [Merge::Accounting::VendorCreditLineRequestContact]
13
+ def self.from_json(json_object:)
14
+ struct = JSON.parse(json_object, object_class: OpenStruct)
15
+ begin
16
+ struct.is_a?(String) != false || raise("Passed value for field struct is not the expected type, validation failed.")
17
+ return struct unless struct.nil?
18
+
19
+ return nil
20
+ rescue StandardError
21
+ # noop
22
+ end
23
+ begin
24
+ Merge::Accounting::Contact.validate_raw(obj: struct)
25
+ return Merge::Accounting::Contact.from_json(json_object: struct) unless struct.nil?
26
+
27
+ return nil
28
+ rescue StandardError
29
+ # noop
30
+ end
31
+ struct
32
+ end
33
+
34
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
35
+ # hash and check each fields type against the current object's property
36
+ # definitions.
37
+ #
38
+ # @param obj [Object]
39
+ # @return [Void]
40
+ def self.validate_raw(obj:)
41
+ begin
42
+ return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
43
+ rescue StandardError
44
+ # noop
45
+ end
46
+ begin
47
+ return Merge::Accounting::Contact.validate_raw(obj: obj)
48
+ rescue StandardError
49
+ # noop
50
+ end
51
+ raise("Passed value matched no type within the union, validation failed.")
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require_relative "project"
5
+
6
+ module Merge
7
+ module Accounting
8
+ class VendorCreditLineRequestProject
9
+ # Deserialize a JSON object to an instance of VendorCreditLineRequestProject
10
+ #
11
+ # @param json_object [String]
12
+ # @return [Merge::Accounting::VendorCreditLineRequestProject]
13
+ def self.from_json(json_object:)
14
+ struct = JSON.parse(json_object, object_class: OpenStruct)
15
+ begin
16
+ struct.is_a?(String) != false || raise("Passed value for field struct is not the expected type, validation failed.")
17
+ return struct unless struct.nil?
18
+
19
+ return nil
20
+ rescue StandardError
21
+ # noop
22
+ end
23
+ begin
24
+ Merge::Accounting::Project.validate_raw(obj: struct)
25
+ return Merge::Accounting::Project.from_json(json_object: struct) unless struct.nil?
26
+
27
+ return nil
28
+ rescue StandardError
29
+ # noop
30
+ end
31
+ struct
32
+ end
33
+
34
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
35
+ # hash and check each fields type against the current object's property
36
+ # definitions.
37
+ #
38
+ # @param obj [Object]
39
+ # @return [Void]
40
+ def self.validate_raw(obj:)
41
+ begin
42
+ return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
43
+ rescue StandardError
44
+ # noop
45
+ end
46
+ begin
47
+ return Merge::Accounting::Project.validate_raw(obj: obj)
48
+ rescue StandardError
49
+ # noop
50
+ end
51
+ raise("Passed value matched no type within the union, validation failed.")
52
+ end
53
+ end
54
+ end
55
+ end
@@ -23,8 +23,9 @@ module Merge
23
23
  # @param event_type [String] If included, will only include events with the given event type. Possible values
24
24
  # include: `CREATED_REMOTE_PRODUCTION_API_KEY`,
25
25
  # `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`,
26
- # `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `INVITED_USER`,
27
- # `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`,
26
+ # `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`,
27
+ # `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`,
28
+ # `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`,
28
29
  # `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`,
29
30
  # `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`,
30
31
  # `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`,
@@ -106,8 +107,9 @@ module Merge
106
107
  # @param event_type [String] If included, will only include events with the given event type. Possible values
107
108
  # include: `CREATED_REMOTE_PRODUCTION_API_KEY`,
108
109
  # `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`,
109
- # `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `INVITED_USER`,
110
- # `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`,
110
+ # `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`,
111
+ # `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`,
112
+ # `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`,
111
113
  # `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`,
112
114
  # `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`,
113
115
  # `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`,
@@ -45,6 +45,8 @@ module Merge
45
45
  attr_reader :account_type
46
46
  # @return [DateTime]
47
47
  attr_reader :completed_at
48
+ # @return [Hash{String => Object}]
49
+ attr_reader :integration_specific_fields
48
50
  # @return [OpenStruct] Additional properties unmapped to the current class definition
49
51
  attr_reader :additional_properties
50
52
  # @return [Object]
@@ -69,10 +71,11 @@ module Merge
69
71
  # @param integration [Merge::Ats::AccountDetailsAndActionsIntegration]
70
72
  # @param account_type [String]
71
73
  # @param completed_at [DateTime]
74
+ # @param integration_specific_fields [Hash{String => Object}]
72
75
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
73
76
  # @return [Merge::Ats::AccountDetailsAndActions]
74
77
  def initialize(id:, status:, end_user_organization_name:, end_user_email_address:, webhook_listener_url:,
75
- account_type:, completed_at:, category: OMIT, status_detail: OMIT, end_user_origin_id: OMIT, subdomain: OMIT, is_duplicate: OMIT, integration: OMIT, additional_properties: nil)
78
+ account_type:, completed_at:, category: OMIT, status_detail: OMIT, end_user_origin_id: OMIT, subdomain: OMIT, is_duplicate: OMIT, integration: OMIT, integration_specific_fields: OMIT, additional_properties: nil)
76
79
  @id = id
77
80
  @category = category if category != OMIT
78
81
  @status = status
@@ -86,6 +89,7 @@ module Merge
86
89
  @integration = integration if integration != OMIT
87
90
  @account_type = account_type
88
91
  @completed_at = completed_at
92
+ @integration_specific_fields = integration_specific_fields if integration_specific_fields != OMIT
89
93
  @additional_properties = additional_properties
90
94
  @_field_set = {
91
95
  "id": id,
@@ -100,7 +104,8 @@ module Merge
100
104
  "is_duplicate": is_duplicate,
101
105
  "integration": integration,
102
106
  "account_type": account_type,
103
- "completed_at": completed_at
107
+ "completed_at": completed_at,
108
+ "integration_specific_fields": integration_specific_fields
104
109
  }.reject do |_k, v|
105
110
  v == OMIT
106
111
  end
@@ -131,6 +136,7 @@ module Merge
131
136
  end
132
137
  account_type = parsed_json["account_type"]
133
138
  completed_at = (DateTime.parse(parsed_json["completed_at"]) unless parsed_json["completed_at"].nil?)
139
+ integration_specific_fields = parsed_json["integration_specific_fields"]
134
140
  new(
135
141
  id: id,
136
142
  category: category,
@@ -145,6 +151,7 @@ module Merge
145
151
  integration: integration,
146
152
  account_type: account_type,
147
153
  completed_at: completed_at,
154
+ integration_specific_fields: integration_specific_fields,
148
155
  additional_properties: struct
149
156
  )
150
157
  end
@@ -176,6 +183,7 @@ module Merge
176
183
  obj.integration.nil? || Merge::Ats::AccountDetailsAndActionsIntegration.validate_raw(obj: obj.integration)
177
184
  obj.account_type.is_a?(String) != false || raise("Passed value for field obj.account_type is not the expected type, validation failed.")
178
185
  obj.completed_at.is_a?(DateTime) != false || raise("Passed value for field obj.completed_at is not the expected type, validation failed.")
186
+ obj.integration_specific_fields&.is_a?(Hash) != false || raise("Passed value for field obj.integration_specific_fields is not the expected type, validation failed.")
179
187
  end
180
188
  end
181
189
  end
@@ -32,6 +32,7 @@ module Merge
32
32
  # * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY
33
33
  # * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY
34
34
  # * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY
35
+ # * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE
35
36
  # * `INVITED_USER` - INVITED_USER
36
37
  # * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED
37
38
  # * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED
@@ -111,6 +112,7 @@ module Merge
111
112
  # * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY
112
113
  # * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY
113
114
  # * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY
115
+ # * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE
114
116
  # * `INVITED_USER` - INVITED_USER
115
117
  # * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED
116
118
  # * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED
@@ -7,6 +7,7 @@ module Merge
7
7
  # * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY
8
8
  # * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY
9
9
  # * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY
10
+ # * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE
10
11
  # * `INVITED_USER` - INVITED_USER
11
12
  # * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED
12
13
  # * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED