Class: ShellEv::M405ErrorResponseError

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_ev/models/m405_error_response_error.rb

Overview

M405ErrorResponseError Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(code = nil, title = nil, detail = nil, additional_info = SKIP) ⇒ M405ErrorResponseError

Returns a new instance of M405ErrorResponseError.



52
53
54
55
56
57
58
59
60
# File 'lib/shell_ev/models/m405_error_response_error.rb', line 52

def initialize(code = nil,
               title = nil,
               detail = nil,
               additional_info = SKIP)
  @code = code
  @title = title
  @detail = detail
  @additional_info = additional_info unless additional_info == SKIP
end

Instance Attribute Details

#additional_infoHash[String, String]

Details of the error that can help under the cause of the error

Returns:

  • (Hash[String, String])


26
27
28
# File 'lib/shell_ev/models/m405_error_response_error.rb', line 26

def additional_info
  @additional_info
end

#codeString

Error code that logically best represents the error encountered

Returns:

  • (String)


14
15
16
# File 'lib/shell_ev/models/m405_error_response_error.rb', line 14

def code
  @code
end

#detailString

Details of the error that can help under the cause of the error

Returns:

  • (String)


22
23
24
# File 'lib/shell_ev/models/m405_error_response_error.rb', line 22

def detail
  @detail
end

#titleString

Description of the error type

Returns:

  • (String)


18
19
20
# File 'lib/shell_ev/models/m405_error_response_error.rb', line 18

def title
  @title
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/shell_ev/models/m405_error_response_error.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  code = hash.key?('Code') ? hash['Code'] : nil
  title = hash.key?('Title') ? hash['Title'] : nil
  detail = hash.key?('Detail') ? hash['Detail'] : nil
  additional_info =
    hash.key?('AdditionalInfo') ? hash['AdditionalInfo'] : SKIP

  # Create object from extracted values.
  M405ErrorResponseError.new(code,
                             title,
                             detail,
                             additional_info)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/shell_ev/models/m405_error_response_error.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['code'] = 'Code'
  @_hash['title'] = 'Title'
  @_hash['detail'] = 'Detail'
  @_hash['additional_info'] = 'AdditionalInfo'
  @_hash
end

.nullablesObject

An array for nullable fields



46
47
48
49
50
# File 'lib/shell_ev/models/m405_error_response_error.rb', line 46

def self.nullables
  %w[
    additional_info
  ]
end

.optionalsObject

An array for optional fields



39
40
41
42
43
# File 'lib/shell_ev/models/m405_error_response_error.rb', line 39

def self.optionals
  %w[
    additional_info
  ]
end