public static void Run()
        {
            const string Username = "";
            const string Password = "";
            const bool Sandbox = true;

            NextCallerPlatformClient client = new NextCallerPlatformClient(Username, Password, Sandbox);

            const string ProfileId = "profileId";
            const string AccountId = "TestUser1";

            try
            {
                ProfileToPost profile = new ProfileToPost
                {
                    Email = "*****@*****.**",
                    FirstName = "Clark",
                    LastName = "Kent",
                    PrimaryAddress = new Address
                    {
                        Line1 = "223 Kryptonite Ave.",
                        Line2 = "",
                        City = "Smallville",
                        State = "KS",
                        ZipCode = "66002"
                    },
                    SecondaryAddress = new Address
                    {
                        Line1 = "223 Kryptonite Ave.",
                        Line2 = "",
                        City = "Smallville",
                        State = "KS",
                        ZipCode = "66002"
                    },
                };

                client.UpdateByProfileId(ProfileId, profile, AccountId);

            }
            catch (FormatException formatException)
            {

                HttpWebRequest request = formatException.Request;
                HttpWebResponse response = formatException.Response;

                HttpStatusCode code = response.StatusCode;
                Console.WriteLine("Status code: {0}", code);

                string reasonPhrase = response.StatusDescription;
                Console.WriteLine("Reason Phrase: {0}", reasonPhrase);

                string responseContent = formatException.Content;
                Console.WriteLine("Content : {0}", responseContent);

            }
            catch (BadRequestException badRequestException)
            {

                HttpWebRequest request = badRequestException.Request;
                HttpWebResponse response = badRequestException.Response;

                Error parsedError = badRequestException.Error;

                string errorCode = parsedError.Code;
                string message = parsedError.Message;
                string type = parsedError.Type;

                Dictionary<string, string[]> description = parsedError.Description;

                Console.WriteLine(parsedError.ToString());

            }
        }
        public void JsonSerialize_ProfileContainsNameAddressPhone_JsonContainsNameAddressPhone()
        {
            //Arrange
            ProfileToPost profile = new ProfileToPost
            {
                FirstName = "Ivan",
                LastName = "Petrov",
                PrimaryAddress = new Address
                    {
                        Country = "Russia",
                        City = "Omsk"
                    },
            };

            //Action
            string json = JsonSerializer.Serialize(profile);

            //Assert
            Assert.IsNotNull(json);

            Assert.IsTrue(json.Contains("\"first_name\":\"Ivan\""));
            Assert.IsTrue(json.Contains("\"last_name\":\"Petrov\""));
            Assert.IsTrue(json.Contains("\"shipping_address1\":{\"country\":\"Russia\",\"city\":\"Omsk\"}"));
        }
        /// <summary>
        /// Updates profile with given id.
        /// More information at: https://nextcaller.com/documentation/v2.1/#/profiles/post-profile/curl
        /// </summary>
        /// <param name="profileData">Profile data to be updated.</param>
        /// <param name="profileId">Id of the updated profile.</param>
        public void UpdateByProfileId(string profileId, ProfileToPost profileData)
        {
            Utility.EnsureParameterValid(!(profileId == null), "profileId");
            Utility.EnsureParameterValid(!(profileData == null), "profileData");

            string jsonData = JsonSerializer.Serialize(profileData);
            UpdateByProfileIdJson(profileId, jsonData);
        }
        public void PostProfile_ValidIdAndValidProfile_NoExceptionsThrown()
        {
            //Arrange
            const string ProfileId = "adaSfaqwfasfasdasdfasfasfasd";

            ProfileToPost profile = new ProfileToPost
            {
                FirstName = "NewFirstName",
                LastName = "NewLastName"
            };

            Mock<IHttpTransport> httpTransportMock = new Mock<IHttpTransport>(MockBehavior.Strict);
            httpTransportMock.Setup(httpTransport => httpTransport.Request(It.IsAny<string>(), It.IsAny<ContentType>(), "POST", It.IsAny<string>(), null))
                .Returns(string.Empty);

            //Action
            NextCallerClient client = new NextCallerClient(httpTransportMock.Object);
            client.UpdateByProfileId(ProfileId, profile);

            //Assert
            httpTransportMock.Verify(httpTransport => httpTransport.Request(It.IsAny<string>(), It.IsAny<ContentType>(), "POST", It.IsAny<string>(), null), Times.Once);
        }