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

            return(FromJson(response.Content));
        }
 private static Request BuildCreateRequest(CreateIpRecordOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Voice,
                "/v1/IpRecords",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="ipAddress"> An IP address in dotted decimal notation, IPv4 only. </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="cidrPrefixLength"> An integer representing the length of the
        ///                        [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default
        ///                        the entire IP address is used, which for IPv4 is value 32. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of IpRecord </returns>
        public static async System.Threading.Tasks.Task <IpRecordResource> CreateAsync(string ipAddress,
                                                                                       string friendlyName      = null,
                                                                                       int?cidrPrefixLength     = null,
                                                                                       ITwilioRestClient client = null)
        {
            var options = new CreateIpRecordOptions(ipAddress)
            {
                FriendlyName = friendlyName, CidrPrefixLength = cidrPrefixLength
            };

            return(await CreateAsync(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="ipAddress"> An IP address in dotted decimal notation, IPv4 only. </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="cidrPrefixLength"> An integer representing the length of the
        ///                        [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default
        ///                        the entire IP address is used, which for IPv4 is value 32. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of IpRecord </returns>
        public static IpRecordResource Create(string ipAddress,
                                              string friendlyName      = null,
                                              int?cidrPrefixLength     = null,
                                              ITwilioRestClient client = null)
        {
            var options = new CreateIpRecordOptions(ipAddress)
            {
                FriendlyName = friendlyName, CidrPrefixLength = cidrPrefixLength
            };

            return(Create(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create IpRecord parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of IpRecord </returns>
        public static async System.Threading.Tasks.Task <IpRecordResource> CreateAsync(CreateIpRecordOptions options,
                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }