pescheck 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +193 -0
  4. data/Rakefile +10 -0
  5. data/docs/AuthenticationApi.md +217 -0
  6. data/docs/ChecksApi.md +147 -0
  7. data/docs/CustomTokenObtainPair.md +20 -0
  8. data/docs/DivisionReadOnly.md +46 -0
  9. data/docs/DivisionWrite.md +40 -0
  10. data/docs/DivisionsApi.md +369 -0
  11. data/docs/JWTGeneration.md +24 -0
  12. data/docs/JWTResponse.md +28 -0
  13. data/docs/OAuthApi.md +213 -0
  14. data/docs/OAuthApplication.md +26 -0
  15. data/docs/OAuthApplicationResponse.md +32 -0
  16. data/docs/PaginatedDivisionReadOnlyList.md +24 -0
  17. data/docs/PaginatedV2ProfileListItemList.md +24 -0
  18. data/docs/PaginatedV2ScreeningListItemList.md +24 -0
  19. data/docs/PatchedDivisionWrite.md +40 -0
  20. data/docs/PatchedV2ProfilePartialUpdate.md +20 -0
  21. data/docs/ProfilesApi.md +438 -0
  22. data/docs/ScreeningsApi.md +293 -0
  23. data/docs/TokenRefresh.md +20 -0
  24. data/docs/V2Candidate.md +36 -0
  25. data/docs/V2CheckField.md +26 -0
  26. data/docs/V2CheckInfo.md +40 -0
  27. data/docs/V2Document.md +28 -0
  28. data/docs/V2DocumentContent.md +20 -0
  29. data/docs/V2Money.md +20 -0
  30. data/docs/V2ProfileCheck.md +20 -0
  31. data/docs/V2ProfileCheckEntry.md +30 -0
  32. data/docs/V2ProfileCreate.md +22 -0
  33. data/docs/V2ProfileDetail.md +38 -0
  34. data/docs/V2ProfileListItem.md +30 -0
  35. data/docs/V2ProfileUpdate.md +22 -0
  36. data/docs/V2ProfileUpdateCheck.md +22 -0
  37. data/docs/V2ScreeningCheck.md +24 -0
  38. data/docs/V2ScreeningCheckEntry.md +34 -0
  39. data/docs/V2ScreeningCheckListItem.md +22 -0
  40. data/docs/V2ScreeningCreate.md +22 -0
  41. data/docs/V2ScreeningDetail.md +34 -0
  42. data/docs/V2ScreeningDetailProfile.md +20 -0
  43. data/docs/V2ScreeningListItem.md +34 -0
  44. data/docs/VerifyWebhook.md +18 -0
  45. data/docs/Webhook.md +26 -0
  46. data/docs/WebhookResponse.md +36 -0
  47. data/docs/WebhooksApi.md +290 -0
  48. data/git_push.sh +57 -0
  49. data/lib/pescheck/api/authentication_api.rb +220 -0
  50. data/lib/pescheck/api/checks_api.rb +144 -0
  51. data/lib/pescheck/api/divisions_api.rb +365 -0
  52. data/lib/pescheck/api/o_auth_api.rb +202 -0
  53. data/lib/pescheck/api/profiles_api.rb +432 -0
  54. data/lib/pescheck/api/screenings_api.rb +288 -0
  55. data/lib/pescheck/api/webhooks_api.rb +278 -0
  56. data/lib/pescheck/api_client.rb +441 -0
  57. data/lib/pescheck/api_error.rb +58 -0
  58. data/lib/pescheck/api_model_base.rb +88 -0
  59. data/lib/pescheck/configuration.rb +429 -0
  60. data/lib/pescheck/models/custom_token_obtain_pair.rb +191 -0
  61. data/lib/pescheck/models/division_read_only.rb +469 -0
  62. data/lib/pescheck/models/division_write.rb +436 -0
  63. data/lib/pescheck/models/jwt_generation.rb +213 -0
  64. data/lib/pescheck/models/jwt_response.rb +285 -0
  65. data/lib/pescheck/models/o_auth_application.rb +265 -0
  66. data/lib/pescheck/models/o_auth_application_response.rb +379 -0
  67. data/lib/pescheck/models/paginated_division_read_only_list.rb +216 -0
  68. data/lib/pescheck/models/paginated_v2_profile_list_item_list.rb +216 -0
  69. data/lib/pescheck/models/paginated_v2_screening_list_item_list.rb +216 -0
  70. data/lib/pescheck/models/patched_division_write.rb +360 -0
  71. data/lib/pescheck/models/patched_v2_profile_partial_update.rb +176 -0
  72. data/lib/pescheck/models/token_refresh.rb +173 -0
  73. data/lib/pescheck/models/v2_candidate.rb +390 -0
  74. data/lib/pescheck/models/v2_check_field.rb +246 -0
  75. data/lib/pescheck/models/v2_check_info.rb +438 -0
  76. data/lib/pescheck/models/v2_document.rb +308 -0
  77. data/lib/pescheck/models/v2_document_content.rb +175 -0
  78. data/lib/pescheck/models/v2_money.rb +210 -0
  79. data/lib/pescheck/models/v2_profile_check.rb +201 -0
  80. data/lib/pescheck/models/v2_profile_check_entry.rb +349 -0
  81. data/lib/pescheck/models/v2_profile_create.rb +212 -0
  82. data/lib/pescheck/models/v2_profile_detail.rb +401 -0
  83. data/lib/pescheck/models/v2_profile_list_item.rb +291 -0
  84. data/lib/pescheck/models/v2_profile_update.rb +213 -0
  85. data/lib/pescheck/models/v2_profile_update_check.rb +210 -0
  86. data/lib/pescheck/models/v2_screening_check.rb +221 -0
  87. data/lib/pescheck/models/v2_screening_check_entry.rb +376 -0
  88. data/lib/pescheck/models/v2_screening_check_list_item.rb +242 -0
  89. data/lib/pescheck/models/v2_screening_create.rb +201 -0
  90. data/lib/pescheck/models/v2_screening_detail.rb +348 -0
  91. data/lib/pescheck/models/v2_screening_detail_profile.rb +156 -0
  92. data/lib/pescheck/models/v2_screening_list_item.rb +330 -0
  93. data/lib/pescheck/models/verify_webhook.rb +166 -0
  94. data/lib/pescheck/models/webhook.rb +265 -0
  95. data/lib/pescheck/models/webhook_response.rb +353 -0
  96. data/lib/pescheck/version.rb +15 -0
  97. data/lib/pescheck.rb +83 -0
  98. data/pescheck.gemspec +41 -0
  99. data/spec/api/authentication_api_spec.rb +68 -0
  100. data/spec/api/checks_api_spec.rb +56 -0
  101. data/spec/api/divisions_api_spec.rb +94 -0
  102. data/spec/api/o_auth_api_spec.rb +67 -0
  103. data/spec/api/profiles_api_spec.rb +105 -0
  104. data/spec/api/screenings_api_spec.rb +81 -0
  105. data/spec/api/webhooks_api_spec.rb +81 -0
  106. data/spec/models/custom_token_obtain_pair_spec.rb +42 -0
  107. data/spec/models/division_read_only_spec.rb +120 -0
  108. data/spec/models/division_write_spec.rb +102 -0
  109. data/spec/models/jwt_generation_spec.rb +54 -0
  110. data/spec/models/jwt_response_spec.rb +66 -0
  111. data/spec/models/o_auth_application_response_spec.rb +86 -0
  112. data/spec/models/o_auth_application_spec.rb +68 -0
  113. data/spec/models/paginated_division_read_only_list_spec.rb +54 -0
  114. data/spec/models/paginated_v2_profile_list_item_list_spec.rb +54 -0
  115. data/spec/models/paginated_v2_screening_list_item_list_spec.rb +54 -0
  116. data/spec/models/patched_division_write_spec.rb +102 -0
  117. data/spec/models/patched_v2_profile_partial_update_spec.rb +42 -0
  118. data/spec/models/token_refresh_spec.rb +42 -0
  119. data/spec/models/v2_candidate_spec.rb +94 -0
  120. data/spec/models/v2_check_field_spec.rb +60 -0
  121. data/spec/models/v2_check_info_spec.rb +102 -0
  122. data/spec/models/v2_document_content_spec.rb +42 -0
  123. data/spec/models/v2_document_spec.rb +70 -0
  124. data/spec/models/v2_money_spec.rb +42 -0
  125. data/spec/models/v2_profile_check_entry_spec.rb +76 -0
  126. data/spec/models/v2_profile_check_spec.rb +46 -0
  127. data/spec/models/v2_profile_create_spec.rb +48 -0
  128. data/spec/models/v2_profile_detail_spec.rb +96 -0
  129. data/spec/models/v2_profile_list_item_spec.rb +72 -0
  130. data/spec/models/v2_profile_update_check_spec.rb +52 -0
  131. data/spec/models/v2_profile_update_spec.rb +48 -0
  132. data/spec/models/v2_screening_check_entry_spec.rb +88 -0
  133. data/spec/models/v2_screening_check_list_item_spec.rb +52 -0
  134. data/spec/models/v2_screening_check_spec.rb +58 -0
  135. data/spec/models/v2_screening_create_spec.rb +48 -0
  136. data/spec/models/v2_screening_detail_profile_spec.rb +42 -0
  137. data/spec/models/v2_screening_detail_spec.rb +84 -0
  138. data/spec/models/v2_screening_list_item_spec.rb +84 -0
  139. data/spec/models/verify_webhook_spec.rb +36 -0
  140. data/spec/models/webhook_response_spec.rb +90 -0
  141. data/spec/models/webhook_spec.rb +64 -0
  142. data/spec/spec_helper.rb +111 -0
  143. metadata +302 -0
@@ -0,0 +1,212 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #API for Pescheck ## Authentication This API supports three authentication methods: 1. **OAuth2** (recommended for API clients) - Use client credentials flow 2. **JWT Bearer** (for user-based access) - Obtain tokens via /api/jwt/ endpoint 3. **Cookie** (for browser-based access) - Session authentication via web login ## Quick Start for API Clients 1. Select your environment from the servers dropdown 2. Use OAuth2 with client credentials flow 3. Scopes are automatically included: read:api, create:api, update:api
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pescheck
17
+ class V2ProfileCreate < ApiModelBase
18
+ attr_accessor :name
19
+
20
+ attr_accessor :description
21
+
22
+ attr_accessor :checks
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'name' => :'name',
28
+ :'description' => :'description',
29
+ :'checks' => :'checks'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'name' => :'String',
47
+ :'description' => :'String',
48
+ :'checks' => :'Array<V2ProfileCheck>'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2ProfileCreate` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2ProfileCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'name')
75
+ self.name = attributes[:'name']
76
+ else
77
+ self.name = nil
78
+ end
79
+
80
+ if attributes.key?(:'description')
81
+ self.description = attributes[:'description']
82
+ else
83
+ self.description = ''
84
+ end
85
+
86
+ if attributes.key?(:'checks')
87
+ if (value = attributes[:'checks']).is_a?(Array)
88
+ self.checks = value
89
+ end
90
+ else
91
+ self.checks = nil
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @name.nil?
101
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
102
+ end
103
+
104
+ if @name.to_s.length > 255
105
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
106
+ end
107
+
108
+ if @checks.nil?
109
+ invalid_properties.push('invalid value for "checks", checks cannot be nil.')
110
+ end
111
+
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
+ return false if @name.nil?
120
+ return false if @name.to_s.length > 255
121
+ return false if @checks.nil?
122
+ true
123
+ end
124
+
125
+ # Custom attribute writer method with validation
126
+ # @param [Object] name Value to be assigned
127
+ def name=(name)
128
+ if name.nil?
129
+ fail ArgumentError, 'name cannot be nil'
130
+ end
131
+
132
+ if name.to_s.length > 255
133
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
134
+ end
135
+
136
+ @name = name
137
+ end
138
+
139
+ # Custom attribute writer method with validation
140
+ # @param [Object] checks Value to be assigned
141
+ def checks=(checks)
142
+ if checks.nil?
143
+ fail ArgumentError, 'checks cannot be nil'
144
+ end
145
+
146
+ @checks = checks
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ name == o.name &&
155
+ description == o.description &&
156
+ checks == o.checks
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [name, description, checks].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ attributes = attributes.transform_keys(&:to_sym)
177
+ transformed_hash = {}
178
+ openapi_types.each_pair do |key, type|
179
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = nil
181
+ elsif type =~ /\AArray<(.*)>/i
182
+ # check to ensure the input is an array given that the attribute
183
+ # is documented as an array but the input is not
184
+ if attributes[attribute_map[key]].is_a?(Array)
185
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
186
+ end
187
+ elsif !attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
189
+ end
190
+ end
191
+ new(transformed_hash)
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ end
211
+
212
+ end
@@ -0,0 +1,401 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #API for Pescheck ## Authentication This API supports three authentication methods: 1. **OAuth2** (recommended for API clients) - Use client credentials flow 2. **JWT Bearer** (for user-based access) - Obtain tokens via /api/jwt/ endpoint 3. **Cookie** (for browser-based access) - Session authentication via web login ## Quick Start for API Clients 1. Select your environment from the servers dropdown 2. Use OAuth2 with client credentials flow 3. Scopes are automatically included: read:api, create:api, update:api
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pescheck
17
+ class V2ProfileDetail < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :description
23
+
24
+ attr_accessor :is_custom
25
+
26
+ attr_accessor :checks
27
+
28
+ attr_accessor :total_price
29
+
30
+ attr_accessor :supported_countries_of_work
31
+
32
+ attr_accessor :supported_countries_of_residence
33
+
34
+ attr_accessor :candidate_fields
35
+
36
+ attr_accessor :created_at
37
+
38
+ attr_accessor :updated_at
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'id' => :'id',
44
+ :'name' => :'name',
45
+ :'description' => :'description',
46
+ :'is_custom' => :'is_custom',
47
+ :'checks' => :'checks',
48
+ :'total_price' => :'total_price',
49
+ :'supported_countries_of_work' => :'supported_countries_of_work',
50
+ :'supported_countries_of_residence' => :'supported_countries_of_residence',
51
+ :'candidate_fields' => :'candidate_fields',
52
+ :'created_at' => :'created_at',
53
+ :'updated_at' => :'updated_at'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'id' => :'String',
71
+ :'name' => :'String',
72
+ :'description' => :'String',
73
+ :'is_custom' => :'Boolean',
74
+ :'checks' => :'Array<V2ProfileCheckEntry>',
75
+ :'total_price' => :'V2Money',
76
+ :'supported_countries_of_work' => :'Array<String>',
77
+ :'supported_countries_of_residence' => :'Array<String>',
78
+ :'candidate_fields' => :'Array<Object>',
79
+ :'created_at' => :'Time',
80
+ :'updated_at' => :'Time'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ :'description',
88
+ ])
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ if (!attributes.is_a?(Hash))
95
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2ProfileDetail` initialize method"
96
+ end
97
+
98
+ # check to see if the attribute exists and convert string to symbol for hash key
99
+ acceptable_attribute_map = self.class.acceptable_attribute_map
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!acceptable_attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2ProfileDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'id')
108
+ self.id = attributes[:'id']
109
+ else
110
+ self.id = nil
111
+ end
112
+
113
+ if attributes.key?(:'name')
114
+ self.name = attributes[:'name']
115
+ else
116
+ self.name = nil
117
+ end
118
+
119
+ if attributes.key?(:'description')
120
+ self.description = attributes[:'description']
121
+ else
122
+ self.description = nil
123
+ end
124
+
125
+ if attributes.key?(:'is_custom')
126
+ self.is_custom = attributes[:'is_custom']
127
+ end
128
+
129
+ if attributes.key?(:'checks')
130
+ if (value = attributes[:'checks']).is_a?(Array)
131
+ self.checks = value
132
+ end
133
+ else
134
+ self.checks = nil
135
+ end
136
+
137
+ if attributes.key?(:'total_price')
138
+ self.total_price = attributes[:'total_price']
139
+ else
140
+ self.total_price = nil
141
+ end
142
+
143
+ if attributes.key?(:'supported_countries_of_work')
144
+ if (value = attributes[:'supported_countries_of_work']).is_a?(Array)
145
+ self.supported_countries_of_work = value
146
+ end
147
+ else
148
+ self.supported_countries_of_work = nil
149
+ end
150
+
151
+ if attributes.key?(:'supported_countries_of_residence')
152
+ if (value = attributes[:'supported_countries_of_residence']).is_a?(Array)
153
+ self.supported_countries_of_residence = value
154
+ end
155
+ else
156
+ self.supported_countries_of_residence = nil
157
+ end
158
+
159
+ if attributes.key?(:'candidate_fields')
160
+ if (value = attributes[:'candidate_fields']).is_a?(Array)
161
+ self.candidate_fields = value
162
+ end
163
+ else
164
+ self.candidate_fields = nil
165
+ end
166
+
167
+ if attributes.key?(:'created_at')
168
+ self.created_at = attributes[:'created_at']
169
+ else
170
+ self.created_at = nil
171
+ end
172
+
173
+ if attributes.key?(:'updated_at')
174
+ self.updated_at = attributes[:'updated_at']
175
+ else
176
+ self.updated_at = nil
177
+ end
178
+ end
179
+
180
+ # Show invalid properties with the reasons. Usually used together with valid?
181
+ # @return Array for valid properties with the reasons
182
+ def list_invalid_properties
183
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
184
+ invalid_properties = Array.new
185
+ if @id.nil?
186
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
187
+ end
188
+
189
+ if @name.nil?
190
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
191
+ end
192
+
193
+ if @checks.nil?
194
+ invalid_properties.push('invalid value for "checks", checks cannot be nil.')
195
+ end
196
+
197
+ if @total_price.nil?
198
+ invalid_properties.push('invalid value for "total_price", total_price cannot be nil.')
199
+ end
200
+
201
+ if @supported_countries_of_work.nil?
202
+ invalid_properties.push('invalid value for "supported_countries_of_work", supported_countries_of_work cannot be nil.')
203
+ end
204
+
205
+ if @supported_countries_of_residence.nil?
206
+ invalid_properties.push('invalid value for "supported_countries_of_residence", supported_countries_of_residence cannot be nil.')
207
+ end
208
+
209
+ if @candidate_fields.nil?
210
+ invalid_properties.push('invalid value for "candidate_fields", candidate_fields cannot be nil.')
211
+ end
212
+
213
+ if @created_at.nil?
214
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
215
+ end
216
+
217
+ if @updated_at.nil?
218
+ invalid_properties.push('invalid value for "updated_at", updated_at 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
+ warn '[DEPRECATED] the `valid?` method is obsolete'
228
+ return false if @id.nil?
229
+ return false if @name.nil?
230
+ return false if @checks.nil?
231
+ return false if @total_price.nil?
232
+ return false if @supported_countries_of_work.nil?
233
+ return false if @supported_countries_of_residence.nil?
234
+ return false if @candidate_fields.nil?
235
+ return false if @created_at.nil?
236
+ return false if @updated_at.nil?
237
+ true
238
+ end
239
+
240
+ # Custom attribute writer method with validation
241
+ # @param [Object] id Value to be assigned
242
+ def id=(id)
243
+ if id.nil?
244
+ fail ArgumentError, 'id cannot be nil'
245
+ end
246
+
247
+ @id = id
248
+ end
249
+
250
+ # Custom attribute writer method with validation
251
+ # @param [Object] name Value to be assigned
252
+ def name=(name)
253
+ if name.nil?
254
+ fail ArgumentError, 'name cannot be nil'
255
+ end
256
+
257
+ @name = name
258
+ end
259
+
260
+ # Custom attribute writer method with validation
261
+ # @param [Object] checks Value to be assigned
262
+ def checks=(checks)
263
+ if checks.nil?
264
+ fail ArgumentError, 'checks cannot be nil'
265
+ end
266
+
267
+ @checks = checks
268
+ end
269
+
270
+ # Custom attribute writer method with validation
271
+ # @param [Object] total_price Value to be assigned
272
+ def total_price=(total_price)
273
+ if total_price.nil?
274
+ fail ArgumentError, 'total_price cannot be nil'
275
+ end
276
+
277
+ @total_price = total_price
278
+ end
279
+
280
+ # Custom attribute writer method with validation
281
+ # @param [Object] supported_countries_of_work Value to be assigned
282
+ def supported_countries_of_work=(supported_countries_of_work)
283
+ if supported_countries_of_work.nil?
284
+ fail ArgumentError, 'supported_countries_of_work cannot be nil'
285
+ end
286
+
287
+ @supported_countries_of_work = supported_countries_of_work
288
+ end
289
+
290
+ # Custom attribute writer method with validation
291
+ # @param [Object] supported_countries_of_residence Value to be assigned
292
+ def supported_countries_of_residence=(supported_countries_of_residence)
293
+ if supported_countries_of_residence.nil?
294
+ fail ArgumentError, 'supported_countries_of_residence cannot be nil'
295
+ end
296
+
297
+ @supported_countries_of_residence = supported_countries_of_residence
298
+ end
299
+
300
+ # Custom attribute writer method with validation
301
+ # @param [Object] candidate_fields Value to be assigned
302
+ def candidate_fields=(candidate_fields)
303
+ if candidate_fields.nil?
304
+ fail ArgumentError, 'candidate_fields cannot be nil'
305
+ end
306
+
307
+ @candidate_fields = candidate_fields
308
+ end
309
+
310
+ # Custom attribute writer method with validation
311
+ # @param [Object] created_at Value to be assigned
312
+ def created_at=(created_at)
313
+ if created_at.nil?
314
+ fail ArgumentError, 'created_at cannot be nil'
315
+ end
316
+
317
+ @created_at = created_at
318
+ end
319
+
320
+ # Custom attribute writer method with validation
321
+ # @param [Object] updated_at Value to be assigned
322
+ def updated_at=(updated_at)
323
+ if updated_at.nil?
324
+ fail ArgumentError, 'updated_at cannot be nil'
325
+ end
326
+
327
+ @updated_at = updated_at
328
+ end
329
+
330
+ # Checks equality by comparing each attribute.
331
+ # @param [Object] Object to be compared
332
+ def ==(o)
333
+ return true if self.equal?(o)
334
+ self.class == o.class &&
335
+ id == o.id &&
336
+ name == o.name &&
337
+ description == o.description &&
338
+ is_custom == o.is_custom &&
339
+ checks == o.checks &&
340
+ total_price == o.total_price &&
341
+ supported_countries_of_work == o.supported_countries_of_work &&
342
+ supported_countries_of_residence == o.supported_countries_of_residence &&
343
+ candidate_fields == o.candidate_fields &&
344
+ created_at == o.created_at &&
345
+ updated_at == o.updated_at
346
+ end
347
+
348
+ # @see the `==` method
349
+ # @param [Object] Object to be compared
350
+ def eql?(o)
351
+ self == o
352
+ end
353
+
354
+ # Calculates hash code according to all attributes.
355
+ # @return [Integer] Hash code
356
+ def hash
357
+ [id, name, description, is_custom, checks, total_price, supported_countries_of_work, supported_countries_of_residence, candidate_fields, created_at, updated_at].hash
358
+ end
359
+
360
+ # Builds the object from hash
361
+ # @param [Hash] attributes Model attributes in the form of hash
362
+ # @return [Object] Returns the model itself
363
+ def self.build_from_hash(attributes)
364
+ return nil unless attributes.is_a?(Hash)
365
+ attributes = attributes.transform_keys(&:to_sym)
366
+ transformed_hash = {}
367
+ openapi_types.each_pair do |key, type|
368
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
369
+ transformed_hash["#{key}"] = nil
370
+ elsif type =~ /\AArray<(.*)>/i
371
+ # check to ensure the input is an array given that the attribute
372
+ # is documented as an array but the input is not
373
+ if attributes[attribute_map[key]].is_a?(Array)
374
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
375
+ end
376
+ elsif !attributes[attribute_map[key]].nil?
377
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
378
+ end
379
+ end
380
+ new(transformed_hash)
381
+ end
382
+
383
+ # Returns the object in the form of hash
384
+ # @return [Hash] Returns the object in the form of hash
385
+ def to_hash
386
+ hash = {}
387
+ self.class.attribute_map.each_pair do |attr, param|
388
+ value = self.send(attr)
389
+ if value.nil?
390
+ is_nullable = self.class.openapi_nullable.include?(attr)
391
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
392
+ end
393
+
394
+ hash[param] = _to_hash(value)
395
+ end
396
+ hash
397
+ end
398
+
399
+ end
400
+
401
+ end