Class: MistApi::ResponseOrgInventoryChange

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/response_org_inventory_change.rb

Overview

ResponseOrgInventoryChange Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(error = nil, op = nil, reason = nil, success = nil) ⇒ ResponseOrgInventoryChange

Returns a new instance of ResponseOrgInventoryChange.



51
52
53
54
55
56
# File 'lib/mist_api/models/response_org_inventory_change.rb', line 51

def initialize(error = nil, op = nil, reason = nil, success = nil)
  @error = error
  @op = op
  @reason = reason
  @success = success
end

Instance Attribute Details

#errorArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


14
15
16
# File 'lib/mist_api/models/response_org_inventory_change.rb', line 14

def error
  @error
end

#opResponseOrgInventoryChangeOpEnum

enum: ‘assign`, `delete`, `downgrade_to_jsi`, `unassign`, `upgrade_to_mist`



19
20
21
# File 'lib/mist_api/models/response_org_inventory_change.rb', line 19

def op
  @op
end

#reasonArray[String]

enum: ‘assign`, `delete`, `downgrade_to_jsi`, `unassign`, `upgrade_to_mist`

Returns:

  • (Array[String])


24
25
26
# File 'lib/mist_api/models/response_org_inventory_change.rb', line 24

def reason
  @reason
end

#successArray[String]

enum: ‘assign`, `delete`, `downgrade_to_jsi`, `unassign`, `upgrade_to_mist`

Returns:

  • (Array[String])


29
30
31
# File 'lib/mist_api/models/response_org_inventory_change.rb', line 29

def success
  @success
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/mist_api/models/response_org_inventory_change.rb', line 59

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  error = hash.key?('error') ? hash['error'] : nil
  op = hash.key?('op') ? hash['op'] : nil
  reason = hash.key?('reason') ? hash['reason'] : nil
  success = hash.key?('success') ? hash['success'] : nil

  # Create object from extracted values.
  ResponseOrgInventoryChange.new(error,
                                 op,
                                 reason,
                                 success)
end

.namesObject

A mapping from model property names to API property names.



32
33
34
35
36
37
38
39
# File 'lib/mist_api/models/response_org_inventory_change.rb', line 32

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['error'] = 'error'
  @_hash['op'] = 'op'
  @_hash['reason'] = 'reason'
  @_hash['success'] = 'success'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/mist_api/models/response_org_inventory_change.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



42
43
44
# File 'lib/mist_api/models/response_org_inventory_change.rb', line 42

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



82
83
84
85
86
# File 'lib/mist_api/models/response_org_inventory_change.rb', line 82

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} error: #{@error.inspect}, op: #{@op.inspect}, reason: #{@reason.inspect},"\
  " success: #{@success.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



76
77
78
79
# File 'lib/mist_api/models/response_org_inventory_change.rb', line 76

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} error: #{@error}, op: #{@op}, reason: #{@reason}, success: #{@success}>"
end