Class: ShellCardManagementApIs::BundleRestrictionUpdate

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

Overview

BundleRestrictionUpdate Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(reset_day_time_restriction = SKIP, reset_location_restriction = SKIP, reset_product_restriction = SKIP, usage_restrictions = SKIP, day_time_restriction_profile_id = SKIP, day_time_restrictions = SKIP, product_restrictions = SKIP, location_restriction_profile_id = SKIP, location_restrictions = SKIP) ⇒ BundleRestrictionUpdate

Returns a new instance of BundleRestrictionUpdate.



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
145
146
147
# File 'lib/shell_card_management_ap_is/models/bundle_restriction_update.rb', line 116

def initialize(reset_day_time_restriction = SKIP,
               reset_location_restriction = SKIP,
               reset_product_restriction = SKIP, usage_restrictions = SKIP,
               day_time_restriction_profile_id = SKIP,
               day_time_restrictions = SKIP, product_restrictions = SKIP,
               location_restriction_profile_id = SKIP,
               location_restrictions = SKIP)
  unless reset_day_time_restriction == SKIP
    @reset_day_time_restriction =
      reset_day_time_restriction
  end
  unless reset_location_restriction == SKIP
    @reset_location_restriction =
      reset_location_restriction
  end
  unless reset_product_restriction == SKIP
    @reset_product_restriction =
      reset_product_restriction
  end
  @usage_restrictions = usage_restrictions unless usage_restrictions == SKIP
  unless day_time_restriction_profile_id == SKIP
    @day_time_restriction_profile_id =
      day_time_restriction_profile_id
  end
  @day_time_restrictions = day_time_restrictions unless day_time_restrictions == SKIP
  @product_restrictions = product_restrictions unless product_restrictions == SKIP
  unless location_restriction_profile_id == SKIP
    @location_restriction_profile_id =
      location_restriction_profile_id
  end
  @location_restrictions = location_restrictions unless location_restrictions == SKIP
end

Instance Attribute Details

#day_time_restriction_profile_idString

Identifier of the day/time restriction profile to be updated for the bundle in Gateway. Optional

Returns:

  • (String)


48
49
50
# File 'lib/shell_card_management_ap_is/models/bundle_restriction_update.rb', line 48

def day_time_restriction_profile_id
  @day_time_restriction_profile_id
end

#day_time_restrictionsCardDayTimeRestrictions

Identifier of the day/time restriction profile to be updated for the bundle in Gateway. Optional



54
55
56
# File 'lib/shell_card_management_ap_is/models/bundle_restriction_update.rb', line 54

def day_time_restrictions
  @day_time_restrictions
end

#location_restriction_profile_idString

Identifier of the location restriction profile to be updated for the bundle in Gateway. Optional

Returns:

  • (String)


66
67
68
# File 'lib/shell_card_management_ap_is/models/bundle_restriction_update.rb', line 66

def location_restriction_profile_id
  @location_restriction_profile_id
end

#location_restrictionsLocationRestriction

Identifier of the location restriction profile to be updated for the bundle in Gateway. Optional

Returns:



72
73
74
# File 'lib/shell_card_management_ap_is/models/bundle_restriction_update.rb', line 72

def location_restrictions
  @location_restrictions
end

#product_restrictionsObject

Identifier of the day/time restriction profile to be updated for the bundle in Gateway. Optional

Returns:

  • (Object)


60
61
62
# File 'lib/shell_card_management_ap_is/models/bundle_restriction_update.rb', line 60

def product_restrictions
  @product_restrictions
end

#reset_day_time_restrictionTrueClass | FalseClass

True/False A value indicates if the day/time restriction is to be reset for card bundle. Optional Default value is False.

Returns:

  • (TrueClass | FalseClass)


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

def reset_day_time_restriction
  @reset_day_time_restriction
end

#reset_location_restrictionTrueClass | FalseClass

True/False A value indicates if the location restriction is to be reset for card bundle. Optional Default value is False.

Returns:

  • (TrueClass | FalseClass)


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

def reset_location_restriction
  @reset_location_restriction
end

#reset_product_restrictionTrueClass | FalseClass

True/False A value indicates if the product restriction is to be reset for card bundle. Optional Default value is False.

Returns:

  • (TrueClass | FalseClass)


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

def reset_product_restriction
  @reset_product_restriction
end

#usage_restrictionsObject

True/False A value indicates if the product restriction is to be reset for card bundle. Optional Default value is False.

Returns:

  • (Object)


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

def usage_restrictions
  @usage_restrictions
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/shell_card_management_ap_is/models/bundle_restriction_update.rb', line 150

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  reset_day_time_restriction =
    hash.key?('ResetDayTimeRestriction') ? hash['ResetDayTimeRestriction'] : SKIP
  reset_location_restriction =
    hash.key?('ResetLocationRestriction') ? hash['ResetLocationRestriction'] : SKIP
  reset_product_restriction =
    hash.key?('ResetProductRestriction') ? hash['ResetProductRestriction'] : SKIP
  usage_restrictions =
    hash.key?('UsageRestrictions') ? hash['UsageRestrictions'] : SKIP
  day_time_restriction_profile_id =
    hash.key?('DayTimeRestrictionProfileId') ? hash['DayTimeRestrictionProfileId'] : SKIP
  day_time_restrictions = CardDayTimeRestrictions.from_hash(hash['DayTimeRestrictions']) if
    hash['DayTimeRestrictions']
  product_restrictions =
    hash.key?('ProductRestrictions') ? hash['ProductRestrictions'] : SKIP
  location_restriction_profile_id =
    hash.key?('LocationRestrictionProfileId') ? hash['LocationRestrictionProfileId'] : SKIP
  location_restrictions = LocationRestriction.from_hash(hash['LocationRestrictions']) if
    hash['LocationRestrictions']

  # Create object from extracted values.
  BundleRestrictionUpdate.new(reset_day_time_restriction,
                              reset_location_restriction,
                              reset_product_restriction,
                              usage_restrictions,
                              day_time_restriction_profile_id,
                              day_time_restrictions,
                              product_restrictions,
                              location_restriction_profile_id,
                              location_restrictions)
end

.namesObject

A mapping from model property names to API property names.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/shell_card_management_ap_is/models/bundle_restriction_update.rb', line 75

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['reset_day_time_restriction'] = 'ResetDayTimeRestriction'
  @_hash['reset_location_restriction'] = 'ResetLocationRestriction'
  @_hash['reset_product_restriction'] = 'ResetProductRestriction'
  @_hash['usage_restrictions'] = 'UsageRestrictions'
  @_hash['day_time_restriction_profile_id'] =
    'DayTimeRestrictionProfileId'
  @_hash['day_time_restrictions'] = 'DayTimeRestrictions'
  @_hash['product_restrictions'] = 'ProductRestrictions'
  @_hash['location_restriction_profile_id'] =
    'LocationRestrictionProfileId'
  @_hash['location_restrictions'] = 'LocationRestrictions'
  @_hash
end

.nullablesObject

An array for nullable fields



107
108
109
110
111
112
113
114
# File 'lib/shell_card_management_ap_is/models/bundle_restriction_update.rb', line 107

def self.nullables
  %w[
    reset_day_time_restriction
    reset_location_restriction
    reset_product_restriction
    day_time_restriction_profile_id
  ]
end

.optionalsObject

An array for optional fields



92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/shell_card_management_ap_is/models/bundle_restriction_update.rb', line 92

def self.optionals
  %w[
    reset_day_time_restriction
    reset_location_restriction
    reset_product_restriction
    usage_restrictions
    day_time_restriction_profile_id
    day_time_restrictions
    product_restrictions
    location_restriction_profile_id
    location_restrictions
  ]
end