Class: ShellDataReportingApIs::FeeRuleLocation

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/fee_rule_location.rb

Overview

FeeRuleLocation Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(delco_id = SKIP, country = SKIP, country_code = SKIP, fuel_network_id = SKIP, network_name = SKIP, site_group_id = SKIP, site_group_name = SKIP, site_code = SKIP, site_id = SKIP, site_name = SKIP) ⇒ FeeRuleLocation

Returns a new instance of FeeRuleLocation.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 100

def initialize(delco_id = SKIP, country = SKIP, country_code = SKIP,
               fuel_network_id = SKIP, network_name = SKIP,
               site_group_id = SKIP, site_group_name = SKIP,
               site_code = SKIP, site_id = SKIP, site_name = SKIP)
  @delco_id = delco_id unless delco_id == SKIP
  @country = country unless country == SKIP
  @country_code = country_code unless country_code == SKIP
  @fuel_network_id = fuel_network_id unless fuel_network_id == SKIP
  @network_name = network_name unless network_name == SKIP
  @site_group_id = site_group_id unless site_group_id == SKIP
  @site_group_name = site_group_name unless site_group_name == SKIP
  @site_code = site_code unless site_code == SKIP
  @site_id = site_id unless site_id == SKIP
  @site_name = site_name unless site_name == SKIP
end

Instance Attribute Details

#countryString

Country name.

Returns:

  • (String)


18
19
20
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 18

def country
  @country
end

#country_codeString

ISO Code of country.

Returns:

  • (String)


22
23
24
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 22

def country_code
  @country_code
end

#delco_idString

Delco Identifier.

Returns:

  • (String)


14
15
16
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 14

def delco_id
  @delco_id
end

#fuel_network_idInteger

Fuel Network Identifier.

Returns:

  • (Integer)


26
27
28
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 26

def fuel_network_id
  @fuel_network_id
end

#network_nameString

Network Name.

Returns:

  • (String)


30
31
32
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 30

def network_name
  @network_name
end

#site_codeInteger

Site Code

Returns:

  • (Integer)


42
43
44
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 42

def site_code
  @site_code
end

#site_group_idInteger

Site-Group ID

Returns:

  • (Integer)


34
35
36
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 34

def site_group_id
  @site_group_id
end

#site_group_nameString

Site-Group name.

Returns:

  • (String)


38
39
40
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 38

def site_group_name
  @site_group_name
end

#site_idInteger

Site Identifier

Returns:

  • (Integer)


46
47
48
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 46

def site_id
  @site_id
end

#site_nameString

Site Name

Returns:

  • (String)


50
51
52
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 50

def site_name
  @site_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 117

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  delco_id = hash.key?('DelcoId') ? hash['DelcoId'] : SKIP
  country = hash.key?('Country') ? hash['Country'] : SKIP
  country_code = hash.key?('CountryCode') ? hash['CountryCode'] : SKIP
  fuel_network_id =
    hash.key?('FuelNetworkId') ? hash['FuelNetworkId'] : SKIP
  network_name = hash.key?('NetworkName') ? hash['NetworkName'] : SKIP
  site_group_id = hash.key?('SiteGroupId') ? hash['SiteGroupId'] : SKIP
  site_group_name =
    hash.key?('SiteGroupName') ? hash['SiteGroupName'] : SKIP
  site_code = hash.key?('SiteCode') ? hash['SiteCode'] : SKIP
  site_id = hash.key?('SiteId') ? hash['SiteId'] : SKIP
  site_name = hash.key?('SiteName') ? hash['SiteName'] : SKIP

  # Create object from extracted values.
  FeeRuleLocation.new(delco_id,
                      country,
                      country_code,
                      fuel_network_id,
                      network_name,
                      site_group_id,
                      site_group_name,
                      site_code,
                      site_id,
                      site_name)
end

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['delco_id'] = 'DelcoId'
  @_hash['country'] = 'Country'
  @_hash['country_code'] = 'CountryCode'
  @_hash['fuel_network_id'] = 'FuelNetworkId'
  @_hash['network_name'] = 'NetworkName'
  @_hash['site_group_id'] = 'SiteGroupId'
  @_hash['site_group_name'] = 'SiteGroupName'
  @_hash['site_code'] = 'SiteCode'
  @_hash['site_id'] = 'SiteId'
  @_hash['site_name'] = 'SiteName'
  @_hash
end

.nullablesObject

An array for nullable fields



85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 85

def self.nullables
  %w[
    delco_id
    country
    country_code
    fuel_network_id
    network_name
    site_group_id
    site_group_name
    site_code
    site_id
    site_name
  ]
end

.optionalsObject

An array for optional fields



69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_location.rb', line 69

def self.optionals
  %w[
    delco_id
    country
    country_code
    fuel_network_id
    network_name
    site_group_id
    site_group_name
    site_code
    site_id
    site_name
  ]
end