merge_hris_client 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -2
  3. data/docs/AccountToken.md +3 -1
  4. data/docs/AvailableActions.md +1 -1
  5. data/docs/BenefitRequest.md +28 -0
  6. data/docs/BenefitsApi.md +78 -0
  7. data/docs/DeleteAccountApi.md +77 -0
  8. data/docs/Employee.md +8 -6
  9. data/docs/EmployeeRequest.md +62 -0
  10. data/docs/EmployeesApi.md +83 -1
  11. data/docs/EmploymentRequest.md +34 -0
  12. data/docs/EmploymentsApi.md +78 -0
  13. data/docs/EndUserDetailsRequest.md +1 -1
  14. data/docs/Issue.md +30 -0
  15. data/docs/IssueStatusEnum.md +15 -0
  16. data/docs/IssuesApi.md +167 -0
  17. data/docs/Location.md +1 -1
  18. data/docs/ModelOperation.md +3 -1
  19. data/docs/PaginatedIssueList.md +22 -0
  20. data/docs/PaginatedSyncStatusList.md +22 -0
  21. data/docs/PaginatedTimeOffBalanceList.md +22 -0
  22. data/docs/RemoteDataRequest.md +20 -0
  23. data/docs/SyncStatus.md +1 -1
  24. data/docs/SyncStatusApi.md +89 -11
  25. data/docs/SyncStatusStatusEnum.md +15 -0
  26. data/docs/Team.md +2 -0
  27. data/docs/TeamsApi.md +2 -0
  28. data/docs/TimeOff.md +4 -0
  29. data/docs/TimeOffBalance.md +28 -0
  30. data/docs/TimeOffBalanceApi.md +181 -0
  31. data/lib/merge_hris_client.rb +15 -4
  32. data/lib/merge_hris_client/api/account_token_api.rb +1 -1
  33. data/lib/merge_hris_client/api/available_actions_api.rb +1 -1
  34. data/lib/merge_hris_client/api/benefits_api.rb +70 -1
  35. data/lib/merge_hris_client/api/companies_api.rb +1 -1
  36. data/lib/merge_hris_client/api/delete_account_api.rb +82 -0
  37. data/lib/merge_hris_client/api/employee_payroll_runs_api.rb +1 -1
  38. data/lib/merge_hris_client/api/employees_api.rb +76 -1
  39. data/lib/merge_hris_client/api/employments_api.rb +70 -1
  40. data/lib/merge_hris_client/api/generate_key_api.rb +1 -1
  41. data/lib/merge_hris_client/api/issues_api.rb +169 -0
  42. data/lib/merge_hris_client/api/link_token_api.rb +1 -1
  43. data/lib/merge_hris_client/api/locations_api.rb +1 -1
  44. data/lib/merge_hris_client/api/passthrough_api.rb +1 -1
  45. data/lib/merge_hris_client/api/payroll_runs_api.rb +1 -1
  46. data/lib/merge_hris_client/api/regenerate_key_api.rb +1 -1
  47. data/lib/merge_hris_client/api/sync_status_api.rb +79 -11
  48. data/lib/merge_hris_client/api/teams_api.rb +4 -1
  49. data/lib/merge_hris_client/api/time_off_api.rb +1 -1
  50. data/lib/merge_hris_client/api/time_off_balance_api.rb +196 -0
  51. data/lib/merge_hris_client/api_client.rb +2 -2
  52. data/lib/merge_hris_client/api_error.rb +1 -1
  53. data/lib/merge_hris_client/configuration.rb +1 -1
  54. data/lib/merge_hris_client/models/account_integration.rb +1 -1
  55. data/lib/merge_hris_client/models/account_token.rb +19 -5
  56. data/lib/merge_hris_client/models/available_actions.rb +1 -1
  57. data/lib/merge_hris_client/models/benefit.rb +1 -1
  58. data/lib/merge_hris_client/models/benefit_plan_type_enum.rb +1 -1
  59. data/lib/merge_hris_client/models/benefit_request.rb +276 -0
  60. data/lib/merge_hris_client/models/company.rb +1 -1
  61. data/lib/merge_hris_client/models/country_enum.rb +1 -1
  62. data/lib/merge_hris_client/models/data_passthrough_request.rb +2 -1
  63. data/lib/merge_hris_client/models/deduction.rb +1 -1
  64. data/lib/merge_hris_client/models/earning.rb +1 -1
  65. data/lib/merge_hris_client/models/employee.rb +32 -20
  66. data/lib/merge_hris_client/models/employee_payroll_run.rb +1 -1
  67. data/lib/merge_hris_client/models/employee_request.rb +523 -0
  68. data/lib/merge_hris_client/models/employment.rb +1 -1
  69. data/lib/merge_hris_client/models/employment_request.rb +309 -0
  70. data/lib/merge_hris_client/models/employment_status_enum.rb +1 -1
  71. data/lib/merge_hris_client/models/employment_type_enum.rb +1 -1
  72. data/lib/merge_hris_client/models/end_user_details_request.rb +2 -6
  73. data/lib/merge_hris_client/models/ethnicity_enum.rb +1 -1
  74. data/lib/merge_hris_client/models/flsa_status_enum.rb +1 -1
  75. data/lib/merge_hris_client/models/gender_enum.rb +1 -1
  76. data/lib/merge_hris_client/models/generate_remote_key_request.rb +1 -1
  77. data/lib/merge_hris_client/models/issue.rb +281 -0
  78. data/lib/merge_hris_client/models/issue_status_enum.rb +36 -0
  79. data/lib/merge_hris_client/models/link_token.rb +1 -1
  80. data/lib/merge_hris_client/models/location.rb +4 -4
  81. data/lib/merge_hris_client/models/method_enum.rb +1 -1
  82. data/lib/merge_hris_client/models/model_operation.rb +21 -5
  83. data/lib/merge_hris_client/models/paginated_benefit_list.rb +1 -1
  84. data/lib/merge_hris_client/models/paginated_company_list.rb +1 -1
  85. data/lib/merge_hris_client/models/paginated_employee_list.rb +1 -1
  86. data/lib/merge_hris_client/models/paginated_employee_payroll_run_list.rb +1 -1
  87. data/lib/merge_hris_client/models/paginated_employment_list.rb +1 -1
  88. data/lib/merge_hris_client/models/paginated_issue_list.rb +240 -0
  89. data/lib/merge_hris_client/models/paginated_location_list.rb +1 -1
  90. data/lib/merge_hris_client/models/paginated_payroll_run_list.rb +1 -1
  91. data/lib/merge_hris_client/models/paginated_sync_status_list.rb +240 -0
  92. data/lib/merge_hris_client/models/paginated_team_list.rb +1 -1
  93. data/lib/merge_hris_client/models/paginated_time_off_balance_list.rb +240 -0
  94. data/lib/merge_hris_client/models/paginated_time_off_list.rb +1 -1
  95. data/lib/merge_hris_client/models/pay_currency_enum.rb +1 -1
  96. data/lib/merge_hris_client/models/pay_frequency_enum.rb +1 -1
  97. data/lib/merge_hris_client/models/pay_period_enum.rb +1 -1
  98. data/lib/merge_hris_client/models/payroll_run.rb +1 -1
  99. data/lib/merge_hris_client/models/remote_data.rb +1 -1
  100. data/lib/merge_hris_client/models/remote_data_request.rb +234 -0
  101. data/lib/merge_hris_client/models/remote_key.rb +1 -1
  102. data/lib/merge_hris_client/models/remote_key_for_regeneration_request.rb +1 -1
  103. data/lib/merge_hris_client/models/remote_response.rb +1 -1
  104. data/lib/merge_hris_client/models/request_type_enum.rb +1 -1
  105. data/lib/merge_hris_client/models/run_state_enum.rb +1 -1
  106. data/lib/merge_hris_client/models/run_type_enum.rb +1 -1
  107. data/lib/merge_hris_client/models/sync_status.rb +2 -2
  108. data/lib/merge_hris_client/models/sync_status_status_enum.rb +37 -0
  109. data/lib/merge_hris_client/models/tax.rb +1 -1
  110. data/lib/merge_hris_client/models/team.rb +13 -2
  111. data/lib/merge_hris_client/models/time_off.rb +24 -2
  112. data/lib/merge_hris_client/models/time_off_balance.rb +275 -0
  113. data/lib/merge_hris_client/models/time_off_status_enum.rb +1 -1
  114. data/lib/merge_hris_client/models/type_enum.rb +1 -1
  115. data/lib/merge_hris_client/models/units_enum.rb +1 -1
  116. data/lib/merge_hris_client/version.rb +2 -2
  117. data/merge_hris_client-1.0.1.gem +0 -0
  118. data/merge_hris_client.gemspec +1 -1
  119. data/spec/api/delete_account_api_spec.rb +46 -0
  120. data/spec/api/generate_key_api_spec.rb +46 -0
  121. data/spec/api/issues_api_spec.rb +65 -0
  122. data/spec/api/sync_status_api_spec.rb +59 -0
  123. data/spec/api/time_off_balance_api_spec.rb +70 -0
  124. data/spec/api_client_spec.rb +1 -1
  125. data/spec/configuration_spec.rb +1 -1
  126. data/spec/models/benefit_request_spec.rb +64 -0
  127. data/spec/models/employee_request_spec.rb +160 -0
  128. data/spec/models/employment_request_spec.rb +82 -0
  129. data/spec/models/generate_remote_key_request_spec.rb +34 -0
  130. data/spec/models/issue_spec.rb +70 -0
  131. data/spec/models/issue_status_enum_spec.rb +28 -0
  132. data/spec/models/paginated_issue_list_spec.rb +46 -0
  133. data/spec/models/paginated_sync_status_list_spec.rb +46 -0
  134. data/spec/models/paginated_time_off_balance_list_spec.rb +46 -0
  135. data/spec/models/remote_data_request_spec.rb +40 -0
  136. data/spec/models/sync_status_spec.rb +64 -0
  137. data/spec/models/sync_status_status_enum_spec.rb +28 -0
  138. data/spec/models/time_off_balance_spec.rb +64 -0
  139. data/spec/spec_helper.rb +1 -1
  140. data/test_ruby.rb +14 -11
  141. metadata +67 -2
@@ -0,0 +1,36 @@
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 IssueStatusEnum
18
+ ONGOING = "ONGOING".freeze
19
+ RESOLVED = "RESOLVED".freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ constantValues = IssueStatusEnum.constants.select { |c| IssueStatusEnum::const_get(c) == value }
33
+ value
34
+ end
35
+ end
36
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -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 a Location for a company. This is shared across many models and is referenced whenever a location is stored. ### Usage Example Fetch from the `LIST Locations` endpoint and filter by `ID` to show all office locations.
17
+ # # The Location Object ### Description The `Location` object is used to represent a Location for a Company or Employee address. This is shared across many models and is referenced whenever a location is stored. ### 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
 
@@ -33,7 +33,7 @@ module MergeHRISClient
33
33
  # The location's city.
34
34
  attr_accessor :city
35
35
 
36
- # The location's state.
36
+ # The location's state. Represents a region if outside of the US.
37
37
  attr_accessor :state
38
38
 
39
39
  # The location's zip code.
@@ -74,7 +74,7 @@ module MergeHRISClient
74
74
  :'street_1' => :'String',
75
75
  :'street_2' => :'String',
76
76
  :'city' => :'String',
77
- :'state' => :'StateEnum',
77
+ :'state' => :'String',
78
78
  :'zip_code' => :'String',
79
79
  :'country' => :'CountryEnum',
80
80
  :'remote_data' => :'Array<RemoteData>'
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -22,12 +22,15 @@ module MergeHRISClient
22
22
 
23
23
  attr_accessor :required_post_parameters
24
24
 
25
+ attr_accessor :supported_fields
26
+
25
27
  # Attribute mapping from ruby-style variable name to JSON key.
26
28
  def self.attribute_map
27
29
  {
28
30
  :'model_name' => :'model_name',
29
31
  :'available_operations' => :'available_operations',
30
- :'required_post_parameters' => :'required_post_parameters'
32
+ :'required_post_parameters' => :'required_post_parameters',
33
+ :'supported_fields' => :'supported_fields'
31
34
  }
32
35
  end
33
36
 
@@ -41,7 +44,8 @@ module MergeHRISClient
41
44
  {
42
45
  :'model_name' => :'String',
43
46
  :'available_operations' => :'Array<String>',
44
- :'required_post_parameters' => :'Array<String>'
47
+ :'required_post_parameters' => :'Array<String>',
48
+ :'supported_fields' => :'Array<String>'
45
49
  }
46
50
  end
47
51
 
@@ -81,6 +85,12 @@ module MergeHRISClient
81
85
  self.required_post_parameters = value
82
86
  end
83
87
  end
88
+
89
+ if attributes.key?(:'supported_fields')
90
+ if (value = attributes[:'supported_fields']).is_a?(Array)
91
+ self.supported_fields = value
92
+ end
93
+ end
84
94
  end
85
95
 
86
96
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -99,6 +109,10 @@ module MergeHRISClient
99
109
  invalid_properties.push('invalid value for "required_post_parameters", required_post_parameters cannot be nil.')
100
110
  end
101
111
 
112
+ if @supported_fields.nil?
113
+ invalid_properties.push('invalid value for "supported_fields", supported_fields cannot be nil.')
114
+ end
115
+
102
116
  invalid_properties
103
117
  end
104
118
 
@@ -108,6 +122,7 @@ module MergeHRISClient
108
122
  return false if @model_name.nil?
109
123
  return false if @available_operations.nil?
110
124
  return false if @required_post_parameters.nil?
125
+ return false if @supported_fields.nil?
111
126
  true
112
127
  end
113
128
 
@@ -118,7 +133,8 @@ module MergeHRISClient
118
133
  self.class == o.class &&
119
134
  model_name == o.model_name &&
120
135
  available_operations == o.available_operations &&
121
- required_post_parameters == o.required_post_parameters
136
+ required_post_parameters == o.required_post_parameters &&
137
+ supported_fields == o.supported_fields
122
138
  end
123
139
 
124
140
  # @see the `==` method
@@ -130,7 +146,7 @@ module MergeHRISClient
130
146
  # Calculates hash code according to all attributes.
131
147
  # @return [Integer] Hash code
132
148
  def hash
133
- [model_name, available_operations, required_post_parameters].hash
149
+ [model_name, available_operations, required_post_parameters, supported_fields].hash
134
150
  end
135
151
 
136
152
  # Builds the object from hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,240 @@
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 PaginatedIssueList
18
+ attr_accessor :_next
19
+
20
+ attr_accessor :previous
21
+
22
+ attr_accessor :results
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'_next' => :'next',
28
+ :'previous' => :'previous',
29
+ :'results' => :'results'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'_next' => :'String',
42
+ :'previous' => :'String',
43
+ :'results' => :'Array<Issue>'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ :'_next',
51
+ :'previous',
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::PaginatedIssueList` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::PaginatedIssueList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'_next')
71
+ self._next = attributes[:'_next']
72
+ end
73
+
74
+ if attributes.key?(:'previous')
75
+ self.previous = attributes[:'previous']
76
+ end
77
+
78
+ if attributes.key?(:'results')
79
+ if (value = attributes[:'results']).is_a?(Array)
80
+ self.results = value
81
+ end
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ _next == o._next &&
104
+ previous == o.previous &&
105
+ results == o.results
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [_next, previous, results].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ new.build_from_hash(attributes)
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ self.class.openapi_types.each_pair do |key, type|
133
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = MergeHRISClient.const_get(type)
188
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end