Class: MistApi::ResponseClaimLicense

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

Overview

ResponseClaimLicense 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(inventory_added = nil, inventory_duplicated = nil, license_added = nil, license_duplicated = nil, license_error = nil, inventory_pending = SKIP) ⇒ ResponseClaimLicense

Returns a new instance of ResponseClaimLicense.



60
61
62
63
64
65
66
67
68
69
# File 'lib/mist_api/models/response_claim_license.rb', line 60

def initialize(inventory_added = nil, inventory_duplicated = nil,
               license_added = nil, license_duplicated = nil,
               license_error = nil, inventory_pending = SKIP)
  @inventory_added = inventory_added
  @inventory_duplicated = inventory_duplicated
  @inventory_pending = inventory_pending unless inventory_pending == SKIP
  @license_added = license_added
  @license_duplicated = license_duplicated
  @license_error = license_error
end

Instance Attribute Details

#inventory_addedArray[ResponseClaimLicenseInventoryItem]

TODO: Write general description for this method



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

def inventory_added
  @inventory_added
end

#inventory_duplicatedArray[ResponseClaimLicenseInventoryItem]

TODO: Write general description for this method



18
19
20
# File 'lib/mist_api/models/response_claim_license.rb', line 18

def inventory_duplicated
  @inventory_duplicated
end

#inventory_pendingArray[ResponseClaimLicenseInventoryPendingItem]

for async claim



22
23
24
# File 'lib/mist_api/models/response_claim_license.rb', line 22

def inventory_pending
  @inventory_pending
end

#license_addedArray[ResponseClaimLicenseLicenseItem]

for async claim



26
27
28
# File 'lib/mist_api/models/response_claim_license.rb', line 26

def license_added
  @license_added
end

#license_duplicatedArray[ResponseClaimLicenseLicenseItem]

for async claim



30
31
32
# File 'lib/mist_api/models/response_claim_license.rb', line 30

def license_duplicated
  @license_duplicated
end

#license_errorArray[ResponseClaimLicenseLicenseErrorItem]

for async claim



34
35
36
# File 'lib/mist_api/models/response_claim_license.rb', line 34

def license_error
  @license_error
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/mist_api/models/response_claim_license.rb', line 72

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  # Parameter is an array, so we need to iterate through it
  inventory_added = nil
  unless hash['inventory_added'].nil?
    inventory_added = []
    hash['inventory_added'].each do |structure|
      inventory_added << (ResponseClaimLicenseInventoryItem.from_hash(structure) if structure)
    end
  end

  inventory_added = nil unless hash.key?('inventory_added')
  # Parameter is an array, so we need to iterate through it
  inventory_duplicated = nil
  unless hash['inventory_duplicated'].nil?
    inventory_duplicated = []
    hash['inventory_duplicated'].each do |structure|
      inventory_duplicated << (ResponseClaimLicenseInventoryItem.from_hash(structure) if structure)
    end
  end

  inventory_duplicated = nil unless hash.key?('inventory_duplicated')
  # Parameter is an array, so we need to iterate through it
  license_added = nil
  unless hash['license_added'].nil?
    license_added = []
    hash['license_added'].each do |structure|
      license_added << (ResponseClaimLicenseLicenseItem.from_hash(structure) if structure)
    end
  end

  license_added = nil unless hash.key?('license_added')
  # Parameter is an array, so we need to iterate through it
  license_duplicated = nil
  unless hash['license_duplicated'].nil?
    license_duplicated = []
    hash['license_duplicated'].each do |structure|
      license_duplicated << (ResponseClaimLicenseLicenseItem.from_hash(structure) if structure)
    end
  end

  license_duplicated = nil unless hash.key?('license_duplicated')
  # Parameter is an array, so we need to iterate through it
  license_error = nil
  unless hash['license_error'].nil?
    license_error = []
    hash['license_error'].each do |structure|
      license_error << (ResponseClaimLicenseLicenseErrorItem.from_hash(structure) if structure)
    end
  end

  license_error = nil unless hash.key?('license_error')
  # Parameter is an array, so we need to iterate through it
  inventory_pending = nil
  unless hash['inventory_pending'].nil?
    inventory_pending = []
    hash['inventory_pending'].each do |structure|
      inventory_pending << (ResponseClaimLicenseInventoryPendingItem.from_hash(structure) if structure)
    end
  end

  inventory_pending = SKIP unless hash.key?('inventory_pending')

  # Create object from extracted values.
  ResponseClaimLicense.new(inventory_added,
                           inventory_duplicated,
                           license_added,
                           license_duplicated,
                           license_error,
                           inventory_pending)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/response_claim_license.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['inventory_added'] = 'inventory_added'
  @_hash['inventory_duplicated'] = 'inventory_duplicated'
  @_hash['inventory_pending'] = 'inventory_pending'
  @_hash['license_added'] = 'license_added'
  @_hash['license_duplicated'] = 'license_duplicated'
  @_hash['license_error'] = 'license_error'
  @_hash
end

.nullablesObject

An array for nullable fields



56
57
58
# File 'lib/mist_api/models/response_claim_license.rb', line 56

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
# File 'lib/mist_api/models/response_claim_license.rb', line 49

def self.optionals
  %w[
    inventory_pending
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



156
157
158
159
160
161
162
# File 'lib/mist_api/models/response_claim_license.rb', line 156

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} inventory_added: #{@inventory_added.inspect}, inventory_duplicated:"\
  " #{@inventory_duplicated.inspect}, inventory_pending: #{@inventory_pending.inspect},"\
  " license_added: #{@license_added.inspect}, license_duplicated:"\
  " #{@license_duplicated.inspect}, license_error: #{@license_error.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



147
148
149
150
151
152
153
# File 'lib/mist_api/models/response_claim_license.rb', line 147

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} inventory_added: #{@inventory_added}, inventory_duplicated:"\
  " #{@inventory_duplicated}, inventory_pending: #{@inventory_pending}, license_added:"\
  " #{@license_added}, license_duplicated: #{@license_duplicated}, license_error:"\
  " #{@license_error}>"
end