Class: Twilio::REST::Messaging::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1.rb,
lib/twilio-ruby/rest/messaging/v1/service.rb,
lib/twilio-ruby/rest/messaging/v1/usecase.rb,
lib/twilio-ruby/rest/messaging/v1/deactivation.rb,
lib/twilio-ruby/rest/messaging/v1/external_campaign.rb,
lib/twilio-ruby/rest/messaging/v1/brand_registration.rb,
lib/twilio-ruby/rest/messaging/v1/service/short_code.rb,
lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb,
lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb,
lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb,
lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb

Defined Under Namespace

Classes: BrandRegistrationContext, BrandRegistrationInstance, BrandRegistrationList, BrandRegistrationPage, DeactivationsContext, DeactivationsInstance, DeactivationsList, DeactivationsPage, ExternalCampaignInstance, ExternalCampaignList, ExternalCampaignPage, ServiceContext, ServiceInstance, ServiceList, ServicePage, UsecaseInstance, UsecaseList, UsecasePage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of Messaging


15
16
17
18
19
20
21
22
23
# File 'lib/twilio-ruby/rest/messaging/v1.rb', line 15

def initialize(domain)
  super
  @version = 'v1'
  @brand_registrations = nil
  @deactivations = nil
  @external_campaign = nil
  @services = nil
  @usecases = nil
end

Instance Method Details

#brand_registrations(sid = :unset) ⇒ Twilio::REST::Messaging::V1::BrandRegistrationContext, Twilio::REST::Messaging::V1::BrandRegistrationList

Parameters:

  • sid (String) (defaults to: :unset)

    The SID of the Brand Registration resource to fetch.

Returns:


29
30
31
32
33
34
35
36
37
38
# File 'lib/twilio-ruby/rest/messaging/v1.rb', line 29

def brand_registrations(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @brand_registrations ||= BrandRegistrationList.new self
  else
      BrandRegistrationContext.new(self, sid)
  end
end

#deactivationsTwilio::REST::Messaging::V1::DeactivationsContext


42
43
44
# File 'lib/twilio-ruby/rest/messaging/v1.rb', line 42

def deactivations
  @deactivations ||= DeactivationsContext.new self
end

#external_campaignTwilio::REST::Messaging::V1::ExternalCampaignContext

Returns:

  • (Twilio::REST::Messaging::V1::ExternalCampaignContext)

48
49
50
# File 'lib/twilio-ruby/rest/messaging/v1.rb', line 48

def external_campaign
  @external_campaign ||= ExternalCampaignList.new self
end

#services(sid = :unset) ⇒ Twilio::REST::Messaging::V1::ServiceContext, Twilio::REST::Messaging::V1::ServiceList

Parameters:

  • sid (String) (defaults to: :unset)

    The SID of the Service resource to fetch.

Returns:


56
57
58
59
60
61
62
63
64
65
# File 'lib/twilio-ruby/rest/messaging/v1.rb', line 56

def services(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @services ||= ServiceList.new self
  else
      ServiceContext.new(self, sid)
  end
end

#to_sObject

Provide a user friendly representation


75
76
77
# File 'lib/twilio-ruby/rest/messaging/v1.rb', line 75

def to_s
  '<Twilio::REST::Messaging::V1>'
end

#usecasesTwilio::REST::Messaging::V1::UsecaseContext

Returns:

  • (Twilio::REST::Messaging::V1::UsecaseContext)

69
70
71
# File 'lib/twilio-ruby/rest/messaging/v1.rb', line 69

def usecases
  @usecases ||= UsecaseList.new self
end