/// <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));
        }
Esempio n. 2
0
 private static Request BuildCreateRequest(CreateParticipantOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Conversations,
                "/v1/Conversations/" + options.PathConversationSid + "/Participants",
                postParams: options.GetParams()
                ));
 }
Esempio n. 3
0
        /// <summary>
        /// create
        /// </summary>
        /// <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 Chat 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="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Participant </returns>
        public static ParticipantResource Create(string pathConversationSid,
                                                 string identity = null,
                                                 string messagingBindingAddress      = null,
                                                 string messagingBindingProxyAddress = null,
                                                 DateTime?dateCreated     = null,
                                                 DateTime?dateUpdated     = null,
                                                 ITwilioRestClient client = null)
        {
            var options = new CreateParticipantOptions(pathConversationSid)
            {
                Identity = identity, MessagingBindingAddress = messagingBindingAddress, MessagingBindingProxyAddress = messagingBindingProxyAddress, DateCreated = dateCreated, DateUpdated = dateUpdated
            };

            return(Create(options, client));
        }
Esempio n. 4
0
        /// <summary>
        /// create
        /// </summary>
        /// <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 Chat 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="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 pathConversationSid,
                                                                                          string identity = null,
                                                                                          string messagingBindingAddress      = null,
                                                                                          string messagingBindingProxyAddress = null,
                                                                                          DateTime?dateCreated     = null,
                                                                                          DateTime?dateUpdated     = null,
                                                                                          ITwilioRestClient client = null)
        {
            var options = new CreateParticipantOptions(pathConversationSid)
            {
                Identity = identity, MessagingBindingAddress = messagingBindingAddress, MessagingBindingProxyAddress = messagingBindingProxyAddress, DateCreated = dateCreated, DateUpdated = dateUpdated
            };

            return(await CreateAsync(options, client));
        }
Esempio n. 5
0
        /// <summary>
        /// create
        /// </summary>
        /// <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 Chat 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 the 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 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(pathConversationSid)
            {
                Identity = identity, MessagingBindingAddress = messagingBindingAddress, MessagingBindingProxyAddress = messagingBindingProxyAddress, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(await CreateAsync(options, client));
        }
        /// <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));
        }