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