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,259 @@
1
+
2
+
3
+ require 'date'
4
+
5
+ module SmartRecruiters
6
+ class ApplyApiError
7
+ attr_accessor :id
8
+
9
+ attr_accessor :code
10
+
11
+ attr_accessor :message
12
+
13
+ class EnumAttributeValidator
14
+ attr_reader :datatype
15
+ attr_reader :allowable_values
16
+
17
+ def initialize(datatype, allowable_values)
18
+ @allowable_values = allowable_values.map do |value|
19
+ case datatype.to_s
20
+ when /Integer/i
21
+ value.to_i
22
+ when /Float/i
23
+ value.to_f
24
+ else
25
+ value
26
+ end
27
+ end
28
+ end
29
+
30
+ def valid?(value)
31
+ !value || allowable_values.include?(value)
32
+ end
33
+ end
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'id' => :'id',
39
+ :'code' => :'code',
40
+ :'message' => :'message'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'id' => :'Object',
48
+ :'code' => :'Object',
49
+ :'message' => :'Object'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmartRecruiters::ApplyApiError` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmartRecruiters::ApplyApiError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'id')
75
+ self.id = attributes[:'id']
76
+ end
77
+
78
+ if attributes.key?(:'code')
79
+ self.code = attributes[:'code']
80
+ end
81
+
82
+ if attributes.key?(:'message')
83
+ self.message = attributes[:'message']
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ if @id.nil?
92
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
93
+ end
94
+
95
+ if @code.nil?
96
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return false if @id.nil?
106
+ return false if @code.nil?
107
+ code_validator = EnumAttributeValidator.new('Object', ['INVALID_REQUEST', 'INVALID_INPUT', 'DATA_VALIDATION_ERROR', 'RESOURCE_NOT_FOUND_ERROR', 'COMPANY_NOT_FOUND_ERROR', 'COMPANY_RETRIEVAL_ERROR', 'APPLY_API_ERROR', 'FILE_UPLOAD_ERROR', 'FILE_API_ERROR', 'INVALID_API_KEY_ERROR', 'UNAUTHORIZED', 'REST_CALL_TIMEOUT'])
108
+ return false unless code_validator.valid?(@code)
109
+ true
110
+ end
111
+
112
+ # Custom attribute writer method checking allowed values (enum).
113
+ # @param [Object] code Object to be assigned
114
+ def code=(code)
115
+ validator = EnumAttributeValidator.new('Object', ['INVALID_REQUEST', 'INVALID_INPUT', 'DATA_VALIDATION_ERROR', 'RESOURCE_NOT_FOUND_ERROR', 'COMPANY_NOT_FOUND_ERROR', 'COMPANY_RETRIEVAL_ERROR', 'APPLY_API_ERROR', 'FILE_UPLOAD_ERROR', 'FILE_API_ERROR', 'INVALID_API_KEY_ERROR', 'UNAUTHORIZED', 'REST_CALL_TIMEOUT'])
116
+ unless validator.valid?(code)
117
+ fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
118
+ end
119
+ @code = code
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ id == o.id &&
128
+ code == o.code &&
129
+ message == o.message
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [id, code, message].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ new.build_from_hash(attributes)
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ self.class.openapi_types.each_pair do |key, type|
157
+ if type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
166
+ self.send("#{key}=", nil)
167
+ end
168
+ end
169
+
170
+ self
171
+ end
172
+
173
+ # Deserializes the data based on type
174
+ # @param string type Data type
175
+ # @param string value Value to be deserialized
176
+ # @return [Object] Deserialized data
177
+ def _deserialize(type, value)
178
+ case type.to_sym
179
+ when :DateTime
180
+ DateTime.parse(value)
181
+ when :Date
182
+ Date.parse(value)
183
+ when :String
184
+ value.to_s
185
+ when :Integer
186
+ value.to_i
187
+ when :Float
188
+ value.to_f
189
+ when :Boolean
190
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
191
+ true
192
+ else
193
+ false
194
+ end
195
+ when :Object
196
+ # generic object (usually a Hash), return directly
197
+ value
198
+ when /\AArray<(?<inner_type>.+)>\z/
199
+ inner_type = Regexp.last_match[:inner_type]
200
+ value.map { |v| _deserialize(inner_type, v) }
201
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
202
+ k_type = Regexp.last_match[:k_type]
203
+ v_type = Regexp.last_match[:v_type]
204
+ {}.tap do |hash|
205
+ value.each do |k, v|
206
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
+ end
208
+ end
209
+ else # model
210
+ SmartRecruiters.const_get(type).build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map { |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end end
259
+ end
@@ -0,0 +1,386 @@
1
+
2
+
3
+ require 'date'
4
+
5
+ module SmartRecruiters
6
+ class ApplyApiRequest
7
+ attr_accessor :first_name
8
+
9
+ attr_accessor :last_name
10
+
11
+ attr_accessor :email
12
+
13
+ attr_accessor :create_join_link
14
+
15
+ attr_accessor :phone_number
16
+
17
+ attr_accessor :location
18
+
19
+ attr_accessor :web
20
+
21
+ attr_accessor :tags
22
+
23
+ attr_accessor :education
24
+
25
+ attr_accessor :experience
26
+
27
+ attr_accessor :source_details
28
+
29
+ attr_accessor :resume
30
+
31
+ attr_accessor :avatar
32
+
33
+ attr_accessor :attachments
34
+
35
+ attr_accessor :answers
36
+
37
+ attr_accessor :message_to_hiring_manager
38
+
39
+ attr_accessor :consent
40
+
41
+ attr_accessor :consent_decisions
42
+
43
+ attr_accessor :internal
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'first_name' => :'firstName',
49
+ :'last_name' => :'lastName',
50
+ :'email' => :'email',
51
+ :'create_join_link' => :'createJoinLink',
52
+ :'phone_number' => :'phoneNumber',
53
+ :'location' => :'location',
54
+ :'web' => :'web',
55
+ :'tags' => :'tags',
56
+ :'education' => :'education',
57
+ :'experience' => :'experience',
58
+ :'source_details' => :'sourceDetails',
59
+ :'resume' => :'resume',
60
+ :'avatar' => :'avatar',
61
+ :'attachments' => :'attachments',
62
+ :'answers' => :'answers',
63
+ :'message_to_hiring_manager' => :'messageToHiringManager',
64
+ :'consent' => :'consent',
65
+ :'consent_decisions' => :'consentDecisions',
66
+ :'internal' => :'internal'
67
+ }
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'first_name' => :'Object',
74
+ :'last_name' => :'Object',
75
+ :'email' => :'Object',
76
+ :'create_join_link' => :'Object',
77
+ :'phone_number' => :'Object',
78
+ :'location' => :'Object',
79
+ :'web' => :'Object',
80
+ :'tags' => :'Object',
81
+ :'education' => :'Object',
82
+ :'experience' => :'Object',
83
+ :'source_details' => :'Object',
84
+ :'resume' => :'Object',
85
+ :'avatar' => :'Object',
86
+ :'attachments' => :'Object',
87
+ :'answers' => :'Object',
88
+ :'message_to_hiring_manager' => :'Object',
89
+ :'consent' => :'Object',
90
+ :'consent_decisions' => :'Object',
91
+ :'internal' => :'Object'
92
+ }
93
+ end
94
+
95
+ # List of attributes with nullable: true
96
+ def self.openapi_nullable
97
+ Set.new([
98
+ ])
99
+ end
100
+
101
+ # Initializes the object
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ def initialize(attributes = {})
104
+ if (!attributes.is_a?(Hash))
105
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmartRecruiters::ApplyApiRequest` initialize method"
106
+ end
107
+
108
+ # check to see if the attribute exists and convert string to symbol for hash key
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!self.class.attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmartRecruiters::ApplyApiRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'first_name')
117
+ self.first_name = attributes[:'first_name']
118
+ end
119
+
120
+ if attributes.key?(:'last_name')
121
+ self.last_name = attributes[:'last_name']
122
+ end
123
+
124
+ if attributes.key?(:'email')
125
+ self.email = attributes[:'email']
126
+ end
127
+
128
+ if attributes.key?(:'create_join_link')
129
+ self.create_join_link = attributes[:'create_join_link']
130
+ end
131
+
132
+ if attributes.key?(:'phone_number')
133
+ self.phone_number = attributes[:'phone_number']
134
+ end
135
+
136
+ if attributes.key?(:'location')
137
+ self.location = attributes[:'location']
138
+ end
139
+
140
+ if attributes.key?(:'web')
141
+ self.web = attributes[:'web']
142
+ end
143
+
144
+ if attributes.key?(:'tags')
145
+ if (value = attributes[:'tags']).is_a?(Array)
146
+ self.tags = value
147
+ end
148
+ end
149
+
150
+ if attributes.key?(:'education')
151
+ if (value = attributes[:'education']).is_a?(Array)
152
+ self.education = value
153
+ end
154
+ end
155
+
156
+ if attributes.key?(:'experience')
157
+ if (value = attributes[:'experience']).is_a?(Array)
158
+ self.experience = value
159
+ end
160
+ end
161
+
162
+ if attributes.key?(:'source_details')
163
+ self.source_details = attributes[:'source_details']
164
+ end
165
+
166
+ if attributes.key?(:'resume')
167
+ self.resume = attributes[:'resume']
168
+ end
169
+
170
+ if attributes.key?(:'avatar')
171
+ self.avatar = attributes[:'avatar']
172
+ end
173
+
174
+ if attributes.key?(:'attachments')
175
+ if (value = attributes[:'attachments']).is_a?(Array)
176
+ self.attachments = value
177
+ end
178
+ end
179
+
180
+ if attributes.key?(:'answers')
181
+ if (value = attributes[:'answers']).is_a?(Array)
182
+ self.answers = value
183
+ end
184
+ end
185
+
186
+ if attributes.key?(:'message_to_hiring_manager')
187
+ self.message_to_hiring_manager = attributes[:'message_to_hiring_manager']
188
+ end
189
+
190
+ if attributes.key?(:'consent')
191
+ self.consent = attributes[:'consent']
192
+ end
193
+
194
+ if attributes.key?(:'consent_decisions')
195
+ if (value = attributes[:'consent_decisions']).is_a?(Hash)
196
+ self.consent_decisions = value
197
+ end
198
+ end
199
+
200
+ if attributes.key?(:'internal')
201
+ self.internal = attributes[:'internal']
202
+ end
203
+ end
204
+
205
+ # Show invalid properties with the reasons. Usually used together with valid?
206
+ # @return Array for valid properties with the reasons
207
+ def list_invalid_properties
208
+ invalid_properties = Array.new
209
+ if @first_name.nil?
210
+ invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
211
+ end
212
+
213
+ if @last_name.nil?
214
+ invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
215
+ end
216
+
217
+ if @email.nil?
218
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
219
+ end
220
+
221
+ invalid_properties
222
+ end
223
+
224
+ # Check to see if the all the properties in the model are valid
225
+ # @return true if the model is valid
226
+ def valid?
227
+ return false if @first_name.nil?
228
+ return false if @last_name.nil?
229
+ return false if @email.nil?
230
+ true
231
+ end
232
+
233
+ # Checks equality by comparing each attribute.
234
+ # @param [Object] Object to be compared
235
+ def ==(o)
236
+ return true if self.equal?(o)
237
+ self.class == o.class &&
238
+ first_name == o.first_name &&
239
+ last_name == o.last_name &&
240
+ email == o.email &&
241
+ create_join_link == o.create_join_link &&
242
+ phone_number == o.phone_number &&
243
+ location == o.location &&
244
+ web == o.web &&
245
+ tags == o.tags &&
246
+ education == o.education &&
247
+ experience == o.experience &&
248
+ source_details == o.source_details &&
249
+ resume == o.resume &&
250
+ avatar == o.avatar &&
251
+ attachments == o.attachments &&
252
+ answers == o.answers &&
253
+ message_to_hiring_manager == o.message_to_hiring_manager &&
254
+ consent == o.consent &&
255
+ consent_decisions == o.consent_decisions &&
256
+ internal == o.internal
257
+ end
258
+
259
+ # @see the `==` method
260
+ # @param [Object] Object to be compared
261
+ def eql?(o)
262
+ self == o
263
+ end
264
+
265
+ # Calculates hash code according to all attributes.
266
+ # @return [Integer] Hash code
267
+ def hash
268
+ [first_name, last_name, email, create_join_link, phone_number, location, web, tags, education, experience, source_details, resume, avatar, attachments, answers, message_to_hiring_manager, consent, consent_decisions, internal].hash
269
+ end
270
+
271
+ # Builds the object from hash
272
+ # @param [Hash] attributes Model attributes in the form of hash
273
+ # @return [Object] Returns the model itself
274
+ def self.build_from_hash(attributes)
275
+ new.build_from_hash(attributes)
276
+ end
277
+
278
+ # Builds the object from hash
279
+ # @param [Hash] attributes Model attributes in the form of hash
280
+ # @return [Object] Returns the model itself
281
+ def build_from_hash(attributes)
282
+ return nil unless attributes.is_a?(Hash)
283
+ self.class.openapi_types.each_pair do |key, type|
284
+ if type =~ /\AArray<(.*)>/i
285
+ # check to ensure the input is an array given that the attribute
286
+ # is documented as an array but the input is not
287
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
288
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
289
+ end
290
+ elsif !attributes[self.class.attribute_map[key]].nil?
291
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
292
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
293
+ self.send("#{key}=", nil)
294
+ end
295
+ end
296
+
297
+ self
298
+ end
299
+
300
+ # Deserializes the data based on type
301
+ # @param string type Data type
302
+ # @param string value Value to be deserialized
303
+ # @return [Object] Deserialized data
304
+ def _deserialize(type, value)
305
+ case type.to_sym
306
+ when :DateTime
307
+ DateTime.parse(value)
308
+ when :Date
309
+ Date.parse(value)
310
+ when :String
311
+ value.to_s
312
+ when :Integer
313
+ value.to_i
314
+ when :Float
315
+ value.to_f
316
+ when :Boolean
317
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
318
+ true
319
+ else
320
+ false
321
+ end
322
+ when :Object
323
+ # generic object (usually a Hash), return directly
324
+ value
325
+ when /\AArray<(?<inner_type>.+)>\z/
326
+ inner_type = Regexp.last_match[:inner_type]
327
+ value.map { |v| _deserialize(inner_type, v) }
328
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
329
+ k_type = Regexp.last_match[:k_type]
330
+ v_type = Regexp.last_match[:v_type]
331
+ {}.tap do |hash|
332
+ value.each do |k, v|
333
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
334
+ end
335
+ end
336
+ else # model
337
+ SmartRecruiters.const_get(type).build_from_hash(value)
338
+ end
339
+ end
340
+
341
+ # Returns the string representation of the object
342
+ # @return [String] String presentation of the object
343
+ def to_s
344
+ to_hash.to_s
345
+ end
346
+
347
+ # to_body is an alias to to_hash (backward compatibility)
348
+ # @return [Hash] Returns the object in the form of hash
349
+ def to_body
350
+ to_hash
351
+ end
352
+
353
+ # Returns the object in the form of hash
354
+ # @return [Hash] Returns the object in the form of hash
355
+ def to_hash
356
+ hash = {}
357
+ self.class.attribute_map.each_pair do |attr, param|
358
+ value = self.send(attr)
359
+ if value.nil?
360
+ is_nullable = self.class.openapi_nullable.include?(attr)
361
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
362
+ end
363
+
364
+ hash[param] = _to_hash(value)
365
+ end
366
+ hash
367
+ end
368
+
369
+ # Outputs non-array value in the form of hash
370
+ # For object, use to_hash. Otherwise, just return the value
371
+ # @param [Object] value Any valid value
372
+ # @return [Hash] Returns the value in the form of hash
373
+ def _to_hash(value)
374
+ if value.is_a?(Array)
375
+ value.compact.map { |v| _to_hash(v) }
376
+ elsif value.is_a?(Hash)
377
+ {}.tap do |hash|
378
+ value.each { |k, v| hash[k] = _to_hash(v) }
379
+ end
380
+ elsif value.respond_to? :to_hash
381
+ value.to_hash
382
+ else
383
+ value
384
+ end
385
+ end end
386
+ end