merge_hris_client 2.0.5 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -8
- data/docs/AccountIntegration.md +6 -2
- data/docs/BankInfo.md +9 -5
- data/docs/BankInfoApi.md +15 -11
- data/docs/Benefit.md +8 -4
- data/docs/BenefitsApi.md +6 -6
- data/docs/CommonModelScopeData.md +20 -0
- data/docs/CommonModelScopes.md +20 -0
- data/docs/CommonModelScopesApi.md +157 -0
- data/docs/CommonModelScopesBodyRequest.md +22 -0
- data/docs/CommonModelScopesDisabledModels.md +26 -0
- data/docs/CommonModelScopesDisabledModelsEnabledActionsEnum.md +15 -0
- data/docs/CommonModelScopesPostInnerDeserializerRequest.md +22 -0
- data/docs/CommonModelScopesUpdateSerializer.md +18 -0
- data/docs/CompaniesApi.md +4 -4
- data/docs/Company.md +7 -3
- data/docs/ConditionSchema.md +30 -0
- data/docs/ConditionTypeEnum.md +15 -0
- data/docs/DataPassthroughRequest.md +1 -1
- data/docs/Deduction.md +11 -5
- data/docs/Earning.md +10 -2
- data/docs/Employee.md +19 -15
- data/docs/EmployeePayrollRun.md +11 -7
- data/docs/EmployeePayrollRunsApi.md +4 -4
- data/docs/EmployeeRequest.md +16 -18
- data/docs/EmployeesApi.md +31 -18
- data/docs/Employment.md +14 -10
- data/docs/EmploymentsApi.md +13 -9
- data/docs/EnabledActionsEnum.md +15 -0
- data/docs/EndUserDetailsRequest.md +5 -3
- data/docs/ForceResyncApi.md +1 -1
- data/docs/Group.md +8 -4
- data/docs/GroupsApi.md +15 -9
- data/docs/Issue.md +10 -8
- data/docs/IssuesApi.md +6 -6
- data/docs/LinkToken.md +1 -1
- data/docs/LinkedAccountCondition.md +28 -0
- data/docs/LinkedAccountConditionRequest.md +22 -0
- data/docs/LinkedAccountSelectiveSyncConfiguration.md +18 -0
- data/docs/LinkedAccountSelectiveSyncConfigurationListRequest.md +18 -0
- data/docs/LinkedAccountSelectiveSyncConfigurationRequest.md +18 -0
- data/docs/LinkedAccountsApi.md +2 -2
- data/docs/Location.md +9 -5
- data/docs/LocationsApi.md +13 -9
- data/docs/MetaResponse.md +2 -0
- data/docs/MultipartFormFieldRequest.md +1 -1
- data/docs/OperatorSchema.md +20 -0
- data/docs/PaginatedConditionSchemaList.md +22 -0
- data/docs/PayGroup.md +7 -3
- data/docs/PayGroupsApi.md +4 -4
- data/docs/PayrollRun.md +9 -5
- data/docs/PayrollRunsApi.md +14 -10
- data/docs/SelectiveSyncApi.md +233 -0
- data/docs/SelectiveSyncConfigurationsUsageEnum.md +15 -0
- data/docs/SyncStatus.md +5 -3
- data/docs/Tax.md +9 -1
- data/docs/Team.md +8 -4
- data/docs/TeamsApi.md +4 -4
- data/docs/TimeOff.md +13 -9
- data/docs/TimeOffApi.md +16 -12
- data/docs/TimeOffBalance.md +10 -6
- data/docs/TimeOffBalancesApi.md +15 -11
- data/docs/TimeOffRequest.md +11 -9
- data/lib/merge_hris_client/api/bank_info_api.rb +24 -10
- data/lib/merge_hris_client/api/benefits_api.rb +6 -6
- data/lib/merge_hris_client/api/common_model_scopes_api.rb +146 -0
- data/lib/merge_hris_client/api/companies_api.rb +4 -4
- data/lib/merge_hris_client/api/employee_payroll_runs_api.rb +4 -4
- data/lib/merge_hris_client/api/employees_api.rb +44 -17
- data/lib/merge_hris_client/api/employments_api.rb +22 -8
- data/lib/merge_hris_client/api/force_resync_api.rb +2 -2
- data/lib/merge_hris_client/api/groups_api.rb +25 -8
- data/lib/merge_hris_client/api/issues_api.rb +6 -6
- data/lib/merge_hris_client/api/linked_accounts_api.rb +3 -3
- data/lib/merge_hris_client/api/locations_api.rb +22 -8
- data/lib/merge_hris_client/api/pay_groups_api.rb +4 -4
- data/lib/merge_hris_client/api/payroll_runs_api.rb +24 -10
- data/lib/merge_hris_client/api/selective_sync_api.rb +225 -0
- data/lib/merge_hris_client/api/teams_api.rb +4 -4
- data/lib/merge_hris_client/api/time_off_api.rb +26 -12
- data/lib/merge_hris_client/api/time_off_balances_api.rb +24 -10
- data/lib/merge_hris_client/models/account_details_and_actions_status_enum.rb +1 -1
- data/lib/merge_hris_client/models/account_integration.rb +30 -8
- data/lib/merge_hris_client/models/account_type_enum.rb +1 -1
- data/lib/merge_hris_client/models/bank_info.rb +39 -16
- data/lib/merge_hris_client/models/benefit.rb +38 -15
- data/lib/merge_hris_client/models/categories_enum.rb +4 -2
- data/lib/merge_hris_client/models/category_enum.rb +4 -2
- data/lib/merge_hris_client/models/common_model_scope_data.rb +234 -0
- data/lib/merge_hris_client/models/common_model_scopes.rb +234 -0
- data/lib/merge_hris_client/models/common_model_scopes_body_request.rb +274 -0
- data/lib/merge_hris_client/models/common_model_scopes_disabled_models.rb +283 -0
- data/lib/merge_hris_client/models/common_model_scopes_disabled_models_enabled_actions_enum.rb +45 -0
- data/lib/merge_hris_client/models/common_model_scopes_post_inner_deserializer_request.rb +274 -0
- data/lib/merge_hris_client/models/common_model_scopes_update_serializer.rb +226 -0
- data/lib/merge_hris_client/models/company.rb +37 -15
- data/lib/merge_hris_client/models/condition_schema.rb +298 -0
- data/lib/merge_hris_client/models/condition_type_enum.rb +50 -0
- data/lib/merge_hris_client/models/country_enum.rb +1 -1
- data/lib/merge_hris_client/models/data_passthrough_request.rb +1 -0
- data/lib/merge_hris_client/models/deduction.rb +50 -17
- data/lib/merge_hris_client/models/earning.rb +51 -6
- data/lib/merge_hris_client/models/earning_type_enum.rb +1 -1
- data/lib/merge_hris_client/models/employee.rb +51 -23
- data/lib/merge_hris_client/models/employee_payroll_run.rb +41 -17
- data/lib/merge_hris_client/models/employee_request.rb +34 -39
- data/lib/merge_hris_client/models/employment.rb +44 -20
- data/lib/merge_hris_client/models/employment_status_enum.rb +1 -1
- data/lib/merge_hris_client/models/employment_type_enum.rb +1 -1
- data/lib/merge_hris_client/models/enabled_actions_enum.rb +45 -0
- data/lib/merge_hris_client/models/encoding_enum.rb +1 -1
- data/lib/merge_hris_client/models/end_user_details_request.rb +20 -7
- data/lib/merge_hris_client/models/ethnicity_enum.rb +1 -1
- data/lib/merge_hris_client/models/flsa_status_enum.rb +1 -1
- data/lib/merge_hris_client/models/gender_enum.rb +1 -1
- data/lib/merge_hris_client/models/group.rb +38 -16
- data/lib/merge_hris_client/models/group_type_enum.rb +3 -2
- data/lib/merge_hris_client/models/issue.rb +16 -4
- data/lib/merge_hris_client/models/link_token.rb +0 -5
- data/lib/merge_hris_client/models/linked_account_condition.rb +282 -0
- data/lib/merge_hris_client/models/linked_account_condition_request.rb +269 -0
- data/lib/merge_hris_client/models/linked_account_selective_sync_configuration.rb +221 -0
- data/lib/merge_hris_client/models/linked_account_selective_sync_configuration_list_request.rb +226 -0
- data/lib/merge_hris_client/models/linked_account_selective_sync_configuration_request.rb +226 -0
- data/lib/merge_hris_client/models/location.rb +39 -17
- data/lib/merge_hris_client/models/location_type_enum.rb +1 -1
- data/lib/merge_hris_client/models/marital_status_enum.rb +1 -1
- data/lib/merge_hris_client/models/meta_response.rb +12 -1
- data/lib/merge_hris_client/models/method_enum.rb +1 -1
- data/lib/merge_hris_client/models/multipart_form_field_request.rb +1 -1
- data/lib/merge_hris_client/models/operator_schema.rb +229 -0
- data/lib/merge_hris_client/models/paginated_condition_schema_list.rb +240 -0
- data/lib/merge_hris_client/models/pay_currency_enum.rb +1 -1
- data/lib/merge_hris_client/models/pay_frequency_enum.rb +3 -2
- data/lib/merge_hris_client/models/pay_group.rb +37 -15
- data/lib/merge_hris_client/models/pay_period_enum.rb +3 -2
- data/lib/merge_hris_client/models/payroll_run.rb +39 -17
- data/lib/merge_hris_client/models/policy_type_enum.rb +1 -1
- data/lib/merge_hris_client/models/reason_enum.rb +1 -1
- data/lib/merge_hris_client/models/request_format_enum.rb +1 -1
- data/lib/merge_hris_client/models/request_type_enum.rb +1 -1
- data/lib/merge_hris_client/models/response_type_enum.rb +1 -1
- data/lib/merge_hris_client/models/run_state_enum.rb +1 -1
- data/lib/merge_hris_client/models/run_type_enum.rb +1 -1
- data/lib/merge_hris_client/models/selective_sync_configurations_usage_enum.rb +45 -0
- data/lib/merge_hris_client/models/sync_status.rb +13 -4
- data/lib/merge_hris_client/models/sync_status_status_enum.rb +1 -1
- data/lib/merge_hris_client/models/tax.rb +50 -5
- data/lib/merge_hris_client/models/team.rb +38 -15
- data/lib/merge_hris_client/models/time_off.rb +43 -19
- data/lib/merge_hris_client/models/time_off_balance.rb +40 -17
- data/lib/merge_hris_client/models/time_off_request.rb +36 -21
- data/lib/merge_hris_client/models/time_off_status_enum.rb +1 -1
- data/lib/merge_hris_client/models/units_enum.rb +1 -1
- data/lib/merge_hris_client/version.rb +1 -1
- data/lib/merge_hris_client.rb +20 -3
- data/spec/api/bank_info_api_spec.rb +7 -5
- data/spec/api/benefits_api_spec.rb +3 -3
- data/spec/api/common_model_scopes_api_spec.rb +58 -0
- data/spec/api/companies_api_spec.rb +2 -2
- data/spec/api/employee_payroll_runs_api_spec.rb +2 -2
- data/spec/api/employees_api_spec.rb +13 -6
- data/spec/api/employments_api_spec.rb +6 -4
- data/spec/api/force_resync_api_spec.rb +1 -1
- data/spec/api/groups_api_spec.rb +7 -4
- data/spec/api/issues_api_spec.rb +3 -3
- data/spec/api/linked_accounts_api_spec.rb +1 -1
- data/spec/api/locations_api_spec.rb +6 -4
- data/spec/api/pay_groups_api_spec.rb +2 -2
- data/spec/api/payroll_runs_api_spec.rb +7 -5
- data/spec/api/selective_sync_api_spec.rb +72 -0
- data/spec/api/teams_api_spec.rb +2 -2
- data/spec/api/time_off_api_spec.rb +8 -6
- data/spec/api/time_off_balances_api_spec.rb +7 -5
- data/spec/models/account_integration_spec.rb +12 -0
- data/spec/models/bank_info_spec.rb +14 -2
- data/spec/models/benefit_spec.rb +14 -2
- data/spec/models/common_model_scope_data_spec.rb +40 -0
- data/spec/models/common_model_scopes_body_request_spec.rb +46 -0
- data/spec/models/common_model_scopes_disabled_models_enabled_actions_enum_spec.rb +28 -0
- data/spec/models/common_model_scopes_disabled_models_spec.rb +58 -0
- data/spec/models/common_model_scopes_post_inner_deserializer_request_spec.rb +46 -0
- data/spec/models/common_model_scopes_spec.rb +40 -0
- data/spec/models/common_model_scopes_update_serializer_spec.rb +34 -0
- data/spec/models/company_spec.rb +14 -2
- data/spec/models/condition_schema_spec.rb +70 -0
- data/spec/models/condition_type_enum_spec.rb +28 -0
- data/spec/models/deduction_spec.rb +20 -2
- data/spec/models/earning_spec.rb +24 -0
- data/spec/models/employee_payroll_run_spec.rb +14 -2
- data/spec/models/employee_request_spec.rb +5 -11
- data/spec/models/employee_spec.rb +15 -3
- data/spec/models/employment_spec.rb +14 -2
- data/spec/models/enabled_actions_enum_spec.rb +28 -0
- data/spec/models/end_user_details_request_spec.rb +6 -0
- data/spec/models/group_spec.rb +14 -2
- data/spec/models/issue_spec.rb +6 -0
- data/spec/models/linked_account_condition_request_spec.rb +46 -0
- data/spec/models/linked_account_condition_spec.rb +64 -0
- data/spec/models/linked_account_selective_sync_configuration_list_request_spec.rb +34 -0
- data/spec/models/linked_account_selective_sync_configuration_request_spec.rb +34 -0
- data/spec/models/linked_account_selective_sync_configuration_spec.rb +34 -0
- data/spec/models/location_spec.rb +14 -2
- data/spec/models/meta_response_spec.rb +6 -0
- data/spec/models/operator_schema_spec.rb +40 -0
- data/spec/models/paginated_condition_schema_list_spec.rb +46 -0
- data/spec/models/pay_group_spec.rb +14 -2
- data/spec/models/payroll_run_spec.rb +14 -2
- data/spec/models/selective_sync_configurations_usage_enum_spec.rb +28 -0
- data/spec/models/sync_status_spec.rb +6 -0
- data/spec/models/tax_spec.rb +24 -0
- data/spec/models/team_spec.rb +14 -2
- data/spec/models/time_off_balance_spec.rb +14 -2
- data/spec/models/time_off_request_spec.rb +12 -6
- data/spec/models/time_off_spec.rb +14 -2
- metadata +183 -103
@@ -0,0 +1,226 @@
|
|
1
|
+
=begin
|
2
|
+
#Merge HRIS API
|
3
|
+
|
4
|
+
#The unified API for building rich integrations with multiple HR Information System platforms.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: hello@merge.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MergeHRISClient
|
17
|
+
class LinkedAccountSelectiveSyncConfigurationRequest
|
18
|
+
# The conditions belonging to a selective sync.
|
19
|
+
attr_accessor :linked_account_conditions
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'linked_account_conditions' => :'linked_account_conditions'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.openapi_types
|
35
|
+
{
|
36
|
+
:'linked_account_conditions' => :'Array<LinkedAccountConditionRequest>'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::LinkedAccountSelectiveSyncConfigurationRequest` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::LinkedAccountSelectiveSyncConfigurationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'linked_account_conditions')
|
62
|
+
if (value = attributes[:'linked_account_conditions']).is_a?(Array)
|
63
|
+
self.linked_account_conditions = value
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
69
|
+
# @return Array for valid properties with the reasons
|
70
|
+
def list_invalid_properties
|
71
|
+
invalid_properties = Array.new
|
72
|
+
if @linked_account_conditions.nil?
|
73
|
+
invalid_properties.push('invalid value for "linked_account_conditions", linked_account_conditions cannot be nil.')
|
74
|
+
end
|
75
|
+
|
76
|
+
invalid_properties
|
77
|
+
end
|
78
|
+
|
79
|
+
# Check to see if the all the properties in the model are valid
|
80
|
+
# @return true if the model is valid
|
81
|
+
def valid?
|
82
|
+
return false if @linked_account_conditions.nil?
|
83
|
+
true
|
84
|
+
end
|
85
|
+
|
86
|
+
# Checks equality by comparing each attribute.
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def ==(o)
|
89
|
+
return true if self.equal?(o)
|
90
|
+
self.class == o.class &&
|
91
|
+
linked_account_conditions == o.linked_account_conditions
|
92
|
+
end
|
93
|
+
|
94
|
+
# @see the `==` method
|
95
|
+
# @param [Object] Object to be compared
|
96
|
+
def eql?(o)
|
97
|
+
self == o
|
98
|
+
end
|
99
|
+
|
100
|
+
# Calculates hash code according to all attributes.
|
101
|
+
# @return [Integer] Hash code
|
102
|
+
def hash
|
103
|
+
[linked_account_conditions].hash
|
104
|
+
end
|
105
|
+
|
106
|
+
# Builds the object from hash
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
# @return [Object] Returns the model itself
|
109
|
+
def self.build_from_hash(attributes)
|
110
|
+
new.build_from_hash(attributes)
|
111
|
+
end
|
112
|
+
|
113
|
+
# Builds the object from hash
|
114
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
115
|
+
# @return [Object] Returns the model itself
|
116
|
+
def build_from_hash(attributes)
|
117
|
+
return nil unless attributes.is_a?(Hash)
|
118
|
+
self.class.openapi_types.each_pair do |key, type|
|
119
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
120
|
+
self.send("#{key}=", nil)
|
121
|
+
elsif type =~ /\AArray<(.*)>/i
|
122
|
+
# check to ensure the input is an array given that the attribute
|
123
|
+
# is documented as an array but the input is not
|
124
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
125
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
126
|
+
end
|
127
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
128
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
self
|
133
|
+
end
|
134
|
+
|
135
|
+
# Deserializes the data based on type
|
136
|
+
# @param string type Data type
|
137
|
+
# @param string value Value to be deserialized
|
138
|
+
# @return [Object] Deserialized data
|
139
|
+
def _deserialize(type, value)
|
140
|
+
case type.to_sym
|
141
|
+
when :Time
|
142
|
+
Time.parse(value)
|
143
|
+
when :Date
|
144
|
+
Date.parse(value)
|
145
|
+
when :String
|
146
|
+
value
|
147
|
+
when :Integer
|
148
|
+
value.to_i
|
149
|
+
when :Float
|
150
|
+
value.to_f
|
151
|
+
when :Boolean
|
152
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
153
|
+
true
|
154
|
+
else
|
155
|
+
false
|
156
|
+
end
|
157
|
+
when :Object
|
158
|
+
# generic object (usually a Hash), return directly
|
159
|
+
value
|
160
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
161
|
+
inner_type = Regexp.last_match[:inner_type]
|
162
|
+
value.map { |v| _deserialize(inner_type, v) }
|
163
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
164
|
+
k_type = Regexp.last_match[:k_type]
|
165
|
+
v_type = Regexp.last_match[:v_type]
|
166
|
+
{}.tap do |hash|
|
167
|
+
value.each do |k, v|
|
168
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
else # model
|
172
|
+
# models (e.g. Pet) or oneOf
|
173
|
+
klass = MergeHRISClient.const_get(type)
|
174
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the string representation of the object
|
179
|
+
# @return [String] String presentation of the object
|
180
|
+
def to_s
|
181
|
+
to_hash.to_s
|
182
|
+
end
|
183
|
+
|
184
|
+
# to_body is an alias to to_hash (backward compatibility)
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_body
|
187
|
+
to_hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the object in the form of hash
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
192
|
+
def to_hash
|
193
|
+
hash = {}
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
195
|
+
value = self.send(attr)
|
196
|
+
if value.nil?
|
197
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
198
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
199
|
+
end
|
200
|
+
|
201
|
+
hash[param] = _to_hash(value)
|
202
|
+
end
|
203
|
+
hash
|
204
|
+
end
|
205
|
+
|
206
|
+
# Outputs non-array value in the form of hash
|
207
|
+
# For object, use to_hash. Otherwise, just return the value
|
208
|
+
# @param [Object] value Any valid value
|
209
|
+
# @return [Hash] Returns the value in the form of hash
|
210
|
+
def _to_hash(value)
|
211
|
+
if value.is_a?(Array)
|
212
|
+
value.compact.map { |v| _to_hash(v) }
|
213
|
+
elsif value.is_a?(Hash)
|
214
|
+
{}.tap do |hash|
|
215
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
216
|
+
end
|
217
|
+
elsif value.respond_to? :to_hash
|
218
|
+
value.to_hash
|
219
|
+
else
|
220
|
+
value
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
end
|
225
|
+
|
226
|
+
end
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module MergeHRISClient
|
17
|
-
# # The Location Object ### Description The `Location` object is used to represent
|
17
|
+
# # The Location Object ### Description The `Location` object is used to represent an address that can be associated with an employee. ### Usage Example Fetch from the `LIST Locations` endpoint and filter by `ID` to show all office locations.
|
18
18
|
class Location
|
19
19
|
attr_accessor :id
|
20
20
|
|
@@ -42,17 +42,22 @@ module MergeHRISClient
|
|
42
42
|
# The location's zip code or postal code.
|
43
43
|
attr_accessor :zip_code
|
44
44
|
|
45
|
-
# The location's country.
|
45
|
+
# The location's country. * `AF` - Afghanistan * `AX` - Åland Islands * `AL` - Albania * `DZ` - Algeria * `AS` - American Samoa * `AD` - Andorra * `AO` - Angola * `AI` - Anguilla * `AQ` - Antarctica * `AG` - Antigua and Barbuda * `AR` - Argentina * `AM` - Armenia * `AW` - Aruba * `AU` - Australia * `AT` - Austria * `AZ` - Azerbaijan * `BS` - Bahamas * `BH` - Bahrain * `BD` - Bangladesh * `BB` - Barbados * `BY` - Belarus * `BE` - Belgium * `BZ` - Belize * `BJ` - Benin * `BM` - Bermuda * `BT` - Bhutan * `BO` - Bolivia * `BQ` - Bonaire, Sint Eustatius and Saba * `BA` - Bosnia and Herzegovina * `BW` - Botswana * `BV` - Bouvet Island * `BR` - Brazil * `IO` - British Indian Ocean Territory * `BN` - Brunei * `BG` - Bulgaria * `BF` - Burkina Faso * `BI` - Burundi * `CV` - Cabo Verde * `KH` - Cambodia * `CM` - Cameroon * `CA` - Canada * `KY` - Cayman Islands * `CF` - Central African Republic * `TD` - Chad * `CL` - Chile * `CN` - China * `CX` - Christmas Island * `CC` - Cocos (Keeling) Islands * `CO` - Colombia * `KM` - Comoros * `CG` - Congo * `CD` - Congo (the Democratic Republic of the) * `CK` - Cook Islands * `CR` - Costa Rica * `CI` - Côte d'Ivoire * `HR` - Croatia * `CU` - Cuba * `CW` - Curaçao * `CY` - Cyprus * `CZ` - Czechia * `DK` - Denmark * `DJ` - Djibouti * `DM` - Dominica * `DO` - Dominican Republic * `EC` - Ecuador * `EG` - Egypt * `SV` - El Salvador * `GQ` - Equatorial Guinea * `ER` - Eritrea * `EE` - Estonia * `SZ` - Eswatini * `ET` - Ethiopia * `FK` - Falkland Islands (Malvinas) * `FO` - Faroe Islands * `FJ` - Fiji * `FI` - Finland * `FR` - France * `GF` - French Guiana * `PF` - French Polynesia * `TF` - French Southern Territories * `GA` - Gabon * `GM` - Gambia * `GE` - Georgia * `DE` - Germany * `GH` - Ghana * `GI` - Gibraltar * `GR` - Greece * `GL` - Greenland * `GD` - Grenada * `GP` - Guadeloupe * `GU` - Guam * `GT` - Guatemala * `GG` - Guernsey * `GN` - Guinea * `GW` - Guinea-Bissau * `GY` - Guyana * `HT` - Haiti * `HM` - Heard Island and McDonald Islands * `VA` - Holy See * `HN` - Honduras * `HK` - Hong Kong * `HU` - Hungary * `IS` - Iceland * `IN` - India * `ID` - Indonesia * `IR` - Iran * `IQ` - Iraq * `IE` - Ireland * `IM` - Isle of Man * `IL` - Israel * `IT` - Italy * `JM` - Jamaica * `JP` - Japan * `JE` - Jersey * `JO` - Jordan * `KZ` - Kazakhstan * `KE` - Kenya * `KI` - Kiribati * `KW` - Kuwait * `KG` - Kyrgyzstan * `LA` - Laos * `LV` - Latvia * `LB` - Lebanon * `LS` - Lesotho * `LR` - Liberia * `LY` - Libya * `LI` - Liechtenstein * `LT` - Lithuania * `LU` - Luxembourg * `MO` - Macao * `MG` - Madagascar * `MW` - Malawi * `MY` - Malaysia * `MV` - Maldives * `ML` - Mali * `MT` - Malta * `MH` - Marshall Islands * `MQ` - Martinique * `MR` - Mauritania * `MU` - Mauritius * `YT` - Mayotte * `MX` - Mexico * `FM` - Micronesia (Federated States of) * `MD` - Moldova * `MC` - Monaco * `MN` - Mongolia * `ME` - Montenegro * `MS` - Montserrat * `MA` - Morocco * `MZ` - Mozambique * `MM` - Myanmar * `NA` - Namibia * `NR` - Nauru * `NP` - Nepal * `NL` - Netherlands * `NC` - New Caledonia * `NZ` - New Zealand * `NI` - Nicaragua * `NE` - Niger * `NG` - Nigeria * `NU` - Niue * `NF` - Norfolk Island * `KP` - North Korea * `MK` - North Macedonia * `MP` - Northern Mariana Islands * `NO` - Norway * `OM` - Oman * `PK` - Pakistan * `PW` - Palau * `PS` - Palestine, State of * `PA` - Panama * `PG` - Papua New Guinea * `PY` - Paraguay * `PE` - Peru * `PH` - Philippines * `PN` - Pitcairn * `PL` - Poland * `PT` - Portugal * `PR` - Puerto Rico * `QA` - Qatar * `RE` - Réunion * `RO` - Romania * `RU` - Russia * `RW` - Rwanda * `BL` - Saint Barthélemy * `SH` - Saint Helena, Ascension and Tristan da Cunha * `KN` - Saint Kitts and Nevis * `LC` - Saint Lucia * `MF` - Saint Martin (French part) * `PM` - Saint Pierre and Miquelon * `VC` - Saint Vincent and the Grenadines * `WS` - Samoa * `SM` - San Marino * `ST` - Sao Tome and Principe * `SA` - Saudi Arabia * `SN` - Senegal * `RS` - Serbia * `SC` - Seychelles * `SL` - Sierra Leone * `SG` - Singapore * `SX` - Sint Maarten (Dutch part) * `SK` - Slovakia * `SI` - Slovenia * `SB` - Solomon Islands * `SO` - Somalia * `ZA` - South Africa * `GS` - South Georgia and the South Sandwich Islands * `KR` - South Korea * `SS` - South Sudan * `ES` - Spain * `LK` - Sri Lanka * `SD` - Sudan * `SR` - Suriname * `SJ` - Svalbard and Jan Mayen * `SE` - Sweden * `CH` - Switzerland * `SY` - Syria * `TW` - Taiwan * `TJ` - Tajikistan * `TZ` - Tanzania * `TH` - Thailand * `TL` - Timor-Leste * `TG` - Togo * `TK` - Tokelau * `TO` - Tonga * `TT` - Trinidad and Tobago * `TN` - Tunisia * `TR` - Turkey * `TM` - Turkmenistan * `TC` - Turks and Caicos Islands * `TV` - Tuvalu * `UG` - Uganda * `UA` - Ukraine * `AE` - United Arab Emirates * `GB` - United Kingdom * `UM` - United States Minor Outlying Islands * `US` - United States of America * `UY` - Uruguay * `UZ` - Uzbekistan * `VU` - Vanuatu * `VE` - Venezuela * `VN` - Vietnam * `VG` - Virgin Islands (British) * `VI` - Virgin Islands (U.S.) * `WF` - Wallis and Futuna * `EH` - Western Sahara * `YE` - Yemen * `ZM` - Zambia * `ZW` - Zimbabwe
|
46
46
|
attr_accessor :country
|
47
47
|
|
48
|
-
# The location's type. Can be either WORK or HOME
|
48
|
+
# The location's type. Can be either WORK or HOME * `HOME` - HOME * `WORK` - WORK
|
49
49
|
attr_accessor :location_type
|
50
50
|
|
51
|
-
attr_accessor :remote_data
|
52
|
-
|
53
51
|
# Indicates whether or not this object has been deleted by third party webhooks.
|
54
52
|
attr_accessor :remote_was_deleted
|
55
53
|
|
54
|
+
attr_accessor :field_mappings
|
55
|
+
|
56
|
+
# This is the datetime that this object was last updated by Merge
|
57
|
+
attr_accessor :modified_at
|
58
|
+
|
59
|
+
attr_accessor :remote_data
|
60
|
+
|
56
61
|
# Attribute mapping from ruby-style variable name to JSON key.
|
57
62
|
def self.attribute_map
|
58
63
|
{
|
@@ -67,8 +72,10 @@ module MergeHRISClient
|
|
67
72
|
:'zip_code' => :'zip_code',
|
68
73
|
:'country' => :'country',
|
69
74
|
:'location_type' => :'location_type',
|
70
|
-
:'
|
71
|
-
:'
|
75
|
+
:'remote_was_deleted' => :'remote_was_deleted',
|
76
|
+
:'field_mappings' => :'field_mappings',
|
77
|
+
:'modified_at' => :'modified_at',
|
78
|
+
:'remote_data' => :'remote_data'
|
72
79
|
}
|
73
80
|
end
|
74
81
|
|
@@ -91,8 +98,10 @@ module MergeHRISClient
|
|
91
98
|
:'zip_code' => :'String',
|
92
99
|
:'country' => :'CountryEnum',
|
93
100
|
:'location_type' => :'LocationTypeEnum',
|
94
|
-
:'
|
95
|
-
:'
|
101
|
+
:'remote_was_deleted' => :'Boolean',
|
102
|
+
:'field_mappings' => :'Hash<String, Object>',
|
103
|
+
:'modified_at' => :'Time',
|
104
|
+
:'remote_data' => :'Array<RemoteData>'
|
96
105
|
}
|
97
106
|
end
|
98
107
|
|
@@ -109,7 +118,8 @@ module MergeHRISClient
|
|
109
118
|
:'zip_code',
|
110
119
|
:'country',
|
111
120
|
:'location_type',
|
112
|
-
:'
|
121
|
+
:'field_mappings',
|
122
|
+
:'remote_data'
|
113
123
|
])
|
114
124
|
end
|
115
125
|
|
@@ -172,15 +182,25 @@ module MergeHRISClient
|
|
172
182
|
self.location_type = attributes[:'location_type']
|
173
183
|
end
|
174
184
|
|
185
|
+
if attributes.key?(:'remote_was_deleted')
|
186
|
+
self.remote_was_deleted = attributes[:'remote_was_deleted']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.key?(:'field_mappings')
|
190
|
+
if (value = attributes[:'field_mappings']).is_a?(Hash)
|
191
|
+
self.field_mappings = value
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.key?(:'modified_at')
|
196
|
+
self.modified_at = attributes[:'modified_at']
|
197
|
+
end
|
198
|
+
|
175
199
|
if attributes.key?(:'remote_data')
|
176
200
|
if (value = attributes[:'remote_data']).is_a?(Array)
|
177
201
|
self.remote_data = value
|
178
202
|
end
|
179
203
|
end
|
180
|
-
|
181
|
-
if attributes.key?(:'remote_was_deleted')
|
182
|
-
self.remote_was_deleted = attributes[:'remote_was_deleted']
|
183
|
-
end
|
184
204
|
end
|
185
205
|
|
186
206
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -212,8 +232,10 @@ module MergeHRISClient
|
|
212
232
|
zip_code == o.zip_code &&
|
213
233
|
country == o.country &&
|
214
234
|
location_type == o.location_type &&
|
215
|
-
|
216
|
-
|
235
|
+
remote_was_deleted == o.remote_was_deleted &&
|
236
|
+
field_mappings == o.field_mappings &&
|
237
|
+
modified_at == o.modified_at &&
|
238
|
+
remote_data == o.remote_data
|
217
239
|
end
|
218
240
|
|
219
241
|
# @see the `==` method
|
@@ -225,7 +247,7 @@ module MergeHRISClient
|
|
225
247
|
# Calculates hash code according to all attributes.
|
226
248
|
# @return [Integer] Hash code
|
227
249
|
def hash
|
228
|
-
[id, remote_id, name, phone_number, street_1, street_2, city, state, zip_code, country, location_type,
|
250
|
+
[id, remote_id, name, phone_number, street_1, street_2, city, state, zip_code, country, location_type, remote_was_deleted, field_mappings, modified_at, remote_data].hash
|
229
251
|
end
|
230
252
|
|
231
253
|
# Builds the object from hash
|
@@ -17,6 +17,8 @@ module MergeHRISClient
|
|
17
17
|
class MetaResponse
|
18
18
|
attr_accessor :request_schema
|
19
19
|
|
20
|
+
attr_accessor :remote_field_classes
|
21
|
+
|
20
22
|
attr_accessor :status
|
21
23
|
|
22
24
|
attr_accessor :has_conditional_params
|
@@ -27,6 +29,7 @@ module MergeHRISClient
|
|
27
29
|
def self.attribute_map
|
28
30
|
{
|
29
31
|
:'request_schema' => :'request_schema',
|
32
|
+
:'remote_field_classes' => :'remote_field_classes',
|
30
33
|
:'status' => :'status',
|
31
34
|
:'has_conditional_params' => :'has_conditional_params',
|
32
35
|
:'has_required_linked_account_params' => :'has_required_linked_account_params'
|
@@ -42,6 +45,7 @@ module MergeHRISClient
|
|
42
45
|
def self.openapi_types
|
43
46
|
{
|
44
47
|
:'request_schema' => :'Hash<String, Object>',
|
48
|
+
:'remote_field_classes' => :'Hash<String, Object>',
|
45
49
|
:'status' => :'LinkedAccountStatus',
|
46
50
|
:'has_conditional_params' => :'Boolean',
|
47
51
|
:'has_required_linked_account_params' => :'Boolean'
|
@@ -75,6 +79,12 @@ module MergeHRISClient
|
|
75
79
|
end
|
76
80
|
end
|
77
81
|
|
82
|
+
if attributes.key?(:'remote_field_classes')
|
83
|
+
if (value = attributes[:'remote_field_classes']).is_a?(Hash)
|
84
|
+
self.remote_field_classes = value
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
78
88
|
if attributes.key?(:'status')
|
79
89
|
self.status = attributes[:'status']
|
80
90
|
end
|
@@ -122,6 +132,7 @@ module MergeHRISClient
|
|
122
132
|
return true if self.equal?(o)
|
123
133
|
self.class == o.class &&
|
124
134
|
request_schema == o.request_schema &&
|
135
|
+
remote_field_classes == o.remote_field_classes &&
|
125
136
|
status == o.status &&
|
126
137
|
has_conditional_params == o.has_conditional_params &&
|
127
138
|
has_required_linked_account_params == o.has_required_linked_account_params
|
@@ -136,7 +147,7 @@ module MergeHRISClient
|
|
136
147
|
# Calculates hash code according to all attributes.
|
137
148
|
# @return [Integer] Hash code
|
138
149
|
def hash
|
139
|
-
[request_schema, status, has_conditional_params, has_required_linked_account_params].hash
|
150
|
+
[request_schema, remote_field_classes, status, has_conditional_params, has_required_linked_account_params].hash
|
140
151
|
end
|
141
152
|
|
142
153
|
# Builds the object from hash
|
@@ -22,7 +22,7 @@ module MergeHRISClient
|
|
22
22
|
# The data for the form field.
|
23
23
|
attr_accessor :data
|
24
24
|
|
25
|
-
# The encoding of the value of `data`. Defaults to `RAW` if not defined.
|
25
|
+
# The encoding of the value of `data`. Defaults to `RAW` if not defined. * `RAW` - RAW * `BASE64` - BASE64 * `GZIP_BASE64` - GZIP_BASE64
|
26
26
|
attr_accessor :encoding
|
27
27
|
|
28
28
|
# The file name of the form field, if the field is for a file.
|
@@ -0,0 +1,229 @@
|
|
1
|
+
=begin
|
2
|
+
#Merge HRIS API
|
3
|
+
|
4
|
+
#The unified API for building rich integrations with multiple HR Information System platforms.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: hello@merge.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MergeHRISClient
|
17
|
+
class OperatorSchema
|
18
|
+
# The operator for which an operator schema is defined.
|
19
|
+
attr_accessor :operator
|
20
|
+
|
21
|
+
# Whether the operator can be repeated multiple times.
|
22
|
+
attr_accessor :is_unique
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'operator' => :'operator',
|
28
|
+
:'is_unique' => :'is_unique'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'operator' => :'String',
|
41
|
+
:'is_unique' => :'Boolean'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::OperatorSchema` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::OperatorSchema`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'operator')
|
67
|
+
self.operator = attributes[:'operator']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'is_unique')
|
71
|
+
self.is_unique = attributes[:'is_unique']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
invalid_properties
|
80
|
+
end
|
81
|
+
|
82
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
def valid?
|
85
|
+
true
|
86
|
+
end
|
87
|
+
|
88
|
+
# Checks equality by comparing each attribute.
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def ==(o)
|
91
|
+
return true if self.equal?(o)
|
92
|
+
self.class == o.class &&
|
93
|
+
operator == o.operator &&
|
94
|
+
is_unique == o.is_unique
|
95
|
+
end
|
96
|
+
|
97
|
+
# @see the `==` method
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def eql?(o)
|
100
|
+
self == o
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Integer] Hash code
|
105
|
+
def hash
|
106
|
+
[operator, is_unique].hash
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def self.build_from_hash(attributes)
|
113
|
+
new.build_from_hash(attributes)
|
114
|
+
end
|
115
|
+
|
116
|
+
# Builds the object from hash
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
+
# @return [Object] Returns the model itself
|
119
|
+
def build_from_hash(attributes)
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
121
|
+
self.class.openapi_types.each_pair do |key, type|
|
122
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
123
|
+
self.send("#{key}=", nil)
|
124
|
+
elsif type =~ /\AArray<(.*)>/i
|
125
|
+
# check to ensure the input is an array given that the attribute
|
126
|
+
# is documented as an array but the input is not
|
127
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
128
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
129
|
+
end
|
130
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
131
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
self
|
136
|
+
end
|
137
|
+
|
138
|
+
# Deserializes the data based on type
|
139
|
+
# @param string type Data type
|
140
|
+
# @param string value Value to be deserialized
|
141
|
+
# @return [Object] Deserialized data
|
142
|
+
def _deserialize(type, value)
|
143
|
+
case type.to_sym
|
144
|
+
when :Time
|
145
|
+
Time.parse(value)
|
146
|
+
when :Date
|
147
|
+
Date.parse(value)
|
148
|
+
when :String
|
149
|
+
value
|
150
|
+
when :Integer
|
151
|
+
value.to_i
|
152
|
+
when :Float
|
153
|
+
value.to_f
|
154
|
+
when :Boolean
|
155
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
156
|
+
true
|
157
|
+
else
|
158
|
+
false
|
159
|
+
end
|
160
|
+
when :Object
|
161
|
+
# generic object (usually a Hash), return directly
|
162
|
+
value
|
163
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
164
|
+
inner_type = Regexp.last_match[:inner_type]
|
165
|
+
value.map { |v| _deserialize(inner_type, v) }
|
166
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
167
|
+
k_type = Regexp.last_match[:k_type]
|
168
|
+
v_type = Regexp.last_match[:v_type]
|
169
|
+
{}.tap do |hash|
|
170
|
+
value.each do |k, v|
|
171
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
else # model
|
175
|
+
# models (e.g. Pet) or oneOf
|
176
|
+
klass = MergeHRISClient.const_get(type)
|
177
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Returns the string representation of the object
|
182
|
+
# @return [String] String presentation of the object
|
183
|
+
def to_s
|
184
|
+
to_hash.to_s
|
185
|
+
end
|
186
|
+
|
187
|
+
# to_body is an alias to to_hash (backward compatibility)
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_body
|
190
|
+
to_hash
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the object in the form of hash
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
195
|
+
def to_hash
|
196
|
+
hash = {}
|
197
|
+
self.class.attribute_map.each_pair do |attr, param|
|
198
|
+
value = self.send(attr)
|
199
|
+
if value.nil?
|
200
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
201
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
202
|
+
end
|
203
|
+
|
204
|
+
hash[param] = _to_hash(value)
|
205
|
+
end
|
206
|
+
hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Outputs non-array value in the form of hash
|
210
|
+
# For object, use to_hash. Otherwise, just return the value
|
211
|
+
# @param [Object] value Any valid value
|
212
|
+
# @return [Hash] Returns the value in the form of hash
|
213
|
+
def _to_hash(value)
|
214
|
+
if value.is_a?(Array)
|
215
|
+
value.compact.map { |v| _to_hash(v) }
|
216
|
+
elsif value.is_a?(Hash)
|
217
|
+
{}.tap do |hash|
|
218
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
219
|
+
end
|
220
|
+
elsif value.respond_to? :to_hash
|
221
|
+
value.to_hash
|
222
|
+
else
|
223
|
+
value
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|