Class: Twilio::REST::Messaging::V1::ServiceContext::AlphaSenderInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, sid: nil) ⇒ AlphaSenderInstance

Initialize the AlphaSenderInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • service_sid (String) (defaults to: nil)

    The 34 character unique sid of the Messaging Service.

  • sid (String) (defaults to: nil)

    The sid



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 233

def initialize(version, payload, service_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'service_sid' => payload['service_sid'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'alpha_sender' => payload['alpha_sender'],
      'capabilities' => payload['capabilities'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
end

Instance Method Details

#account_sidString

Returns The 34 character unique sid of the Account.

Returns:

  • (String)

    The 34 character unique sid of the Account.



272
273
274
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 272

def 
  @properties['account_sid']
end

#alpha_senderString

Returns An Alphanumeric Sender ID string, up to 11 characters.

Returns:

  • (String)

    An Alphanumeric Sender ID string, up to 11 characters.



296
297
298
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 296

def alpha_sender
  @properties['alpha_sender']
end

#capabilitiesHash

Returns An array of values that indicate whether the number can receive calls or messages.

Returns:

  • (Hash)

    An array of values that indicate whether the number can receive calls or messages.



302
303
304
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 302

def capabilities
  @properties['capabilities']
end

#contextAlphaSenderContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



257
258
259
260
261
262
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 257

def context
  unless @instance_context
    @instance_context = AlphaSenderContext.new(@version, @params['service_sid'], @params['sid'], )
  end
  @instance_context
end

#date_createdTime

Returns The date that this resource was created.

Returns:

  • (Time)

    The date that this resource was created.



284
285
286
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 284

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date that this resource was last updated.

Returns:

  • (Time)

    The date that this resource was last updated.



290
291
292
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 290

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the AlphaSenderInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



322
323
324
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 322

def delete
  context.delete
end

#fetchAlphaSenderInstance

Fetch a AlphaSenderInstance

Returns:



315
316
317
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 315

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



335
336
337
338
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 335

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Messaging.V1.AlphaSenderInstance #{values}>"
end

#service_sidString

Returns The 34 character unique sid of the Messaging Service.

Returns:

  • (String)

    The 34 character unique sid of the Messaging Service.



278
279
280
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 278

def service_sid
  @properties['service_sid']
end

#sidString

Returns The 34 character unique sid of the Alpha Sender ID.

Returns:

  • (String)

    The 34 character unique sid of the Alpha Sender ID.



266
267
268
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 266

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



328
329
330
331
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 328

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Messaging.V1.AlphaSenderInstance #{values}>"
end

#urlString

Returns The absolute URL for this resource.

Returns:

  • (String)

    The absolute URL for this resource.



308
309
310
# File 'lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb', line 308

def url
  @properties['url']
end