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

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/external_campaign.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ ExternalCampaignList

Initialize the ExternalCampaignList

Parameters:

  • version (Version)

    Version that contains the resource



26
27
28
29
30
31
32
# File 'lib/twilio-ruby/rest/messaging/v1/external_campaign.rb', line 26

def initialize(version)
    super(version)
    # Path Solution
    @solution = {  }
    @uri = "/Services/PreregisteredUsa2p"
    
end

Instance Method Details

#create(campaign_id: nil, messaging_service_sid: nil, cnp_migration: :unset) ⇒ ExternalCampaignInstance

Create the ExternalCampaignInstance

Parameters:

  • campaign_id (String) (defaults to: nil)

    ID of the preregistered campaign.

  • messaging_service_sid (String) (defaults to: nil)

    The SID of the [Messaging Service](www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with.

  • cnp_migration (Boolean) (defaults to: :unset)

    Customers should use this flag during the ERC registration process to indicate to Twilio that the campaign being registered is undergoing CNP migration. It is important for the user to first trigger the CNP migration process for said campaign in their CSP portal and have Twilio accept the sharing request, before making this api call.

Returns:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/twilio-ruby/rest/messaging/v1/external_campaign.rb', line 39

def create(
    campaign_id: nil, 
    messaging_service_sid: nil, 
    cnp_migration: :unset
)

    data = Twilio::Values.of({
        'CampaignId' => campaign_id,
        'MessagingServiceSid' => messaging_service_sid,
        'CnpMigration' => cnp_migration,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, data: data, headers: headers)
    ExternalCampaignInstance.new(
        @version,
        payload,
    )
end

#to_sObject

Provide a user friendly representation



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

def to_s
    '#<Twilio.Messaging.V1.ExternalCampaignList>'
end