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

            return(FromJson(response.Content));
        }
コード例 #2
0
 private static Request BuildCreateRequest(CreateTrustProductsOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Trusthub,
                "/v1/TrustProducts",
                postParams: options.GetParams(),
                headerParams: null
                ));
 }
コード例 #3
0
        /// <summary>
        /// Create a new Customer-Profile.
        /// </summary>
        /// <param name="friendlyName"> The string that you assigned to describe the resource </param>
        /// <param name="email"> The email address </param>
        /// <param name="policySid"> The unique string of a policy. </param>
        /// <param name="statusCallback"> The URL we call to inform your application of status changes. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TrustProducts </returns>
        public static async System.Threading.Tasks.Task <TrustProductsResource> CreateAsync(string friendlyName,
                                                                                            string email,
                                                                                            string policySid,
                                                                                            Uri statusCallback       = null,
                                                                                            ITwilioRestClient client = null)
        {
            var options = new CreateTrustProductsOptions(friendlyName, email, policySid)
            {
                StatusCallback = statusCallback
            };

            return(await CreateAsync(options, client));
        }
コード例 #4
0
        /// <summary>
        /// Create a new Customer-Profile.
        /// </summary>
        /// <param name="friendlyName"> The string that you assigned to describe the resource </param>
        /// <param name="email"> The email address </param>
        /// <param name="policySid"> The unique string of a policy. </param>
        /// <param name="statusCallback"> The URL we call to inform your application of status changes. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TrustProducts </returns>
        public static TrustProductsResource Create(string friendlyName,
                                                   string email,
                                                   string policySid,
                                                   Uri statusCallback       = null,
                                                   ITwilioRestClient client = null)
        {
            var options = new CreateTrustProductsOptions(friendlyName, email, policySid)
            {
                StatusCallback = statusCallback
            };

            return(Create(options, client));
        }
コード例 #5
0
        /// <summary>
        /// Create a new Customer-Profile.
        /// </summary>
        /// <param name="options"> Create TrustProducts parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TrustProducts </returns>
        public static async System.Threading.Tasks.Task <TrustProductsResource> CreateAsync(CreateTrustProductsOptions options,
                                                                                            ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }