# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License 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.
# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.
defmodule GoogleApi.Compute.V1.Model.CorsPolicy do
@moduledoc """
The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard.
## Attributes
* `allowCredentials` (*type:* `boolean()`, *default:* `nil`) - In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This field translates to the Access-Control-Allow-Credentials header. Default is false.
* `allowHeaders` (*type:* `list(String.t)`, *default:* `nil`) - Specifies the content for the Access-Control-Allow-Headers header.
* `allowMethods` (*type:* `list(String.t)`, *default:* `nil`) - Specifies the content for the Access-Control-Allow-Methods header.
* `allowOriginRegexes` (*type:* `list(String.t)`, *default:* `nil`) - Specifies a regular expression that matches allowed origins. For more information, see regular expression syntax . An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED.
* `allowOrigins` (*type:* `list(String.t)`, *default:* `nil`) - Specifies the list of origins that is allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
* `disabled` (*type:* `boolean()`, *default:* `nil`) - If true, disables the CORS policy. The default value is false, which indicates that the CORS policy is in effect.
* `exposeHeaders` (*type:* `list(String.t)`, *default:* `nil`) - Specifies the content for the Access-Control-Expose-Headers header.
* `maxAge` (*type:* `integer()`, *default:* `nil`) - Specifies how long results of a preflight request can be cached in seconds. This field translates to the Access-Control-Max-Age header.
"""
use GoogleApi.Gax.ModelBase
@type t :: %__MODULE__{
:allowCredentials => boolean() | nil,
:allowHeaders => list(String.t()) | nil,
:allowMethods => list(String.t()) | nil,
:allowOriginRegexes => list(String.t()) | nil,
:allowOrigins => list(String.t()) | nil,
:disabled => boolean() | nil,
:exposeHeaders => list(String.t()) | nil,
:maxAge => integer() | nil
}
field(:allowCredentials)
field(:allowHeaders, type: :list)
field(:allowMethods, type: :list)
field(:allowOriginRegexes, type: :list)
field(:allowOrigins, type: :list)
field(:disabled)
field(:exposeHeaders, type: :list)
field(:maxAge)
end
defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.CorsPolicy do
def decode(value, options) do
GoogleApi.Compute.V1.Model.CorsPolicy.decode(value, options)
end
end
defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.CorsPolicy do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end