Class: Twilio::REST::Api::V2010::AccountContext::ConferenceContext::ParticipantInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, conference_sid: nil, call_sid: nil) ⇒ ParticipantInstance

Initialize the ParticipantInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created this Participant resource.

  • sid (String)

    The SID of the Call resource to fetch.



990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 990

def initialize(version, payload , account_sid: nil, conference_sid: nil, call_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'call_sid' => payload['call_sid'],
        'label' => payload['label'],
        'call_sid_to_coach' => payload['call_sid_to_coach'],
        'coaching' => payload['coaching'],
        'conference_sid' => payload['conference_sid'],
        'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
        'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
        'end_conference_on_exit' => payload['end_conference_on_exit'],
        'muted' => payload['muted'],
        'hold' => payload['hold'],
        'start_conference_on_enter' => payload['start_conference_on_enter'],
        'status' => payload['status'],
        'queue_time' => payload['queue_time'],
        'uri' => payload['uri'],
    }

    # Context
    @instance_context = nil
    @params = { 'account_sid' =>   ,'conference_sid' => conference_sid  || @properties['conference_sid']  ,'call_sid' => call_sid  || @properties['call_sid']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the Participant resource.

Returns:

  • (String)

    The SID of the Account that created the Participant resource.



1031
1032
1033
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1031

def 
    @properties['account_sid']
end

#call_sidString

Returns The SID of the Call the Participant resource is associated with.

Returns:

  • (String)

    The SID of the Call the Participant resource is associated with.



1037
1038
1039
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1037

def call_sid
    @properties['call_sid']
end

#call_sid_to_coachString

Returns The SID of the participant who is being coached. The participant being coached is the only participant who can hear the participant who is coaching.

Returns:

  • (String)

    The SID of the participant who is being coached. The participant being coached is the only participant who can hear the participant who is coaching.



1049
1050
1051
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1049

def call_sid_to_coach
    @properties['call_sid_to_coach']
end

#coachingBoolean

Returns Whether the participant is coaching another call. Can be: true or false. If not present, defaults to false unless call_sid_to_coach is defined. If true, call_sid_to_coach must be defined.

Returns:

  • (Boolean)

    Whether the participant is coaching another call. Can be: true or false. If not present, defaults to false unless call_sid_to_coach is defined. If true, call_sid_to_coach must be defined.



1055
1056
1057
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1055

def coaching
    @properties['coaching']
end

#conference_sidString

Returns The SID of the conference the participant is in.

Returns:

  • (String)

    The SID of the conference the participant is in.



1061
1062
1063
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1061

def conference_sid
    @properties['conference_sid']
end

#contextParticipantContext

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

Returns:



1022
1023
1024
1025
1026
1027
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1022

def context
    unless @instance_context
        @instance_context = ParticipantContext.new(@version , @params['account_sid'], @params['conference_sid'], @params['call_sid'])
    end
    @instance_context
end

#date_createdTime

Returns The date and time in GMT that the resource was created specified in RFC 2822 format.

Returns:

  • (Time)

    The date and time in GMT that the resource was created specified in RFC 2822 format.



1067
1068
1069
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1067

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT that the resource was last updated specified in RFC 2822 format.

Returns:

  • (Time)

    The date and time in GMT that the resource was last updated specified in RFC 2822 format.



1073
1074
1075
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1073

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the ParticipantInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



1122
1123
1124
1125
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1122

def delete

    context.delete
end

#end_conference_on_exitBoolean

Returns Whether the conference ends when the participant leaves. Can be: true or false and the default is false. If true, the conference ends and all other participants drop out when the participant leaves.

Returns:

  • (Boolean)

    Whether the conference ends when the participant leaves. Can be: true or false and the default is false. If true, the conference ends and all other participants drop out when the participant leaves.



1079
1080
1081
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1079

def end_conference_on_exit
    @properties['end_conference_on_exit']
end

#fetchParticipantInstance

Fetch the ParticipantInstance

Returns:



1130
1131
1132
1133
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1130

def fetch

    context.fetch
end

#holdBoolean

Returns Whether the participant is on hold. Can be true or false.

Returns:

  • (Boolean)

    Whether the participant is on hold. Can be true or false.



1091
1092
1093
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1091

def hold
    @properties['hold']
end

#inspectObject

Provide a detailed, user friendly representation



1190
1191
1192
1193
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1190

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

#labelString

Returns The user-specified label of this participant, if one was given when the participant was created. This may be used to fetch, update or delete the participant.

Returns:

  • (String)

    The user-specified label of this participant, if one was given when the participant was created. This may be used to fetch, update or delete the participant.



1043
1044
1045
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1043

def label
    @properties['label']
end

#mutedBoolean

Returns Whether the participant is muted. Can be true or false.

Returns:

  • (Boolean)

    Whether the participant is muted. Can be true or false.



1085
1086
1087
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1085

def muted
    @properties['muted']
end

#queue_timeString

Returns The wait time in milliseconds before participant's call is placed. Only available in the response to a create participant request.

Returns:

  • (String)

    The wait time in milliseconds before participant's call is placed. Only available in the response to a create participant request.



1109
1110
1111
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1109

def queue_time
    @properties['queue_time']
end

#start_conference_on_enterBoolean

Returns Whether the conference starts when the participant joins the conference, if it has not already started. Can be: true or false and the default is true. If false and the conference has not started, the participant is muted and hears background music until another participant starts the conference.

Returns:

  • (Boolean)

    Whether the conference starts when the participant joins the conference, if it has not already started. Can be: true or false and the default is true. If false and the conference has not started, the participant is muted and hears background music until another participant starts the conference.



1097
1098
1099
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1097

def start_conference_on_enter
    @properties['start_conference_on_enter']
end

#statusStatus

Returns:

  • (Status)


1103
1104
1105
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1103

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



1183
1184
1185
1186
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1183

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

#update(muted: :unset, hold: :unset, hold_url: :unset, hold_method: :unset, announce_url: :unset, announce_method: :unset, wait_url: :unset, wait_method: :unset, beep_on_exit: :unset, end_conference_on_exit: :unset, coaching: :unset, call_sid_to_coach: :unset) ⇒ ParticipantInstance

Update the ParticipantInstance

Parameters:

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

    Whether the participant should be muted. Can be true or false. true will mute the participant, and false will un-mute them. Anything value other than true or false is interpreted as false.

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

    Whether the participant should be on hold. Can be: true or false. true puts the participant on hold, and false lets them rejoin the conference.

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

    The URL we call using the hold_method for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains <Play>, <Say>, <Pause>, or <Redirect> verbs.

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

    The HTTP method we should use to call hold_url. Can be: GET or POST and the default is GET.

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

    The URL we call using the announce_method for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains <Play>, <Say>, <Pause>, or <Redirect> verbs.

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

    The HTTP method we should use to call announce_url. Can be: GET or POST and defaults to POST.

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

    The URL that Twilio calls using the wait_method before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting wait_url to ''. For more details on the allowable verbs within the waitUrl, see the waitUrl attribute in the TwiML instruction.

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

    The HTTP method we should use to call wait_url. Can be GET or POST and the default is POST. When using a static audio file, this should be GET so that we can cache the file.

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

    Whether to play a notification beep to the conference when the participant exits. Can be: true or false.

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

    Whether to end the conference when the participant leaves. Can be: true or false and defaults to false.

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

    Whether the participant is coaching another call. Can be: true or false. If not present, defaults to false unless call_sid_to_coach is defined. If true, call_sid_to_coach must be defined.

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

    The SID of the participant who is being coached. The participant being coached is the only participant who can hear the participant who is coaching.

Returns:



1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1150

def update(
  muted: :unset, 
  hold: :unset, 
  hold_url: :unset, 
  hold_method: :unset, 
  announce_url: :unset, 
  announce_method: :unset, 
  wait_url: :unset, 
  wait_method: :unset, 
  beep_on_exit: :unset, 
  end_conference_on_exit: :unset, 
  coaching: :unset, 
  call_sid_to_coach: :unset
)

    context.update(
        muted: muted, 
        hold: hold, 
        hold_url: hold_url, 
        hold_method: hold_method, 
        announce_url: announce_url, 
        announce_method: announce_method, 
        wait_url: wait_url, 
        wait_method: wait_method, 
        beep_on_exit: beep_on_exit, 
        end_conference_on_exit: end_conference_on_exit, 
        coaching: coaching, 
        call_sid_to_coach: call_sid_to_coach, 
    )
end

#uriString

Returns The URI of the resource, relative to https://api.twilio.com.

Returns:

  • (String)

    The URI of the resource, relative to https://api.twilio.com.



1115
1116
1117
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 1115

def uri
    @properties['uri']
end