Ejemplo n.º 1
0
        /// <summary>
        /// Create a new Message to a Participant
        /// </summary>
        ///
        /// <param name="options"> Create MessageInteraction parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of MessageInteraction </returns>
        public static MessageInteractionResource Create(CreateMessageInteractionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new Message to a Participant
        /// </summary>
        ///
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSessionSid"> Session Sid. </param>
        /// <param name="pathParticipantSid"> Participant Sid. </param>
        /// <param name="body"> The body </param>
        /// <param name="mediaUrl"> The media_url </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of MessageInteraction </returns>
        public static async System.Threading.Tasks.Task <MessageInteractionResource> CreateAsync(string pathServiceSid, string pathSessionSid, string pathParticipantSid, string body = null, List <Uri> mediaUrl = null, ITwilioRestClient client = null)
        {
            var options = new CreateMessageInteractionOptions(pathServiceSid, pathSessionSid, pathParticipantSid)
            {
                Body = body, MediaUrl = mediaUrl
            };

            return(await CreateAsync(options, client));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a new Message to a Participant
        /// </summary>
        ///
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSessionSid"> Session Sid. </param>
        /// <param name="pathParticipantSid"> Participant Sid. </param>
        /// <param name="body"> The body </param>
        /// <param name="mediaUrl"> The media_url </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of MessageInteraction </returns>
        public static MessageInteractionResource Create(string pathServiceSid, string pathSessionSid, string pathParticipantSid, string body = null, List <Uri> mediaUrl = null, ITwilioRestClient client = null)
        {
            var options = new CreateMessageInteractionOptions(pathServiceSid, pathSessionSid, pathParticipantSid)
            {
                Body = body, MediaUrl = mediaUrl
            };

            return(Create(options, client));
        }
Ejemplo n.º 4
0
 private static Request BuildCreateRequest(CreateMessageInteractionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Proxy,
                "/v1/Services/" + options.PathServiceSid + "/Sessions/" + options.PathSessionSid + "/Participants/" + options.PathParticipantSid + "/MessageInteractions",
                postParams: options.GetParams()
                ));
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Create a new Message to a Participant
        /// </summary>
        ///
        /// <param name="options"> Create MessageInteraction parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of MessageInteraction </returns>
        public static async System.Threading.Tasks.Task <MessageInteractionResource> CreateAsync(CreateMessageInteractionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }