merge_ats_client 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +208 -0
- data/Rakefile +10 -0
- data/config.json +2 -0
- data/docs/AccessRoleEnum.md +15 -0
- data/docs/AccountIntegration.md +28 -0
- data/docs/AccountToken.md +18 -0
- data/docs/AccountTokenApi.md +79 -0
- data/docs/ActivitiesApi.md +181 -0
- data/docs/Activity.md +34 -0
- data/docs/ActivityTypeEnum.md +15 -0
- data/docs/Application.md +38 -0
- data/docs/ApplicationRequest.md +34 -0
- data/docs/ApplicationsApi.md +351 -0
- data/docs/Attachment.md +28 -0
- data/docs/AttachmentsApi.md +177 -0
- data/docs/AvailableActions.md +22 -0
- data/docs/AvailableActionsApi.md +79 -0
- data/docs/Candidate.md +54 -0
- data/docs/CandidateRequest.md +46 -0
- data/docs/CandidatesApi.md +259 -0
- data/docs/DataPassthrough.md +24 -0
- data/docs/DataPassthroughRequest.md +26 -0
- data/docs/Department.md +24 -0
- data/docs/DepartmentsApi.md +175 -0
- data/docs/DisabilityStatusEnum.md +15 -0
- data/docs/EEOC.md +34 -0
- data/docs/EeocsApi.md +181 -0
- data/docs/EmailAddress.md +20 -0
- data/docs/EmailAddressRequest.md +20 -0
- data/docs/EmailAddressTypeEnum.md +15 -0
- data/docs/EndUserDetails.md +24 -0
- data/docs/EndUserDetailsRequest.md +26 -0
- data/docs/GenderEnum.md +15 -0
- data/docs/GenerateKeyApi.md +79 -0
- data/docs/GenerateRemoteKeyRequest.md +18 -0
- data/docs/InterviewsApi.md +185 -0
- data/docs/Job.md +40 -0
- data/docs/JobInterviewStage.md +26 -0
- data/docs/JobInterviewStagesApi.md +181 -0
- data/docs/JobStatusEnum.md +15 -0
- data/docs/JobsApi.md +179 -0
- data/docs/LinkToken.md +20 -0
- data/docs/LinkTokenApi.md +79 -0
- data/docs/MethodEnum.md +15 -0
- data/docs/ModelOperation.md +22 -0
- data/docs/Offer.md +36 -0
- data/docs/OfferStatusEnum.md +15 -0
- data/docs/OffersApi.md +183 -0
- data/docs/Office.md +26 -0
- data/docs/OfficesApi.md +175 -0
- data/docs/OverallRecommendationEnum.md +15 -0
- data/docs/PaginatedActivityList.md +22 -0
- data/docs/PaginatedApplicationList.md +22 -0
- data/docs/PaginatedAttachmentList.md +22 -0
- data/docs/PaginatedCandidateList.md +22 -0
- data/docs/PaginatedDepartmentList.md +22 -0
- data/docs/PaginatedEEOCList.md +22 -0
- data/docs/PaginatedJobInterviewStageList.md +22 -0
- data/docs/PaginatedJobList.md +22 -0
- data/docs/PaginatedOfferList.md +22 -0
- data/docs/PaginatedOfficeList.md +22 -0
- data/docs/PaginatedRejectReasonList.md +22 -0
- data/docs/PaginatedRemoteUserList.md +22 -0
- data/docs/PaginatedScheduledInterviewList.md +22 -0
- data/docs/PaginatedScorecardList.md +22 -0
- data/docs/PaginatedTagList.md +22 -0
- data/docs/PassthroughApi.md +81 -0
- data/docs/PatchedApplicationRequest.md +34 -0
- data/docs/PhoneNumber.md +20 -0
- data/docs/PhoneNumberRequest.md +20 -0
- data/docs/PhoneNumberTypeEnum.md +15 -0
- data/docs/RaceEnum.md +15 -0
- data/docs/RegenerateKeyApi.md +79 -0
- data/docs/RejectReason.md +24 -0
- data/docs/RejectReasonsApi.md +175 -0
- data/docs/RemoteData.md +20 -0
- data/docs/RemoteDataRequest.md +20 -0
- data/docs/RemoteKey.md +20 -0
- data/docs/RemoteKeyForRegeneration.md +18 -0
- data/docs/RemoteKeyForRegenerationRequest.md +18 -0
- data/docs/RemoteResponse.md +26 -0
- data/docs/RemoteUser.md +34 -0
- data/docs/ScheduledInterview.md +42 -0
- data/docs/ScheduledInterviewStatusEnum.md +15 -0
- data/docs/Scorecard.md +34 -0
- data/docs/ScorecardsApi.md +185 -0
- data/docs/SyncStatus.md +28 -0
- data/docs/SyncStatusApi.md +79 -0
- data/docs/Tag.md +22 -0
- data/docs/TagsApi.md +97 -0
- data/docs/Url.md +20 -0
- data/docs/UrlRequest.md +20 -0
- data/docs/UrlTypeEnum.md +15 -0
- data/docs/UsersApi.md +175 -0
- data/docs/VeteranStatusEnum.md +15 -0
- data/docs/VisibilityEnum.md +15 -0
- data/git_push.sh +58 -0
- data/lib/merge_ats_client.rb +131 -0
- data/lib/merge_ats_client/api/account_token_api.rb +83 -0
- data/lib/merge_ats_client/api/activities_api.rb +196 -0
- data/lib/merge_ats_client/api/applications_api.rb +366 -0
- data/lib/merge_ats_client/api/attachments_api.rb +182 -0
- data/lib/merge_ats_client/api/available_actions_api.rb +84 -0
- data/lib/merge_ats_client/api/candidates_api.rb +269 -0
- data/lib/merge_ats_client/api/departments_api.rb +179 -0
- data/lib/merge_ats_client/api/eeocs_api.rb +196 -0
- data/lib/merge_ats_client/api/generate_key_api.rb +85 -0
- data/lib/merge_ats_client/api/interviews_api.rb +202 -0
- data/lib/merge_ats_client/api/job_interview_stages_api.rb +196 -0
- data/lib/merge_ats_client/api/jobs_api.rb +193 -0
- data/lib/merge_ats_client/api/link_token_api.rb +85 -0
- data/lib/merge_ats_client/api/offers_api.rb +199 -0
- data/lib/merge_ats_client/api/offices_api.rb +179 -0
- data/lib/merge_ats_client/api/passthrough_api.rb +92 -0
- data/lib/merge_ats_client/api/regenerate_key_api.rb +85 -0
- data/lib/merge_ats_client/api/reject_reasons_api.rb +179 -0
- data/lib/merge_ats_client/api/scorecards_api.rb +202 -0
- data/lib/merge_ats_client/api/sync_status_api.rb +84 -0
- data/lib/merge_ats_client/api/tags_api.rb +108 -0
- data/lib/merge_ats_client/api/users_api.rb +179 -0
- data/lib/merge_ats_client/api_client.rb +390 -0
- data/lib/merge_ats_client/api_error.rb +57 -0
- data/lib/merge_ats_client/configuration.rb +279 -0
- data/lib/merge_ats_client/models/access_role_enum.rb +38 -0
- data/lib/merge_ats_client/models/account_integration.rb +325 -0
- data/lib/merge_ats_client/models/account_token.rb +223 -0
- data/lib/merge_ats_client/models/activity.rb +308 -0
- data/lib/merge_ats_client/models/activity_type_enum.rb +36 -0
- data/lib/merge_ats_client/models/application.rb +330 -0
- data/lib/merge_ats_client/models/application_request.rb +309 -0
- data/lib/merge_ats_client/models/attachment.rb +289 -0
- data/lib/merge_ats_client/models/available_actions.rb +249 -0
- data/lib/merge_ats_client/models/candidate.rb +420 -0
- data/lib/merge_ats_client/models/candidate_request.rb +377 -0
- data/lib/merge_ats_client/models/data_passthrough.rb +262 -0
- data/lib/merge_ats_client/models/data_passthrough_request.rb +271 -0
- data/lib/merge_ats_client/models/department.rb +253 -0
- data/lib/merge_ats_client/models/disability_status_enum.rb +36 -0
- data/lib/merge_ats_client/models/eeoc.rb +308 -0
- data/lib/merge_ats_client/models/email_address.rb +247 -0
- data/lib/merge_ats_client/models/email_address_request.rb +247 -0
- data/lib/merge_ats_client/models/email_address_type_enum.rb +36 -0
- data/lib/merge_ats_client/models/end_user_details.rb +289 -0
- data/lib/merge_ats_client/models/end_user_details_request.rb +298 -0
- data/lib/merge_ats_client/models/gender_enum.rb +38 -0
- data/lib/merge_ats_client/models/generate_remote_key_request.rb +224 -0
- data/lib/merge_ats_client/models/job.rb +341 -0
- data/lib/merge_ats_client/models/job_interview_stage.rb +264 -0
- data/lib/merge_ats_client/models/job_status_enum.rb +38 -0
- data/lib/merge_ats_client/models/link_token.rb +237 -0
- data/lib/merge_ats_client/models/method_enum.rb +40 -0
- data/lib/merge_ats_client/models/model_operation.rb +256 -0
- data/lib/merge_ats_client/models/offer.rb +319 -0
- data/lib/merge_ats_client/models/offer_status_enum.rb +42 -0
- data/lib/merge_ats_client/models/office.rb +264 -0
- data/lib/merge_ats_client/models/overall_recommendation_enum.rb +38 -0
- data/lib/merge_ats_client/models/paginated_activity_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_application_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_attachment_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_candidate_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_department_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_eeoc_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_job_interview_stage_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_job_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_offer_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_office_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_reject_reason_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_remote_user_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_scheduled_interview_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_scorecard_list.rb +240 -0
- data/lib/merge_ats_client/models/paginated_tag_list.rb +240 -0
- data/lib/merge_ats_client/models/patched_application_request.rb +309 -0
- data/lib/merge_ats_client/models/phone_number.rb +232 -0
- data/lib/merge_ats_client/models/phone_number_request.rb +232 -0
- data/lib/merge_ats_client/models/phone_number_type_enum.rb +38 -0
- data/lib/merge_ats_client/models/race_enum.rb +41 -0
- data/lib/merge_ats_client/models/reject_reason.rb +253 -0
- data/lib/merge_ats_client/models/remote_data.rb +234 -0
- data/lib/merge_ats_client/models/remote_data_request.rb +234 -0
- data/lib/merge_ats_client/models/remote_key.rb +238 -0
- data/lib/merge_ats_client/models/remote_key_for_regeneration.rb +224 -0
- data/lib/merge_ats_client/models/remote_key_for_regeneration_request.rb +224 -0
- data/lib/merge_ats_client/models/remote_response.rb +279 -0
- data/lib/merge_ats_client/models/remote_user.rb +323 -0
- data/lib/merge_ats_client/models/scheduled_interview.rb +352 -0
- data/lib/merge_ats_client/models/scheduled_interview_status_enum.rb +36 -0
- data/lib/merge_ats_client/models/scorecard.rb +308 -0
- data/lib/merge_ats_client/models/sync_status.rb +294 -0
- data/lib/merge_ats_client/models/tag.rb +244 -0
- data/lib/merge_ats_client/models/url.rb +247 -0
- data/lib/merge_ats_client/models/url_request.rb +247 -0
- data/lib/merge_ats_client/models/url_type_enum.rb +39 -0
- data/lib/merge_ats_client/models/veteran_status_enum.rb +36 -0
- data/lib/merge_ats_client/models/visibility_enum.rb +36 -0
- data/lib/merge_ats_client/version.rb +15 -0
- data/merge_ats_client-1.0.0.gem +0 -0
- data/merge_ats_client.gemspec +38 -0
- data/pull_request_template.md +22 -0
- data/spec/api/account_token_api_spec.rb +46 -0
- data/spec/api/activities_api_spec.rb +68 -0
- data/spec/api/applications_api_spec.rb +72 -0
- data/spec/api/attachments_api_spec.rb +66 -0
- data/spec/api/available_actions_api_spec.rb +46 -0
- data/spec/api/candidates_api_spec.rb +67 -0
- data/spec/api/departments_api_spec.rb +65 -0
- data/spec/api/eeocs_api_spec.rb +68 -0
- data/spec/api/interviews_api_spec.rb +70 -0
- data/spec/api/job_interview_stages_api_spec.rb +68 -0
- data/spec/api/jobs_api_spec.rb +67 -0
- data/spec/api/link_token_api_spec.rb +46 -0
- data/spec/api/offers_api_spec.rb +69 -0
- data/spec/api/offices_api_spec.rb +65 -0
- data/spec/api/passthrough_api_spec.rb +47 -0
- data/spec/api/regenerate_key_api_spec.rb +48 -0
- data/spec/api/reject_reasons_api_spec.rb +65 -0
- data/spec/api/scorecards_api_spec.rb +70 -0
- data/spec/api/sync_status_api_spec.rb +45 -0
- data/spec/api/tags_api_spec.rb +53 -0
- data/spec/api/users_api_spec.rb +65 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/access_role_enum_spec.rb +28 -0
- data/spec/models/account_integration_spec.rb +58 -0
- data/spec/models/account_token_spec.rb +34 -0
- data/spec/models/activity_spec.rb +76 -0
- data/spec/models/activity_type_enum_spec.rb +28 -0
- data/spec/models/application_request_spec.rb +82 -0
- data/spec/models/application_spec.rb +94 -0
- data/spec/models/attachment_spec.rb +52 -0
- data/spec/models/available_actions_spec.rb +46 -0
- data/spec/models/candidate_request_spec.rb +118 -0
- data/spec/models/candidate_spec.rb +136 -0
- data/spec/models/data_passthrough_request_spec.rb +58 -0
- data/spec/models/data_passthrough_spec.rb +52 -0
- data/spec/models/department_spec.rb +46 -0
- data/spec/models/disability_status_enum_spec.rb +28 -0
- data/spec/models/eeoc_spec.rb +76 -0
- data/spec/models/email_address_request_spec.rb +40 -0
- data/spec/models/email_address_spec.rb +40 -0
- data/spec/models/email_address_type_enum_spec.rb +28 -0
- data/spec/models/end_user_details_request_spec.rb +56 -0
- data/spec/models/end_user_details_spec.rb +56 -0
- data/spec/models/gender_enum_spec.rb +28 -0
- data/spec/models/generate_remote_key_request_spec.rb +34 -0
- data/spec/models/job_interview_stage_spec.rb +52 -0
- data/spec/models/job_spec.rb +88 -0
- data/spec/models/job_status_enum_spec.rb +28 -0
- data/spec/models/link_token_spec.rb +40 -0
- data/spec/models/method_enum_spec.rb +28 -0
- data/spec/models/model_operation_spec.rb +40 -0
- data/spec/models/offer_spec.rb +82 -0
- data/spec/models/offer_status_enum_spec.rb +28 -0
- data/spec/models/office_spec.rb +52 -0
- data/spec/models/overall_recommendation_enum_spec.rb +28 -0
- data/spec/models/paginated_activity_list_spec.rb +46 -0
- data/spec/models/paginated_application_list_spec.rb +46 -0
- data/spec/models/paginated_attachment_list_spec.rb +46 -0
- data/spec/models/paginated_candidate_list_spec.rb +46 -0
- data/spec/models/paginated_department_list_spec.rb +46 -0
- data/spec/models/paginated_eeoc_list_spec.rb +46 -0
- data/spec/models/paginated_job_interview_stage_list_spec.rb +46 -0
- data/spec/models/paginated_job_list_spec.rb +46 -0
- data/spec/models/paginated_offer_list_spec.rb +46 -0
- data/spec/models/paginated_office_list_spec.rb +46 -0
- data/spec/models/paginated_reject_reason_list_spec.rb +46 -0
- data/spec/models/paginated_remote_user_list_spec.rb +46 -0
- data/spec/models/paginated_scheduled_interview_list_spec.rb +46 -0
- data/spec/models/paginated_scorecard_list_spec.rb +46 -0
- data/spec/models/paginated_tag_list_spec.rb +46 -0
- data/spec/models/patched_application_request_spec.rb +82 -0
- data/spec/models/phone_number_request_spec.rb +40 -0
- data/spec/models/phone_number_spec.rb +40 -0
- data/spec/models/phone_number_type_enum_spec.rb +28 -0
- data/spec/models/race_enum_spec.rb +28 -0
- data/spec/models/reject_reason_spec.rb +46 -0
- data/spec/models/remote_data_spec.rb +40 -0
- data/spec/models/remote_key_for_regeneration_request_spec.rb +34 -0
- data/spec/models/remote_key_for_regeneration_spec.rb +34 -0
- data/spec/models/remote_key_spec.rb +40 -0
- data/spec/models/remote_response_spec.rb +58 -0
- data/spec/models/remote_user_spec.rb +76 -0
- data/spec/models/scheduled_interview_spec.rb +100 -0
- data/spec/models/scheduled_interview_status_enum_spec.rb +28 -0
- data/spec/models/scorecard_spec.rb +76 -0
- data/spec/models/sync_status_spec.rb +64 -0
- data/spec/models/tag_spec.rb +40 -0
- data/spec/models/url_request_spec.rb +40 -0
- data/spec/models/url_spec.rb +40 -0
- data/spec/models/url_type_enum_spec.rb +28 -0
- data/spec/models/veteran_status_enum_spec.rb +28 -0
- data/spec/models/visibility_enum_spec.rb +28 -0
- data/spec/spec_helper.rb +111 -0
- data/test_ats.rb +22 -0
- data/test_signature.rb +32 -0
- metadata +473 -0
@@ -0,0 +1,420 @@
|
|
1
|
+
=begin
|
2
|
+
#Merge ATS API
|
3
|
+
|
4
|
+
#The unified API for building rich integrations with multiple Applicant Tracking System platforms.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: hello@merge.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MergeATSClient
|
17
|
+
# # The Candidate Object ### Description The `Candidate` object is used to represent a Candidate for various positions. ### Usage Example Fetch from the `LIST Candidates` endpoint and filter by `ID` to show all candidates.
|
18
|
+
class Candidate
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# The third-party API ID of the matching object.
|
22
|
+
attr_accessor :remote_id
|
23
|
+
|
24
|
+
# The candidate's first name.
|
25
|
+
attr_accessor :first_name
|
26
|
+
|
27
|
+
# The candidate's last name.
|
28
|
+
attr_accessor :last_name
|
29
|
+
|
30
|
+
# The candidate's current company.
|
31
|
+
attr_accessor :company
|
32
|
+
|
33
|
+
# The candidate's current title.
|
34
|
+
attr_accessor :title
|
35
|
+
|
36
|
+
# When the third party's candidate was created.
|
37
|
+
attr_accessor :remote_created_at
|
38
|
+
|
39
|
+
# When the third party's candidate was updated.
|
40
|
+
attr_accessor :remote_updated_at
|
41
|
+
|
42
|
+
# When the most recent candidate interaction occurred.
|
43
|
+
attr_accessor :last_interaction_at
|
44
|
+
|
45
|
+
# Whether or not the candidate is private.
|
46
|
+
attr_accessor :is_private
|
47
|
+
|
48
|
+
# Whether or not the candidate can be emailed.
|
49
|
+
attr_accessor :can_email
|
50
|
+
|
51
|
+
# The candidate's locations.
|
52
|
+
attr_accessor :locations
|
53
|
+
|
54
|
+
attr_accessor :phone_numbers
|
55
|
+
|
56
|
+
attr_accessor :email_addresses
|
57
|
+
|
58
|
+
attr_accessor :urls
|
59
|
+
|
60
|
+
attr_accessor :tags
|
61
|
+
|
62
|
+
attr_accessor :applications
|
63
|
+
|
64
|
+
attr_accessor :attachments
|
65
|
+
|
66
|
+
attr_accessor :remote_data
|
67
|
+
|
68
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
69
|
+
def self.attribute_map
|
70
|
+
{
|
71
|
+
:'id' => :'id',
|
72
|
+
:'remote_id' => :'remote_id',
|
73
|
+
:'first_name' => :'first_name',
|
74
|
+
:'last_name' => :'last_name',
|
75
|
+
:'company' => :'company',
|
76
|
+
:'title' => :'title',
|
77
|
+
:'remote_created_at' => :'remote_created_at',
|
78
|
+
:'remote_updated_at' => :'remote_updated_at',
|
79
|
+
:'last_interaction_at' => :'last_interaction_at',
|
80
|
+
:'is_private' => :'is_private',
|
81
|
+
:'can_email' => :'can_email',
|
82
|
+
:'locations' => :'locations',
|
83
|
+
:'phone_numbers' => :'phone_numbers',
|
84
|
+
:'email_addresses' => :'email_addresses',
|
85
|
+
:'urls' => :'urls',
|
86
|
+
:'tags' => :'tags',
|
87
|
+
:'applications' => :'applications',
|
88
|
+
:'attachments' => :'attachments',
|
89
|
+
:'remote_data' => :'remote_data'
|
90
|
+
}
|
91
|
+
end
|
92
|
+
|
93
|
+
# Returns all the JSON keys this model knows about
|
94
|
+
def self.acceptable_attributes
|
95
|
+
attribute_map.values
|
96
|
+
end
|
97
|
+
|
98
|
+
# Attribute type mapping.
|
99
|
+
def self.openapi_types
|
100
|
+
{
|
101
|
+
:'id' => :'String',
|
102
|
+
:'remote_id' => :'String',
|
103
|
+
:'first_name' => :'String',
|
104
|
+
:'last_name' => :'String',
|
105
|
+
:'company' => :'String',
|
106
|
+
:'title' => :'String',
|
107
|
+
:'remote_created_at' => :'Time',
|
108
|
+
:'remote_updated_at' => :'Time',
|
109
|
+
:'last_interaction_at' => :'Time',
|
110
|
+
:'is_private' => :'Boolean',
|
111
|
+
:'can_email' => :'Boolean',
|
112
|
+
:'locations' => :'Array<String>',
|
113
|
+
:'phone_numbers' => :'Array<PhoneNumber>',
|
114
|
+
:'email_addresses' => :'Array<EmailAddress>',
|
115
|
+
:'urls' => :'Array<Url>',
|
116
|
+
:'tags' => :'Array<String>',
|
117
|
+
:'applications' => :'Array<String>',
|
118
|
+
:'attachments' => :'Array<String>',
|
119
|
+
:'remote_data' => :'Array<RemoteData>'
|
120
|
+
}
|
121
|
+
end
|
122
|
+
|
123
|
+
# List of attributes with nullable: true
|
124
|
+
def self.openapi_nullable
|
125
|
+
Set.new([
|
126
|
+
:'remote_id',
|
127
|
+
:'first_name',
|
128
|
+
:'last_name',
|
129
|
+
:'company',
|
130
|
+
:'title',
|
131
|
+
:'remote_created_at',
|
132
|
+
:'remote_updated_at',
|
133
|
+
:'last_interaction_at',
|
134
|
+
:'is_private',
|
135
|
+
:'can_email',
|
136
|
+
:'locations',
|
137
|
+
:'remote_data'
|
138
|
+
])
|
139
|
+
end
|
140
|
+
|
141
|
+
# Initializes the object
|
142
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
+
def initialize(attributes = {})
|
144
|
+
if (!attributes.is_a?(Hash))
|
145
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MergeATSClient::Candidate` initialize method"
|
146
|
+
end
|
147
|
+
|
148
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
149
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
150
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
151
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MergeATSClient::Candidate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
152
|
+
end
|
153
|
+
h[k.to_sym] = v
|
154
|
+
}
|
155
|
+
|
156
|
+
if attributes.key?(:'id')
|
157
|
+
self.id = attributes[:'id']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'remote_id')
|
161
|
+
self.remote_id = attributes[:'remote_id']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'first_name')
|
165
|
+
self.first_name = attributes[:'first_name']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'last_name')
|
169
|
+
self.last_name = attributes[:'last_name']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:'company')
|
173
|
+
self.company = attributes[:'company']
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.key?(:'title')
|
177
|
+
self.title = attributes[:'title']
|
178
|
+
end
|
179
|
+
|
180
|
+
if attributes.key?(:'remote_created_at')
|
181
|
+
self.remote_created_at = attributes[:'remote_created_at']
|
182
|
+
end
|
183
|
+
|
184
|
+
if attributes.key?(:'remote_updated_at')
|
185
|
+
self.remote_updated_at = attributes[:'remote_updated_at']
|
186
|
+
end
|
187
|
+
|
188
|
+
if attributes.key?(:'last_interaction_at')
|
189
|
+
self.last_interaction_at = attributes[:'last_interaction_at']
|
190
|
+
end
|
191
|
+
|
192
|
+
if attributes.key?(:'is_private')
|
193
|
+
self.is_private = attributes[:'is_private']
|
194
|
+
end
|
195
|
+
|
196
|
+
if attributes.key?(:'can_email')
|
197
|
+
self.can_email = attributes[:'can_email']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'locations')
|
201
|
+
if (value = attributes[:'locations']).is_a?(Array)
|
202
|
+
self.locations = value
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
if attributes.key?(:'phone_numbers')
|
207
|
+
if (value = attributes[:'phone_numbers']).is_a?(Array)
|
208
|
+
self.phone_numbers = value
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
if attributes.key?(:'email_addresses')
|
213
|
+
if (value = attributes[:'email_addresses']).is_a?(Array)
|
214
|
+
self.email_addresses = value
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
if attributes.key?(:'urls')
|
219
|
+
if (value = attributes[:'urls']).is_a?(Array)
|
220
|
+
self.urls = value
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
if attributes.key?(:'tags')
|
225
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
226
|
+
self.tags = value
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
if attributes.key?(:'applications')
|
231
|
+
if (value = attributes[:'applications']).is_a?(Array)
|
232
|
+
self.applications = value
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
if attributes.key?(:'attachments')
|
237
|
+
if (value = attributes[:'attachments']).is_a?(Array)
|
238
|
+
self.attachments = value
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
if attributes.key?(:'remote_data')
|
243
|
+
if (value = attributes[:'remote_data']).is_a?(Array)
|
244
|
+
self.remote_data = value
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
250
|
+
# @return Array for valid properties with the reasons
|
251
|
+
def list_invalid_properties
|
252
|
+
invalid_properties = Array.new
|
253
|
+
invalid_properties
|
254
|
+
end
|
255
|
+
|
256
|
+
# Check to see if the all the properties in the model are valid
|
257
|
+
# @return true if the model is valid
|
258
|
+
def valid?
|
259
|
+
true
|
260
|
+
end
|
261
|
+
|
262
|
+
# Checks equality by comparing each attribute.
|
263
|
+
# @param [Object] Object to be compared
|
264
|
+
def ==(o)
|
265
|
+
return true if self.equal?(o)
|
266
|
+
self.class == o.class &&
|
267
|
+
id == o.id &&
|
268
|
+
remote_id == o.remote_id &&
|
269
|
+
first_name == o.first_name &&
|
270
|
+
last_name == o.last_name &&
|
271
|
+
company == o.company &&
|
272
|
+
title == o.title &&
|
273
|
+
remote_created_at == o.remote_created_at &&
|
274
|
+
remote_updated_at == o.remote_updated_at &&
|
275
|
+
last_interaction_at == o.last_interaction_at &&
|
276
|
+
is_private == o.is_private &&
|
277
|
+
can_email == o.can_email &&
|
278
|
+
locations == o.locations &&
|
279
|
+
phone_numbers == o.phone_numbers &&
|
280
|
+
email_addresses == o.email_addresses &&
|
281
|
+
urls == o.urls &&
|
282
|
+
tags == o.tags &&
|
283
|
+
applications == o.applications &&
|
284
|
+
attachments == o.attachments &&
|
285
|
+
remote_data == o.remote_data
|
286
|
+
end
|
287
|
+
|
288
|
+
# @see the `==` method
|
289
|
+
# @param [Object] Object to be compared
|
290
|
+
def eql?(o)
|
291
|
+
self == o
|
292
|
+
end
|
293
|
+
|
294
|
+
# Calculates hash code according to all attributes.
|
295
|
+
# @return [Integer] Hash code
|
296
|
+
def hash
|
297
|
+
[id, remote_id, first_name, last_name, company, title, remote_created_at, remote_updated_at, last_interaction_at, is_private, can_email, locations, phone_numbers, email_addresses, urls, tags, applications, attachments, remote_data].hash
|
298
|
+
end
|
299
|
+
|
300
|
+
# Builds the object from hash
|
301
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
302
|
+
# @return [Object] Returns the model itself
|
303
|
+
def self.build_from_hash(attributes)
|
304
|
+
new.build_from_hash(attributes)
|
305
|
+
end
|
306
|
+
|
307
|
+
# Builds the object from hash
|
308
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
309
|
+
# @return [Object] Returns the model itself
|
310
|
+
def build_from_hash(attributes)
|
311
|
+
return nil unless attributes.is_a?(Hash)
|
312
|
+
self.class.openapi_types.each_pair do |key, type|
|
313
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
314
|
+
self.send("#{key}=", nil)
|
315
|
+
elsif type =~ /\AArray<(.*)>/i
|
316
|
+
# check to ensure the input is an array given that the attribute
|
317
|
+
# is documented as an array but the input is not
|
318
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
319
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
320
|
+
end
|
321
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
322
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
323
|
+
end
|
324
|
+
end
|
325
|
+
|
326
|
+
self
|
327
|
+
end
|
328
|
+
|
329
|
+
# Deserializes the data based on type
|
330
|
+
# @param string type Data type
|
331
|
+
# @param string value Value to be deserialized
|
332
|
+
# @return [Object] Deserialized data
|
333
|
+
def _deserialize(type, value)
|
334
|
+
case type.to_sym
|
335
|
+
when :Time
|
336
|
+
Time.parse(value)
|
337
|
+
when :Date
|
338
|
+
Date.parse(value)
|
339
|
+
when :String
|
340
|
+
value.to_s
|
341
|
+
when :Integer
|
342
|
+
value.to_i
|
343
|
+
when :Float
|
344
|
+
value.to_f
|
345
|
+
when :Boolean
|
346
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
347
|
+
true
|
348
|
+
else
|
349
|
+
false
|
350
|
+
end
|
351
|
+
when :Object
|
352
|
+
# generic object (usually a Hash), return directly
|
353
|
+
value
|
354
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
355
|
+
inner_type = Regexp.last_match[:inner_type]
|
356
|
+
value.map { |v| _deserialize(inner_type, v) }
|
357
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
358
|
+
k_type = Regexp.last_match[:k_type]
|
359
|
+
v_type = Regexp.last_match[:v_type]
|
360
|
+
{}.tap do |hash|
|
361
|
+
value.each do |k, v|
|
362
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
363
|
+
end
|
364
|
+
end
|
365
|
+
else # model
|
366
|
+
# models (e.g. Pet) or oneOf
|
367
|
+
klass = MergeATSClient.const_get(type)
|
368
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
# Returns the string representation of the object
|
373
|
+
# @return [String] String presentation of the object
|
374
|
+
def to_s
|
375
|
+
to_hash.to_s
|
376
|
+
end
|
377
|
+
|
378
|
+
# to_body is an alias to to_hash (backward compatibility)
|
379
|
+
# @return [Hash] Returns the object in the form of hash
|
380
|
+
def to_body
|
381
|
+
to_hash
|
382
|
+
end
|
383
|
+
|
384
|
+
# Returns the object in the form of hash
|
385
|
+
# @return [Hash] Returns the object in the form of hash
|
386
|
+
def to_hash
|
387
|
+
hash = {}
|
388
|
+
self.class.attribute_map.each_pair do |attr, param|
|
389
|
+
value = self.send(attr)
|
390
|
+
if value.nil?
|
391
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
392
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
393
|
+
end
|
394
|
+
|
395
|
+
hash[param] = _to_hash(value)
|
396
|
+
end
|
397
|
+
hash
|
398
|
+
end
|
399
|
+
|
400
|
+
# Outputs non-array value in the form of hash
|
401
|
+
# For object, use to_hash. Otherwise, just return the value
|
402
|
+
# @param [Object] value Any valid value
|
403
|
+
# @return [Hash] Returns the value in the form of hash
|
404
|
+
def _to_hash(value)
|
405
|
+
if value.is_a?(Array)
|
406
|
+
value.compact.map { |v| _to_hash(v) }
|
407
|
+
elsif value.is_a?(Hash)
|
408
|
+
{}.tap do |hash|
|
409
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
410
|
+
end
|
411
|
+
elsif value.respond_to? :to_hash
|
412
|
+
value.to_hash
|
413
|
+
else
|
414
|
+
value
|
415
|
+
end
|
416
|
+
end
|
417
|
+
|
418
|
+
end
|
419
|
+
|
420
|
+
end
|
@@ -0,0 +1,377 @@
|
|
1
|
+
=begin
|
2
|
+
#Merge ATS API
|
3
|
+
|
4
|
+
#The unified API for building rich integrations with multiple Applicant Tracking System platforms.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: hello@merge.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MergeATSClient
|
17
|
+
# # The Candidate Object ### Description The `Candidate` object is used to represent a Candidate for various positions. ### Usage Example Fetch from the `LIST Candidates` endpoint and filter by `ID` to show all candidates.
|
18
|
+
class CandidateRequest
|
19
|
+
# The third-party API ID of the matching object.
|
20
|
+
attr_accessor :remote_id
|
21
|
+
|
22
|
+
# The candidate's first name.
|
23
|
+
attr_accessor :first_name
|
24
|
+
|
25
|
+
# The candidate's last name.
|
26
|
+
attr_accessor :last_name
|
27
|
+
|
28
|
+
# The candidate's current company.
|
29
|
+
attr_accessor :company
|
30
|
+
|
31
|
+
# The candidate's current title.
|
32
|
+
attr_accessor :title
|
33
|
+
|
34
|
+
# When the third party's candidate was created.
|
35
|
+
attr_accessor :remote_created_at
|
36
|
+
|
37
|
+
# When the third party's candidate was updated.
|
38
|
+
attr_accessor :remote_updated_at
|
39
|
+
|
40
|
+
# When the most recent candidate interaction occurred.
|
41
|
+
attr_accessor :last_interaction_at
|
42
|
+
|
43
|
+
# Whether or not the candidate is private.
|
44
|
+
attr_accessor :is_private
|
45
|
+
|
46
|
+
# Whether or not the candidate can be emailed.
|
47
|
+
attr_accessor :can_email
|
48
|
+
|
49
|
+
# The candidate's locations.
|
50
|
+
attr_accessor :locations
|
51
|
+
|
52
|
+
attr_accessor :phone_numbers
|
53
|
+
|
54
|
+
attr_accessor :email_addresses
|
55
|
+
|
56
|
+
attr_accessor :urls
|
57
|
+
|
58
|
+
attr_accessor :tags
|
59
|
+
|
60
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
61
|
+
def self.attribute_map
|
62
|
+
{
|
63
|
+
:'remote_id' => :'remote_id',
|
64
|
+
:'first_name' => :'first_name',
|
65
|
+
:'last_name' => :'last_name',
|
66
|
+
:'company' => :'company',
|
67
|
+
:'title' => :'title',
|
68
|
+
:'remote_created_at' => :'remote_created_at',
|
69
|
+
:'remote_updated_at' => :'remote_updated_at',
|
70
|
+
:'last_interaction_at' => :'last_interaction_at',
|
71
|
+
:'is_private' => :'is_private',
|
72
|
+
:'can_email' => :'can_email',
|
73
|
+
:'locations' => :'locations',
|
74
|
+
:'phone_numbers' => :'phone_numbers',
|
75
|
+
:'email_addresses' => :'email_addresses',
|
76
|
+
:'urls' => :'urls',
|
77
|
+
:'tags' => :'tags'
|
78
|
+
}
|
79
|
+
end
|
80
|
+
|
81
|
+
# Returns all the JSON keys this model knows about
|
82
|
+
def self.acceptable_attributes
|
83
|
+
attribute_map.values
|
84
|
+
end
|
85
|
+
|
86
|
+
# Attribute type mapping.
|
87
|
+
def self.openapi_types
|
88
|
+
{
|
89
|
+
:'remote_id' => :'String',
|
90
|
+
:'first_name' => :'String',
|
91
|
+
:'last_name' => :'String',
|
92
|
+
:'company' => :'String',
|
93
|
+
:'title' => :'String',
|
94
|
+
:'remote_created_at' => :'Time',
|
95
|
+
:'remote_updated_at' => :'Time',
|
96
|
+
:'last_interaction_at' => :'Time',
|
97
|
+
:'is_private' => :'Boolean',
|
98
|
+
:'can_email' => :'Boolean',
|
99
|
+
:'locations' => :'Array<String>',
|
100
|
+
:'phone_numbers' => :'Array<PhoneNumberRequest>',
|
101
|
+
:'email_addresses' => :'Array<EmailAddressRequest>',
|
102
|
+
:'urls' => :'Array<UrlRequest>',
|
103
|
+
:'tags' => :'Array<String>'
|
104
|
+
}
|
105
|
+
end
|
106
|
+
|
107
|
+
# List of attributes with nullable: true
|
108
|
+
def self.openapi_nullable
|
109
|
+
Set.new([
|
110
|
+
:'remote_id',
|
111
|
+
:'first_name',
|
112
|
+
:'last_name',
|
113
|
+
:'company',
|
114
|
+
:'title',
|
115
|
+
:'remote_created_at',
|
116
|
+
:'remote_updated_at',
|
117
|
+
:'last_interaction_at',
|
118
|
+
:'is_private',
|
119
|
+
:'can_email',
|
120
|
+
:'locations',
|
121
|
+
])
|
122
|
+
end
|
123
|
+
|
124
|
+
# Initializes the object
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
126
|
+
def initialize(attributes = {})
|
127
|
+
if (!attributes.is_a?(Hash))
|
128
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MergeATSClient::CandidateRequest` initialize method"
|
129
|
+
end
|
130
|
+
|
131
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
132
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
133
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
134
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MergeATSClient::CandidateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
135
|
+
end
|
136
|
+
h[k.to_sym] = v
|
137
|
+
}
|
138
|
+
|
139
|
+
if attributes.key?(:'remote_id')
|
140
|
+
self.remote_id = attributes[:'remote_id']
|
141
|
+
end
|
142
|
+
|
143
|
+
if attributes.key?(:'first_name')
|
144
|
+
self.first_name = attributes[:'first_name']
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.key?(:'last_name')
|
148
|
+
self.last_name = attributes[:'last_name']
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.key?(:'company')
|
152
|
+
self.company = attributes[:'company']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.key?(:'title')
|
156
|
+
self.title = attributes[:'title']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.key?(:'remote_created_at')
|
160
|
+
self.remote_created_at = attributes[:'remote_created_at']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:'remote_updated_at')
|
164
|
+
self.remote_updated_at = attributes[:'remote_updated_at']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.key?(:'last_interaction_at')
|
168
|
+
self.last_interaction_at = attributes[:'last_interaction_at']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'is_private')
|
172
|
+
self.is_private = attributes[:'is_private']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'can_email')
|
176
|
+
self.can_email = attributes[:'can_email']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'locations')
|
180
|
+
if (value = attributes[:'locations']).is_a?(Array)
|
181
|
+
self.locations = value
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.key?(:'phone_numbers')
|
186
|
+
if (value = attributes[:'phone_numbers']).is_a?(Array)
|
187
|
+
self.phone_numbers = value
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.key?(:'email_addresses')
|
192
|
+
if (value = attributes[:'email_addresses']).is_a?(Array)
|
193
|
+
self.email_addresses = value
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.key?(:'urls')
|
198
|
+
if (value = attributes[:'urls']).is_a?(Array)
|
199
|
+
self.urls = value
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
if attributes.key?(:'tags')
|
204
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
205
|
+
self.tags = value
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
211
|
+
# @return Array for valid properties with the reasons
|
212
|
+
def list_invalid_properties
|
213
|
+
invalid_properties = Array.new
|
214
|
+
invalid_properties
|
215
|
+
end
|
216
|
+
|
217
|
+
# Check to see if the all the properties in the model are valid
|
218
|
+
# @return true if the model is valid
|
219
|
+
def valid?
|
220
|
+
true
|
221
|
+
end
|
222
|
+
|
223
|
+
# Checks equality by comparing each attribute.
|
224
|
+
# @param [Object] Object to be compared
|
225
|
+
def ==(o)
|
226
|
+
return true if self.equal?(o)
|
227
|
+
self.class == o.class &&
|
228
|
+
remote_id == o.remote_id &&
|
229
|
+
first_name == o.first_name &&
|
230
|
+
last_name == o.last_name &&
|
231
|
+
company == o.company &&
|
232
|
+
title == o.title &&
|
233
|
+
remote_created_at == o.remote_created_at &&
|
234
|
+
remote_updated_at == o.remote_updated_at &&
|
235
|
+
last_interaction_at == o.last_interaction_at &&
|
236
|
+
is_private == o.is_private &&
|
237
|
+
can_email == o.can_email &&
|
238
|
+
locations == o.locations &&
|
239
|
+
phone_numbers == o.phone_numbers &&
|
240
|
+
email_addresses == o.email_addresses &&
|
241
|
+
urls == o.urls &&
|
242
|
+
tags == o.tags
|
243
|
+
end
|
244
|
+
|
245
|
+
# @see the `==` method
|
246
|
+
# @param [Object] Object to be compared
|
247
|
+
def eql?(o)
|
248
|
+
self == o
|
249
|
+
end
|
250
|
+
|
251
|
+
# Calculates hash code according to all attributes.
|
252
|
+
# @return [Integer] Hash code
|
253
|
+
def hash
|
254
|
+
[remote_id, first_name, last_name, company, title, remote_created_at, remote_updated_at, last_interaction_at, is_private, can_email, locations, phone_numbers, email_addresses, urls, tags].hash
|
255
|
+
end
|
256
|
+
|
257
|
+
# Builds the object from hash
|
258
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
259
|
+
# @return [Object] Returns the model itself
|
260
|
+
def self.build_from_hash(attributes)
|
261
|
+
new.build_from_hash(attributes)
|
262
|
+
end
|
263
|
+
|
264
|
+
# Builds the object from hash
|
265
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
266
|
+
# @return [Object] Returns the model itself
|
267
|
+
def build_from_hash(attributes)
|
268
|
+
return nil unless attributes.is_a?(Hash)
|
269
|
+
self.class.openapi_types.each_pair do |key, type|
|
270
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
271
|
+
self.send("#{key}=", nil)
|
272
|
+
elsif type =~ /\AArray<(.*)>/i
|
273
|
+
# check to ensure the input is an array given that the attribute
|
274
|
+
# is documented as an array but the input is not
|
275
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
276
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
277
|
+
end
|
278
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
279
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
self
|
284
|
+
end
|
285
|
+
|
286
|
+
# Deserializes the data based on type
|
287
|
+
# @param string type Data type
|
288
|
+
# @param string value Value to be deserialized
|
289
|
+
# @return [Object] Deserialized data
|
290
|
+
def _deserialize(type, value)
|
291
|
+
case type.to_sym
|
292
|
+
when :Time
|
293
|
+
Time.parse(value)
|
294
|
+
when :Date
|
295
|
+
Date.parse(value)
|
296
|
+
when :String
|
297
|
+
value.to_s
|
298
|
+
when :Integer
|
299
|
+
value.to_i
|
300
|
+
when :Float
|
301
|
+
value.to_f
|
302
|
+
when :Boolean
|
303
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
304
|
+
true
|
305
|
+
else
|
306
|
+
false
|
307
|
+
end
|
308
|
+
when :Object
|
309
|
+
# generic object (usually a Hash), return directly
|
310
|
+
value
|
311
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
312
|
+
inner_type = Regexp.last_match[:inner_type]
|
313
|
+
value.map { |v| _deserialize(inner_type, v) }
|
314
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
315
|
+
k_type = Regexp.last_match[:k_type]
|
316
|
+
v_type = Regexp.last_match[:v_type]
|
317
|
+
{}.tap do |hash|
|
318
|
+
value.each do |k, v|
|
319
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
320
|
+
end
|
321
|
+
end
|
322
|
+
else # model
|
323
|
+
# models (e.g. Pet) or oneOf
|
324
|
+
klass = MergeATSClient.const_get(type)
|
325
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
326
|
+
end
|
327
|
+
end
|
328
|
+
|
329
|
+
# Returns the string representation of the object
|
330
|
+
# @return [String] String presentation of the object
|
331
|
+
def to_s
|
332
|
+
to_hash.to_s
|
333
|
+
end
|
334
|
+
|
335
|
+
# to_body is an alias to to_hash (backward compatibility)
|
336
|
+
# @return [Hash] Returns the object in the form of hash
|
337
|
+
def to_body
|
338
|
+
to_hash
|
339
|
+
end
|
340
|
+
|
341
|
+
# Returns the object in the form of hash
|
342
|
+
# @return [Hash] Returns the object in the form of hash
|
343
|
+
def to_hash
|
344
|
+
hash = {}
|
345
|
+
self.class.attribute_map.each_pair do |attr, param|
|
346
|
+
value = self.send(attr)
|
347
|
+
if value.nil?
|
348
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
349
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
350
|
+
end
|
351
|
+
|
352
|
+
hash[param] = _to_hash(value)
|
353
|
+
end
|
354
|
+
hash
|
355
|
+
end
|
356
|
+
|
357
|
+
# Outputs non-array value in the form of hash
|
358
|
+
# For object, use to_hash. Otherwise, just return the value
|
359
|
+
# @param [Object] value Any valid value
|
360
|
+
# @return [Hash] Returns the value in the form of hash
|
361
|
+
def _to_hash(value)
|
362
|
+
if value.is_a?(Array)
|
363
|
+
value.compact.map { |v| _to_hash(v) }
|
364
|
+
elsif value.is_a?(Hash)
|
365
|
+
{}.tap do |hash|
|
366
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
367
|
+
end
|
368
|
+
elsif value.respond_to? :to_hash
|
369
|
+
value.to_hash
|
370
|
+
else
|
371
|
+
value
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
375
|
+
end
|
376
|
+
|
377
|
+
end
|