Beispiel #1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Service parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Create(CreateServiceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Beispiel #2
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="webhookUrl"> The webhook_url </param>
        /// <param name="reachabilityWebhooksEnabled"> The reachability_webhooks_enabled </param>
        /// <param name="aclEnabled"> The acl_enabled </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> CreateAsync(string friendlyName = null, Uri webhookUrl = null, bool?reachabilityWebhooksEnabled = null, bool?aclEnabled = null, ITwilioRestClient client = null)
        {
            var options = new CreateServiceOptions {
                FriendlyName = friendlyName, WebhookUrl = webhookUrl, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled
            };

            return(await CreateAsync(options, client));
        }
Beispiel #3
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="webhookUrl"> The webhook_url </param>
        /// <param name="reachabilityWebhooksEnabled"> The reachability_webhooks_enabled </param>
        /// <param name="aclEnabled"> The acl_enabled </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Create(string friendlyName = null, Uri webhookUrl = null, bool?reachabilityWebhooksEnabled = null, bool?aclEnabled = null, ITwilioRestClient client = null)
        {
            var options = new CreateServiceOptions {
                FriendlyName = friendlyName, WebhookUrl = webhookUrl, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled
            };

            return(Create(options, client));
        }
Beispiel #4
0
 private static Request BuildCreateRequest(CreateServiceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Sync,
                "/v1/Services",
                postParams: options.GetParams()
                ));
 }
Beispiel #5
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Service parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> CreateAsync(CreateServiceOptions options,
                                                                                      ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }