Class: Bandwidth::LookupResult
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Bandwidth::LookupResult
- Defined in:
- lib/bandwidth-sdk/models/lookup_result.rb
Overview
Carrier information results for the specified telephone number.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#country_code_a3 ⇒ Object
The country code of the telephone number in ISO 3166-1 alpha-3 format.
-
#deactivation_date ⇒ Object
[DNI-Only](#section/DNI-Only).
-
#deactivation_event ⇒ Object
Returns the value of attribute deactivation_event.
-
#deactivation_reporter ⇒ Object
[DNI-Only](#section/DNI-Only).
-
#initial_message_delivery_status_date ⇒ Object
[DNI-Only](#section/DNI-Only).
-
#latest_message_delivery_status ⇒ Object
Returns the value of attribute latest_message_delivery_status.
-
#latest_message_delivery_status_date ⇒ Object
[DNI-Only](#section/DNI-Only).
-
#line_type ⇒ Object
Returns the value of attribute line_type.
-
#messaging_provider ⇒ Object
The messaging service provider of the telephone number.
-
#phone_number ⇒ Object
The telephone number in E.164 format.
-
#rcs_enabled ⇒ Object
[RCS-Only](#section/RCS-Only).
-
#voice_provider ⇒ Object
The voice service provider of the telephone number.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ LookupResult
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ LookupResult
Initializes the object
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 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 184 185 186 187 188 189 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 128 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::LookupResult` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::LookupResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'phone_number') self.phone_number = attributes[:'phone_number'] end if attributes.key?(:'line_type') self.line_type = attributes[:'line_type'] end if attributes.key?(:'messaging_provider') self.messaging_provider = attributes[:'messaging_provider'] end if attributes.key?(:'voice_provider') self.voice_provider = attributes[:'voice_provider'] end if attributes.key?(:'country_code_a3') self.country_code_a3 = attributes[:'country_code_a3'] end if attributes.key?(:'deactivation_reporter') self.deactivation_reporter = attributes[:'deactivation_reporter'] end if attributes.key?(:'deactivation_date') self.deactivation_date = attributes[:'deactivation_date'] end if attributes.key?(:'deactivation_event') self.deactivation_event = attributes[:'deactivation_event'] end if attributes.key?(:'latest_message_delivery_status') self. = attributes[:'latest_message_delivery_status'] end if attributes.key?(:'initial_message_delivery_status_date') self. = attributes[:'initial_message_delivery_status_date'] end if attributes.key?(:'latest_message_delivery_status_date') self. = attributes[:'latest_message_delivery_status_date'] end if attributes.key?(:'rcs_enabled') self.rcs_enabled = attributes[:'rcs_enabled'] end end |
Instance Attribute Details
#country_code_a3 ⇒ Object
The country code of the telephone number in ISO 3166-1 alpha-3 format.
31 32 33 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 31 def country_code_a3 @country_code_a3 end |
#deactivation_date ⇒ Object
[DNI-Only](#section/DNI-Only). The datetime the carrier reported a deactivation event.
37 38 39 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 37 def deactivation_date @deactivation_date end |
#deactivation_event ⇒ Object
Returns the value of attribute deactivation_event.
39 40 41 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 39 def deactivation_event @deactivation_event end |
#deactivation_reporter ⇒ Object
[DNI-Only](#section/DNI-Only). The carrier that reported a deactivation event for this phone number.
34 35 36 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 34 def deactivation_reporter @deactivation_reporter end |
#initial_message_delivery_status_date ⇒ Object
[DNI-Only](#section/DNI-Only). The date the phone number entered the status described in ‘latestMessageDeliveryStatus`. Think of this as the "start time" for that status. Value resets every time the `latestMessageDeliveryStatus` changes.
44 45 46 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 44 def @initial_message_delivery_status_date end |
#latest_message_delivery_status ⇒ Object
Returns the value of attribute latest_message_delivery_status.
41 42 43 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 41 def @latest_message_delivery_status end |
#latest_message_delivery_status_date ⇒ Object
[DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the ‘latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes.
47 48 49 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 47 def @latest_message_delivery_status_date end |
#line_type ⇒ Object
Returns the value of attribute line_type.
22 23 24 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 22 def line_type @line_type end |
#messaging_provider ⇒ Object
The messaging service provider of the telephone number.
25 26 27 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 25 def messaging_provider @messaging_provider end |
#phone_number ⇒ Object
The telephone number in E.164 format.
20 21 22 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 20 def phone_number @phone_number end |
#rcs_enabled ⇒ Object
[RCS-Only](#section/RCS-Only). Indicates whether the phone number is capable of receiving RCS messages. Value will be null if account has RCS, but no value was returned. Absent when account does not have RCS.
50 51 52 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 50 def rcs_enabled @rcs_enabled end |
#voice_provider ⇒ Object
The voice service provider of the telephone number.
28 29 30 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 28 def voice_provider @voice_provider end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
93 94 95 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 93 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
98 99 100 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 98 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 75 def self.attribute_map { :'phone_number' => :'phoneNumber', :'line_type' => :'lineType', :'messaging_provider' => :'messagingProvider', :'voice_provider' => :'voiceProvider', :'country_code_a3' => :'countryCodeA3', :'deactivation_reporter' => :'deactivationReporter', :'deactivation_date' => :'deactivationDate', :'deactivation_event' => :'deactivationEvent', :'latest_message_delivery_status' => :'latestMessageDeliveryStatus', :'initial_message_delivery_status_date' => :'initialMessageDeliveryStatusDate', :'latest_message_delivery_status_date' => :'latestMessageDeliveryStatusDate', :'rcs_enabled' => :'rcsEnabled' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 240 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
121 122 123 124 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 121 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 103 def self.openapi_types { :'phone_number' => :'String', :'line_type' => :'LineTypeEnum', :'messaging_provider' => :'String', :'voice_provider' => :'String', :'country_code_a3' => :'String', :'deactivation_reporter' => :'String', :'deactivation_date' => :'String', :'deactivation_event' => :'DeactivationEventEnum', :'latest_message_delivery_status' => :'LatestMessageDeliveryStatusEnum', :'initial_message_delivery_status_date' => :'Date', :'latest_message_delivery_status_date' => :'Date', :'rcs_enabled' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 208 def ==(o) return true if self.equal?(o) self.class == o.class && phone_number == o.phone_number && line_type == o.line_type && messaging_provider == o.messaging_provider && voice_provider == o.voice_provider && country_code_a3 == o.country_code_a3 && deactivation_reporter == o.deactivation_reporter && deactivation_date == o.deactivation_date && deactivation_event == o.deactivation_event && == o. && == o. && == o. && rcs_enabled == o.rcs_enabled end |
#eql?(o) ⇒ Boolean
227 228 229 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 227 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
233 234 235 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 233 def hash [phone_number, line_type, messaging_provider, voice_provider, country_code_a3, deactivation_reporter, deactivation_date, deactivation_event, , , , rcs_enabled].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
193 194 195 196 197 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 193 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 262 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
201 202 203 204 |
# File 'lib/bandwidth-sdk/models/lookup_result.rb', line 201 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |