/// <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)); }
/// <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)); }
/// <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)); }
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() )); }
/// <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)); }