コード例 #1
0
        /// <summary>
        /// Create a new Factor for the Entity
        /// </summary>
        /// <param name="options"> Create Factor parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Factor </returns>
        public static FactorResource Create(CreateFactorOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #2
0
        /// <summary>
        /// Create a new Factor for the Entity
        /// </summary>
        /// <param name="options"> Create 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> CreateAsync(CreateFactorOptions options,
                                                                                     ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #3
0
 private static Request BuildCreateRequest(CreateFactorOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Authy,
                "/v1/Services/" + options.PathServiceSid + "/Entities/" + options.PathIdentity + "/Factors",
                postParams: options.GetParams()
                ));
 }
コード例 #4
0
        /// <summary>
        /// Create a new Factor for the Entity
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique identity of the Entity </param>
        /// <param name="binding"> A unique binding for this Factor </param>
        /// <param name="friendlyName"> The friendly name of this Factor </param>
        /// <param name="factorType"> The Type of this Factor </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> CreateAsync(string pathServiceSid,
                                                                                     string pathIdentity,
                                                                                     string binding,
                                                                                     string friendlyName,
                                                                                     FactorResource.FactorTypesEnum factorType,
                                                                                     ITwilioRestClient client = null)
        {
            var options = new CreateFactorOptions(pathServiceSid, pathIdentity, binding, friendlyName, factorType);

            return(await CreateAsync(options, client));
        }
コード例 #5
0
        /// <summary>
        /// Create a new Factor for the Entity
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique identity of the Entity </param>
        /// <param name="binding"> A unique binding for this Factor </param>
        /// <param name="friendlyName"> The friendly name of this Factor </param>
        /// <param name="factorType"> The Type of this Factor </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Factor </returns>
        public static FactorResource Create(string pathServiceSid,
                                            string pathIdentity,
                                            string binding,
                                            string friendlyName,
                                            FactorResource.FactorTypesEnum factorType,
                                            ITwilioRestClient client = null)
        {
            var options = new CreateFactorOptions(pathServiceSid, pathIdentity, binding, friendlyName, factorType);

            return(Create(options, client));
        }