/// <summary>
        /// This endpoint allows you to delete a domain from your Pepipost account.
        /// </summary>
        /// <param name="body">Required parameter: delete domain</param>
        /// <return>Returns the object response from the API call</return>
        public object DeleteDomain(Models.DeleteDomain body)
        {
            Task <object> t = DeleteDomainAsync(body);

            APIHelper.RunTaskSynchronously(t);
            return(t.Result);
        }
        /// <summary>
        /// This endpoint allows you to delete a domain from your Pepipost account.
        /// </summary>
        /// <param name="body">Required parameter: delete domain</param>
        /// <return>Returns the object response from the API call</return>
        public async Task <object> DeleteDomainAsync(Models.DeleteDomain body)
        {
            //the base uri for api requests
            string _baseUri = Configuration.BaseUri;

            //prepare query string for API call
            StringBuilder _queryBuilder = new StringBuilder(_baseUri);

            _queryBuilder.Append("/domain/delete");


            //validate and preprocess url
            string _queryUrl = APIHelper.CleanUrl(_queryBuilder);

            //append request with appropriate headers and parameters
            var _headers = new Dictionary <string, string>()
            {
                { "user-agent", "APIMATIC 2.0" },
                { "content-type", "application/json; charset=utf-8" }
            };

            _headers.Add("api_key", Configuration.ApiKey);

            //append body params
            var _body = APIHelper.JsonSerialize(body);

            //prepare the API call request to fetch the response
            HttpRequest _request = ClientInstance.DeleteBody(_queryUrl, _headers, _body);

            //invoke request and get response
            HttpStringResponse _response = (HttpStringResponse)await ClientInstance.ExecuteAsStringAsync(_request).ConfigureAwait(false);

            HttpContext _context = new HttpContext(_request, _response);

            //Error handling using HTTP status codes
            if (_response.StatusCode == 400)
            {
                throw new APIException(@"API Response", _context);
            }

            if (_response.StatusCode == 401)
            {
                throw new APIException(@"API Response", _context);
            }

            if (_response.StatusCode == 403)
            {
                throw new APIException(@"API Response", _context);
            }

            if (_response.StatusCode == 405)
            {
                throw new APIException(@"Invalid input", _context);
            }

            //handle errors defined at the API level
            base.ValidateResponse(_response, _context);

            try
            {
                return(_response.Body);
            }
            catch (Exception _ex)
            {
                throw new APIException("Failed to parse the response: " + _ex.Message, _context);
            }
        }