Class: ShellCardManagementApIs::CreateBundleResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_card_management_ap_is/models/create_bundle_response.rb

Overview

CreateBundleResponse 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(bundle_creation_status = SKIP, bundle_id = SKIP, day_time_restriction_status = SKIP, day_time_restriction_profile_id = SKIP, location_restriction_status = SKIP, location_restriction_profile_id = SKIP, usage_restriction_status = SKIP, product_restriction_status = SKIP, product_restriction_profile_id = SKIP, cards = SKIP) ⇒ CreateBundleResponse

Returns a new instance of CreateBundleResponse.



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
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 91

def initialize(bundle_creation_status = SKIP, bundle_id = SKIP,
               day_time_restriction_status = SKIP,
               day_time_restriction_profile_id = SKIP,
               location_restriction_status = SKIP,
               location_restriction_profile_id = SKIP,
               usage_restriction_status = SKIP,
               product_restriction_status = SKIP,
               product_restriction_profile_id = SKIP, cards = SKIP)
  @bundle_creation_status = bundle_creation_status unless bundle_creation_status == SKIP
  @bundle_id = bundle_id unless bundle_id == SKIP
  unless day_time_restriction_status == SKIP
    @day_time_restriction_status =
      day_time_restriction_status
  end
  unless day_time_restriction_profile_id == SKIP
    @day_time_restriction_profile_id =
      day_time_restriction_profile_id
  end
  unless location_restriction_status == SKIP
    @location_restriction_status =
      location_restriction_status
  end
  unless location_restriction_profile_id == SKIP
    @location_restriction_profile_id =
      location_restriction_profile_id
  end
  @usage_restriction_status = usage_restriction_status unless usage_restriction_status == SKIP
  unless product_restriction_status == SKIP
    @product_restriction_status =
      product_restriction_status
  end
  unless product_restriction_profile_id == SKIP
    @product_restriction_profile_id =
      product_restriction_profile_id
  end
  @cards = cards unless cards == SKIP
end

Instance Attribute Details

#bundle_creation_statusErrorStatus

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 14

def bundle_creation_status
  @bundle_creation_status
end

#bundle_idString

Identifier of the newly created bundle

Returns:

  • (String)


18
19
20
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 18

def bundle_id
  @bundle_id
end

#cardsArray[BundleCardRestrictionStatus]

Identifier of the product restriction profile created

Returns:



50
51
52
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 50

def cards
  @cards
end

#day_time_restriction_profile_idString

Identifier of the day/time restriction profile created

Returns:

  • (String)


26
27
28
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 26

def day_time_restriction_profile_id
  @day_time_restriction_profile_id
end

#day_time_restriction_statusErrorStatus

Identifier of the newly created bundle

Returns:



22
23
24
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 22

def day_time_restriction_status
  @day_time_restriction_status
end

#location_restriction_profile_idString

Identifier of the location restriction profile created

Returns:

  • (String)


34
35
36
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 34

def location_restriction_profile_id
  @location_restriction_profile_id
end

#location_restriction_statusErrorStatus

Identifier of the day/time restriction profile created

Returns:



30
31
32
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 30

def location_restriction_status
  @location_restriction_status
end

#product_restriction_profile_idString

Identifier of the product restriction profile created

Returns:

  • (String)


46
47
48
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 46

def product_restriction_profile_id
  @product_restriction_profile_id
end

#product_restriction_statusErrorStatus

Identifier of the location restriction profile created

Returns:



42
43
44
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 42

def product_restriction_status
  @product_restriction_status
end

#usage_restriction_statusErrorStatus

Identifier of the location restriction profile created

Returns:



38
39
40
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 38

def usage_restriction_status
  @usage_restriction_status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 130

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  bundle_creation_status = ErrorStatus.from_hash(hash['BundleCreationStatus']) if
    hash['BundleCreationStatus']
  bundle_id = hash.key?('BundleId') ? hash['BundleId'] : SKIP
  day_time_restriction_status = ErrorStatus.from_hash(hash['DayTimeRestrictionStatus']) if
    hash['DayTimeRestrictionStatus']
  day_time_restriction_profile_id =
    hash.key?('DayTimeRestrictionProfileId') ? hash['DayTimeRestrictionProfileId'] : SKIP
  location_restriction_status = ErrorStatus.from_hash(hash['LocationRestrictionStatus']) if
    hash['LocationRestrictionStatus']
  location_restriction_profile_id =
    hash.key?('LocationRestrictionProfileId') ? hash['LocationRestrictionProfileId'] : SKIP
  usage_restriction_status = ErrorStatus.from_hash(hash['UsageRestrictionStatus']) if
    hash['UsageRestrictionStatus']
  product_restriction_status = ErrorStatus.from_hash(hash['ProductRestrictionStatus']) if
    hash['ProductRestrictionStatus']
  product_restriction_profile_id =
    hash.key?('ProductRestrictionProfileId') ? hash['ProductRestrictionProfileId'] : SKIP
  # Parameter is an array, so we need to iterate through it

  cards = nil
  unless hash['Cards'].nil?
    cards = []
    hash['Cards'].each do |structure|
      cards << (BundleCardRestrictionStatus.from_hash(structure) if structure)
    end
  end

  cards = SKIP unless hash.key?('Cards')

  # Create object from extracted values.

  CreateBundleResponse.new(bundle_creation_status,
                           bundle_id,
                           day_time_restriction_status,
                           day_time_restriction_profile_id,
                           location_restriction_status,
                           location_restriction_profile_id,
                           usage_restriction_status,
                           product_restriction_status,
                           product_restriction_profile_id,
                           cards)
end

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['bundle_creation_status'] = 'BundleCreationStatus'
  @_hash['bundle_id'] = 'BundleId'
  @_hash['day_time_restriction_status'] = 'DayTimeRestrictionStatus'
  @_hash['day_time_restriction_profile_id'] =
    'DayTimeRestrictionProfileId'
  @_hash['location_restriction_status'] = 'LocationRestrictionStatus'
  @_hash['location_restriction_profile_id'] =
    'LocationRestrictionProfileId'
  @_hash['usage_restriction_status'] = 'UsageRestrictionStatus'
  @_hash['product_restriction_status'] = 'ProductRestrictionStatus'
  @_hash['product_restriction_profile_id'] = 'ProductRestrictionProfileId'
  @_hash['cards'] = 'Cards'
  @_hash
end

.nullablesObject

An array for nullable fields



87
88
89
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 87

def self.nullables
  []
end

.optionalsObject

An array for optional fields



71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 71

def self.optionals
  %w[
    bundle_creation_status
    bundle_id
    day_time_restriction_status
    day_time_restriction_profile_id
    location_restriction_status
    location_restriction_profile_id
    usage_restriction_status
    product_restriction_status
    product_restriction_profile_id
    cards
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 189

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} bundle_creation_status: #{@bundle_creation_status.inspect}, bundle_id:"\
  " #{@bundle_id.inspect}, day_time_restriction_status:"\
  " #{@day_time_restriction_status.inspect}, day_time_restriction_profile_id:"\
  " #{@day_time_restriction_profile_id.inspect}, location_restriction_status:"\
  " #{@location_restriction_status.inspect}, location_restriction_profile_id:"\
  " #{@location_restriction_profile_id.inspect}, usage_restriction_status:"\
  " #{@usage_restriction_status.inspect}, product_restriction_status:"\
  " #{@product_restriction_status.inspect}, product_restriction_profile_id:"\
  " #{@product_restriction_profile_id.inspect}, cards: #{@cards.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



176
177
178
179
180
181
182
183
184
185
186
# File 'lib/shell_card_management_ap_is/models/create_bundle_response.rb', line 176

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} bundle_creation_status: #{@bundle_creation_status}, bundle_id:"\
  " #{@bundle_id}, day_time_restriction_status: #{@day_time_restriction_status},"\
  " day_time_restriction_profile_id: #{@day_time_restriction_profile_id},"\
  " location_restriction_status: #{@location_restriction_status},"\
  " location_restriction_profile_id: #{@location_restriction_profile_id},"\
  " usage_restriction_status: #{@usage_restriction_status}, product_restriction_status:"\
  " #{@product_restriction_status}, product_restriction_profile_id:"\
  " #{@product_restriction_profile_id}, cards: #{@cards}>"
end