Class: FinnhubRuby::VisaApplication

Inherits:
Object
  • Object
show all
Defined in:
lib/finnhub_ruby/models/visa_application.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VisaApplication

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/finnhub_ruby/models/visa_application.rb', line 158

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::VisaApplication` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::VisaApplication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'year')
    self.year = attributes[:'year']
  end

  if attributes.key?(:'quarter')
    self.quarter = attributes[:'quarter']
  end

  if attributes.key?(:'symbol')
    self.symbol = attributes[:'symbol']
  end

  if attributes.key?(:'case_number')
    self.case_number = attributes[:'case_number']
  end

  if attributes.key?(:'case_status')
    self.case_status = attributes[:'case_status']
  end

  if attributes.key?(:'received_date')
    self.received_date = attributes[:'received_date']
  end

  if attributes.key?(:'visa_class')
    self.visa_class = attributes[:'visa_class']
  end

  if attributes.key?(:'job_title')
    self.job_title = attributes[:'job_title']
  end

  if attributes.key?(:'soc_code')
    self.soc_code = attributes[:'soc_code']
  end

  if attributes.key?(:'full_time_position')
    self.full_time_position = attributes[:'full_time_position']
  end

  if attributes.key?(:'begin_date')
    self.begin_date = attributes[:'begin_date']
  end

  if attributes.key?(:'end_date')
    self.end_date = attributes[:'end_date']
  end

  if attributes.key?(:'employer_name')
    self.employer_name = attributes[:'employer_name']
  end

  if attributes.key?(:'worksite_address')
    self.worksite_address = attributes[:'worksite_address']
  end

  if attributes.key?(:'worksite_city')
    self.worksite_city = attributes[:'worksite_city']
  end

  if attributes.key?(:'worksite_county')
    self.worksite_county = attributes[:'worksite_county']
  end

  if attributes.key?(:'worksite_state')
    self.worksite_state = attributes[:'worksite_state']
  end

  if attributes.key?(:'worksite_postal_code')
    self.worksite_postal_code = attributes[:'worksite_postal_code']
  end

  if attributes.key?(:'wage_range_from')
    self.wage_range_from = attributes[:'wage_range_from']
  end

  if attributes.key?(:'wage_range_to')
    self.wage_range_to = attributes[:'wage_range_to']
  end

  if attributes.key?(:'wage_unit_of_pay')
    self.wage_unit_of_pay = attributes[:'wage_unit_of_pay']
  end

  if attributes.key?(:'wage_level')
    self.wage_level = attributes[:'wage_level']
  end

  if attributes.key?(:'h1b_dependent')
    self.h1b_dependent = attributes[:'h1b_dependent']
  end
end

Instance Attribute Details

#begin_dateObject

Job’s start date.



49
50
51
# File 'lib/finnhub_ruby/models/visa_application.rb', line 49

def begin_date
  @begin_date
end

#case_numberObject

Case number.



28
29
30
# File 'lib/finnhub_ruby/models/visa_application.rb', line 28

def case_number
  @case_number
end

#case_statusObject

Case status.



31
32
33
# File 'lib/finnhub_ruby/models/visa_application.rb', line 31

def case_status
  @case_status
end

#employer_nameObject

Company’s name.



55
56
57
# File 'lib/finnhub_ruby/models/visa_application.rb', line 55

def employer_name
  @employer_name
end

#end_dateObject

Job’s end date.



52
53
54
# File 'lib/finnhub_ruby/models/visa_application.rb', line 52

def end_date
  @end_date
end

#full_time_positionObject

Full-time position flag.



46
47
48
# File 'lib/finnhub_ruby/models/visa_application.rb', line 46

def full_time_position
  @full_time_position
end

#h1b_dependentObject

H1B dependent flag.



85
86
87
# File 'lib/finnhub_ruby/models/visa_application.rb', line 85

def h1b_dependent
  @h1b_dependent
end

#job_titleObject

Job Title.



40
41
42
# File 'lib/finnhub_ruby/models/visa_application.rb', line 40

def job_title
  @job_title
end

#quarterObject

Quarter.



22
23
24
# File 'lib/finnhub_ruby/models/visa_application.rb', line 22

def quarter
  @quarter
end

#received_dateObject

Received date.



34
35
36
# File 'lib/finnhub_ruby/models/visa_application.rb', line 34

def received_date
  @received_date
end

#soc_codeObject

SOC Code. A list of SOC code can be found <a href="www.bls.gov/oes/current/oes_stru.htm" target="_blank">here</a>.



43
44
45
# File 'lib/finnhub_ruby/models/visa_application.rb', line 43

def soc_code
  @soc_code
end

#symbolObject

Symbol.



25
26
27
# File 'lib/finnhub_ruby/models/visa_application.rb', line 25

def symbol
  @symbol
end

#visa_classObject

Visa class.



37
38
39
# File 'lib/finnhub_ruby/models/visa_application.rb', line 37

def visa_class
  @visa_class
end

#wage_levelObject

Wage level.



82
83
84
# File 'lib/finnhub_ruby/models/visa_application.rb', line 82

def wage_level
  @wage_level
end

#wage_range_fromObject

Wage range from.



73
74
75
# File 'lib/finnhub_ruby/models/visa_application.rb', line 73

def wage_range_from
  @wage_range_from
end

#wage_range_toObject

Wage range to.



76
77
78
# File 'lib/finnhub_ruby/models/visa_application.rb', line 76

def wage_range_to
  @wage_range_to
end

#wage_unit_of_payObject

Wage unit of pay.



79
80
81
# File 'lib/finnhub_ruby/models/visa_application.rb', line 79

def wage_unit_of_pay
  @wage_unit_of_pay
end

#worksite_addressObject

Worksite address.



58
59
60
# File 'lib/finnhub_ruby/models/visa_application.rb', line 58

def worksite_address
  @worksite_address
end

#worksite_cityObject

Worksite city.



61
62
63
# File 'lib/finnhub_ruby/models/visa_application.rb', line 61

def worksite_city
  @worksite_city
end

#worksite_countyObject

Worksite county.



64
65
66
# File 'lib/finnhub_ruby/models/visa_application.rb', line 64

def worksite_county
  @worksite_county
end

#worksite_postal_codeObject

Worksite postal code.



70
71
72
# File 'lib/finnhub_ruby/models/visa_application.rb', line 70

def worksite_postal_code
  @worksite_postal_code
end

#worksite_stateObject

Worksite state.



67
68
69
# File 'lib/finnhub_ruby/models/visa_application.rb', line 67

def worksite_state
  @worksite_state
end

#yearObject

Year.



19
20
21
# File 'lib/finnhub_ruby/models/visa_application.rb', line 19

def year
  @year
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



117
118
119
# File 'lib/finnhub_ruby/models/visa_application.rb', line 117

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/finnhub_ruby/models/visa_application.rb', line 88

def self.attribute_map
  {
    :'year' => :'year',
    :'quarter' => :'quarter',
    :'symbol' => :'symbol',
    :'case_number' => :'caseNumber',
    :'case_status' => :'caseStatus',
    :'received_date' => :'receivedDate',
    :'visa_class' => :'visaClass',
    :'job_title' => :'jobTitle',
    :'soc_code' => :'socCode',
    :'full_time_position' => :'fullTimePosition',
    :'begin_date' => :'beginDate',
    :'end_date' => :'endDate',
    :'employer_name' => :'employerName',
    :'worksite_address' => :'worksiteAddress',
    :'worksite_city' => :'worksiteCity',
    :'worksite_county' => :'worksiteCounty',
    :'worksite_state' => :'worksiteState',
    :'worksite_postal_code' => :'worksitePostalCode',
    :'wage_range_from' => :'wageRangeFrom',
    :'wage_range_to' => :'wageRangeTo',
    :'wage_unit_of_pay' => :'wageUnitOfPay',
    :'wage_level' => :'wageLevel',
    :'h1b_dependent' => :'h1bDependent'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



322
323
324
# File 'lib/finnhub_ruby/models/visa_application.rb', line 322

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



151
152
153
154
# File 'lib/finnhub_ruby/models/visa_application.rb', line 151

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/finnhub_ruby/models/visa_application.rb', line 122

def self.openapi_types
  {
    :'year' => :'Integer',
    :'quarter' => :'Integer',
    :'symbol' => :'String',
    :'case_number' => :'String',
    :'case_status' => :'String',
    :'received_date' => :'String',
    :'visa_class' => :'String',
    :'job_title' => :'String',
    :'soc_code' => :'String',
    :'full_time_position' => :'String',
    :'begin_date' => :'String',
    :'end_date' => :'String',
    :'employer_name' => :'String',
    :'worksite_address' => :'String',
    :'worksite_city' => :'String',
    :'worksite_county' => :'String',
    :'worksite_state' => :'String',
    :'worksite_postal_code' => :'String',
    :'wage_range_from' => :'Float',
    :'wage_range_to' => :'Float',
    :'wage_unit_of_pay' => :'String',
    :'wage_level' => :'String',
    :'h1b_dependent' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/finnhub_ruby/models/visa_application.rb', line 279

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      year == o.year &&
      quarter == o.quarter &&
      symbol == o.symbol &&
      case_number == o.case_number &&
      case_status == o.case_status &&
      received_date == o.received_date &&
      visa_class == o.visa_class &&
      job_title == o.job_title &&
      soc_code == o.soc_code &&
      full_time_position == o.full_time_position &&
      begin_date == o.begin_date &&
      end_date == o.end_date &&
      employer_name == o.employer_name &&
      worksite_address == o.worksite_address &&
      worksite_city == o.worksite_city &&
      worksite_county == o.worksite_county &&
      worksite_state == o.worksite_state &&
      worksite_postal_code == o.worksite_postal_code &&
      wage_range_from == o.wage_range_from &&
      wage_range_to == o.wage_range_to &&
      wage_unit_of_pay == o.wage_unit_of_pay &&
      wage_level == o.wage_level &&
      h1b_dependent == o.h1b_dependent
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/finnhub_ruby/models/visa_application.rb', line 352

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = FinnhubRuby.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/finnhub_ruby/models/visa_application.rb', line 423

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/finnhub_ruby/models/visa_application.rb', line 329

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


309
310
311
# File 'lib/finnhub_ruby/models/visa_application.rb', line 309

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



315
316
317
# File 'lib/finnhub_ruby/models/visa_application.rb', line 315

def hash
  [year, quarter, symbol, case_number, case_status, received_date, visa_class, job_title, soc_code, full_time_position, begin_date, end_date, employer_name, worksite_address, worksite_city, worksite_county, worksite_state, worksite_postal_code, wage_range_from, wage_range_to, wage_unit_of_pay, wage_level, h1b_dependent].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



266
267
268
269
# File 'lib/finnhub_ruby/models/visa_application.rb', line 266

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



399
400
401
# File 'lib/finnhub_ruby/models/visa_application.rb', line 399

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/finnhub_ruby/models/visa_application.rb', line 405

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



393
394
395
# File 'lib/finnhub_ruby/models/visa_application.rb', line 393

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



273
274
275
# File 'lib/finnhub_ruby/models/visa_application.rb', line 273

def valid?
  true
end