Пример #1
0
        /// <summary>
        /// Update a specific Factor. This endpoint can be used to Verify a Factor if passed an `AuthPayload` param.
        /// </summary>
        /// <param name="options"> Update Factor parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Factor </returns>
        public static FactorResource Update(UpdateFactorOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Пример #2
0
        /// <summary>
        /// Update a specific Factor. This endpoint can be used to Verify a Factor if passed an `AuthPayload` param.
        /// </summary>
        /// <param name="options"> Update Factor parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Factor </returns>
        public static async System.Threading.Tasks.Task <FactorResource> UpdateAsync(UpdateFactorOptions options,
                                                                                     ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildUpdateRequest(UpdateFactorOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Authy,
                "/v1/Services/" + options.PathServiceSid + "/Entities/" + options.PathIdentity + "/Factors/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Пример #4
0
        /// <summary>
        /// Update a specific Factor. This endpoint can be used to Verify a Factor if passed an `AuthPayload` param.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique identity of the Entity </param>
        /// <param name="pathSid"> A string that uniquely identifies this Factor. </param>
        /// <param name="authPayload"> Optional payload to verify the Factor for the first time </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Factor </returns>
        public static async System.Threading.Tasks.Task <FactorResource> UpdateAsync(string pathServiceSid,
                                                                                     string pathIdentity,
                                                                                     string pathSid,
                                                                                     string authPayload       = null,
                                                                                     ITwilioRestClient client = null)
        {
            var options = new UpdateFactorOptions(pathServiceSid, pathIdentity, pathSid)
            {
                AuthPayload = authPayload
            };

            return(await UpdateAsync(options, client));
        }
Пример #5
0
        /// <summary>
        /// Update a specific Factor. This endpoint can be used to Verify a Factor if passed an `AuthPayload` param.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique identity of the Entity </param>
        /// <param name="pathSid"> A string that uniquely identifies this Factor. </param>
        /// <param name="authPayload"> Optional payload to verify the Factor for the first time </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Factor </returns>
        public static FactorResource Update(string pathServiceSid,
                                            string pathIdentity,
                                            string pathSid,
                                            string authPayload       = null,
                                            ITwilioRestClient client = null)
        {
            var options = new UpdateFactorOptions(pathServiceSid, pathIdentity, pathSid)
            {
                AuthPayload = authPayload
            };

            return(Update(options, client));
        }