Class: ShellCardManagementApIs::BundleRestriction
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::BundleRestriction
- Defined in:
- lib/shell_card_management_ap_is/models/bundle_restriction.rb
Overview
BundleRestriction Model.
Instance Attribute Summary collapse
-
#day_time_restriction_action ⇒ String
The value indicates what actions to be performed with respect to day time restriction.
-
#day_time_restrictions ⇒ DayTimeRestrictions
The value indicates what actions to be performed with respect to location restriction.
-
#location_restriction_action ⇒ String
The value indicates what actions to be performed with respect to location restriction.
-
#location_restrictions ⇒ LocationRestriction
The value indicates what actions to be performed with respect to location restriction.
-
#product_restrictions ⇒ Object
The value indicates what actions to be performed with respect to location restriction.
-
#usage_restrictions ⇒ Object
The value indicates what actions to be performed with respect to location restriction.
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(day_time_restriction_action = SKIP, location_restriction_action = SKIP, usage_restrictions = SKIP, day_time_restrictions = SKIP, product_restrictions = SKIP, location_restrictions = SKIP) ⇒ BundleRestriction
constructor
A new instance of BundleRestriction.
Methods inherited from BaseModel
Constructor Details
#initialize(day_time_restriction_action = SKIP, location_restriction_action = SKIP, usage_restrictions = SKIP, day_time_restrictions = SKIP, product_restrictions = SKIP, location_restrictions = SKIP) ⇒ BundleRestriction
Returns a new instance of BundleRestriction.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/shell_card_management_ap_is/models/bundle_restriction.rb', line 104 def initialize(day_time_restriction_action = SKIP, location_restriction_action = SKIP, usage_restrictions = SKIP, day_time_restrictions = SKIP, product_restrictions = SKIP, location_restrictions = SKIP) unless day_time_restriction_action == SKIP @day_time_restriction_action = day_time_restriction_action end unless location_restriction_action == SKIP @location_restriction_action = location_restriction_action end @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_restriction_action ⇒ String
The value indicates what actions to be performed with respect to day time restriction. Mandatory Allowed values – • Add: Apply the given restriction on the bundle. • Default: No Day/Time restriction will be applied on the bundle in Gateway.
20 21 22 |
# File 'lib/shell_card_management_ap_is/models/bundle_restriction.rb', line 20 def day_time_restriction_action @day_time_restriction_action end |
#day_time_restrictions ⇒ DayTimeRestrictions
The value indicates what actions to be performed with respect to location restriction. Mandatory Allowed values – • Add: Apply the given restriction on the bundle. • Default: No location restriction will be applied on the bundle in Gateway.
50 51 52 |
# File 'lib/shell_card_management_ap_is/models/bundle_restriction.rb', line 50 def day_time_restrictions @day_time_restrictions end |
#location_restriction_action ⇒ String
The value indicates what actions to be performed with respect to location restriction. Mandatory Allowed values – • Add: Apply the given restriction on the bundle. • Default: No location restriction will be applied on the bundle in Gateway.
30 31 32 |
# File 'lib/shell_card_management_ap_is/models/bundle_restriction.rb', line 30 def location_restriction_action @location_restriction_action end |
#location_restrictions ⇒ LocationRestriction
The value indicates what actions to be performed with respect to location restriction. Mandatory Allowed values – • Add: Apply the given restriction on the bundle. • Default: No location restriction will be applied on the bundle in Gateway.
70 71 72 |
# File 'lib/shell_card_management_ap_is/models/bundle_restriction.rb', line 70 def location_restrictions @location_restrictions end |
#product_restrictions ⇒ Object
The value indicates what actions to be performed with respect to location restriction. Mandatory Allowed values – • Add: Apply the given restriction on the bundle. • Default: No location restriction will be applied on the bundle in Gateway.
60 61 62 |
# File 'lib/shell_card_management_ap_is/models/bundle_restriction.rb', line 60 def product_restrictions @product_restrictions end |
#usage_restrictions ⇒ Object
The value indicates what actions to be performed with respect to location restriction. Mandatory Allowed values – • Add: Apply the given restriction on the bundle. • Default: No location restriction will be applied on the bundle in Gateway.
40 41 42 |
# File 'lib/shell_card_management_ap_is/models/bundle_restriction.rb', line 40 def usage_restrictions @usage_restrictions end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/shell_card_management_ap_is/models/bundle_restriction.rb', line 123 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. day_time_restriction_action = hash.key?('DayTimeRestrictionAction') ? hash['DayTimeRestrictionAction'] : SKIP location_restriction_action = hash.key?('LocationRestrictionAction') ? hash['LocationRestrictionAction'] : SKIP usage_restrictions = hash.key?('UsageRestrictions') ? hash['UsageRestrictions'] : SKIP day_time_restrictions = DayTimeRestrictions.from_hash(hash['DayTimeRestrictions']) if hash['DayTimeRestrictions'] product_restrictions = hash.key?('ProductRestrictions') ? hash['ProductRestrictions'] : SKIP location_restrictions = LocationRestriction.from_hash(hash['LocationRestrictions']) if hash['LocationRestrictions'] # Create object from extracted values. BundleRestriction.new(day_time_restriction_action, location_restriction_action, usage_restrictions, day_time_restrictions, product_restrictions, location_restrictions) end |
.names ⇒ Object
A mapping from model property names to API property names.
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/shell_card_management_ap_is/models/bundle_restriction.rb', line 73 def self.names @_hash = {} if @_hash.nil? @_hash['day_time_restriction_action'] = 'DayTimeRestrictionAction' @_hash['location_restriction_action'] = 'LocationRestrictionAction' @_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
97 98 99 100 101 102 |
# File 'lib/shell_card_management_ap_is/models/bundle_restriction.rb', line 97 def self.nullables %w[ day_time_restriction_action location_restriction_action ] end |
.optionals ⇒ Object
An array for optional fields
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/shell_card_management_ap_is/models/bundle_restriction.rb', line 85 def self.optionals %w[ day_time_restriction_action location_restriction_action usage_restrictions day_time_restrictions product_restrictions location_restrictions ] end |