コード例 #1
0
        /// <summary>
        /// Fetch a specific Challenge.
        /// </summary>
        /// <param name="options"> Fetch Challenge parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Challenge </returns>
        public static ChallengeResource Fetch(FetchChallengeOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #2
0
 private static Request BuildFetchRequest(FetchChallengeOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Authy,
                "/v1/Services/" + options.PathServiceSid + "/Entities/" + options.PathIdentity + "/Factors/" + options.PathFactorSid + "/Challenges/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
コード例 #3
0
        /// <summary>
        /// Fetch a specific Challenge.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique identity of the Entity </param>
        /// <param name="pathFactorSid"> Factor Sid. </param>
        /// <param name="pathSid"> A string that uniquely identifies this Challenge, or `latest`. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Challenge </returns>
        public static async System.Threading.Tasks.Task <ChallengeResource> FetchAsync(string pathServiceSid,
                                                                                       string pathIdentity,
                                                                                       string pathFactorSid,
                                                                                       string pathSid,
                                                                                       ITwilioRestClient client = null)
        {
            var options = new FetchChallengeOptions(pathServiceSid, pathIdentity, pathFactorSid, pathSid);

            return(await FetchAsync(options, client));
        }
コード例 #4
0
        /// <summary>
        /// Fetch a specific Challenge.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique identity of the Entity </param>
        /// <param name="pathFactorSid"> Factor Sid. </param>
        /// <param name="pathSid"> A string that uniquely identifies this Challenge, or `latest`. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Challenge </returns>
        public static ChallengeResource Fetch(string pathServiceSid,
                                              string pathIdentity,
                                              string pathFactorSid,
                                              string pathSid,
                                              ITwilioRestClient client = null)
        {
            var options = new FetchChallengeOptions(pathServiceSid, pathIdentity, pathFactorSid, pathSid);

            return(Fetch(options, client));
        }
コード例 #5
0
        /// <summary>
        /// Fetch a specific Challenge.
        /// </summary>
        /// <param name="options"> Fetch Challenge parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Challenge </returns>
        public static async System.Threading.Tasks.Task <ChallengeResource> FetchAsync(FetchChallengeOptions options,
                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }