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.
- checksums.yaml +4 -4
- data/lib/merge_ruby_client/accounting/accounts/client.rb +16 -8
- data/lib/merge_ruby_client/accounting/audit_trail/client.rb +6 -4
- data/lib/merge_ruby_client/accounting/client.rb +7 -0
- data/lib/merge_ruby_client/accounting/contacts/client.rb +14 -6
- data/lib/merge_ruby_client/accounting/expenses/client.rb +12 -4
- data/lib/merge_ruby_client/accounting/invoices/client.rb +12 -4
- data/lib/merge_ruby_client/accounting/items/client.rb +332 -0
- data/lib/merge_ruby_client/accounting/journal_entries/client.rb +12 -4
- data/lib/merge_ruby_client/accounting/payments/client.rb +12 -4
- data/lib/merge_ruby_client/accounting/projects/client.rb +224 -0
- data/lib/merge_ruby_client/accounting/projects/types/projects_list_request_expand.rb +13 -0
- data/lib/merge_ruby_client/accounting/projects/types/projects_retrieve_request_expand.rb +13 -0
- data/lib/merge_ruby_client/accounting/purchase_orders/client.rb +12 -4
- data/lib/merge_ruby_client/accounting/tracking_categories/client.rb +16 -8
- data/lib/merge_ruby_client/accounting/types/account_details_and_actions.rb +10 -2
- data/lib/merge_ruby_client/accounting/types/audit_log_event.rb +2 -0
- data/lib/merge_ruby_client/accounting/types/credit_note_line_item.rb +29 -1
- data/lib/merge_ruby_client/accounting/types/credit_note_line_item_contact.rb +56 -0
- data/lib/merge_ruby_client/accounting/types/credit_note_line_item_project.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/credit_note_line_item_request.rb +29 -1
- data/lib/merge_ruby_client/accounting/types/credit_note_line_item_request_contact.rb +56 -0
- data/lib/merge_ruby_client/accounting/types/credit_note_line_item_request_project.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/event_type_enum.rb +2 -0
- data/lib/merge_ruby_client/accounting/types/expense_line.rb +15 -1
- data/lib/merge_ruby_client/accounting/types/expense_line_project.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/expense_line_request.rb +15 -1
- data/lib/merge_ruby_client/accounting/types/expense_line_request_project.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb +12 -1
- data/lib/merge_ruby_client/accounting/types/field_mapping_api_instance_response.rb +12 -1
- data/lib/merge_ruby_client/accounting/types/general_ledger_transaction_line.rb +15 -1
- data/lib/merge_ruby_client/accounting/types/general_ledger_transaction_line_project.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/invoice_line_item.rb +29 -1
- data/lib/merge_ruby_client/accounting/types/invoice_line_item_contact.rb +56 -0
- data/lib/merge_ruby_client/accounting/types/invoice_line_item_project.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/invoice_line_item_request.rb +29 -1
- data/lib/merge_ruby_client/accounting/types/invoice_line_item_request_contact.rb +56 -0
- data/lib/merge_ruby_client/accounting/types/invoice_line_item_request_project.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/item_request_request.rb +202 -0
- data/lib/merge_ruby_client/accounting/types/item_request_request_company.rb +56 -0
- data/lib/merge_ruby_client/accounting/types/item_request_request_purchase_account.rb +56 -0
- data/lib/merge_ruby_client/accounting/types/item_request_request_purchase_tax_rate.rb +56 -0
- data/lib/merge_ruby_client/accounting/types/item_request_request_sales_account.rb +56 -0
- data/lib/merge_ruby_client/accounting/types/item_request_request_sales_tax_rate.rb +56 -0
- data/lib/merge_ruby_client/accounting/types/item_response.rb +101 -0
- data/lib/merge_ruby_client/accounting/types/journal_line.rb +15 -1
- data/lib/merge_ruby_client/accounting/types/journal_line_project.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/journal_line_request.rb +15 -1
- data/lib/merge_ruby_client/accounting/types/journal_line_request_project.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/paginated_project_list.rb +80 -0
- data/lib/merge_ruby_client/accounting/types/patched_item_request_request.rb +172 -0
- data/lib/merge_ruby_client/accounting/types/project.rb +162 -0
- data/lib/merge_ruby_client/accounting/types/project_company.rb +56 -0
- data/lib/merge_ruby_client/accounting/types/project_contact.rb +56 -0
- data/lib/merge_ruby_client/accounting/types/remote_field_api_response.rb +12 -1
- data/lib/merge_ruby_client/accounting/types/type_2_bb_enum.rb +16 -0
- data/lib/merge_ruby_client/accounting/types/vendor_credit_line.rb +29 -1
- data/lib/merge_ruby_client/accounting/types/vendor_credit_line_contact.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/vendor_credit_line_project.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/vendor_credit_line_request.rb +29 -1
- data/lib/merge_ruby_client/accounting/types/vendor_credit_line_request_contact.rb +55 -0
- data/lib/merge_ruby_client/accounting/types/vendor_credit_line_request_project.rb +55 -0
- data/lib/merge_ruby_client/ats/audit_trail/client.rb +6 -4
- data/lib/merge_ruby_client/ats/types/account_details_and_actions.rb +10 -2
- data/lib/merge_ruby_client/ats/types/audit_log_event.rb +2 -0
- data/lib/merge_ruby_client/ats/types/event_type_enum.rb +1 -0
- data/lib/merge_ruby_client/crm/accounts/client.rb +6 -2
- data/lib/merge_ruby_client/crm/audit_trail/client.rb +6 -4
- data/lib/merge_ruby_client/crm/contacts/client.rb +6 -2
- data/lib/merge_ruby_client/crm/custom_objects/client.rb +10 -2
- data/lib/merge_ruby_client/crm/engagement_types/client.rb +6 -2
- data/lib/merge_ruby_client/crm/engagements/client.rb +6 -2
- data/lib/merge_ruby_client/crm/leads/client.rb +6 -2
- data/lib/merge_ruby_client/crm/notes/client.rb +6 -2
- data/lib/merge_ruby_client/crm/opportunities/client.rb +6 -2
- data/lib/merge_ruby_client/crm/stages/client.rb +6 -2
- data/lib/merge_ruby_client/crm/sync_status/client.rb +20 -6
- data/lib/merge_ruby_client/crm/tasks/client.rb +6 -2
- data/lib/merge_ruby_client/crm/types/audit_log_event.rb +2 -0
- data/lib/merge_ruby_client/crm/types/custom_object_request.rb +26 -3
- data/lib/merge_ruby_client/crm/types/event_type_enum.rb +2 -0
- data/lib/merge_ruby_client/crm/users/client.rb +6 -2
- data/lib/merge_ruby_client/filestorage/audit_trail/client.rb +6 -4
- data/lib/merge_ruby_client/filestorage/files/client.rb +48 -12
- data/lib/merge_ruby_client/filestorage/files/types/files_download_request_meta_list_request_order_by.rb +14 -0
- data/lib/merge_ruby_client/filestorage/files/types/files_list_request_order_by.rb +14 -0
- data/lib/merge_ruby_client/filestorage/sync_status/client.rb +20 -6
- data/lib/merge_ruby_client/filestorage/types/account_details_and_actions.rb +10 -2
- data/lib/merge_ruby_client/filestorage/types/audit_log_event.rb +2 -0
- data/lib/merge_ruby_client/filestorage/types/download_request_meta.rb +2 -9
- data/lib/merge_ruby_client/filestorage/types/event_type_enum.rb +2 -0
- data/lib/merge_ruby_client/filestorage/types/file.rb +13 -1
- data/lib/merge_ruby_client/filestorage/types/file_request.rb +13 -1
- data/lib/merge_ruby_client/hris/audit_trail/client.rb +6 -4
- data/lib/merge_ruby_client/hris/types/account_details_and_actions.rb +10 -2
- data/lib/merge_ruby_client/hris/types/audit_log_event.rb +2 -0
- data/lib/merge_ruby_client/hris/types/event_type_enum.rb +2 -0
- data/lib/merge_ruby_client/ticketing/audit_trail/client.rb +6 -4
- data/lib/merge_ruby_client/ticketing/tickets/client.rb +26 -10
- data/lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb +10 -2
- data/lib/merge_ruby_client/ticketing/types/audit_log_event.rb +2 -0
- data/lib/merge_ruby_client/ticketing/types/collection.rb +18 -16
- data/lib/merge_ruby_client/ticketing/types/{access_level_enum.rb → collection_access_level_enum.rb} +3 -1
- data/lib/merge_ruby_client/ticketing/types/event_type_enum.rb +2 -0
- data/lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb +20 -1
- data/lib/merge_ruby_client/ticketing/types/ticket.rb +20 -1
- data/lib/merge_ruby_client/ticketing/types/ticket_access_level_enum.rb +16 -0
- data/lib/merge_ruby_client/ticketing/types/ticket_request.rb +20 -1
- data/lib/merge_ruby_client.rb +7 -7
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +243 -208
- 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 credit note's contact.
|
9
|
+
class CreditNoteLineItemContact
|
10
|
+
# Deserialize a JSON object to an instance of CreditNoteLineItemContact
|
11
|
+
#
|
12
|
+
# @param json_object [String]
|
13
|
+
# @return [Merge::Accounting::CreditNoteLineItemContact]
|
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
|
@@ -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 CreditNoteLineItemProject
|
9
|
+
# Deserialize a JSON object to an instance of CreditNoteLineItemProject
|
10
|
+
#
|
11
|
+
# @param json_object [String]
|
12
|
+
# @return [Merge::Accounting::CreditNoteLineItemProject]
|
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
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
require_relative "credit_note_line_item_request_item"
|
4
4
|
require_relative "credit_note_line_item_request_company"
|
5
|
+
require_relative "credit_note_line_item_request_contact"
|
6
|
+
require_relative "credit_note_line_item_request_project"
|
5
7
|
require "ostruct"
|
6
8
|
require "json"
|
7
9
|
|
@@ -39,6 +41,10 @@ module Merge
|
|
39
41
|
attr_reader :account
|
40
42
|
# @return [Merge::Accounting::CreditNoteLineItemRequestCompany] The company the credit note belongs to.
|
41
43
|
attr_reader :company
|
44
|
+
# @return [Merge::Accounting::CreditNoteLineItemRequestContact] The credit note's contact.
|
45
|
+
attr_reader :contact
|
46
|
+
# @return [Merge::Accounting::CreditNoteLineItemRequestProject]
|
47
|
+
attr_reader :project
|
42
48
|
# @return [Hash{String => Object}]
|
43
49
|
attr_reader :integration_params
|
44
50
|
# @return [Hash{String => Object}]
|
@@ -64,12 +70,14 @@ module Merge
|
|
64
70
|
# @param tracking_categories [Array<String>] The credit note line item's associated tracking categories.
|
65
71
|
# @param account [String] The credit note line item's account.
|
66
72
|
# @param company [Merge::Accounting::CreditNoteLineItemRequestCompany] The company the credit note belongs to.
|
73
|
+
# @param contact [Merge::Accounting::CreditNoteLineItemRequestContact] The credit note's contact.
|
74
|
+
# @param project [Merge::Accounting::CreditNoteLineItemRequestProject]
|
67
75
|
# @param integration_params [Hash{String => Object}]
|
68
76
|
# @param linked_account_params [Hash{String => Object}]
|
69
77
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
70
78
|
# @return [Merge::Accounting::CreditNoteLineItemRequest]
|
71
79
|
def initialize(remote_id: OMIT, item: OMIT, name: OMIT, description: OMIT, quantity: OMIT, memo: OMIT,
|
72
|
-
unit_price: OMIT, tax_rate: OMIT, total_line_amount: OMIT, tracking_category: OMIT, tracking_categories: OMIT, account: OMIT, company: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil)
|
80
|
+
unit_price: OMIT, tax_rate: OMIT, total_line_amount: OMIT, tracking_category: OMIT, tracking_categories: OMIT, account: OMIT, company: OMIT, contact: OMIT, project: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil)
|
73
81
|
@remote_id = remote_id if remote_id != OMIT
|
74
82
|
@item = item if item != OMIT
|
75
83
|
@name = name if name != OMIT
|
@@ -83,6 +91,8 @@ module Merge
|
|
83
91
|
@tracking_categories = tracking_categories if tracking_categories != OMIT
|
84
92
|
@account = account if account != OMIT
|
85
93
|
@company = company if company != OMIT
|
94
|
+
@contact = contact if contact != OMIT
|
95
|
+
@project = project if project != OMIT
|
86
96
|
@integration_params = integration_params if integration_params != OMIT
|
87
97
|
@linked_account_params = linked_account_params if linked_account_params != OMIT
|
88
98
|
@additional_properties = additional_properties
|
@@ -100,6 +110,8 @@ module Merge
|
|
100
110
|
"tracking_categories": tracking_categories,
|
101
111
|
"account": account,
|
102
112
|
"company": company,
|
113
|
+
"contact": contact,
|
114
|
+
"project": project,
|
103
115
|
"integration_params": integration_params,
|
104
116
|
"linked_account_params": linked_account_params
|
105
117
|
}.reject do |_k, v|
|
@@ -137,6 +149,18 @@ module Merge
|
|
137
149
|
company = parsed_json["company"].to_json
|
138
150
|
company = Merge::Accounting::CreditNoteLineItemRequestCompany.from_json(json_object: company)
|
139
151
|
end
|
152
|
+
if parsed_json["contact"].nil?
|
153
|
+
contact = nil
|
154
|
+
else
|
155
|
+
contact = parsed_json["contact"].to_json
|
156
|
+
contact = Merge::Accounting::CreditNoteLineItemRequestContact.from_json(json_object: contact)
|
157
|
+
end
|
158
|
+
if parsed_json["project"].nil?
|
159
|
+
project = nil
|
160
|
+
else
|
161
|
+
project = parsed_json["project"].to_json
|
162
|
+
project = Merge::Accounting::CreditNoteLineItemRequestProject.from_json(json_object: project)
|
163
|
+
end
|
140
164
|
integration_params = parsed_json["integration_params"]
|
141
165
|
linked_account_params = parsed_json["linked_account_params"]
|
142
166
|
new(
|
@@ -153,6 +177,8 @@ module Merge
|
|
153
177
|
tracking_categories: tracking_categories,
|
154
178
|
account: account,
|
155
179
|
company: company,
|
180
|
+
contact: contact,
|
181
|
+
project: project,
|
156
182
|
integration_params: integration_params,
|
157
183
|
linked_account_params: linked_account_params,
|
158
184
|
additional_properties: struct
|
@@ -186,6 +212,8 @@ module Merge
|
|
186
212
|
obj.tracking_categories&.is_a?(Array) != false || raise("Passed value for field obj.tracking_categories is not the expected type, validation failed.")
|
187
213
|
obj.account&.is_a?(String) != false || raise("Passed value for field obj.account is not the expected type, validation failed.")
|
188
214
|
obj.company.nil? || Merge::Accounting::CreditNoteLineItemRequestCompany.validate_raw(obj: obj.company)
|
215
|
+
obj.contact.nil? || Merge::Accounting::CreditNoteLineItemRequestContact.validate_raw(obj: obj.contact)
|
216
|
+
obj.project.nil? || Merge::Accounting::CreditNoteLineItemRequestProject.validate_raw(obj: obj.project)
|
189
217
|
obj.integration_params&.is_a?(Hash) != false || raise("Passed value for field obj.integration_params is not the expected type, validation failed.")
|
190
218
|
obj.linked_account_params&.is_a?(Hash) != false || raise("Passed value for field obj.linked_account_params is not the expected type, validation failed.")
|
191
219
|
end
|
@@ -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 credit note's contact.
|
9
|
+
class CreditNoteLineItemRequestContact
|
10
|
+
# Deserialize a JSON object to an instance of CreditNoteLineItemRequestContact
|
11
|
+
#
|
12
|
+
# @param json_object [String]
|
13
|
+
# @return [Merge::Accounting::CreditNoteLineItemRequestContact]
|
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
|
@@ -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 CreditNoteLineItemRequestProject
|
9
|
+
# Deserialize a JSON object to an instance of CreditNoteLineItemRequestProject
|
10
|
+
#
|
11
|
+
# @param json_object [String]
|
12
|
+
# @return [Merge::Accounting::CreditNoteLineItemRequestProject]
|
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
|
@@ -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
|
@@ -61,6 +62,7 @@ module Merge
|
|
61
62
|
CREATED_TEST_API_KEY = "CREATED_TEST_API_KEY"
|
62
63
|
DELETED_TEST_API_KEY = "DELETED_TEST_API_KEY"
|
63
64
|
REGENERATED_PRODUCTION_API_KEY = "REGENERATED_PRODUCTION_API_KEY"
|
65
|
+
REGENERATED_WEBHOOK_SIGNATURE = "REGENERATED_WEBHOOK_SIGNATURE"
|
64
66
|
INVITED_USER = "INVITED_USER"
|
65
67
|
TWO_FACTOR_AUTH_ENABLED = "TWO_FACTOR_AUTH_ENABLED"
|
66
68
|
TWO_FACTOR_AUTH_DISABLED = "TWO_FACTOR_AUTH_DISABLED"
|
@@ -8,6 +8,7 @@ require_relative "expense_line_employee"
|
|
8
8
|
require_relative "transaction_currency_enum"
|
9
9
|
require_relative "expense_line_account"
|
10
10
|
require_relative "expense_line_contact"
|
11
|
+
require_relative "expense_line_project"
|
11
12
|
require "ostruct"
|
12
13
|
require "json"
|
13
14
|
|
@@ -351,6 +352,8 @@ module Merge
|
|
351
352
|
attr_reader :account
|
352
353
|
# @return [Merge::Accounting::ExpenseLineContact] The expense's contact.
|
353
354
|
attr_reader :contact
|
355
|
+
# @return [Merge::Accounting::ExpenseLineProject]
|
356
|
+
attr_reader :project
|
354
357
|
# @return [String] The description of the item that was purchased by the company.
|
355
358
|
attr_reader :description
|
356
359
|
# @return [String] The expense line item's exchange rate.
|
@@ -689,6 +692,7 @@ module Merge
|
|
689
692
|
# * `ZWL` - Zimbabwean Dollar (2009)
|
690
693
|
# @param account [Merge::Accounting::ExpenseLineAccount] The expense's payment account.
|
691
694
|
# @param contact [Merge::Accounting::ExpenseLineContact] The expense's contact.
|
695
|
+
# @param project [Merge::Accounting::ExpenseLineProject]
|
692
696
|
# @param description [String] The description of the item that was purchased by the company.
|
693
697
|
# @param exchange_rate [String] The expense line item's exchange rate.
|
694
698
|
# @param tax_rate [String] The tax rate that applies to this line item.
|
@@ -699,7 +703,7 @@ module Merge
|
|
699
703
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
700
704
|
# @return [Merge::Accounting::ExpenseLine]
|
701
705
|
def initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, item: OMIT, net_amount: OMIT,
|
702
|
-
tracking_category: OMIT, tracking_categories: OMIT, company: OMIT, employee: OMIT, currency: OMIT, account: OMIT, contact: OMIT, description: OMIT, exchange_rate: OMIT, tax_rate: OMIT, remote_was_deleted: OMIT, additional_properties: nil)
|
706
|
+
tracking_category: OMIT, tracking_categories: OMIT, company: OMIT, employee: OMIT, currency: OMIT, account: OMIT, contact: OMIT, project: OMIT, description: OMIT, exchange_rate: OMIT, tax_rate: OMIT, remote_was_deleted: OMIT, additional_properties: nil)
|
703
707
|
@id = id if id != OMIT
|
704
708
|
@remote_id = remote_id if remote_id != OMIT
|
705
709
|
@created_at = created_at if created_at != OMIT
|
@@ -713,6 +717,7 @@ module Merge
|
|
713
717
|
@currency = currency if currency != OMIT
|
714
718
|
@account = account if account != OMIT
|
715
719
|
@contact = contact if contact != OMIT
|
720
|
+
@project = project if project != OMIT
|
716
721
|
@description = description if description != OMIT
|
717
722
|
@exchange_rate = exchange_rate if exchange_rate != OMIT
|
718
723
|
@tax_rate = tax_rate if tax_rate != OMIT
|
@@ -732,6 +737,7 @@ module Merge
|
|
732
737
|
"currency": currency,
|
733
738
|
"account": account,
|
734
739
|
"contact": contact,
|
740
|
+
"project": project,
|
735
741
|
"description": description,
|
736
742
|
"exchange_rate": exchange_rate,
|
737
743
|
"tax_rate": tax_rate,
|
@@ -789,6 +795,12 @@ module Merge
|
|
789
795
|
contact = parsed_json["contact"].to_json
|
790
796
|
contact = Merge::Accounting::ExpenseLineContact.from_json(json_object: contact)
|
791
797
|
end
|
798
|
+
if parsed_json["project"].nil?
|
799
|
+
project = nil
|
800
|
+
else
|
801
|
+
project = parsed_json["project"].to_json
|
802
|
+
project = Merge::Accounting::ExpenseLineProject.from_json(json_object: project)
|
803
|
+
end
|
792
804
|
description = parsed_json["description"]
|
793
805
|
exchange_rate = parsed_json["exchange_rate"]
|
794
806
|
tax_rate = parsed_json["tax_rate"]
|
@@ -807,6 +819,7 @@ module Merge
|
|
807
819
|
currency: currency,
|
808
820
|
account: account,
|
809
821
|
contact: contact,
|
822
|
+
project: project,
|
810
823
|
description: description,
|
811
824
|
exchange_rate: exchange_rate,
|
812
825
|
tax_rate: tax_rate,
|
@@ -842,6 +855,7 @@ module Merge
|
|
842
855
|
obj.currency&.is_a?(Merge::Accounting::TransactionCurrencyEnum) != false || raise("Passed value for field obj.currency is not the expected type, validation failed.")
|
843
856
|
obj.account.nil? || Merge::Accounting::ExpenseLineAccount.validate_raw(obj: obj.account)
|
844
857
|
obj.contact.nil? || Merge::Accounting::ExpenseLineContact.validate_raw(obj: obj.contact)
|
858
|
+
obj.project.nil? || Merge::Accounting::ExpenseLineProject.validate_raw(obj: obj.project)
|
845
859
|
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
846
860
|
obj.exchange_rate&.is_a?(String) != false || raise("Passed value for field obj.exchange_rate is not the expected type, validation failed.")
|
847
861
|
obj.tax_rate&.is_a?(String) != false || raise("Passed value for field obj.tax_rate is not the expected type, validation failed.")
|
@@ -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 ExpenseLineProject
|
9
|
+
# Deserialize a JSON object to an instance of ExpenseLineProject
|
10
|
+
#
|
11
|
+
# @param json_object [String]
|
12
|
+
# @return [Merge::Accounting::ExpenseLineProject]
|
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
|
@@ -7,6 +7,7 @@ require_relative "expense_line_request_employee"
|
|
7
7
|
require_relative "transaction_currency_enum"
|
8
8
|
require_relative "expense_line_request_account"
|
9
9
|
require_relative "expense_line_request_contact"
|
10
|
+
require_relative "expense_line_request_project"
|
10
11
|
require_relative "remote_field_request"
|
11
12
|
require "ostruct"
|
12
13
|
require "json"
|
@@ -345,6 +346,8 @@ module Merge
|
|
345
346
|
attr_reader :account
|
346
347
|
# @return [Merge::Accounting::ExpenseLineRequestContact] The expense's contact.
|
347
348
|
attr_reader :contact
|
349
|
+
# @return [Merge::Accounting::ExpenseLineRequestProject]
|
350
|
+
attr_reader :project
|
348
351
|
# @return [String] The description of the item that was purchased by the company.
|
349
352
|
attr_reader :description
|
350
353
|
# @return [String] The expense line item's exchange rate.
|
@@ -681,6 +684,7 @@ module Merge
|
|
681
684
|
# * `ZWL` - Zimbabwean Dollar (2009)
|
682
685
|
# @param account [Merge::Accounting::ExpenseLineRequestAccount] The expense's payment account.
|
683
686
|
# @param contact [Merge::Accounting::ExpenseLineRequestContact] The expense's contact.
|
687
|
+
# @param project [Merge::Accounting::ExpenseLineRequestProject]
|
684
688
|
# @param description [String] The description of the item that was purchased by the company.
|
685
689
|
# @param exchange_rate [String] The expense line item's exchange rate.
|
686
690
|
# @param tax_rate [String] The tax rate that applies to this line item.
|
@@ -690,7 +694,7 @@ module Merge
|
|
690
694
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
691
695
|
# @return [Merge::Accounting::ExpenseLineRequest]
|
692
696
|
def initialize(remote_id: OMIT, item: OMIT, net_amount: OMIT, tracking_category: OMIT, tracking_categories: OMIT,
|
693
|
-
company: OMIT, employee: OMIT, currency: OMIT, account: OMIT, contact: OMIT, description: OMIT, exchange_rate: OMIT, tax_rate: OMIT, integration_params: OMIT, linked_account_params: OMIT, remote_fields: OMIT, additional_properties: nil)
|
697
|
+
company: OMIT, employee: OMIT, currency: OMIT, account: OMIT, contact: OMIT, project: OMIT, description: OMIT, exchange_rate: OMIT, tax_rate: OMIT, integration_params: OMIT, linked_account_params: OMIT, remote_fields: OMIT, additional_properties: nil)
|
694
698
|
@remote_id = remote_id if remote_id != OMIT
|
695
699
|
@item = item if item != OMIT
|
696
700
|
@net_amount = net_amount if net_amount != OMIT
|
@@ -701,6 +705,7 @@ module Merge
|
|
701
705
|
@currency = currency if currency != OMIT
|
702
706
|
@account = account if account != OMIT
|
703
707
|
@contact = contact if contact != OMIT
|
708
|
+
@project = project if project != OMIT
|
704
709
|
@description = description if description != OMIT
|
705
710
|
@exchange_rate = exchange_rate if exchange_rate != OMIT
|
706
711
|
@tax_rate = tax_rate if tax_rate != OMIT
|
@@ -719,6 +724,7 @@ module Merge
|
|
719
724
|
"currency": currency,
|
720
725
|
"account": account,
|
721
726
|
"contact": contact,
|
727
|
+
"project": project,
|
722
728
|
"description": description,
|
723
729
|
"exchange_rate": exchange_rate,
|
724
730
|
"tax_rate": tax_rate,
|
@@ -775,6 +781,12 @@ module Merge
|
|
775
781
|
contact = parsed_json["contact"].to_json
|
776
782
|
contact = Merge::Accounting::ExpenseLineRequestContact.from_json(json_object: contact)
|
777
783
|
end
|
784
|
+
if parsed_json["project"].nil?
|
785
|
+
project = nil
|
786
|
+
else
|
787
|
+
project = parsed_json["project"].to_json
|
788
|
+
project = Merge::Accounting::ExpenseLineRequestProject.from_json(json_object: project)
|
789
|
+
end
|
778
790
|
description = parsed_json["description"]
|
779
791
|
exchange_rate = parsed_json["exchange_rate"]
|
780
792
|
tax_rate = parsed_json["tax_rate"]
|
@@ -795,6 +807,7 @@ module Merge
|
|
795
807
|
currency: currency,
|
796
808
|
account: account,
|
797
809
|
contact: contact,
|
810
|
+
project: project,
|
798
811
|
description: description,
|
799
812
|
exchange_rate: exchange_rate,
|
800
813
|
tax_rate: tax_rate,
|
@@ -829,6 +842,7 @@ module Merge
|
|
829
842
|
obj.currency&.is_a?(Merge::Accounting::TransactionCurrencyEnum) != false || raise("Passed value for field obj.currency is not the expected type, validation failed.")
|
830
843
|
obj.account.nil? || Merge::Accounting::ExpenseLineRequestAccount.validate_raw(obj: obj.account)
|
831
844
|
obj.contact.nil? || Merge::Accounting::ExpenseLineRequestContact.validate_raw(obj: obj.contact)
|
845
|
+
obj.project.nil? || Merge::Accounting::ExpenseLineRequestProject.validate_raw(obj: obj.project)
|
832
846
|
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
833
847
|
obj.exchange_rate&.is_a?(String) != false || raise("Passed value for field obj.exchange_rate is not the expected type, validation failed.")
|
834
848
|
obj.tax_rate&.is_a?(String) != false || raise("Passed value for field obj.tax_rate 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 ExpenseLineRequestProject
|
9
|
+
# Deserialize a JSON object to an instance of ExpenseLineRequestProject
|
10
|
+
#
|
11
|
+
# @param json_object [String]
|
12
|
+
# @return [Merge::Accounting::ExpenseLineRequestProject]
|
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
|
@@ -54,6 +54,8 @@ module Merge
|
|
54
54
|
# @return [Array<Merge::Accounting::ExternalTargetFieldApi>]
|
55
55
|
attr_reader :payment_method
|
56
56
|
# @return [Array<Merge::Accounting::ExternalTargetFieldApi>]
|
57
|
+
attr_reader :project
|
58
|
+
# @return [Array<Merge::Accounting::ExternalTargetFieldApi>]
|
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::ExternalTargetFieldApi>]
|
87
89
|
# @param employee [Array<Merge::Accounting::ExternalTargetFieldApi>]
|
88
90
|
# @param payment_method [Array<Merge::Accounting::ExternalTargetFieldApi>]
|
91
|
+
# @param project [Array<Merge::Accounting::ExternalTargetFieldApi>]
|
89
92
|
# @param payment_term [Array<Merge::Accounting::ExternalTargetFieldApi>]
|
90
93
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
91
94
|
# @return [Merge::Accounting::ExternalTargetFieldApiResponse]
|
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::ExternalTargetFieldApi.from_json(json_object: item)
|
247
252
|
end
|
253
|
+
project = parsed_json["Project"]&.map do |item|
|
254
|
+
item = item.to_json
|
255
|
+
Merge::Accounting::ExternalTargetFieldApi.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::ExternalTargetFieldApi.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
|