open_api_smart_recruiters_sdk 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +13 -0
  4. data/Gemfile +16 -0
  5. data/Gemfile.lock +65 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +35 -0
  8. data/Rakefile +12 -0
  9. data/lib/smart_recruiters/api/application_api_api.rb +188 -0
  10. data/lib/smart_recruiters/api/candidates_api.rb +2417 -0
  11. data/lib/smart_recruiters/api/configuration_api.rb +2504 -0
  12. data/lib/smart_recruiters/api/job_applications_api.rb +63 -0
  13. data/lib/smart_recruiters/api/jobs_api.rb +1851 -0
  14. data/lib/smart_recruiters/api/subscriptions_api.rb +469 -0
  15. data/lib/smart_recruiters/api_client.rb +379 -0
  16. data/lib/smart_recruiters/api_error.rb +46 -0
  17. data/lib/smart_recruiters/authorization.rb +66 -0
  18. data/lib/smart_recruiters/configuration.rb +214 -0
  19. data/lib/smart_recruiters/models/action.rb +248 -0
  20. data/lib/smart_recruiters/models/actions.rb +190 -0
  21. data/lib/smart_recruiters/models/all_of_candidate_details_primary_assignment.rb +262 -0
  22. data/lib/smart_recruiters/models/all_of_candidate_details_secondary_assignments_items.rb +262 -0
  23. data/lib/smart_recruiters/models/answer_field.rb +227 -0
  24. data/lib/smart_recruiters/models/answer_field_value.rb +216 -0
  25. data/lib/smart_recruiters/models/answer_record.rb +197 -0
  26. data/lib/smart_recruiters/models/application.rb +260 -0
  27. data/lib/smart_recruiters/models/application_attachment_webhook_payload.rb +248 -0
  28. data/lib/smart_recruiters/models/application_status_info.rb +231 -0
  29. data/lib/smart_recruiters/models/application_url.rb +198 -0
  30. data/lib/smart_recruiters/models/application_webhook_payload.rb +230 -0
  31. data/lib/smart_recruiters/models/apply_api_error.rb +259 -0
  32. data/lib/smart_recruiters/models/apply_api_request.rb +386 -0
  33. data/lib/smart_recruiters/models/apply_api_response.rb +224 -0
  34. data/lib/smart_recruiters/models/apply_configuration.rb +229 -0
  35. data/lib/smart_recruiters/models/apply_settings.rb +197 -0
  36. data/lib/smart_recruiters/models/assignment.rb +251 -0
  37. data/lib/smart_recruiters/models/assignment_actions.rb +197 -0
  38. data/lib/smart_recruiters/models/attachment.rb +230 -0
  39. data/lib/smart_recruiters/models/attachment_actions.rb +202 -0
  40. data/lib/smart_recruiters/models/attachments.rb +218 -0
  41. data/lib/smart_recruiters/models/callback_authentication.rb +188 -0
  42. data/lib/smart_recruiters/models/callback_basic_auth.rb +249 -0
  43. data/lib/smart_recruiters/models/callback_header_auth.rb +250 -0
  44. data/lib/smart_recruiters/models/callback_o_auth2_auth.rb +262 -0
  45. data/lib/smart_recruiters/models/callback_request.rb +216 -0
  46. data/lib/smart_recruiters/models/callback_request_request_details.rb +219 -0
  47. data/lib/smart_recruiters/models/callback_request_status.rb +19 -0
  48. data/lib/smart_recruiters/models/callback_requests.rb +192 -0
  49. data/lib/smart_recruiters/models/callback_url.rb +188 -0
  50. data/lib/smart_recruiters/models/candidate.rb +349 -0
  51. data/lib/smart_recruiters/models/candidate_actions.rb +216 -0
  52. data/lib/smart_recruiters/models/candidate_attachment_for_job.rb +253 -0
  53. data/lib/smart_recruiters/models/candidate_attachment_for_job_actions.rb +216 -0
  54. data/lib/smart_recruiters/models/candidate_attachments_for_job.rb +218 -0
  55. data/lib/smart_recruiters/models/candidate_consent.rb +197 -0
  56. data/lib/smart_recruiters/models/candidate_consent_decisions.rb +213 -0
  57. data/lib/smart_recruiters/models/candidate_consent_status.rb +212 -0
  58. data/lib/smart_recruiters/models/candidate_details.rb +349 -0
  59. data/lib/smart_recruiters/models/candidate_details_actions.rb +229 -0
  60. data/lib/smart_recruiters/models/candidate_input.rb +308 -0
  61. data/lib/smart_recruiters/models/candidate_job.rb +216 -0
  62. data/lib/smart_recruiters/models/candidate_location.rb +251 -0
  63. data/lib/smart_recruiters/models/candidate_primary_assignment.rb +225 -0
  64. data/lib/smart_recruiters/models/candidate_primary_assignment_job.rb +230 -0
  65. data/lib/smart_recruiters/models/candidate_primary_assignment_job_actions.rb +202 -0
  66. data/lib/smart_recruiters/models/candidate_properties.rb +199 -0
  67. data/lib/smart_recruiters/models/candidate_property.rb +268 -0
  68. data/lib/smart_recruiters/models/candidate_property_actions.rb +202 -0
  69. data/lib/smart_recruiters/models/candidate_property_availability.rb +253 -0
  70. data/lib/smart_recruiters/models/candidate_property_definition.rb +233 -0
  71. data/lib/smart_recruiters/models/candidate_property_definition_list.rb +208 -0
  72. data/lib/smart_recruiters/models/candidate_property_filter.rb +215 -0
  73. data/lib/smart_recruiters/models/candidate_property_filter_values.rb +208 -0
  74. data/lib/smart_recruiters/models/candidate_property_input_value.rb +198 -0
  75. data/lib/smart_recruiters/models/candidate_property_type.rb +27 -0
  76. data/lib/smart_recruiters/models/candidate_property_value.rb +212 -0
  77. data/lib/smart_recruiters/models/candidate_property_value_label.rb +202 -0
  78. data/lib/smart_recruiters/models/candidate_property_value_list.rb +208 -0
  79. data/lib/smart_recruiters/models/candidate_secondary_assignments.rb +202 -0
  80. data/lib/smart_recruiters/models/candidate_source.rb +225 -0
  81. data/lib/smart_recruiters/models/candidate_status.rb +230 -0
  82. data/lib/smart_recruiters/models/candidate_status_enum.rb +26 -0
  83. data/lib/smart_recruiters/models/candidate_status_history_list.rb +208 -0
  84. data/lib/smart_recruiters/models/candidate_status_history_list_elem.rb +224 -0
  85. data/lib/smart_recruiters/models/candidate_tags.rb +204 -0
  86. data/lib/smart_recruiters/models/candidate_webhook_payload.rb +202 -0
  87. data/lib/smart_recruiters/models/candidates.rb +255 -0
  88. data/lib/smart_recruiters/models/company_configuration.rb +246 -0
  89. data/lib/smart_recruiters/models/compensation.rb +215 -0
  90. data/lib/smart_recruiters/models/consent_decision.rb +226 -0
  91. data/lib/smart_recruiters/models/consent_decision_status.rb +20 -0
  92. data/lib/smart_recruiters/models/consent_request.rb +203 -0
  93. data/lib/smart_recruiters/models/consent_request_scheduled.rb +250 -0
  94. data/lib/smart_recruiters/models/consent_request_scheduled_body.rb +197 -0
  95. data/lib/smart_recruiters/models/consent_request_unavailable.rb +245 -0
  96. data/lib/smart_recruiters/models/consent_requests_results.rb +204 -0
  97. data/lib/smart_recruiters/models/consent_scope.rb +22 -0
  98. data/lib/smart_recruiters/models/consent_status.rb +20 -0
  99. data/lib/smart_recruiters/models/department.rb +220 -0
  100. data/lib/smart_recruiters/models/departments.rb +208 -0
  101. data/lib/smart_recruiters/models/dependent_job_properties.rb +218 -0
  102. data/lib/smart_recruiters/models/dependent_job_properties_ids.rb +204 -0
  103. data/lib/smart_recruiters/models/dependent_job_property.rb +216 -0
  104. data/lib/smart_recruiters/models/dependent_job_property_value.rb +220 -0
  105. data/lib/smart_recruiters/models/dependent_job_property_values.rb +208 -0
  106. data/lib/smart_recruiters/models/dependent_job_property_values_relation.rb +218 -0
  107. data/lib/smart_recruiters/models/dependent_job_property_values_relations.rb +218 -0
  108. data/lib/smart_recruiters/models/education.rb +270 -0
  109. data/lib/smart_recruiters/models/email_address.rb +188 -0
  110. data/lib/smart_recruiters/models/employment.rb +261 -0
  111. data/lib/smart_recruiters/models/error.rb +211 -0
  112. data/lib/smart_recruiters/models/error_response.rb +208 -0
  113. data/lib/smart_recruiters/models/event.rb +206 -0
  114. data/lib/smart_recruiters/models/event_name.rb +64 -0
  115. data/lib/smart_recruiters/models/experience.rb +251 -0
  116. data/lib/smart_recruiters/models/field_value.rb +216 -0
  117. data/lib/smart_recruiters/models/headcount_patch_request.rb +197 -0
  118. data/lib/smart_recruiters/models/headcount_update_accepted.rb +231 -0
  119. data/lib/smart_recruiters/models/hiring_process.rb +224 -0
  120. data/lib/smart_recruiters/models/hiring_process_sub_statuses.rb +221 -0
  121. data/lib/smart_recruiters/models/hiring_processes.rb +218 -0
  122. data/lib/smart_recruiters/models/hiring_team_member.rb +220 -0
  123. data/lib/smart_recruiters/models/hiring_team_member_response.rb +215 -0
  124. data/lib/smart_recruiters/models/hiring_team_member_response_actions.rb +202 -0
  125. data/lib/smart_recruiters/models/hiring_team_member_role.rb +22 -0
  126. data/lib/smart_recruiters/models/hiring_team_members.rb +208 -0
  127. data/lib/smart_recruiters/models/id_attachments_body.rb +249 -0
  128. data/lib/smart_recruiters/models/identifiable.rb +202 -0
  129. data/lib/smart_recruiters/models/industry.rb +207 -0
  130. data/lib/smart_recruiters/models/job.rb +197 -0
  131. data/lib/smart_recruiters/models/job_ad.rb +206 -0
  132. data/lib/smart_recruiters/models/job_ad_content.rb +220 -0
  133. data/lib/smart_recruiters/models/job_ad_input.rb +206 -0
  134. data/lib/smart_recruiters/models/job_ad_item.rb +397 -0
  135. data/lib/smart_recruiters/models/job_ad_item_actions.rb +202 -0
  136. data/lib/smart_recruiters/models/job_ad_language.rb +202 -0
  137. data/lib/smart_recruiters/models/job_ad_postings_webhook_payload.rb +216 -0
  138. data/lib/smart_recruiters/models/job_ad_publication_scheduled.rb +231 -0
  139. data/lib/smart_recruiters/models/job_ad_section.rb +206 -0
  140. data/lib/smart_recruiters/models/job_ad_sections.rb +233 -0
  141. data/lib/smart_recruiters/models/job_ad_unpublish_scheduled.rb +231 -0
  142. data/lib/smart_recruiters/models/job_ad_videos.rb +199 -0
  143. data/lib/smart_recruiters/models/job_ad_webhook_payload.rb +216 -0
  144. data/lib/smart_recruiters/models/job_ads.rb +192 -0
  145. data/lib/smart_recruiters/models/job_application.rb +242 -0
  146. data/lib/smart_recruiters/models/job_application_status.rb +26 -0
  147. data/lib/smart_recruiters/models/job_approval.rb +217 -0
  148. data/lib/smart_recruiters/models/job_approval_position.rb +251 -0
  149. data/lib/smart_recruiters/models/job_approval_webhook_payload.rb +216 -0
  150. data/lib/smart_recruiters/models/job_details.rb +394 -0
  151. data/lib/smart_recruiters/models/job_details_actions.rb +233 -0
  152. data/lib/smart_recruiters/models/job_id_attachments_body.rb +249 -0
  153. data/lib/smart_recruiters/models/job_input.rb +341 -0
  154. data/lib/smart_recruiters/models/job_job.rb +215 -0
  155. data/lib/smart_recruiters/models/job_job_actions.rb +211 -0
  156. data/lib/smart_recruiters/models/job_location_input.rb +252 -0
  157. data/lib/smart_recruiters/models/job_note.rb +202 -0
  158. data/lib/smart_recruiters/models/job_position.rb +256 -0
  159. data/lib/smart_recruiters/models/job_position_input.rb +282 -0
  160. data/lib/smart_recruiters/models/job_positions.rb +218 -0
  161. data/lib/smart_recruiters/models/job_property.rb +225 -0
  162. data/lib/smart_recruiters/models/job_property_definition.rb +300 -0
  163. data/lib/smart_recruiters/models/job_property_definition_creation_request.rb +282 -0
  164. data/lib/smart_recruiters/models/job_property_definition_list.rb +208 -0
  165. data/lib/smart_recruiters/models/job_property_input.rb +220 -0
  166. data/lib/smart_recruiters/models/job_property_value.rb +206 -0
  167. data/lib/smart_recruiters/models/job_property_value_definition.rb +220 -0
  168. data/lib/smart_recruiters/models/job_property_value_definition_list.rb +208 -0
  169. data/lib/smart_recruiters/models/job_status.rb +25 -0
  170. data/lib/smart_recruiters/models/job_status_history.rb +216 -0
  171. data/lib/smart_recruiters/models/job_status_history_actions.rb +202 -0
  172. data/lib/smart_recruiters/models/job_status_history_content.rb +220 -0
  173. data/lib/smart_recruiters/models/job_status_update.rb +202 -0
  174. data/lib/smart_recruiters/models/job_summary.rb +302 -0
  175. data/lib/smart_recruiters/models/job_webhook_payload.rb +202 -0
  176. data/lib/smart_recruiters/models/jobs.rb +235 -0
  177. data/lib/smart_recruiters/models/json_patch.rb +192 -0
  178. data/lib/smart_recruiters/models/json_pointer.rb +188 -0
  179. data/lib/smart_recruiters/models/label_translation.rb +216 -0
  180. data/lib/smart_recruiters/models/label_translations.rb +192 -0
  181. data/lib/smart_recruiters/models/labeled.rb +202 -0
  182. data/lib/smart_recruiters/models/language.rb +220 -0
  183. data/lib/smart_recruiters/models/language_code.rb +87 -0
  184. data/lib/smart_recruiters/models/location.rb +251 -0
  185. data/lib/smart_recruiters/models/model_when.rb +189 -0
  186. data/lib/smart_recruiters/models/offer_approval_webhook_payload.rb +244 -0
  187. data/lib/smart_recruiters/models/offer_properties_category.rb +208 -0
  188. data/lib/smart_recruiters/models/offer_properties_definition.rb +199 -0
  189. data/lib/smart_recruiters/models/offer_property_definition.rb +258 -0
  190. data/lib/smart_recruiters/models/offer_webhook_payload.rb +230 -0
  191. data/lib/smart_recruiters/models/onboarding_assignments_completed_webhook_payload.rb +216 -0
  192. data/lib/smart_recruiters/models/onboarding_high_priority_assignments_completed_webhook_payload.rb +216 -0
  193. data/lib/smart_recruiters/models/onboarding_process_webhook_payload.rb +216 -0
  194. data/lib/smart_recruiters/models/onboarding_status.rb +236 -0
  195. data/lib/smart_recruiters/models/one_of_candidate_property_value.rb +188 -0
  196. data/lib/smart_recruiters/models/one_of_consent_requests_results_results_items.rb +188 -0
  197. data/lib/smart_recruiters/models/one_of_json_patch_items.rb +188 -0
  198. data/lib/smart_recruiters/models/path.rb +202 -0
  199. data/lib/smart_recruiters/models/personal_details.rb +242 -0
  200. data/lib/smart_recruiters/models/position_webhook_payload.rb +216 -0
  201. data/lib/smart_recruiters/models/posting_status.rb +21 -0
  202. data/lib/smart_recruiters/models/privacy_policy.rb +206 -0
  203. data/lib/smart_recruiters/models/properties.rb +208 -0
  204. data/lib/smart_recruiters/models/property.rb +211 -0
  205. data/lib/smart_recruiters/models/publication.rb +244 -0
  206. data/lib/smart_recruiters/models/publication_list.rb +204 -0
  207. data/lib/smart_recruiters/models/publication_list_item.rb +239 -0
  208. data/lib/smart_recruiters/models/relation_job_property_value.rb +211 -0
  209. data/lib/smart_recruiters/models/review_webhook_payload.rb +216 -0
  210. data/lib/smart_recruiters/models/salary_range.rb +215 -0
  211. data/lib/smart_recruiters/models/screening_answer.rb +313 -0
  212. data/lib/smart_recruiters/models/screening_answers.rb +218 -0
  213. data/lib/smart_recruiters/models/screening_question.rb +246 -0
  214. data/lib/smart_recruiters/models/screening_question_answer.rb +218 -0
  215. data/lib/smart_recruiters/models/screening_question_field.rb +315 -0
  216. data/lib/smart_recruiters/models/screening_questions_answers_webhook_payload.rb +230 -0
  217. data/lib/smart_recruiters/models/secret_key_payload.rb +197 -0
  218. data/lib/smart_recruiters/models/source.rb +244 -0
  219. data/lib/smart_recruiters/models/source_actions.rb +202 -0
  220. data/lib/smart_recruiters/models/source_definition.rb +230 -0
  221. data/lib/smart_recruiters/models/source_details.rb +225 -0
  222. data/lib/smart_recruiters/models/source_types.rb +218 -0
  223. data/lib/smart_recruiters/models/source_types_actions.rb +202 -0
  224. data/lib/smart_recruiters/models/source_types_content.rb +246 -0
  225. data/lib/smart_recruiters/models/sources.rb +246 -0
  226. data/lib/smart_recruiters/models/subscription.rb +270 -0
  227. data/lib/smart_recruiters/models/subscription_request.rb +236 -0
  228. data/lib/smart_recruiters/models/subscriptions.rb +192 -0
  229. data/lib/smart_recruiters/models/user_identity.rb +215 -0
  230. data/lib/smart_recruiters/models/uuid.rb +188 -0
  231. data/lib/smart_recruiters/models/valid_job_status.rb +24 -0
  232. data/lib/smart_recruiters/models/web.rb +233 -0
  233. data/lib/smart_recruiters/models/web_profile.rb +233 -0
  234. data/lib/smart_recruiters/version.rb +5 -0
  235. data/lib/smart_recruiters.rb +46 -0
  236. data/open_api_smart_recruiters_sdk.gemspec +45 -0
  237. data/sig/smart_recruiters.rbs +4 -0
  238. metadata +367 -0
@@ -0,0 +1,262 @@
1
+ require 'date'
2
+
3
+ module SmartRecruiters
4
+ class AllOfCandidateDetailsSecondaryAssignmentsItems
5
+ attr_accessor :status
6
+
7
+ attr_accessor :sub_status
8
+
9
+ attr_accessor :starts_on
10
+
11
+ attr_accessor :source
12
+
13
+ attr_accessor :reason_of_rejection
14
+
15
+ attr_accessor :reason_of_withdrawal
16
+
17
+ attr_accessor :actions
18
+
19
+ attr_accessor :job
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'status' => :'status',
25
+ :'sub_status' => :'subStatus',
26
+ :'starts_on' => :'startsOn',
27
+ :'source' => :'source',
28
+ :'reason_of_rejection' => :'reasonOfRejection',
29
+ :'reason_of_withdrawal' => :'reasonOfWithdrawal',
30
+ :'actions' => :'actions',
31
+ :'job' => :'job'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'status' => :'',
39
+ :'sub_status' => :'',
40
+ :'starts_on' => :'',
41
+ :'source' => :'',
42
+ :'reason_of_rejection' => :'',
43
+ :'reason_of_withdrawal' => :'',
44
+ :'actions' => :'',
45
+ :'job' => :''
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
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 `SmartRecruiters::AllOfCandidateDetailsSecondaryAssignmentsItems` 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 `SmartRecruiters::AllOfCandidateDetailsSecondaryAssignmentsItems`. 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
+ # call parent's initialize
71
+ super(attributes)
72
+
73
+ if attributes.key?(:'status')
74
+ self.status = attributes[:'status']
75
+ end
76
+
77
+ if attributes.key?(:'sub_status')
78
+ self.sub_status = attributes[:'sub_status']
79
+ end
80
+
81
+ if attributes.key?(:'starts_on')
82
+ self.starts_on = attributes[:'starts_on']
83
+ end
84
+
85
+ if attributes.key?(:'source')
86
+ self.source = attributes[:'source']
87
+ end
88
+
89
+ if attributes.key?(:'reason_of_rejection')
90
+ self.reason_of_rejection = attributes[:'reason_of_rejection']
91
+ end
92
+
93
+ if attributes.key?(:'reason_of_withdrawal')
94
+ self.reason_of_withdrawal = attributes[:'reason_of_withdrawal']
95
+ end
96
+
97
+ if attributes.key?(:'actions')
98
+ self.actions = attributes[:'actions']
99
+ end
100
+
101
+ if attributes.key?(:'job')
102
+ self.job = attributes[:'job']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = super
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ status == o.status &&
125
+ sub_status == o.sub_status &&
126
+ starts_on == o.starts_on &&
127
+ source == o.source &&
128
+ reason_of_rejection == o.reason_of_rejection &&
129
+ reason_of_withdrawal == o.reason_of_withdrawal &&
130
+ actions == o.actions &&
131
+ job == o.job && super(o)
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Integer] Hash code
142
+ def hash
143
+ [status, sub_status, starts_on, source, reason_of_rejection, reason_of_withdrawal, actions, job].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def self.build_from_hash(attributes)
150
+ new.build_from_hash(attributes)
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+ super(attributes)
159
+ self.class.openapi_types.each_pair do |key, type|
160
+ if type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
164
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
165
+ end
166
+ elsif !attributes[self.class.attribute_map[key]].nil?
167
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
169
+ self.send("#{key}=", nil)
170
+ end
171
+ end
172
+
173
+ self
174
+ end
175
+
176
+ # Deserializes the data based on type
177
+ # @param string type Data type
178
+ # @param string value Value to be deserialized
179
+ # @return [Object] Deserialized data
180
+ def _deserialize(type, value)
181
+ case type.to_sym
182
+ when :DateTime
183
+ DateTime.parse(value)
184
+ when :Date
185
+ Date.parse(value)
186
+ when :String
187
+ value.to_s
188
+ when :Integer
189
+ value.to_i
190
+ when :Float
191
+ value.to_f
192
+ when :Boolean
193
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
194
+ true
195
+ else
196
+ false
197
+ end
198
+ when :Object
199
+ # generic object (usually a Hash), return directly
200
+ value
201
+ when /\AArray<(?<inner_type>.+)>\z/
202
+ inner_type = Regexp.last_match[:inner_type]
203
+ value.map { |v| _deserialize(inner_type, v) }
204
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
205
+ k_type = Regexp.last_match[:k_type]
206
+ v_type = Regexp.last_match[:v_type]
207
+ {}.tap do |hash|
208
+ value.each do |k, v|
209
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
210
+ end
211
+ end
212
+ else # model
213
+ SmartRecruiters.const_get(type).build_from_hash(value)
214
+ end
215
+ end
216
+
217
+ # Returns the string representation of the object
218
+ # @return [String] String presentation of the object
219
+ def to_s
220
+ to_hash.to_s
221
+ end
222
+
223
+ # to_body is an alias to to_hash (backward compatibility)
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_body
226
+ to_hash
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = super
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end end
262
+ end
@@ -0,0 +1,227 @@
1
+ require 'date'
2
+
3
+ module SmartRecruiters
4
+ class AnswerField
5
+ attr_accessor :id
6
+
7
+ # Field label shown to candidate - ignore when empty
8
+ attr_accessor :label
9
+
10
+ # Multiple values may be used for example for Multiselect Dropdown question
11
+ attr_accessor :values
12
+
13
+ # Attribute mapping from ruby-style variable name to JSON key.
14
+ def self.attribute_map
15
+ {
16
+ :'id' => :'id',
17
+ :'label' => :'label',
18
+ :'values' => :'values'
19
+ }
20
+ end
21
+
22
+ # Attribute type mapping.
23
+ def self.openapi_types
24
+ {
25
+ :'id' => :'Object',
26
+ :'label' => :'Object',
27
+ :'values' => :'Object'
28
+ }
29
+ end
30
+
31
+ # List of attributes with nullable: true
32
+ def self.openapi_nullable
33
+ Set.new([
34
+ ])
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ if (!attributes.is_a?(Hash))
41
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmartRecruiters::AnswerField` initialize method"
42
+ end
43
+
44
+ # check to see if the attribute exists and convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h|
46
+ if (!self.class.attribute_map.key?(k.to_sym))
47
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmartRecruiters::AnswerField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
48
+ end
49
+ h[k.to_sym] = v
50
+ }
51
+
52
+ if attributes.key?(:'id')
53
+ self.id = attributes[:'id']
54
+ end
55
+
56
+ if attributes.key?(:'label')
57
+ self.label = attributes[:'label']
58
+ end
59
+
60
+ if attributes.key?(:'values')
61
+ if (value = attributes[:'values']).is_a?(Array)
62
+ self.values = value
63
+ end
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ if @id.nil?
72
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
73
+ end
74
+
75
+ if @values.nil?
76
+ invalid_properties.push('invalid value for "values", values cannot be nil.')
77
+ end
78
+
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
+ return false if @id.nil?
86
+ return false if @values.nil?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ id == o.id &&
96
+ label == o.label &&
97
+ values == o.values
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Integer] Hash code
108
+ def hash
109
+ [id, label, values].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def self.build_from_hash(attributes)
116
+ new.build_from_hash(attributes)
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ self.class.openapi_types.each_pair do |key, type|
125
+ if type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ end
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ SmartRecruiters.const_get(type).build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end end
227
+ end
@@ -0,0 +1,216 @@
1
+ require 'date'
2
+
3
+ module SmartRecruiters
4
+ class AnswerFieldValue
5
+ # Value text or value ID - depends on question definition
6
+ attr_accessor :id
7
+
8
+ # Value text shown to candidate
9
+ attr_accessor :label
10
+
11
+ # Attribute mapping from ruby-style variable name to JSON key.
12
+ def self.attribute_map
13
+ {
14
+ :'id' => :'id',
15
+ :'label' => :'label'
16
+ }
17
+ end
18
+
19
+ # Attribute type mapping.
20
+ def self.openapi_types
21
+ {
22
+ :'id' => :'Object',
23
+ :'label' => :'Object'
24
+ }
25
+ end
26
+
27
+ # List of attributes with nullable: true
28
+ def self.openapi_nullable
29
+ Set.new([
30
+ ])
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ if (!attributes.is_a?(Hash))
37
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmartRecruiters::AnswerFieldValue` initialize method"
38
+ end
39
+
40
+ # check to see if the attribute exists and convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}) { |(k, v), h|
42
+ if (!self.class.attribute_map.key?(k.to_sym))
43
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmartRecruiters::AnswerFieldValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
44
+ end
45
+ h[k.to_sym] = v
46
+ }
47
+
48
+ if attributes.key?(:'id')
49
+ self.id = attributes[:'id']
50
+ end
51
+
52
+ if attributes.key?(:'label')
53
+ self.label = attributes[:'label']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ if @id.nil?
62
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
63
+ end
64
+
65
+ if @label.nil?
66
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
67
+ end
68
+
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ return false if @id.nil?
76
+ return false if @label.nil?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ id == o.id &&
86
+ label == o.label
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [id, label].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
123
+ self.send("#{key}=", nil)
124
+ end
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ SmartRecruiters.const_get(type).build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end end
216
+ end