/*******************************************************************************
 *  Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License"). You may not use
 *  this file except in compliance with the License. A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 *  or in the "license" file accompanying this file.
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, either express or implied. See the License for the
 *  specific language governing permissions and limitations under the License.
 * *****************************************************************************
 *    __  _    _  ___
 *   (  )( \/\/ )/ __)
 *   /__\ \    / \__ \
 *  (_)(_) \/\/  (___/
 *
 *  AWS SDK for .NET
 *  API Version: 2009-12-01
 *
 */

using System.Xml.Serialization;

namespace Amazon.CloudFront.Model
{
    /// <summary>
    /// Represents an error returned by the CloudFront service. Exposes
    /// an error code, a message, a host ID and a request ID for
    /// debugging purposes.
    /// </summary>
    [XmlRootAttribute(Namespace = "http://cloudfront.amazonaws.com/doc/2009-12-01/", IsNullable = false)]
    public class CloudFrontError
    {
        #region Private Members

        private string code;
        private string message;
        private string type;
        private string requestId;

        #endregion

        #region Code

        /// <summary>
        /// Gets and sets the Code property.
        /// </summary>
        [XmlElementAttribute(ElementName = "Code")]
        public string Code
        {
            get { return this.code; }
            set { this.code = value; }
        }

        /// <summary>
        /// Sets the Code property.
        /// </summary>
        /// <param name="code">Code property</param>
        /// <returns>this instance</returns>
        public CloudFrontError WithCode(string code)
        {
            this.code = code;
            return this;
        }

        /// <summary>
        /// Checks if Code property is set.
        /// </summary>
        /// <returns>true if Code property is set.</returns>
        internal bool IsSetCode()
        {
            return this.code != null;
        }

        #endregion

        #region Message

        /// <summary>
        /// Gets and sets the Message property.
        /// </summary>
        [XmlElementAttribute(ElementName = "Message")]
        public string Message
        {
            get { return this.message; }
            set { this.message = value; }
        }

        #endregion

        #region HostId

        /// <summary>
        /// Gets and sets the Type property.
        /// </summary>
        [XmlElementAttribute(ElementName = "Type")]
        public string Type
        {
            get { return this.type; }
            set { this.type = value; }
        }

        #endregion

        #region RequestId

        /// <summary>
        /// Gets and sets the RequestId property.
        /// </summary>
        [XmlElementAttribute(ElementName = "RequestId")]
        public string RequestId
        {
            get { return this.requestId; }
            set { this.requestId = value; }
        }

        #endregion
    }
}
