Class: Zernio::EnableSmsOnNumber200Response
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::EnableSmsOnNumber200Response
- Defined in:
- lib/zernio-sdk/models/enable_sms_on_number200_response.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#already_registered ⇒ Object
A prior non-rejected registration already covers this number; no re-submit needed.
-
#country ⇒ Object
Returns the value of attribute country.
-
#domestic_only ⇒ Object
Returns the value of attribute domestic_only.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#id ⇒ Object
The SMS social account ID (present when enabled).
-
#is_active ⇒ Object
False for US numbers until their registration is approved.
-
#message ⇒ Object
Human-readable explanation when
enabledis false. -
#mms_capable ⇒ Object
Returns the value of attribute mms_capable.
-
#needs_registration ⇒ Object
US only; a carrier registration is required before delivery.
-
#not_ready ⇒ Object
Number is still provisioning at the carrier; retry shortly.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#registration_status ⇒ Object
Returns the value of attribute registration_status.
-
#reusable ⇒ Object
Returns the value of attribute reusable.
-
#sms_capable ⇒ Object
Null when capability can't be read yet (still provisioning).
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 = {}) ⇒ EnableSmsOnNumber200Response
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 = {}) ⇒ EnableSmsOnNumber200Response
Initializes the object
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 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 135 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::EnableSmsOnNumber200Response` 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 `Zernio::EnableSmsOnNumber200Response`. 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?(:'enabled') self.enabled = attributes[:'enabled'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'phone_number') self.phone_number = attributes[:'phone_number'] end if attributes.key?(:'is_active') self.is_active = attributes[:'is_active'] end if attributes.key?(:'country') self.country = attributes[:'country'] end if attributes.key?(:'sms_capable') self.sms_capable = attributes[:'sms_capable'] end if attributes.key?(:'mms_capable') self.mms_capable = attributes[:'mms_capable'] end if attributes.key?(:'domestic_only') self.domestic_only = attributes[:'domestic_only'] end if attributes.key?(:'not_ready') self.not_ready = attributes[:'not_ready'] end if attributes.key?(:'needs_registration') self.needs_registration = attributes[:'needs_registration'] end if attributes.key?(:'already_registered') self.already_registered = attributes[:'already_registered'] end if attributes.key?(:'registration_status') self.registration_status = attributes[:'registration_status'] end if attributes.key?(:'reusable') self.reusable = attributes[:'reusable'] end if attributes.key?(:'message') self. = attributes[:'message'] end end |
Instance Attribute Details
#already_registered ⇒ Object
A prior non-rejected registration already covers this number; no re-submit needed.
44 45 46 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 44 def already_registered @already_registered end |
#country ⇒ Object
Returns the value of attribute country.
28 29 30 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 28 def country @country end |
#domestic_only ⇒ Object
Returns the value of attribute domestic_only.
35 36 37 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 35 def domestic_only @domestic_only end |
#enabled ⇒ Object
Returns the value of attribute enabled.
18 19 20 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 18 def enabled @enabled end |
#id ⇒ Object
The SMS social account ID (present when enabled).
21 22 23 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 21 def id @id end |
#is_active ⇒ Object
False for US numbers until their registration is approved.
26 27 28 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 26 def is_active @is_active end |
#message ⇒ Object
Human-readable explanation when enabled is false.
51 52 53 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 51 def @message end |
#mms_capable ⇒ Object
Returns the value of attribute mms_capable.
33 34 35 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 33 def mms_capable @mms_capable end |
#needs_registration ⇒ Object
US only; a carrier registration is required before delivery.
41 42 43 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 41 def needs_registration @needs_registration end |
#not_ready ⇒ Object
Number is still provisioning at the carrier; retry shortly.
38 39 40 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 38 def not_ready @not_ready end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
23 24 25 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 23 def phone_number @phone_number end |
#registration_status ⇒ Object
Returns the value of attribute registration_status.
46 47 48 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 46 def registration_status @registration_status end |
#reusable ⇒ Object
Returns the value of attribute reusable.
48 49 50 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 48 def reusable @reusable end |
#sms_capable ⇒ Object
Null when capability can't be read yet (still provisioning).
31 32 33 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 31 def sms_capable @sms_capable end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
96 97 98 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 96 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
101 102 103 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 101 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 76 def self.attribute_map { :'enabled' => :'enabled', :'id' => :'id', :'phone_number' => :'phoneNumber', :'is_active' => :'isActive', :'country' => :'country', :'sms_capable' => :'smsCapable', :'mms_capable' => :'mmsCapable', :'domestic_only' => :'domesticOnly', :'not_ready' => :'notReady', :'needs_registration' => :'needsRegistration', :'already_registered' => :'alreadyRegistered', :'registration_status' => :'registrationStatus', :'reusable' => :'reusable', :'message' => :'message' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 269 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
126 127 128 129 130 131 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 126 def self.openapi_nullable Set.new([ :'sms_capable', :'registration_status', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 106 def self.openapi_types { :'enabled' => :'Boolean', :'id' => :'String', :'phone_number' => :'String', :'is_active' => :'Boolean', :'country' => :'String', :'sms_capable' => :'Boolean', :'mms_capable' => :'Boolean', :'domestic_only' => :'Boolean', :'not_ready' => :'Boolean', :'needs_registration' => :'Boolean', :'already_registered' => :'Boolean', :'registration_status' => :'String', :'reusable' => :'EnableSmsOnNumber200ResponseReusable', :'message' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 235 def ==(o) return true if self.equal?(o) self.class == o.class && enabled == o.enabled && id == o.id && phone_number == o.phone_number && is_active == o.is_active && country == o.country && sms_capable == o.sms_capable && mms_capable == o.mms_capable && domestic_only == o.domestic_only && not_ready == o.not_ready && needs_registration == o.needs_registration && already_registered == o.already_registered && registration_status == o.registration_status && reusable == o.reusable && == o. end |
#eql?(o) ⇒ Boolean
256 257 258 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 256 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
262 263 264 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 262 def hash [enabled, id, phone_number, is_active, country, sms_capable, mms_capable, domestic_only, not_ready, needs_registration, already_registered, registration_status, reusable, ].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
208 209 210 211 212 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 208 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
291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 291 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
216 217 218 219 220 221 |
# File 'lib/zernio-sdk/models/enable_sms_on_number200_response.rb', line 216 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' registration_status_validator = EnumAttributeValidator.new('String', ["pending", "approved", "rejected"]) return false unless registration_status_validator.valid?(@registration_status) true end |