Class: Twilio::REST::Api::V2010::AccountContext::CallContext::UserDefinedMessageList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid: nil, call_sid: nil) ⇒ UserDefinedMessageList

Initialize the UserDefinedMessageList

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created User Defined Message.

  • call_sid (String) (defaults to: nil)

    The SID of the Call the User Defined Message is associated with.



26
27
28
29
30
31
32
# File 'lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb', line 26

def initialize(version, account_sid: nil, call_sid: nil)
  super(version)

  # Path Solution
  @solution = {account_sid: , call_sid: call_sid}
  @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:call_sid]}/UserDefinedMessages.json"
end

Instance Method Details

#create(content: nil, idempotency_key: :unset) ⇒ UserDefinedMessageInstance

Create the UserDefinedMessageInstance

Parameters:

  • content (String) (defaults to: nil)

    The User Defined Message in the form of URL-encoded JSON string.

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

    A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb', line 41

def create(content: nil, idempotency_key: :unset)
  data = Twilio::Values.of({'Content' => content, 'IdempotencyKey' => idempotency_key, })

  payload = @version.create('POST', @uri, data: data)

  UserDefinedMessageInstance.new(
      @version,
      payload,
      account_sid: @solution[:account_sid],
      call_sid: @solution[:call_sid],
  )
end

#to_sObject

Provide a user friendly representation



56
57
58
# File 'lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb', line 56

def to_s
  '#<Twilio.Api.V2010.UserDefinedMessageList>'
end