/*******************************************************************************
 *  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>
    /// The SetDistributionConfigRequest contains the parameters used for the
    /// SetDistributionConfig operation.
    /// The ETag parameter is used if you wish to specify the ETag to match with the
    /// ETag of the Distribution with the Id specified.
    /// <br />Required Parameters: Id
    /// <br />Required Parameters: DistributionConfig
    /// <br />Required Parameters: ETag of the Distribution. This
    /// can be retrieved via a call to GetDistibutionInfo
    /// </summary>
    /// <remarks>
    /// If you want to serve private content, you need to:
    /// <list type="bullet">
    /// <item>Associate an Origin Access Identity with the DistributionConfig</item>
    /// <item>Associate TrustedSigners with the DistributionConfig if you want to 
    /// serve content via Signed URLs</item>
    /// </list>
    /// </remarks>
    /// <seealso cref="T:Amazon.CloudFront.Model.CloudFrontDistributionConfig"/>
    /// <seealso cref="T:Amazon.CloudFront.Model.UrlTrustedSigners"/>
    /// <seealso cref="P:Amazon.CloudFront.Model.CloudFrontDistributionConfig.OriginAccessIdentity"/>
    /// <seealso cref="P:Amazon.CloudFront.Model.CloudFrontDistributionConfig.TrustedSigners"/>
    public class SetDistributionConfigRequest : CloudFrontRequest
    {
        #region Id

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

        /// <summary>
        /// Sets the Id property for this request.
        /// This is the CloudFront Distribution Id that will be reconfigured
        /// by this request.
        /// </summary>
        /// <param name="id">The value that Id is set to</param>
        /// <returns>the request with the Id set</returns>
        public SetDistributionConfigRequest WithId(string id)
        {
            this.distId = id;
            return this;
        }

        #endregion

        #region DistributionConfig

        /// <summary>
        /// Gets and Sets the DistributionConfig property.
        /// The CloudFront Distribution's configuration will be modified
        /// to reflect the values in this configuration object.
        /// </summary>
        [XmlElementAttribute(ElementName = "DistributionConfig")]
        public override CloudFrontDistributionConfig DistributionConfig
        {
            get { return this.dConfig; }
            set { this.dConfig = value; }
        }

        /// <summary>
        /// Sets the DistributionConfig property for this request.
        /// </summary>
        /// <param name="distributionConfig">The value that DistributionConfig is set to</param>
        /// <returns>the request with the Configuration set</returns>
        public SetDistributionConfigRequest WithDistributionConfig(CloudFrontDistributionConfig distributionConfig)
        {
            this.dConfig = distributionConfig;
            return this;
        }

        #endregion

        #region ETag

        /// <summary>
        /// Gets and sets the ETag property. This should be the ETag of the Distribution.
        /// <see cref="P:Amazon.CloudFront.Model.CloudFrontDistribution.ETag"/>
        /// </summary>
        public override string ETag
        {
            get { return this.etagHeader; }
            set { this.etagHeader = value; }
        }

        /// <summary>
        /// Sets the ETag property for this request.
        /// This is the ETag of the CloudFront Distribution which will be reconfigured.
        /// </summary>
        /// <param name="etag">The value that ETag is set to</param>
        /// <returns>the request with the ETag set</returns>
        public SetDistributionConfigRequest WithETag(string etag)
        {
            this.etagHeader = etag;
            return this;
        }

        #endregion
    }
}