/// <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));
        }
 private static Request BuildCreateRequest(CreateServiceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/understand/Services",
                client.Region,
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="logQueries"> The log_queries </param>
        /// <param name="ttl"> The ttl </param>
        /// <param name="uniqueName"> The unique_name </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,
                                                                                      bool?logQueries          = null,
                                                                                      int?ttl                  = null,
                                                                                      string uniqueName        = null,
                                                                                      ITwilioRestClient client = null)
        {
            var options = new CreateServiceOptions()
            {
                FriendlyName = friendlyName, LogQueries = logQueries, Ttl = ttl, UniqueName = uniqueName
            };

            return(await CreateAsync(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="logQueries"> The log_queries </param>
        /// <param name="ttl"> The ttl </param>
        /// <param name="uniqueName"> The unique_name </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,
                                             bool?logQueries          = null,
                                             int?ttl                  = null,
                                             string uniqueName        = null,
                                             ITwilioRestClient client = null)
        {
            var options = new CreateServiceOptions()
            {
                FriendlyName = friendlyName, LogQueries = logQueries, Ttl = ttl, UniqueName = uniqueName
            };

            return(Create(options, client));
        }
        /// <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));
        }