class Twilio::REST::Verify::V2::ServiceContext::MessagingConfigurationInstance
Public Class Methods
Initialize the MessagingConfigurationInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] service_sid
The SID of the
{Service}[https://www.twilio.com/docs/verify/api/service] that the resource is associated with.
@param [String] country The
{ISO-3166-1}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`.
@return [MessagingConfigurationInstance] MessagingConfigurationInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 252 def initialize(version, payload, service_sid: nil, country: nil) 253 super(version) 254 255 # Marshaled Properties 256 @properties = { 257 'account_sid' => payload['account_sid'], 258 'service_sid' => payload['service_sid'], 259 'country' => payload['country'], 260 'messaging_service_sid' => payload['messaging_service_sid'], 261 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 262 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 263 'url' => payload['url'], 264 } 265 266 # Context 267 @instance_context = nil 268 @params = {'service_sid' => service_sid, 'country' => country || @properties['country'], } 269 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 288 def account_sid 289 @properties['account_sid'] 290 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [MessagingConfigurationContext] MessagingConfigurationContext
for this MessagingConfigurationInstance
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 275 def context 276 unless @instance_context 277 @instance_context = MessagingConfigurationContext.new( 278 @version, 279 @params['service_sid'], 280 @params['country'], 281 ) 282 end 283 @instance_context 284 end
@return [String] The ISO-3166-1 country code of the country or `all`.
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 300 def country 301 @properties['country'] 302 end
@return [Time] The RFC 2822 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 312 def date_created 313 @properties['date_created'] 314 end
@return [Time] The RFC 2822 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 318 def date_updated 319 @properties['date_updated'] 320 end
Delete the MessagingConfigurationInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 348 def delete 349 context.delete 350 end
Fetch the MessagingConfigurationInstance
@return [MessagingConfigurationInstance] Fetched MessagingConfigurationInstance
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 341 def fetch 342 context.fetch 343 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 361 def inspect 362 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 363 "<Twilio.Verify.V2.MessagingConfigurationInstance #{values}>" 364 end
@return [String] The SID of the Messaging
Service used for this configuration.
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 306 def messaging_service_sid 307 @properties['messaging_service_sid'] 308 end
@return [String] The SID of the Service that the resource is associated with
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 294 def service_sid 295 @properties['service_sid'] 296 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 354 def to_s 355 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 356 "<Twilio.Verify.V2.MessagingConfigurationInstance #{values}>" 357 end
Update the MessagingConfigurationInstance
@param [String] messaging_service_sid
The SID of the {Messaging
Service}[https://www.twilio.com/docs/sms/services/api] to be used to send SMS to the country of this configuration.
@return [MessagingConfigurationInstance] Updated MessagingConfigurationInstance
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 334 def update(messaging_service_sid: nil) 335 context.update(messaging_service_sid: messaging_service_sid, ) 336 end
@return [String] The URL of this resource.
# File lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb 324 def url 325 @properties['url'] 326 end