Class: ShellCardManagementApIs::PartnerSiteRestriction

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

Overview

PartnerSiteRestriction Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(network_code = SKIP, sites = SKIP, site_groups = SKIP, exclusive = SKIP) ⇒ PartnerSiteRestriction

Returns a new instance of PartnerSiteRestriction.



68
69
70
71
72
73
74
# File 'lib/shell_card_management_ap_is/models/partner_site_restriction.rb', line 68

def initialize(network_code = SKIP, sites = SKIP, site_groups = SKIP,
               exclusive = SKIP)
  @network_code = network_code unless network_code == SKIP
  @sites = sites unless sites == SKIP
  @site_groups = site_groups unless site_groups == SKIP
  @exclusive = exclusive unless exclusive == SKIP
end

Instance Attribute Details

#exclusiveTrueClass | FalseClass

Flag indicates whether the profile is inclusive or exclusive. Mandatory 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.

Returns:

  • (TrueClass | FalseClass)


41
42
43
# File 'lib/shell_card_management_ap_is/models/partner_site_restriction.rb', line 41

def exclusive
  @exclusive
end

#network_codeString

Gateway network codes, typically 7 or 10 digits, where sites and site groups belong to. Example: 0002003250

Returns:

  • (String)


16
17
18
# File 'lib/shell_card_management_ap_is/models/partner_site_restriction.rb', line 16

def network_code
  @network_code
end

#site_groupsArray[String]

A list of site group ids in this network which needs to be either restricted or allowed. For example, 83649200 A list of values must be passed for either Sites or SiteGroups or both. Max 10 sites groups are allowed for the Partner site Restriction.

Returns:

  • (Array[String])


32
33
34
# File 'lib/shell_card_management_ap_is/models/partner_site_restriction.rb', line 32

def site_groups
  @site_groups
end

#sitesArray[String]

A list of Site IDs in this network which needs to be either restricted or allowed. For example, 97123, 97155 A list of values must be passed for either Sites or SiteGroups or both. Max 10 sites are allowed for the Partner site Restriction.

Returns:

  • (Array[String])


24
25
26
# File 'lib/shell_card_management_ap_is/models/partner_site_restriction.rb', line 24

def sites
  @sites
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  network_code = hash.key?('NetworkCode') ? hash['NetworkCode'] : 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.
  PartnerSiteRestriction.new(network_code,
                             sites,
                             site_groups,
                             exclusive)
end

.namesObject

A mapping from model property names to API property names.



44
45
46
47
48
49
50
51
# File 'lib/shell_card_management_ap_is/models/partner_site_restriction.rb', line 44

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['network_code'] = 'NetworkCode'
  @_hash['sites'] = 'Sites'
  @_hash['site_groups'] = 'SiteGroups'
  @_hash['exclusive'] = 'Exclusive'
  @_hash
end

.nullablesObject

An array for nullable fields



64
65
66
# File 'lib/shell_card_management_ap_is/models/partner_site_restriction.rb', line 64

def self.nullables
  []
end

.optionalsObject

An array for optional fields



54
55
56
57
58
59
60
61
# File 'lib/shell_card_management_ap_is/models/partner_site_restriction.rb', line 54

def self.optionals
  %w[
    network_code
    sites
    site_groups
    exclusive
  ]
end