Class: OCI::ThreatIntelligence::Models::GeodataDetails
- Inherits:
-
Object
- Object
- OCI::ThreatIntelligence::Models::GeodataDetails
- Defined in:
- lib/oci/threat_intelligence/models/geodata_details.rb
Overview
Geodata information for a given IP address
Instance Attribute Summary collapse
-
#admin_div ⇒ String
[Required] State/Province/subdivision within the country.
-
#city ⇒ String
[Required] City of origin.
-
#country_code ⇒ String
[Required] Two-letter abbreviation for country of origin.
-
#geo_id ⇒ String
Unique Identifier (optional).
-
#label ⇒ String
[Required] Information on source providing the information.
-
#latitude ⇒ String
[Required] Latitude.
-
#longitude ⇒ String
[Required] Longitude.
-
#origin ⇒ String
[Required] ASN entry.
-
#routed_prefix ⇒ String
Encompassing assigned prefix for the IP.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ GeodataDetails
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ GeodataDetails
Initializes the object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 96 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.routed_prefix = attributes[:'routedPrefix'] if attributes[:'routedPrefix'] raise 'You cannot provide both :routedPrefix and :routed_prefix' if attributes.key?(:'routedPrefix') && attributes.key?(:'routed_prefix') self.routed_prefix = attributes[:'routed_prefix'] if attributes[:'routed_prefix'] self.origin = attributes[:'origin'] if attributes[:'origin'] self.geo_id = attributes[:'geoId'] if attributes[:'geoId'] raise 'You cannot provide both :geoId and :geo_id' if attributes.key?(:'geoId') && attributes.key?(:'geo_id') self.geo_id = attributes[:'geo_id'] if attributes[:'geo_id'] self.country_code = attributes[:'countryCode'] if attributes[:'countryCode'] raise 'You cannot provide both :countryCode and :country_code' if attributes.key?(:'countryCode') && attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] if attributes[:'country_code'] self.admin_div = attributes[:'adminDiv'] if attributes[:'adminDiv'] raise 'You cannot provide both :adminDiv and :admin_div' if attributes.key?(:'adminDiv') && attributes.key?(:'admin_div') self.admin_div = attributes[:'admin_div'] if attributes[:'admin_div'] self.city = attributes[:'city'] if attributes[:'city'] self.latitude = attributes[:'latitude'] if attributes[:'latitude'] self.longitude = attributes[:'longitude'] if attributes[:'longitude'] self.label = attributes[:'label'] if attributes[:'label'] end |
Instance Attribute Details
#admin_div ⇒ String
[Required] State/Province/subdivision within the country
29 30 31 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 29 def admin_div @admin_div end |
#city ⇒ String
[Required] City of origin
33 34 35 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 33 def city @city end |
#country_code ⇒ String
[Required] Two-letter abbreviation for country of origin
25 26 27 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 25 def country_code @country_code end |
#geo_id ⇒ String
Unique Identifier (optional)
21 22 23 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 21 def geo_id @geo_id end |
#label ⇒ String
[Required] Information on source providing the information
45 46 47 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 45 def label @label end |
#latitude ⇒ String
[Required] Latitude
37 38 39 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 37 def latitude @latitude end |
#longitude ⇒ String
[Required] Longitude
41 42 43 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 41 def longitude @longitude end |
#origin ⇒ String
[Required] ASN entry
17 18 19 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 17 def origin @origin end |
#routed_prefix ⇒ String
Encompassing assigned prefix for the IP
13 14 15 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 13 def routed_prefix @routed_prefix end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 48 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'routed_prefix': :'routedPrefix', 'origin': :'origin', 'geo_id': :'geoId', 'country_code': :'countryCode', 'admin_div': :'adminDiv', 'city': :'city', 'latitude': :'latitude', 'longitude': :'longitude', 'label': :'label' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 65 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'routed_prefix': :'String', 'origin': :'String', 'geo_id': :'String', 'country_code': :'String', 'admin_div': :'String', 'city': :'String', 'latitude': :'String', 'longitude': :'String', 'label': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 144 def ==(other) return true if equal?(other) self.class == other.class && routed_prefix == other.routed_prefix && origin == other.origin && geo_id == other.geo_id && country_code == other.country_code && admin_div == other.admin_div && city == other.city && latitude == other.latitude && longitude == other.longitude && label == other.label end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 182 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
162 163 164 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 162 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
171 172 173 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 171 def hash [routed_prefix, origin, geo_id, country_code, admin_div, city, latitude, longitude, label].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
215 216 217 218 219 220 221 222 223 224 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 215 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
209 210 211 |
# File 'lib/oci/threat_intelligence/models/geodata_details.rb', line 209 def to_s to_hash.to_s end |