Class: ShellCardManagementApIs::ShellSiteRestriction
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::ShellSiteRestriction
- Defined in:
- lib/shell_card_management_ap_is/models/shell_site_restriction.rb
Overview
ShellSiteRestriction Model.
Instance Attribute Summary collapse
-
#country ⇒ String
ISO 3166-1 Numeric-3 code of the country where the site restriction is applied.
-
#exclusive ⇒ TrueClass | FalseClass
Flag indicates whether the profile is inclusive or exclusive.
-
#site_groups ⇒ Array[String]
A list of site group ids in this country which is either restricted or allowed.
-
#sites ⇒ Array[String]
A list of Site IDs in this country, in the format “AA1111” where “AA” is a 2-character country code and “1111” is a 4-digit site number in that country, which is either restricted or allowed.
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(country = SKIP, sites = SKIP, site_groups = SKIP, exclusive = SKIP) ⇒ ShellSiteRestriction
constructor
A new instance of ShellSiteRestriction.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(country = SKIP, sites = SKIP, site_groups = SKIP, exclusive = SKIP) ⇒ ShellSiteRestriction
Returns a new instance of ShellSiteRestriction.
63 64 65 66 67 68 69 |
# File 'lib/shell_card_management_ap_is/models/shell_site_restriction.rb', line 63 def initialize(country = SKIP, sites = SKIP, site_groups = SKIP, exclusive = SKIP) @country = country unless country == SKIP @sites = sites unless sites == SKIP @site_groups = site_groups unless site_groups == SKIP @exclusive = exclusive unless exclusive == SKIP end |
Instance Attribute Details
#country ⇒ String
ISO 3166-1 Numeric-3 code of the country where the site restriction is applied. Example: 826 for United Kingdom.
16 17 18 |
# File 'lib/shell_card_management_ap_is/models/shell_site_restriction.rb', line 16 def country @country end |
#exclusive ⇒ TrueClass | FalseClass
Flag indicates whether the profile is inclusive or exclusive. Example: False - (inclusive), i.e. the “Sites” & “SiteGroups” properties lists the sites & site groups where the transaction will be allowed. True - (exclusive), i.e. the “Sites” & “SiteGroups” properties lists the sites and site groups where the transactions will be declined.
36 37 38 |
# File 'lib/shell_card_management_ap_is/models/shell_site_restriction.rb', line 36 def exclusive @exclusive end |
#site_groups ⇒ Array[String]
A list of site group ids in this country which is either restricted or allowed.
28 29 30 |
# File 'lib/shell_card_management_ap_is/models/shell_site_restriction.rb', line 28 def site_groups @site_groups end |
#sites ⇒ Array[String]
A list of Site IDs in this country, in the format “AA1111” where “AA” is a 2-character country code and “1111” is a 4-digit site number in that country, which is either restricted or allowed. For example, “GB1234”.
23 24 25 |
# File 'lib/shell_card_management_ap_is/models/shell_site_restriction.rb', line 23 def sites @sites end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/shell_card_management_ap_is/models/shell_site_restriction.rb', line 72 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. country = hash.key?('Country') ? hash['Country'] : SKIP sites = hash.key?('Sites') ? hash['Sites'] : SKIP site_groups = hash.key?('SiteGroups') ? hash['SiteGroups'] : SKIP exclusive = hash.key?('Exclusive') ? hash['Exclusive'] : SKIP # Create object from extracted values. ShellSiteRestriction.new(country, sites, site_groups, exclusive) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 44 45 46 |
# File 'lib/shell_card_management_ap_is/models/shell_site_restriction.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['country'] = 'Country' @_hash['sites'] = 'Sites' @_hash['site_groups'] = 'SiteGroups' @_hash['exclusive'] = 'Exclusive' @_hash end |
.nullables ⇒ Object
An array for nullable fields
59 60 61 |
# File 'lib/shell_card_management_ap_is/models/shell_site_restriction.rb', line 59 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 |
# File 'lib/shell_card_management_ap_is/models/shell_site_restriction.rb', line 49 def self.optionals %w[ country sites site_groups exclusive ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
96 97 98 99 100 |
# File 'lib/shell_card_management_ap_is/models/shell_site_restriction.rb', line 96 def inspect class_name = self.class.name.split('::').last "<#{class_name} country: #{@country.inspect}, sites: #{@sites.inspect}, site_groups:"\ " #{@site_groups.inspect}, exclusive: #{@exclusive.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
89 90 91 92 93 |
# File 'lib/shell_card_management_ap_is/models/shell_site_restriction.rb', line 89 def to_s class_name = self.class.name.split('::').last "<#{class_name} country: #{@country}, sites: #{@sites}, site_groups: #{@site_groups},"\ " exclusive: #{@exclusive}>" end |