/* * Copyright 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. */ /* * Do not modify this file. This file is generated from the cloudfront-2020-05-31.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.CloudFront.Model { /// /// A complex type that controls: /// /// /// /// For more information about custom error pages, see Customizing /// Error Responses in the Amazon CloudFront Developer Guide. /// /// public partial class CustomErrorResponse { private long? _errorCachingMinTTL; private int? _errorCode; private string _responseCode; private string _responsePagePath; /// /// Gets and sets the property ErrorCachingMinTTL. /// /// The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP /// status code specified in ErrorCode. When this time period has elapsed, /// CloudFront queries your origin to see whether the problem that caused the error has /// been resolved and the requested object is now available. /// /// /// /// For more information, see Customizing /// Error Responses in the Amazon CloudFront Developer Guide. /// /// public long ErrorCachingMinTTL { get { return this._errorCachingMinTTL.GetValueOrDefault(); } set { this._errorCachingMinTTL = value; } } // Check to see if ErrorCachingMinTTL property is set internal bool IsSetErrorCachingMinTTL() { return this._errorCachingMinTTL.HasValue; } /// /// Gets and sets the property ErrorCode. /// /// The HTTP status code for which you want to specify a custom error page and/or a caching /// duration. /// /// [AWSProperty(Required=true)] public int ErrorCode { get { return this._errorCode.GetValueOrDefault(); } set { this._errorCode = value; } } // Check to see if ErrorCode property is set internal bool IsSetErrorCode() { return this._errorCode.HasValue; } /// /// Gets and sets the property ResponseCode. /// /// The HTTP status code that you want CloudFront to return to the viewer along with the /// custom error page. There are a variety of reasons that you might want CloudFront to /// return a status code different from the status code that your origin returned to CloudFront, /// for example: /// /// /// /// If you specify a value for ResponseCode, you must also specify a value /// for ResponsePagePath. /// /// public string ResponseCode { get { return this._responseCode; } set { this._responseCode = value; } } // Check to see if ResponseCode property is set internal bool IsSetResponseCode() { return this._responseCode != null; } /// /// Gets and sets the property ResponsePagePath. /// /// The path to the custom error page that you want CloudFront to return to a viewer when /// your origin returns the HTTP status code specified by ErrorCode, for /// example, /4xx-errors/403-forbidden.html. If you want to store your objects /// and your custom error pages in different locations, your distribution must include /// a cache behavior for which the following is true: /// /// /// /// If you specify a value for ResponsePagePath, you must also specify a /// value for ResponseCode. /// /// /// /// We recommend that you store custom error pages in an Amazon S3 bucket. If you store /// custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront /// can't get the files that you want to return to viewers because the origin server is /// unavailable. /// /// public string ResponsePagePath { get { return this._responsePagePath; } set { this._responsePagePath = value; } } // Check to see if ResponsePagePath property is set internal bool IsSetResponsePagePath() { return this._responsePagePath != null; } } }