/// <summary>
        /// Create a new End User.
        /// </summary>
        /// <param name="options"> Create EndUser parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of EndUser </returns>
        public static EndUserResource Create(CreateEndUserOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildCreateRequest(CreateEndUserOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Numbers,
                "/v2/RegulatoryCompliance/EndUsers",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Create a new End User.
        /// </summary>
        /// <param name="friendlyName"> The string that you assigned to describe the resource </param>
        /// <param name="type"> The type of end user of the Bundle resource </param>
        /// <param name="attributes"> The set of parameters that compose the End User resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of EndUser </returns>
        public static EndUserResource Create(string friendlyName,
                                             EndUserResource.TypeEnum type,
                                             object attributes        = null,
                                             ITwilioRestClient client = null)
        {
            var options = new CreateEndUserOptions(friendlyName, type)
            {
                Attributes = attributes
            };

            return(Create(options, client));
        }
        /// <summary>
        /// Create a new End User.
        /// </summary>
        /// <param name="friendlyName"> The string that you assigned to describe the resource </param>
        /// <param name="type"> The type of end user of the Bundle resource </param>
        /// <param name="attributes"> The set of parameters that compose the End User resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of EndUser </returns>
        public static async System.Threading.Tasks.Task <EndUserResource> CreateAsync(string friendlyName,
                                                                                      EndUserResource.TypeEnum type,
                                                                                      object attributes        = null,
                                                                                      ITwilioRestClient client = null)
        {
            var options = new CreateEndUserOptions(friendlyName, type)
            {
                Attributes = attributes
            };

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

            return(FromJson(response.Content));
        }