merge_ruby_client 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/merge_ruby_client/accounting/audit_trail/client.rb +2 -4
- data/lib/merge_ruby_client/accounting/client.rb +7 -0
- data/lib/merge_ruby_client/accounting/link_token/client.rb +4 -8
- data/lib/merge_ruby_client/accounting/payments/client.rb +0 -4
- data/lib/merge_ruby_client/accounting/selective_sync/client.rb +218 -0
- data/lib/merge_ruby_client/accounting/types/account.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/accounting_attachment.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/accounting_period.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/accounting_phone_number.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/address.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/audit_log_event.rb +0 -6
- data/lib/merge_ruby_client/accounting/types/balance_sheet.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/cash_flow_statement.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/company_info.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/condition_schema.rb +136 -0
- data/lib/merge_ruby_client/accounting/types/condition_type_enum.rb +22 -0
- data/lib/merge_ruby_client/accounting/types/contact.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/credit_note.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/credit_note_line_item.rb +13 -5
- data/lib/merge_ruby_client/accounting/types/event_type_enum.rb +0 -6
- data/lib/merge_ruby_client/accounting/types/expense.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/expense_line.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/income_statement.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/invoice.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/invoice_line_item.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/item.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/journal_entry.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/journal_line.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/linked_account_condition.rb +104 -0
- data/lib/merge_ruby_client/accounting/types/linked_account_condition_request.rb +87 -0
- data/lib/merge_ruby_client/accounting/types/linked_account_selective_sync_configuration.rb +65 -0
- data/lib/merge_ruby_client/accounting/types/linked_account_selective_sync_configuration_request.rb +63 -0
- data/lib/merge_ruby_client/accounting/types/operator_schema.rb +68 -0
- data/lib/merge_ruby_client/accounting/types/paginated_condition_schema_list.rb +80 -0
- data/lib/merge_ruby_client/accounting/types/patched_payment_request.rb +1 -14
- data/lib/merge_ruby_client/accounting/types/payment.rb +5 -18
- data/lib/merge_ruby_client/accounting/types/payment_line_item.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/payment_request.rb +1 -14
- data/lib/merge_ruby_client/accounting/types/purchase_order.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/purchase_order_line_item.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/remote_field_api.rb +2 -16
- data/lib/merge_ruby_client/accounting/types/report_item.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/tax_rate.rb +10 -12
- data/lib/merge_ruby_client/accounting/types/tax_rate_company.rb +1 -2
- data/lib/merge_ruby_client/accounting/types/tracking_category.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/transaction.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/transaction_line_item.rb +6 -6
- data/lib/merge_ruby_client/accounting/types/vendor_credit.rb +4 -4
- data/lib/merge_ruby_client/accounting/types/vendor_credit_line.rb +4 -4
- data/lib/merge_ruby_client/ats/audit_trail/client.rb +2 -4
- data/lib/merge_ruby_client/ats/client.rb +7 -0
- data/lib/merge_ruby_client/ats/job_postings/client.rb +4 -16
- data/lib/merge_ruby_client/ats/link_token/client.rb +4 -8
- data/lib/merge_ruby_client/ats/selective_sync/client.rb +218 -0
- data/lib/merge_ruby_client/ats/types/activity.rb +4 -4
- data/lib/merge_ruby_client/ats/types/application.rb +4 -4
- data/lib/merge_ruby_client/ats/types/attachment.rb +4 -4
- data/lib/merge_ruby_client/ats/types/audit_log_event.rb +0 -6
- data/lib/merge_ruby_client/ats/types/candidate.rb +4 -4
- data/lib/merge_ruby_client/ats/types/condition_schema.rb +136 -0
- data/lib/merge_ruby_client/ats/types/condition_type_enum.rb +22 -0
- data/lib/merge_ruby_client/ats/types/department.rb +4 -4
- data/lib/merge_ruby_client/ats/types/eeoc.rb +4 -4
- data/lib/merge_ruby_client/ats/types/email_address.rb +4 -4
- data/lib/merge_ruby_client/ats/types/event_type_enum.rb +0 -6
- data/lib/merge_ruby_client/ats/types/job.rb +4 -4
- data/lib/merge_ruby_client/ats/types/job_interview_stage.rb +4 -4
- data/lib/merge_ruby_client/ats/types/job_posting.rb +4 -4
- data/lib/merge_ruby_client/ats/types/linked_account_condition.rb +104 -0
- data/lib/merge_ruby_client/ats/types/linked_account_condition_request.rb +87 -0
- data/lib/merge_ruby_client/ats/types/linked_account_selective_sync_configuration.rb +65 -0
- data/lib/merge_ruby_client/ats/types/linked_account_selective_sync_configuration_request.rb +63 -0
- data/lib/merge_ruby_client/ats/types/offer.rb +4 -4
- data/lib/merge_ruby_client/ats/types/office.rb +4 -4
- data/lib/merge_ruby_client/ats/types/operator_schema.rb +68 -0
- data/lib/merge_ruby_client/ats/types/paginated_condition_schema_list.rb +80 -0
- data/lib/merge_ruby_client/ats/types/phone_number.rb +4 -4
- data/lib/merge_ruby_client/ats/types/reject_reason.rb +4 -4
- data/lib/merge_ruby_client/ats/types/remote_field_api.rb +2 -16
- data/lib/merge_ruby_client/ats/types/remote_user.rb +4 -4
- data/lib/merge_ruby_client/ats/types/scheduled_interview.rb +4 -4
- data/lib/merge_ruby_client/ats/types/scorecard.rb +4 -4
- data/lib/merge_ruby_client/ats/types/screening_question.rb +4 -4
- data/lib/merge_ruby_client/ats/types/screening_question_option.rb +4 -4
- data/lib/merge_ruby_client/ats/types/tag.rb +4 -4
- data/lib/merge_ruby_client/ats/types/url.rb +4 -4
- data/lib/merge_ruby_client/crm/accounts/client.rb +0 -4
- data/lib/merge_ruby_client/crm/audit_trail/client.rb +2 -4
- data/lib/merge_ruby_client/crm/client.rb +7 -0
- data/lib/merge_ruby_client/crm/custom_objects/client.rb +2 -2
- data/lib/merge_ruby_client/crm/link_token/client.rb +4 -8
- data/lib/merge_ruby_client/crm/selective_sync/client.rb +218 -0
- data/lib/merge_ruby_client/crm/types/account.rb +4 -4
- data/lib/merge_ruby_client/crm/types/account_request.rb +1 -13
- data/lib/merge_ruby_client/crm/types/address.rb +4 -4
- data/lib/merge_ruby_client/crm/types/association.rb +6 -6
- data/lib/merge_ruby_client/crm/types/association_association_type.rb +0 -1
- data/lib/merge_ruby_client/crm/types/association_sub_type.rb +4 -4
- data/lib/merge_ruby_client/crm/types/association_type.rb +6 -8
- data/lib/merge_ruby_client/crm/types/audit_log_event.rb +0 -6
- data/lib/merge_ruby_client/crm/types/condition_schema.rb +136 -0
- data/lib/merge_ruby_client/crm/types/condition_type_enum.rb +22 -0
- data/lib/merge_ruby_client/crm/types/contact.rb +4 -4
- data/lib/merge_ruby_client/crm/types/custom_object.rb +8 -8
- data/lib/merge_ruby_client/crm/types/custom_object_class.rb +8 -10
- data/lib/merge_ruby_client/crm/types/email_address.rb +4 -4
- data/lib/merge_ruby_client/crm/types/engagement.rb +4 -4
- data/lib/merge_ruby_client/crm/types/engagement_type.rb +4 -4
- data/lib/merge_ruby_client/crm/types/event_type_enum.rb +0 -6
- data/lib/merge_ruby_client/crm/types/lead.rb +4 -4
- data/lib/merge_ruby_client/crm/types/linked_account_condition.rb +104 -0
- data/lib/merge_ruby_client/crm/types/linked_account_condition_request.rb +87 -0
- data/lib/merge_ruby_client/crm/types/linked_account_selective_sync_configuration.rb +65 -0
- data/lib/merge_ruby_client/crm/types/linked_account_selective_sync_configuration_request.rb +63 -0
- data/lib/merge_ruby_client/crm/types/note.rb +4 -4
- data/lib/merge_ruby_client/crm/types/operator_schema.rb +68 -0
- data/lib/merge_ruby_client/crm/types/opportunity.rb +4 -4
- data/lib/merge_ruby_client/crm/types/paginated_condition_schema_list.rb +80 -0
- data/lib/merge_ruby_client/crm/types/patched_account_request.rb +1 -13
- data/lib/merge_ruby_client/crm/types/phone_number.rb +4 -4
- data/lib/merge_ruby_client/crm/types/remote_field_api.rb +2 -16
- data/lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb +4 -4
- data/lib/merge_ruby_client/crm/types/stage.rb +4 -4
- data/lib/merge_ruby_client/crm/types/task.rb +4 -4
- data/lib/merge_ruby_client/crm/types/user.rb +4 -4
- data/lib/merge_ruby_client/filestorage/audit_trail/client.rb +2 -4
- data/lib/merge_ruby_client/filestorage/client.rb +7 -0
- data/lib/merge_ruby_client/filestorage/link_token/client.rb +4 -8
- data/lib/merge_ruby_client/filestorage/selective_sync/client.rb +218 -0
- data/lib/merge_ruby_client/filestorage/types/audit_log_event.rb +0 -6
- data/lib/merge_ruby_client/filestorage/types/condition_schema.rb +136 -0
- data/lib/merge_ruby_client/filestorage/types/condition_type_enum.rb +22 -0
- data/lib/merge_ruby_client/filestorage/types/drive.rb +4 -4
- data/lib/merge_ruby_client/filestorage/types/event_type_enum.rb +0 -6
- data/lib/merge_ruby_client/filestorage/types/file.rb +4 -4
- data/lib/merge_ruby_client/filestorage/types/folder.rb +4 -4
- data/lib/merge_ruby_client/filestorage/types/group.rb +4 -4
- data/lib/merge_ruby_client/filestorage/types/linked_account_condition.rb +104 -0
- data/lib/merge_ruby_client/filestorage/types/linked_account_condition_request.rb +87 -0
- data/lib/merge_ruby_client/filestorage/types/linked_account_selective_sync_configuration.rb +65 -0
- data/lib/merge_ruby_client/filestorage/types/linked_account_selective_sync_configuration_request.rb +63 -0
- data/lib/merge_ruby_client/filestorage/types/operator_schema.rb +68 -0
- data/lib/merge_ruby_client/filestorage/types/paginated_condition_schema_list.rb +80 -0
- data/lib/merge_ruby_client/filestorage/types/permission.rb +4 -4
- data/lib/merge_ruby_client/filestorage/types/remote_field_api.rb +2 -16
- data/lib/merge_ruby_client/filestorage/types/user.rb +4 -4
- data/lib/merge_ruby_client/hris/audit_trail/client.rb +2 -4
- data/lib/merge_ruby_client/hris/client.rb +7 -0
- data/lib/merge_ruby_client/hris/groups/client.rb +2 -10
- data/lib/merge_ruby_client/hris/link_token/client.rb +4 -8
- data/lib/merge_ruby_client/hris/selective_sync/client.rb +218 -0
- data/lib/merge_ruby_client/hris/types/audit_log_event.rb +0 -6
- data/lib/merge_ruby_client/hris/types/bank_info.rb +4 -4
- data/lib/merge_ruby_client/hris/types/benefit.rb +4 -4
- data/lib/merge_ruby_client/hris/types/company.rb +4 -4
- data/lib/merge_ruby_client/hris/types/condition_schema.rb +136 -0
- data/lib/merge_ruby_client/hris/types/condition_type_enum.rb +22 -0
- data/lib/merge_ruby_client/hris/types/deduction.rb +4 -4
- data/lib/merge_ruby_client/hris/types/dependent.rb +4 -4
- data/lib/merge_ruby_client/hris/types/earning.rb +4 -4
- data/lib/merge_ruby_client/hris/types/employee.rb +4 -4
- data/lib/merge_ruby_client/hris/types/employee_payroll_run.rb +4 -4
- data/lib/merge_ruby_client/hris/types/employer_benefit.rb +4 -4
- data/lib/merge_ruby_client/hris/types/employment.rb +4 -4
- data/lib/merge_ruby_client/hris/types/event_type_enum.rb +0 -6
- data/lib/merge_ruby_client/hris/types/group.rb +5 -19
- data/lib/merge_ruby_client/hris/types/linked_account_condition.rb +104 -0
- data/lib/merge_ruby_client/hris/types/linked_account_condition_request.rb +87 -0
- data/lib/merge_ruby_client/hris/types/linked_account_selective_sync_configuration.rb +65 -0
- data/lib/merge_ruby_client/hris/types/linked_account_selective_sync_configuration_request.rb +63 -0
- data/lib/merge_ruby_client/hris/types/location.rb +4 -4
- data/lib/merge_ruby_client/hris/types/operator_schema.rb +68 -0
- data/lib/merge_ruby_client/hris/types/paginated_condition_schema_list.rb +80 -0
- data/lib/merge_ruby_client/hris/types/pay_group.rb +4 -4
- data/lib/merge_ruby_client/hris/types/payroll_run.rb +4 -4
- data/lib/merge_ruby_client/hris/types/remote_field_api.rb +2 -16
- data/lib/merge_ruby_client/hris/types/tax.rb +4 -4
- data/lib/merge_ruby_client/hris/types/team.rb +4 -4
- data/lib/merge_ruby_client/hris/types/time_off.rb +4 -4
- data/lib/merge_ruby_client/hris/types/time_off_balance.rb +4 -4
- data/lib/merge_ruby_client/hris/types/timesheet_entry.rb +4 -4
- data/lib/merge_ruby_client/ticketing/audit_trail/client.rb +2 -4
- data/lib/merge_ruby_client/ticketing/client.rb +7 -0
- data/lib/merge_ruby_client/ticketing/contacts/client.rb +0 -127
- data/lib/merge_ruby_client/ticketing/link_token/client.rb +4 -8
- data/lib/merge_ruby_client/ticketing/selective_sync/client.rb +218 -0
- data/lib/merge_ruby_client/ticketing/types/account.rb +4 -4
- data/lib/merge_ruby_client/ticketing/types/attachment.rb +4 -4
- data/lib/merge_ruby_client/ticketing/types/audit_log_event.rb +0 -6
- data/lib/merge_ruby_client/ticketing/types/collection.rb +4 -4
- data/lib/merge_ruby_client/ticketing/types/comment.rb +4 -4
- data/lib/merge_ruby_client/ticketing/types/condition_schema.rb +136 -0
- data/lib/merge_ruby_client/ticketing/types/condition_type_enum.rb +22 -0
- data/lib/merge_ruby_client/ticketing/types/contact.rb +4 -4
- data/lib/merge_ruby_client/ticketing/types/event_type_enum.rb +0 -6
- data/lib/merge_ruby_client/ticketing/types/linked_account_condition.rb +104 -0
- data/lib/merge_ruby_client/ticketing/types/linked_account_condition_request.rb +87 -0
- data/lib/merge_ruby_client/ticketing/types/linked_account_selective_sync_configuration.rb +65 -0
- data/lib/merge_ruby_client/ticketing/types/linked_account_selective_sync_configuration_request.rb +63 -0
- data/lib/merge_ruby_client/ticketing/types/operator_schema.rb +68 -0
- data/lib/merge_ruby_client/ticketing/types/paginated_condition_schema_list.rb +80 -0
- data/lib/merge_ruby_client/ticketing/types/project.rb +4 -4
- data/lib/merge_ruby_client/ticketing/types/remote_field_api.rb +2 -16
- data/lib/merge_ruby_client/ticketing/types/role.rb +4 -4
- data/lib/merge_ruby_client/ticketing/types/tag.rb +4 -4
- data/lib/merge_ruby_client/ticketing/types/team.rb +4 -4
- data/lib/merge_ruby_client/ticketing/types/ticket.rb +4 -4
- data/lib/merge_ruby_client/ticketing/types/user.rb +4 -4
- data/lib/merge_ruby_client.rb +7 -7
- data/lib/requests.rb +2 -12
- data/lib/types_export.rb +153 -115
- metadata +56 -12
- data/lib/merge_ruby_client/accounting/types/payment_type_enum.rb +0 -12
- data/lib/merge_ruby_client/accounting/types/remote_field_api_coverage.rb +0 -54
- data/lib/merge_ruby_client/ats/types/remote_field_api_coverage.rb +0 -54
- data/lib/merge_ruby_client/crm/types/remote_field_api_coverage.rb +0 -54
- data/lib/merge_ruby_client/filestorage/types/remote_field_api_coverage.rb +0 -54
- data/lib/merge_ruby_client/hris/types/remote_field_api_coverage.rb +0 -54
- data/lib/merge_ruby_client/ticketing/types/contact_request.rb +0 -125
- data/lib/merge_ruby_client/ticketing/types/contact_request_account.rb +0 -56
- data/lib/merge_ruby_client/ticketing/types/remote_field_api_coverage.rb +0 -54
- data/lib/merge_ruby_client/ticketing/types/ticketing_contact_response.rb +0 -101
@@ -0,0 +1,136 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "condition_type_enum"
|
4
|
+
require_relative "operator_schema"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Merge
|
9
|
+
module Accounting
|
10
|
+
class ConditionSchema
|
11
|
+
# @return [String] The ID of the condition schema. This ID is used when updating selective syncs
|
12
|
+
# for a linked account.
|
13
|
+
attr_reader :id
|
14
|
+
# @return [String] The common model for which a condition schema is defined.
|
15
|
+
attr_reader :common_model
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :native_name
|
18
|
+
# @return [String]
|
19
|
+
attr_reader :field_name
|
20
|
+
# @return [Boolean] Whether this condition can only be applied once. If false, the condition can be
|
21
|
+
# AND'd together multiple times.
|
22
|
+
attr_reader :is_unique
|
23
|
+
# @return [Merge::Accounting::ConditionTypeEnum] The type of value(s) that can be set for this condition.
|
24
|
+
# - `BOOLEAN` - BOOLEAN
|
25
|
+
# - `DATE` - DATE
|
26
|
+
# - `DATE_TIME` - DATE_TIME
|
27
|
+
# - `INTEGER` - INTEGER
|
28
|
+
# - `FLOAT` - FLOAT
|
29
|
+
# - `STRING` - STRING
|
30
|
+
# - `LIST_OF_STRINGS` - LIST_OF_STRINGS
|
31
|
+
attr_reader :condition_type
|
32
|
+
# @return [Array<Merge::Accounting::OperatorSchema>] The schemas for the operators that can be used on a condition.
|
33
|
+
attr_reader :operators
|
34
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
35
|
+
attr_reader :additional_properties
|
36
|
+
# @return [Object]
|
37
|
+
attr_reader :_field_set
|
38
|
+
protected :_field_set
|
39
|
+
|
40
|
+
OMIT = Object.new
|
41
|
+
|
42
|
+
# @param id [String] The ID of the condition schema. This ID is used when updating selective syncs
|
43
|
+
# for a linked account.
|
44
|
+
# @param common_model [String] The common model for which a condition schema is defined.
|
45
|
+
# @param native_name [String]
|
46
|
+
# @param field_name [String]
|
47
|
+
# @param is_unique [Boolean] Whether this condition can only be applied once. If false, the condition can be
|
48
|
+
# AND'd together multiple times.
|
49
|
+
# @param condition_type [Merge::Accounting::ConditionTypeEnum] The type of value(s) that can be set for this condition.
|
50
|
+
# - `BOOLEAN` - BOOLEAN
|
51
|
+
# - `DATE` - DATE
|
52
|
+
# - `DATE_TIME` - DATE_TIME
|
53
|
+
# - `INTEGER` - INTEGER
|
54
|
+
# - `FLOAT` - FLOAT
|
55
|
+
# - `STRING` - STRING
|
56
|
+
# - `LIST_OF_STRINGS` - LIST_OF_STRINGS
|
57
|
+
# @param operators [Array<Merge::Accounting::OperatorSchema>] The schemas for the operators that can be used on a condition.
|
58
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
59
|
+
# @return [Merge::Accounting::ConditionSchema]
|
60
|
+
def initialize(id:, condition_type:, operators:, common_model: OMIT, native_name: OMIT, field_name: OMIT,
|
61
|
+
is_unique: OMIT, additional_properties: nil)
|
62
|
+
@id = id
|
63
|
+
@common_model = common_model if common_model != OMIT
|
64
|
+
@native_name = native_name if native_name != OMIT
|
65
|
+
@field_name = field_name if field_name != OMIT
|
66
|
+
@is_unique = is_unique if is_unique != OMIT
|
67
|
+
@condition_type = condition_type
|
68
|
+
@operators = operators
|
69
|
+
@additional_properties = additional_properties
|
70
|
+
@_field_set = {
|
71
|
+
"id": id,
|
72
|
+
"common_model": common_model,
|
73
|
+
"native_name": native_name,
|
74
|
+
"field_name": field_name,
|
75
|
+
"is_unique": is_unique,
|
76
|
+
"condition_type": condition_type,
|
77
|
+
"operators": operators
|
78
|
+
}.reject do |_k, v|
|
79
|
+
v == OMIT
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Deserialize a JSON object to an instance of ConditionSchema
|
84
|
+
#
|
85
|
+
# @param json_object [String]
|
86
|
+
# @return [Merge::Accounting::ConditionSchema]
|
87
|
+
def self.from_json(json_object:)
|
88
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
89
|
+
parsed_json = JSON.parse(json_object)
|
90
|
+
id = struct["id"]
|
91
|
+
common_model = struct["common_model"]
|
92
|
+
native_name = struct["native_name"]
|
93
|
+
field_name = struct["field_name"]
|
94
|
+
is_unique = struct["is_unique"]
|
95
|
+
condition_type = struct["condition_type"]
|
96
|
+
operators = parsed_json["operators"]&.map do |v|
|
97
|
+
v = v.to_json
|
98
|
+
Merge::Accounting::OperatorSchema.from_json(json_object: v)
|
99
|
+
end
|
100
|
+
new(
|
101
|
+
id: id,
|
102
|
+
common_model: common_model,
|
103
|
+
native_name: native_name,
|
104
|
+
field_name: field_name,
|
105
|
+
is_unique: is_unique,
|
106
|
+
condition_type: condition_type,
|
107
|
+
operators: operators,
|
108
|
+
additional_properties: struct
|
109
|
+
)
|
110
|
+
end
|
111
|
+
|
112
|
+
# Serialize an instance of ConditionSchema to a JSON object
|
113
|
+
#
|
114
|
+
# @return [String]
|
115
|
+
def to_json(*_args)
|
116
|
+
@_field_set&.to_json
|
117
|
+
end
|
118
|
+
|
119
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
120
|
+
# hash and check each fields type against the current object's property
|
121
|
+
# definitions.
|
122
|
+
#
|
123
|
+
# @param obj [Object]
|
124
|
+
# @return [Void]
|
125
|
+
def self.validate_raw(obj:)
|
126
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
127
|
+
obj.common_model&.is_a?(String) != false || raise("Passed value for field obj.common_model is not the expected type, validation failed.")
|
128
|
+
obj.native_name&.is_a?(String) != false || raise("Passed value for field obj.native_name is not the expected type, validation failed.")
|
129
|
+
obj.field_name&.is_a?(String) != false || raise("Passed value for field obj.field_name is not the expected type, validation failed.")
|
130
|
+
obj.is_unique&.is_a?(Boolean) != false || raise("Passed value for field obj.is_unique is not the expected type, validation failed.")
|
131
|
+
obj.condition_type.is_a?(Merge::Accounting::ConditionTypeEnum) != false || raise("Passed value for field obj.condition_type is not the expected type, validation failed.")
|
132
|
+
obj.operators.is_a?(Array) != false || raise("Passed value for field obj.operators is not the expected type, validation failed.")
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Merge
|
4
|
+
module Accounting
|
5
|
+
# - `BOOLEAN` - BOOLEAN
|
6
|
+
# - `DATE` - DATE
|
7
|
+
# - `DATE_TIME` - DATE_TIME
|
8
|
+
# - `INTEGER` - INTEGER
|
9
|
+
# - `FLOAT` - FLOAT
|
10
|
+
# - `STRING` - STRING
|
11
|
+
# - `LIST_OF_STRINGS` - LIST_OF_STRINGS
|
12
|
+
class ConditionTypeEnum
|
13
|
+
BOOLEAN = "BOOLEAN"
|
14
|
+
DATE = "DATE"
|
15
|
+
DATE_TIME = "DATE_TIME"
|
16
|
+
INTEGER = "INTEGER"
|
17
|
+
FLOAT = "FLOAT"
|
18
|
+
STRING = "STRING"
|
19
|
+
LIST_OF_STRINGS = "LIST_OF_STRINGS"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -25,9 +25,9 @@ module Merge
|
|
25
25
|
attr_reader :id
|
26
26
|
# @return [String] The third-party API ID of the matching object.
|
27
27
|
attr_reader :remote_id
|
28
|
-
# @return [DateTime]
|
28
|
+
# @return [DateTime]
|
29
29
|
attr_reader :created_at
|
30
|
-
# @return [DateTime]
|
30
|
+
# @return [DateTime] This is the datetime that this object was last updated by Merge
|
31
31
|
attr_reader :modified_at
|
32
32
|
# @return [String] The contact's name.
|
33
33
|
attr_reader :name
|
@@ -70,8 +70,8 @@ module Merge
|
|
70
70
|
|
71
71
|
# @param id [String]
|
72
72
|
# @param remote_id [String] The third-party API ID of the matching object.
|
73
|
-
# @param created_at [DateTime]
|
74
|
-
# @param modified_at [DateTime]
|
73
|
+
# @param created_at [DateTime]
|
74
|
+
# @param modified_at [DateTime] This is the datetime that this object was last updated by Merge
|
75
75
|
# @param name [String] The contact's name.
|
76
76
|
# @param is_supplier [Boolean] Whether the contact is a supplier.
|
77
77
|
# @param is_customer [Boolean] Whether the contact is a customer.
|
@@ -30,9 +30,9 @@ module Merge
|
|
30
30
|
attr_reader :id
|
31
31
|
# @return [String] The third-party API ID of the matching object.
|
32
32
|
attr_reader :remote_id
|
33
|
-
# @return [DateTime]
|
33
|
+
# @return [DateTime]
|
34
34
|
attr_reader :created_at
|
35
|
-
# @return [DateTime]
|
35
|
+
# @return [DateTime] This is the datetime that this object was last updated by Merge
|
36
36
|
attr_reader :modified_at
|
37
37
|
# @return [DateTime] The credit note's transaction date.
|
38
38
|
attr_reader :transaction_date
|
@@ -393,8 +393,8 @@ module Merge
|
|
393
393
|
|
394
394
|
# @param id [String]
|
395
395
|
# @param remote_id [String] The third-party API ID of the matching object.
|
396
|
-
# @param created_at [DateTime]
|
397
|
-
# @param modified_at [DateTime]
|
396
|
+
# @param created_at [DateTime]
|
397
|
+
# @param modified_at [DateTime] This is the datetime that this object was last updated by Merge
|
398
398
|
# @param transaction_date [DateTime] The credit note's transaction date.
|
399
399
|
# @param status [Merge::Accounting::CreditNoteStatusEnum] The credit note's status.
|
400
400
|
# - `SUBMITTED` - SUBMITTED
|
@@ -13,9 +13,9 @@ module Merge
|
|
13
13
|
attr_reader :id
|
14
14
|
# @return [String] The third-party API ID of the matching object.
|
15
15
|
attr_reader :remote_id
|
16
|
-
# @return [DateTime]
|
16
|
+
# @return [DateTime]
|
17
17
|
attr_reader :created_at
|
18
|
-
# @return [DateTime]
|
18
|
+
# @return [DateTime] This is the datetime that this object was last updated by Merge
|
19
19
|
attr_reader :modified_at
|
20
20
|
# @return [Merge::Accounting::CreditNoteLineItemItem]
|
21
21
|
attr_reader :item
|
@@ -29,6 +29,8 @@ module Merge
|
|
29
29
|
attr_reader :memo
|
30
30
|
# @return [String] The credit note line item's unit price.
|
31
31
|
attr_reader :unit_price
|
32
|
+
# @return [String] The credit note line item's tax rate.
|
33
|
+
attr_reader :tax_rate
|
32
34
|
# @return [String] The credit note line item's total.
|
33
35
|
attr_reader :total_line_amount
|
34
36
|
# @return [String] The credit note line item's associated tracking category.
|
@@ -52,14 +54,15 @@ module Merge
|
|
52
54
|
|
53
55
|
# @param id [String]
|
54
56
|
# @param remote_id [String] The third-party API ID of the matching object.
|
55
|
-
# @param created_at [DateTime]
|
56
|
-
# @param modified_at [DateTime]
|
57
|
+
# @param created_at [DateTime]
|
58
|
+
# @param modified_at [DateTime] This is the datetime that this object was last updated by Merge
|
57
59
|
# @param item [Merge::Accounting::CreditNoteLineItemItem]
|
58
60
|
# @param name [String] The credit note line item's name.
|
59
61
|
# @param description [String] The description of the item that is owed.
|
60
62
|
# @param quantity [String] The credit note line item's quantity.
|
61
63
|
# @param memo [String] The credit note line item's memo.
|
62
64
|
# @param unit_price [String] The credit note line item's unit price.
|
65
|
+
# @param tax_rate [String] The credit note line item's tax rate.
|
63
66
|
# @param total_line_amount [String] The credit note line item's total.
|
64
67
|
# @param tracking_category [String] The credit note line item's associated tracking category.
|
65
68
|
# @param tracking_categories [Array<String>] The credit note line item's associated tracking categories.
|
@@ -70,7 +73,7 @@ module Merge
|
|
70
73
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
71
74
|
# @return [Merge::Accounting::CreditNoteLineItem]
|
72
75
|
def initialize(tracking_categories:, id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, item: OMIT, name: OMIT,
|
73
|
-
description: OMIT, quantity: OMIT, memo: OMIT, unit_price: OMIT, total_line_amount: OMIT, tracking_category: OMIT, account: OMIT, company: OMIT, remote_was_deleted: OMIT, additional_properties: nil)
|
76
|
+
description: OMIT, quantity: OMIT, memo: OMIT, unit_price: OMIT, tax_rate: OMIT, total_line_amount: OMIT, tracking_category: OMIT, account: OMIT, company: OMIT, remote_was_deleted: OMIT, additional_properties: nil)
|
74
77
|
@id = id if id != OMIT
|
75
78
|
@remote_id = remote_id if remote_id != OMIT
|
76
79
|
@created_at = created_at if created_at != OMIT
|
@@ -81,6 +84,7 @@ module Merge
|
|
81
84
|
@quantity = quantity if quantity != OMIT
|
82
85
|
@memo = memo if memo != OMIT
|
83
86
|
@unit_price = unit_price if unit_price != OMIT
|
87
|
+
@tax_rate = tax_rate if tax_rate != OMIT
|
84
88
|
@total_line_amount = total_line_amount if total_line_amount != OMIT
|
85
89
|
@tracking_category = tracking_category if tracking_category != OMIT
|
86
90
|
@tracking_categories = tracking_categories
|
@@ -99,6 +103,7 @@ module Merge
|
|
99
103
|
"quantity": quantity,
|
100
104
|
"memo": memo,
|
101
105
|
"unit_price": unit_price,
|
106
|
+
"tax_rate": tax_rate,
|
102
107
|
"total_line_amount": total_line_amount,
|
103
108
|
"tracking_category": tracking_category,
|
104
109
|
"tracking_categories": tracking_categories,
|
@@ -132,6 +137,7 @@ module Merge
|
|
132
137
|
quantity = struct["quantity"]
|
133
138
|
memo = struct["memo"]
|
134
139
|
unit_price = struct["unit_price"]
|
140
|
+
tax_rate = struct["tax_rate"]
|
135
141
|
total_line_amount = struct["total_line_amount"]
|
136
142
|
tracking_category = struct["tracking_category"]
|
137
143
|
tracking_categories = struct["tracking_categories"]
|
@@ -154,6 +160,7 @@ module Merge
|
|
154
160
|
quantity: quantity,
|
155
161
|
memo: memo,
|
156
162
|
unit_price: unit_price,
|
163
|
+
tax_rate: tax_rate,
|
157
164
|
total_line_amount: total_line_amount,
|
158
165
|
tracking_category: tracking_category,
|
159
166
|
tracking_categories: tracking_categories,
|
@@ -188,6 +195,7 @@ module Merge
|
|
188
195
|
obj.quantity&.is_a?(String) != false || raise("Passed value for field obj.quantity is not the expected type, validation failed.")
|
189
196
|
obj.memo&.is_a?(String) != false || raise("Passed value for field obj.memo is not the expected type, validation failed.")
|
190
197
|
obj.unit_price&.is_a?(String) != false || raise("Passed value for field obj.unit_price is not the expected type, validation failed.")
|
198
|
+
obj.tax_rate&.is_a?(String) != false || raise("Passed value for field obj.tax_rate is not the expected type, validation failed.")
|
191
199
|
obj.total_line_amount&.is_a?(String) != false || raise("Passed value for field obj.total_line_amount is not the expected type, validation failed.")
|
192
200
|
obj.tracking_category&.is_a?(String) != false || raise("Passed value for field obj.tracking_category is not the expected type, validation failed.")
|
193
201
|
obj.tracking_categories.is_a?(Array) != false || raise("Passed value for field obj.tracking_categories is not the expected type, validation failed.")
|
@@ -43,9 +43,6 @@ module Merge
|
|
43
43
|
# - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC
|
44
44
|
# - `MUTED_ISSUE` - MUTED_ISSUE
|
45
45
|
# - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK
|
46
|
-
# - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK
|
47
|
-
# - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK
|
48
|
-
# - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED
|
49
46
|
class EventTypeEnum
|
50
47
|
CREATED_REMOTE_PRODUCTION_API_KEY = "CREATED_REMOTE_PRODUCTION_API_KEY"
|
51
48
|
DELETED_REMOTE_PRODUCTION_API_KEY = "DELETED_REMOTE_PRODUCTION_API_KEY"
|
@@ -81,9 +78,6 @@ module Merge
|
|
81
78
|
FORCED_LINKED_ACCOUNT_RESYNC = "FORCED_LINKED_ACCOUNT_RESYNC"
|
82
79
|
MUTED_ISSUE = "MUTED_ISSUE"
|
83
80
|
GENERATED_MAGIC_LINK = "GENERATED_MAGIC_LINK"
|
84
|
-
ENABLED_MERGE_WEBHOOK = "ENABLED_MERGE_WEBHOOK"
|
85
|
-
DISABLED_MERGE_WEBHOOK = "DISABLED_MERGE_WEBHOOK"
|
86
|
-
MERGE_WEBHOOK_TARGET_CHANGED = "MERGE_WEBHOOK_TARGET_CHANGED"
|
87
81
|
end
|
88
82
|
end
|
89
83
|
end
|
@@ -31,9 +31,9 @@ module Merge
|
|
31
31
|
attr_reader :id
|
32
32
|
# @return [String] The third-party API ID of the matching object.
|
33
33
|
attr_reader :remote_id
|
34
|
-
# @return [DateTime]
|
34
|
+
# @return [DateTime]
|
35
35
|
attr_reader :created_at
|
36
|
-
# @return [DateTime]
|
36
|
+
# @return [DateTime] This is the datetime that this object was last updated by Merge
|
37
37
|
attr_reader :modified_at
|
38
38
|
# @return [DateTime] When the transaction occurred.
|
39
39
|
attr_reader :transaction_date
|
@@ -386,8 +386,8 @@ module Merge
|
|
386
386
|
|
387
387
|
# @param id [String]
|
388
388
|
# @param remote_id [String] The third-party API ID of the matching object.
|
389
|
-
# @param created_at [DateTime]
|
390
|
-
# @param modified_at [DateTime]
|
389
|
+
# @param created_at [DateTime]
|
390
|
+
# @param modified_at [DateTime] This is the datetime that this object was last updated by Merge
|
391
391
|
# @param transaction_date [DateTime] When the transaction occurred.
|
392
392
|
# @param remote_created_at [DateTime] When the expense was created.
|
393
393
|
# @param account [Merge::Accounting::ExpenseAccount] The expense's payment account.
|
@@ -22,9 +22,9 @@ module Merge
|
|
22
22
|
attr_reader :id
|
23
23
|
# @return [String] The third-party API ID of the matching object.
|
24
24
|
attr_reader :remote_id
|
25
|
-
# @return [DateTime]
|
25
|
+
# @return [DateTime]
|
26
26
|
attr_reader :created_at
|
27
|
-
# @return [DateTime]
|
27
|
+
# @return [DateTime] This is the datetime that this object was last updated by Merge
|
28
28
|
attr_reader :modified_at
|
29
29
|
# @return [Merge::Accounting::ExpenseLineItem] The line's item.
|
30
30
|
attr_reader :item
|
@@ -365,8 +365,8 @@ module Merge
|
|
365
365
|
|
366
366
|
# @param id [String]
|
367
367
|
# @param remote_id [String] The third-party API ID of the matching object.
|
368
|
-
# @param created_at [DateTime]
|
369
|
-
# @param modified_at [DateTime]
|
368
|
+
# @param created_at [DateTime]
|
369
|
+
# @param modified_at [DateTime] This is the datetime that this object was last updated by Merge
|
370
370
|
# @param item [Merge::Accounting::ExpenseLineItem] The line's item.
|
371
371
|
# @param net_amount [Float] The line's net amount.
|
372
372
|
# @param tracking_category [Merge::Accounting::ExpenseLineTrackingCategory]
|
@@ -24,9 +24,9 @@ module Merge
|
|
24
24
|
attr_reader :id
|
25
25
|
# @return [String] The third-party API ID of the matching object.
|
26
26
|
attr_reader :remote_id
|
27
|
-
# @return [DateTime]
|
27
|
+
# @return [DateTime]
|
28
28
|
attr_reader :created_at
|
29
|
-
# @return [DateTime]
|
29
|
+
# @return [DateTime] This is the datetime that this object was last updated by Merge
|
30
30
|
attr_reader :modified_at
|
31
31
|
# @return [String] The income statement's name.
|
32
32
|
attr_reader :name
|
@@ -375,8 +375,8 @@ module Merge
|
|
375
375
|
|
376
376
|
# @param id [String]
|
377
377
|
# @param remote_id [String] The third-party API ID of the matching object.
|
378
|
-
# @param created_at [DateTime]
|
379
|
-
# @param modified_at [DateTime]
|
378
|
+
# @param created_at [DateTime]
|
379
|
+
# @param modified_at [DateTime] This is the datetime that this object was last updated by Merge
|
380
380
|
# @param name [String] The income statement's name.
|
381
381
|
# @param currency [Merge::Accounting::CurrencyEnum] The income statement's currency.
|
382
382
|
# - `XUA` - ADB Unit of Account
|
@@ -29,9 +29,9 @@ module Merge
|
|
29
29
|
attr_reader :id
|
30
30
|
# @return [String] The third-party API ID of the matching object.
|
31
31
|
attr_reader :remote_id
|
32
|
-
# @return [DateTime]
|
32
|
+
# @return [DateTime]
|
33
33
|
attr_reader :created_at
|
34
|
-
# @return [DateTime]
|
34
|
+
# @return [DateTime] This is the datetime that this object was last updated by Merge
|
35
35
|
attr_reader :modified_at
|
36
36
|
# @return [Merge::Accounting::InvoiceTypeEnum] Whether the invoice is an accounts receivable or accounts payable. If `type` is
|
37
37
|
# `ACCOUNTS_PAYABLE`, the invoice is a bill. If `type` is `ACCOUNTS_RECEIVABLE`,
|
@@ -412,8 +412,8 @@ module Merge
|
|
412
412
|
|
413
413
|
# @param id [String]
|
414
414
|
# @param remote_id [String] The third-party API ID of the matching object.
|
415
|
-
# @param created_at [DateTime]
|
416
|
-
# @param modified_at [DateTime]
|
415
|
+
# @param created_at [DateTime]
|
416
|
+
# @param modified_at [DateTime] This is the datetime that this object was last updated by Merge
|
417
417
|
# @param type [Merge::Accounting::InvoiceTypeEnum] Whether the invoice is an accounts receivable or accounts payable. If `type` is
|
418
418
|
# `ACCOUNTS_PAYABLE`, the invoice is a bill. If `type` is `ACCOUNTS_RECEIVABLE`,
|
419
419
|
# it is an invoice.
|
@@ -22,9 +22,9 @@ module Merge
|
|
22
22
|
attr_reader :id
|
23
23
|
# @return [String] The third-party API ID of the matching object.
|
24
24
|
attr_reader :remote_id
|
25
|
-
# @return [DateTime]
|
25
|
+
# @return [DateTime]
|
26
26
|
attr_reader :created_at
|
27
|
-
# @return [DateTime]
|
27
|
+
# @return [DateTime] This is the datetime that this object was last updated by Merge
|
28
28
|
attr_reader :modified_at
|
29
29
|
# @return [String] The line item's description.
|
30
30
|
attr_reader :description
|
@@ -369,8 +369,8 @@ module Merge
|
|
369
369
|
|
370
370
|
# @param id [String]
|
371
371
|
# @param remote_id [String] The third-party API ID of the matching object.
|
372
|
-
# @param created_at [DateTime]
|
373
|
-
# @param modified_at [DateTime]
|
372
|
+
# @param created_at [DateTime]
|
373
|
+
# @param modified_at [DateTime] This is the datetime that this object was last updated by Merge
|
374
374
|
# @param description [String] The line item's description.
|
375
375
|
# @param unit_price [Float] The line item's unit price.
|
376
376
|
# @param quantity [Float] The line item's quantity.
|
@@ -21,9 +21,9 @@ module Merge
|
|
21
21
|
attr_reader :id
|
22
22
|
# @return [String] The third-party API ID of the matching object.
|
23
23
|
attr_reader :remote_id
|
24
|
-
# @return [DateTime]
|
24
|
+
# @return [DateTime]
|
25
25
|
attr_reader :created_at
|
26
|
-
# @return [DateTime]
|
26
|
+
# @return [DateTime] This is the datetime that this object was last updated by Merge
|
27
27
|
attr_reader :modified_at
|
28
28
|
# @return [String] The item's name.
|
29
29
|
attr_reader :name
|
@@ -60,8 +60,8 @@ module Merge
|
|
60
60
|
|
61
61
|
# @param id [String]
|
62
62
|
# @param remote_id [String] The third-party API ID of the matching object.
|
63
|
-
# @param created_at [DateTime]
|
64
|
-
# @param modified_at [DateTime]
|
63
|
+
# @param created_at [DateTime]
|
64
|
+
# @param modified_at [DateTime] This is the datetime that this object was last updated by Merge
|
65
65
|
# @param name [String] The item's name.
|
66
66
|
# @param status [Merge::Accounting::Status7D1Enum] The item's status.
|
67
67
|
# - `ACTIVE` - ACTIVE
|
@@ -32,9 +32,9 @@ module Merge
|
|
32
32
|
attr_reader :id
|
33
33
|
# @return [String] The third-party API ID of the matching object.
|
34
34
|
attr_reader :remote_id
|
35
|
-
# @return [DateTime]
|
35
|
+
# @return [DateTime]
|
36
36
|
attr_reader :created_at
|
37
|
-
# @return [DateTime]
|
37
|
+
# @return [DateTime] This is the datetime that this object was last updated by Merge
|
38
38
|
attr_reader :modified_at
|
39
39
|
# @return [DateTime] The journal entry's transaction date.
|
40
40
|
attr_reader :transaction_date
|
@@ -389,8 +389,8 @@ module Merge
|
|
389
389
|
|
390
390
|
# @param id [String]
|
391
391
|
# @param remote_id [String] The third-party API ID of the matching object.
|
392
|
-
# @param created_at [DateTime]
|
393
|
-
# @param modified_at [DateTime]
|
392
|
+
# @param created_at [DateTime]
|
393
|
+
# @param modified_at [DateTime] This is the datetime that this object was last updated by Merge
|
394
394
|
# @param transaction_date [DateTime] The journal entry's transaction date.
|
395
395
|
# @param remote_created_at [DateTime] When the third party's journal entry was created.
|
396
396
|
# @param remote_updated_at [DateTime] When the third party's journal entry was updated.
|
@@ -21,9 +21,9 @@ module Merge
|
|
21
21
|
attr_reader :id
|
22
22
|
# @return [String] The third-party API ID of the matching object.
|
23
23
|
attr_reader :remote_id
|
24
|
-
# @return [DateTime]
|
24
|
+
# @return [DateTime]
|
25
25
|
attr_reader :created_at
|
26
|
-
# @return [DateTime]
|
26
|
+
# @return [DateTime] This is the datetime that this object was last updated by Merge
|
27
27
|
attr_reader :modified_at
|
28
28
|
# @return [Merge::Accounting::JournalLineAccount]
|
29
29
|
attr_reader :account
|
@@ -362,8 +362,8 @@ module Merge
|
|
362
362
|
|
363
363
|
# @param id [String]
|
364
364
|
# @param remote_id [String] The third-party API ID of the matching object.
|
365
|
-
# @param created_at [DateTime]
|
366
|
-
# @param modified_at [DateTime]
|
365
|
+
# @param created_at [DateTime]
|
366
|
+
# @param modified_at [DateTime] This is the datetime that this object was last updated by Merge
|
367
367
|
# @param account [Merge::Accounting::JournalLineAccount]
|
368
368
|
# @param net_amount [Float] The value of the line item including taxes and other fees.
|
369
369
|
# @param tracking_category [Merge::Accounting::JournalLineTrackingCategory]
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Merge
|
7
|
+
module Accounting
|
8
|
+
class LinkedAccountCondition
|
9
|
+
# @return [String] The ID indicating which condition schema to use for a specific condition.
|
10
|
+
attr_reader :condition_schema_id
|
11
|
+
# @return [String] The common model for a specific condition.
|
12
|
+
attr_reader :common_model
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :native_name
|
15
|
+
# @return [String] The operator for a specific condition.
|
16
|
+
attr_reader :operator
|
17
|
+
# @return [Object]
|
18
|
+
attr_reader :value
|
19
|
+
# @return [String]
|
20
|
+
attr_reader :field_name
|
21
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
22
|
+
attr_reader :additional_properties
|
23
|
+
# @return [Object]
|
24
|
+
attr_reader :_field_set
|
25
|
+
protected :_field_set
|
26
|
+
|
27
|
+
OMIT = Object.new
|
28
|
+
|
29
|
+
# @param condition_schema_id [String] The ID indicating which condition schema to use for a specific condition.
|
30
|
+
# @param common_model [String] The common model for a specific condition.
|
31
|
+
# @param native_name [String]
|
32
|
+
# @param operator [String] The operator for a specific condition.
|
33
|
+
# @param value [Object]
|
34
|
+
# @param field_name [String]
|
35
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
36
|
+
# @return [Merge::Accounting::LinkedAccountCondition]
|
37
|
+
def initialize(condition_schema_id:, operator:, common_model: OMIT, native_name: OMIT, value: OMIT,
|
38
|
+
field_name: OMIT, additional_properties: nil)
|
39
|
+
@condition_schema_id = condition_schema_id
|
40
|
+
@common_model = common_model if common_model != OMIT
|
41
|
+
@native_name = native_name if native_name != OMIT
|
42
|
+
@operator = operator
|
43
|
+
@value = value if value != OMIT
|
44
|
+
@field_name = field_name if field_name != OMIT
|
45
|
+
@additional_properties = additional_properties
|
46
|
+
@_field_set = {
|
47
|
+
"condition_schema_id": condition_schema_id,
|
48
|
+
"common_model": common_model,
|
49
|
+
"native_name": native_name,
|
50
|
+
"operator": operator,
|
51
|
+
"value": value,
|
52
|
+
"field_name": field_name
|
53
|
+
}.reject do |_k, v|
|
54
|
+
v == OMIT
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Deserialize a JSON object to an instance of LinkedAccountCondition
|
59
|
+
#
|
60
|
+
# @param json_object [String]
|
61
|
+
# @return [Merge::Accounting::LinkedAccountCondition]
|
62
|
+
def self.from_json(json_object:)
|
63
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
64
|
+
condition_schema_id = struct["condition_schema_id"]
|
65
|
+
common_model = struct["common_model"]
|
66
|
+
native_name = struct["native_name"]
|
67
|
+
operator = struct["operator"]
|
68
|
+
value = struct["value"]
|
69
|
+
field_name = struct["field_name"]
|
70
|
+
new(
|
71
|
+
condition_schema_id: condition_schema_id,
|
72
|
+
common_model: common_model,
|
73
|
+
native_name: native_name,
|
74
|
+
operator: operator,
|
75
|
+
value: value,
|
76
|
+
field_name: field_name,
|
77
|
+
additional_properties: struct
|
78
|
+
)
|
79
|
+
end
|
80
|
+
|
81
|
+
# Serialize an instance of LinkedAccountCondition to a JSON object
|
82
|
+
#
|
83
|
+
# @return [String]
|
84
|
+
def to_json(*_args)
|
85
|
+
@_field_set&.to_json
|
86
|
+
end
|
87
|
+
|
88
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
89
|
+
# hash and check each fields type against the current object's property
|
90
|
+
# definitions.
|
91
|
+
#
|
92
|
+
# @param obj [Object]
|
93
|
+
# @return [Void]
|
94
|
+
def self.validate_raw(obj:)
|
95
|
+
obj.condition_schema_id.is_a?(String) != false || raise("Passed value for field obj.condition_schema_id is not the expected type, validation failed.")
|
96
|
+
obj.common_model&.is_a?(String) != false || raise("Passed value for field obj.common_model is not the expected type, validation failed.")
|
97
|
+
obj.native_name&.is_a?(String) != false || raise("Passed value for field obj.native_name is not the expected type, validation failed.")
|
98
|
+
obj.operator.is_a?(String) != false || raise("Passed value for field obj.operator is not the expected type, validation failed.")
|
99
|
+
obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
100
|
+
obj.field_name&.is_a?(String) != false || raise("Passed value for field obj.field_name is not the expected type, validation failed.")
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|