예제 #1
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="options"> Create Participant parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Participant </returns>
        public static ParticipantResource Create(CreateParticipantOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
예제 #2
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="pathConferenceSid"> The conference_sid </param>
        /// <param name="from"> The from </param>
        /// <param name="to"> The to </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="statusCallback"> The status_callback </param>
        /// <param name="statusCallbackMethod"> The status_callback_method </param>
        /// <param name="statusCallbackEvent"> The status_callback_event </param>
        /// <param name="timeout"> The timeout </param>
        /// <param name="record"> The record </param>
        /// <param name="muted"> The muted </param>
        /// <param name="beep"> The beep </param>
        /// <param name="startConferenceOnEnter"> The start_conference_on_enter </param>
        /// <param name="endConferenceOnExit"> The end_conference_on_exit </param>
        /// <param name="waitUrl"> The wait_url </param>
        /// <param name="waitMethod"> The wait_method </param>
        /// <param name="earlyMedia"> The early_media </param>
        /// <param name="maxParticipants"> The max_participants </param>
        /// <param name="conferenceRecord"> The conference_record </param>
        /// <param name="conferenceTrim"> The conference_trim </param>
        /// <param name="conferenceStatusCallback"> The conference_status_callback </param>
        /// <param name="conferenceStatusCallbackMethod"> The conference_status_callback_method </param>
        /// <param name="conferenceStatusCallbackEvent"> The conference_status_callback_event </param>
        /// <param name="recordingChannels"> The recording_channels </param>
        /// <param name="recordingStatusCallback"> The recording_status_callback </param>
        /// <param name="recordingStatusCallbackMethod"> The recording_status_callback_method </param>
        /// <param name="sipAuthUsername"> The sip_auth_username </param>
        /// <param name="sipAuthPassword"> The sip_auth_password </param>
        /// <param name="region"> The region </param>
        /// <param name="conferenceRecordingStatusCallback"> The conference_recording_status_callback </param>
        /// <param name="conferenceRecordingStatusCallbackMethod"> The conference_recording_status_callback_method </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Participant </returns>
        public static async System.Threading.Tasks.Task <ParticipantResource> CreateAsync(string pathConferenceSid, Types.PhoneNumber from, Types.PhoneNumber to, string pathAccountSid = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, List <string> statusCallbackEvent = null, int?timeout = null, bool?record = null, bool?muted = null, string beep = null, bool?startConferenceOnEnter = null, bool?endConferenceOnExit = null, Uri waitUrl = null, Twilio.Http.HttpMethod waitMethod = null, bool?earlyMedia = null, int?maxParticipants = null, string conferenceRecord = null, string conferenceTrim = null, Uri conferenceStatusCallback = null, Twilio.Http.HttpMethod conferenceStatusCallbackMethod = null, List <string> conferenceStatusCallbackEvent = null, string recordingChannels = null, Uri recordingStatusCallback = null, Twilio.Http.HttpMethod recordingStatusCallbackMethod = null, string sipAuthUsername = null, string sipAuthPassword = null, string region = null, Uri conferenceRecordingStatusCallback = null, Twilio.Http.HttpMethod conferenceRecordingStatusCallbackMethod = null, ITwilioRestClient client = null)
        {
            var options = new CreateParticipantOptions(pathConferenceSid, from, to)
            {
                PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod
            };

            return(await CreateAsync(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="pathConferenceSid"> The conference_sid </param>
        /// <param name="from"> The from </param>
        /// <param name="to"> The to </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="statusCallback"> The status_callback </param>
        /// <param name="statusCallbackMethod"> The status_callback_method </param>
        /// <param name="statusCallbackEvent"> The status_callback_event </param>
        /// <param name="timeout"> The timeout </param>
        /// <param name="record"> The record </param>
        /// <param name="muted"> The muted </param>
        /// <param name="beep"> The beep </param>
        /// <param name="startConferenceOnEnter"> The start_conference_on_enter </param>
        /// <param name="endConferenceOnExit"> The end_conference_on_exit </param>
        /// <param name="waitUrl"> The wait_url </param>
        /// <param name="waitMethod"> The wait_method </param>
        /// <param name="earlyMedia"> The early_media </param>
        /// <param name="maxParticipants"> The max_participants </param>
        /// <param name="conferenceRecord"> The conference_record </param>
        /// <param name="conferenceTrim"> The conference_trim </param>
        /// <param name="conferenceStatusCallback"> The conference_status_callback </param>
        /// <param name="conferenceStatusCallbackMethod"> The conference_status_callback_method </param>
        /// <param name="conferenceStatusCallbackEvent"> The conference_status_callback_event </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Participant </returns>
        public static ParticipantResource Create(string pathConferenceSid, Types.PhoneNumber from, Types.PhoneNumber to, string pathAccountSid = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, List <string> statusCallbackEvent = null, int?timeout = null, bool?record = null, bool?muted = null, ParticipantResource.BeepEnum beep = null, bool?startConferenceOnEnter = null, bool?endConferenceOnExit = null, Uri waitUrl = null, Twilio.Http.HttpMethod waitMethod = null, bool?earlyMedia = null, int?maxParticipants = null, ParticipantResource.ConferenceRecordEnum conferenceRecord = null, string conferenceTrim = null, Uri conferenceStatusCallback = null, Twilio.Http.HttpMethod conferenceStatusCallbackMethod = null, List <string> conferenceStatusCallbackEvent = null, ITwilioRestClient client = null)
        {
            var options = new CreateParticipantOptions(pathConferenceSid, from, to)
            {
                PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent
            };

            return(Create(options, client));
        }
예제 #4
0
 private static Request BuildCreateRequest(CreateParticipantOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Conferences/" + options.PathConferenceSid + "/Participants.json",
                client.Region,
                postParams: options.GetParams()
                ));
 }
예제 #5
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="options"> Create Participant parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Participant </returns>
        public static async System.Threading.Tasks.Task <ParticipantResource> CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }