Class: VoiceML::ConversationsV1ConversationWithParticipantsResource

Inherits:
Object
  • Object
show all
Defined in:
lib/voiceml/resources/conversations_v1.rb

Overview

============================================================================

/v1/ConversationWithParticipants (single-call conv + participants)

Constant Summary collapse

FIELDS =
{
  'FriendlyName' => :friendly_name,
  'UniqueName' => :unique_name,
  'MessagingServiceSid' => :messaging_service_sid,
  'Attributes' => :attributes,
  'State' => :state,
  'Timers.Inactive' => :timers_inactive,
  'Timers.Closed' => :timers_closed,
  'Participant' => :participant
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ ConversationsV1ConversationWithParticipantsResource

Returns a new instance of ConversationsV1ConversationWithParticipantsResource.



591
592
593
# File 'lib/voiceml/resources/conversations_v1.rb', line 591

def initialize(transport)
  @transport = transport
end

Instance Method Details

#create(participant: nil, **kwargs) ⇒ Object



595
596
597
598
599
600
601
602
603
604
605
606
607
# File 'lib/voiceml/resources/conversations_v1.rb', line 595

def create(participant: nil, **kwargs)
  kwargs[:participant] = participant unless participant.nil?
  form = {}
  FIELDS.each do |wire, k|
    value = kwargs[k]
    next if value.nil?

    form[wire] = value
  end
  ConversationsV1ConversationWithParticipants.from_hash(
    @transport.request(:post, '/v1/ConversationWithParticipants', form: form)
  )
end