コード例 #1
0
        /// <summary>
        /// Create a new Participant in this Session.
        /// </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 a new Participant in this Session.
        /// </summary>
        ///
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSessionSid"> Session Sid. </param>
        /// <param name="identifier"> The Participant's contact identifier, normally a phone number. </param>
        /// <param name="friendlyName"> A human readable description of this resource </param>
        /// <param name="participantType"> The Type of this Participant </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 pathServiceSid, string pathSessionSid, string identifier, string friendlyName = null, ParticipantResource.ParticipantTypeEnum participantType = null, ITwilioRestClient client = null)
        {
            var options = new CreateParticipantOptions(pathServiceSid, pathSessionSid, identifier)
            {
                FriendlyName = friendlyName, ParticipantType = participantType
            };

            return(await CreateAsync(options, client));
        }
コード例 #3
0
        /// <summary>
        /// Create a new Participant in this Session.
        /// </summary>
        ///
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSessionSid"> Session Sid. </param>
        /// <param name="identifier"> The Participant's contact identifier, normally a phone number. </param>
        /// <param name="friendlyName"> A human readable description of this resource </param>
        /// <param name="participantType"> The Type of this Participant </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Participant </returns>
        public static ParticipantResource Create(string pathServiceSid, string pathSessionSid, string identifier, string friendlyName = null, ParticipantResource.ParticipantTypeEnum participantType = null, ITwilioRestClient client = null)
        {
            var options = new CreateParticipantOptions(pathServiceSid, pathSessionSid, identifier)
            {
                FriendlyName = friendlyName, ParticipantType = participantType
            };

            return(Create(options, client));
        }
コード例 #4
0
 private static Request BuildCreateRequest(CreateParticipantOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/Proxy/Services/" + options.PathServiceSid + "/Sessions/" + options.PathSessionSid + "/Participants",
                client.Region,
                postParams: options.GetParams()
                ));
 }
コード例 #5
0
        /// <summary>
        /// Create a new Participant in this Session.
        /// </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));
        }