/* * 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 mediastore-2017-09-01.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.MediaStore.Model { /// /// A rule for a CORS policy. You can add up to 100 rules to a CORS policy. If more than /// one rule applies, the service uses the first applicable rule listed. /// public partial class CorsRule { private List _allowedHeaders = new List(); private List _allowedMethods = new List(); private List _allowedOrigins = new List(); private List _exposeHeaders = new List(); private int? _maxAgeSeconds; /// /// Gets and sets the property AllowedHeaders. /// /// Specifies which headers are allowed in a preflight OPTIONS request through /// the Access-Control-Request-Headers header. Each header name that is specified /// in Access-Control-Request-Headers must have a corresponding entry in /// the rule. Only the headers that were requested are sent back. /// /// /// /// This element can contain only one wildcard character (*). /// /// [AWSProperty(Required=true, Min=0, Max=100)] public List AllowedHeaders { get { return this._allowedHeaders; } set { this._allowedHeaders = value; } } // Check to see if AllowedHeaders property is set internal bool IsSetAllowedHeaders() { return this._allowedHeaders != null && this._allowedHeaders.Count > 0; } /// /// Gets and sets the property AllowedMethods. /// /// Identifies an HTTP method that the origin that is specified in the rule is allowed /// to execute. /// /// /// /// Each CORS rule must contain at least one AllowedMethods and one AllowedOrigins /// element. /// /// [AWSProperty(Min=1, Max=4)] public List AllowedMethods { get { return this._allowedMethods; } set { this._allowedMethods = value; } } // Check to see if AllowedMethods property is set internal bool IsSetAllowedMethods() { return this._allowedMethods != null && this._allowedMethods.Count > 0; } /// /// Gets and sets the property AllowedOrigins. /// /// One or more response headers that you want users to be able to access from their applications /// (for example, from a JavaScript XMLHttpRequest object). /// /// /// /// Each CORS rule must have at least one AllowedOrigins element. The string /// value can include only one wildcard character (*), for example, http://*.example.com. /// Additionally, you can specify only one wildcard character to allow cross-origin access /// for all origins. /// /// [AWSProperty(Required=true, Min=1, Max=100)] public List AllowedOrigins { get { return this._allowedOrigins; } set { this._allowedOrigins = value; } } // Check to see if AllowedOrigins property is set internal bool IsSetAllowedOrigins() { return this._allowedOrigins != null && this._allowedOrigins.Count > 0; } /// /// Gets and sets the property ExposeHeaders. /// /// One or more headers in the response that you want users to be able to access from /// their applications (for example, from a JavaScript XMLHttpRequest object). /// /// /// /// This element is optional for each rule. /// /// [AWSProperty(Min=0, Max=100)] public List ExposeHeaders { get { return this._exposeHeaders; } set { this._exposeHeaders = value; } } // Check to see if ExposeHeaders property is set internal bool IsSetExposeHeaders() { return this._exposeHeaders != null && this._exposeHeaders.Count > 0; } /// /// Gets and sets the property MaxAgeSeconds. /// /// The time in seconds that your browser caches the preflight response for the specified /// resource. /// /// /// /// A CORS rule can have only one MaxAgeSeconds element. /// /// [AWSProperty(Min=0, Max=2147483647)] public int MaxAgeSeconds { get { return this._maxAgeSeconds.GetValueOrDefault(); } set { this._maxAgeSeconds = value; } } // Check to see if MaxAgeSeconds property is set internal bool IsSetMaxAgeSeconds() { return this._maxAgeSeconds.HasValue; } } }