/*******************************************************************************
 * 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-05-15
 */

using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;

namespace Amazon.CloudWatch.Model
{
    /// <summary>
    /// Error associated with the request.
    /// </summary>
    [XmlRootAttribute(Namespace = "http://monitoring.amazonaws.com/doc/2009-05-15/", IsNullable = false)]
    public class Error
    {
        private string typeField;
        private string codeField;
        private string messageField;
        private Object detailField;

        /// <summary>
        /// Gets and sets the Type property.
        /// The error type. There are two types of error codes: client and server.
        /// these error codes are prefixed with Client. For example: Client.AuthFailure.
        /// </summary>
        [XmlElementAttribute(ElementName = "Type")]
        public string Type
        {
            get { return this.typeField ; }
            set { this.typeField= value; }
        }

        /// <summary>
        /// Sets the Type property
        /// </summary>
        /// <param name="type">The error type. There are two types of error codes: client and server.
        /// these error codes are prefixed with Client. For example: Client.AuthFailure.</param>
        /// <returns>this instance</returns>
        public Error WithType(string type)
        {
            this.typeField = type;
            return this;
        }

        /// <summary>
        /// Checks if Type property is set
        /// </summary>
        /// <returns>true if Type property is set</returns>
        public bool IsSetType()
        {
            return this.typeField != null;
        }

        /// <summary>
        /// Gets and sets the Code property.
        /// The specific error code. See the CloudWatch developer documentation for more details.
        /// </summary>
        [XmlElementAttribute(ElementName = "Code")]
        public string Code
        {
            get { return this.codeField ; }
            set { this.codeField= value; }
        }

        /// <summary>
        /// Sets the Code property
        /// </summary>
        /// <param name="code">The specific error code. See the CloudWatch developer documentation for more details.</param>
        /// <returns>this instance</returns>
        public Error WithCode(string code)
        {
            this.codeField = code;
            return this;
        }

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

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

        /// <summary>
        /// Sets the Message property
        /// </summary>
        /// <param name="message">A summary of the error.</param>
        /// <returns>this instance</returns>
        public Error WithMessage(string message)
        {
            this.messageField = message;
            return this;
        }

        /// <summary>
        /// Checks if Message property is set
        /// </summary>
        /// <returns>true if Message property is set</returns>
        public bool IsSetMessage()
        {
            return  this.messageField != null;
        }

        /// <summary>
        /// Gets and sets the Detail property.
        /// Details associated with the error.
        /// </summary>
        [XmlElementAttribute(ElementName = "Detail")]
        public Object Detail
        {
            get { return this.detailField ; }
            set { this.detailField = value; }
        }

        /// <summary>
        /// Sets the Detail property
        /// </summary>
        /// <param name="detail">Details associated with the error.</param>
        /// <returns>this instance</returns>
        public Error WithDetail(Object detail)
        {
            this.detailField = detail;
            return this;
        }

        /// <summary>
        /// Checks if Detail property is set
        /// </summary>
        /// <returns>true if Detail property is set</returns>
        public bool IsSetDetail()
        {
            return this.detailField != null;
        }

    }
}
