Example #1
0
        /// <summary>
        /// Add a new participant to the conversation in a specific service
        /// </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));
        }
Example #2
0
 private static Request BuildCreateRequest(CreateParticipantOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Conversations,
                "/v1/Services/" + options.PathChatServiceSid + "/Conversations/" + options.PathConversationSid + "/Participants",
                postParams: options.GetParams(),
                headerParams: options.GetHeaderParams()
                ));
 }
Example #3
0
        /// <summary>
        /// Add a new participant to the conversation in a specific service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service that the resource is associated with. </param>
        /// <param name="pathConversationSid"> The unique ID of the Conversation for this participant. </param>
        /// <param name="identity"> A unique string identifier for the conversation participant as Conversation User. </param>
        /// <param name="messagingBindingAddress"> The address of the participant's device. </param>
        /// <param name="messagingBindingProxyAddress"> The address of the Twilio phone number that the participant is in
        ///                                    contact with. </param>
        /// <param name="dateCreated"> The date that this resource was created. </param>
        /// <param name="dateUpdated"> The date that this resource was last updated. </param>
        /// <param name="attributes"> An optional string metadata field you can use to store any data you wish. </param>
        /// <param name="messagingBindingProjectedAddress"> The address of the Twilio phone number that is used in Group MMS.
        ///                                        </param>
        /// <param name="roleSid"> The SID of a conversation-level Role to assign to the participant </param>
        /// <param name="xTwilioWebhookEnabled"> The X-Twilio-Webhook-Enabled HTTP request header </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 pathChatServiceSid,
                                                                                          string pathConversationSid,
                                                                                          string identity = null,
                                                                                          string messagingBindingAddress      = null,
                                                                                          string messagingBindingProxyAddress = null,
                                                                                          DateTime?dateCreated = null,
                                                                                          DateTime?dateUpdated = null,
                                                                                          string attributes    = null,
                                                                                          string messagingBindingProjectedAddress = null,
                                                                                          string roleSid = null,
                                                                                          ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                                                                          ITwilioRestClient client = null)
        {
            var options = new CreateParticipantOptions(pathChatServiceSid, pathConversationSid)
            {
                Identity = identity, MessagingBindingAddress = messagingBindingAddress, MessagingBindingProxyAddress = messagingBindingProxyAddress, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(await CreateAsync(options, client));
        }
Example #4
0
        /// <summary>
        /// Add a new participant to the conversation in a specific service
        /// </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));
        }