Class: ShellCardManagementApIs::BundledRestrictionsList
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::BundledRestrictionsList
- Defined in:
- lib/shell_card_management_ap_is/models/bundled_restrictions_list.rb
Overview
BundledRestrictionsList Model.
Instance Attribute Summary collapse
-
#day_time_restrictions ⇒ DayTimeRestrictions
TODO: Write general description for this method.
-
#location_restrictions ⇒ LocationRestriction
TODO: Write general description for this method.
-
#product_restrictions ⇒ BundledDetailsProductList
TODO: Write general description for this method.
-
#usage_restrictions ⇒ Object
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(usage_restrictions = SKIP, day_time_restrictions = SKIP, product_restrictions = SKIP, location_restrictions = SKIP) ⇒ BundledRestrictionsList
constructor
A new instance of BundledRestrictionsList.
Methods inherited from BaseModel
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_restrictions ⇒ DayTimeRestrictions
TODO: Write general description for this method
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_restrictions ⇒ LocationRestriction
TODO: Write general description for this method
26 27 28 |
# File 'lib/shell_card_management_ap_is/models/bundled_restrictions_list.rb', line 26 def location_restrictions @location_restrictions end |
#product_restrictions ⇒ BundledDetailsProductList
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_restrictions ⇒ Object
TODO: Write general description for this method
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
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 |
.optionals ⇒ Object
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 |