Class: ShellCardManagementApIs::BundledRestrictionsList

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

Overview

BundledRestrictionsList Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(usage_restrictions = SKIP, day_time_restrictions = SKIP, product_restrictions = SKIP, location_restrictions = SKIP) ⇒ BundledRestrictionsList

Returns a new instance of BundledRestrictionsList.



53
54
55
56
57
58
59
# File 'lib/shell_card_management_ap_is/models/bundled_restrictions_list.rb', line 53

def initialize(usage_restrictions = SKIP, day_time_restrictions = SKIP,
               product_restrictions = SKIP, location_restrictions = SKIP)
  @usage_restrictions = usage_restrictions unless usage_restrictions == SKIP
  @day_time_restrictions = day_time_restrictions unless day_time_restrictions == SKIP
  @product_restrictions = product_restrictions unless product_restrictions == SKIP
  @location_restrictions = location_restrictions unless location_restrictions == SKIP
end

Instance Attribute Details

#day_time_restrictionsDayTimeRestrictions

TODO: Write general description for this method

Returns:



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

def day_time_restrictions
  @day_time_restrictions
end

#location_restrictionsLocationRestriction

TODO: Write general description for this method

Returns:



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

def location_restrictions
  @location_restrictions
end

#product_restrictionsBundledDetailsProductList

TODO: Write general description for this method



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

def product_restrictions
  @product_restrictions
end

#usage_restrictionsObject

TODO: Write general description for this method

Returns:

  • (Object)


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

def usage_restrictions
  @usage_restrictions
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/shell_card_management_ap_is/models/bundled_restrictions_list.rb', line 62

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  usage_restrictions =
    hash.key?('UsageRestrictions') ? hash['UsageRestrictions'] : SKIP
  day_time_restrictions = DayTimeRestrictions.from_hash(hash['DayTimeRestrictions']) if
    hash['DayTimeRestrictions']
  product_restrictions = BundledDetailsProductList.from_hash(hash['ProductRestrictions']) if
    hash['ProductRestrictions']
  location_restrictions = LocationRestriction.from_hash(hash['LocationRestrictions']) if
    hash['LocationRestrictions']

  # Create object from extracted values.
  BundledRestrictionsList.new(usage_restrictions,
                              day_time_restrictions,
                              product_restrictions,
                              location_restrictions)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['usage_restrictions'] = 'UsageRestrictions'
  @_hash['day_time_restrictions'] = 'DayTimeRestrictions'
  @_hash['product_restrictions'] = 'ProductRestrictions'
  @_hash['location_restrictions'] = 'LocationRestrictions'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/shell_card_management_ap_is/models/bundled_restrictions_list.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
46
# File 'lib/shell_card_management_ap_is/models/bundled_restrictions_list.rb', line 39

def self.optionals
  %w[
    usage_restrictions
    day_time_restrictions
    product_restrictions
    location_restrictions
  ]
end