# 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.NetworkSecurity.V1.Model.TlsInspectionPolicy do
  @moduledoc """
  The TlsInspectionPolicy resource contains references to CA pools in Certificate Authority Service and associated metadata.

  ## Attributes

  *   `caPool` (*type:* `String.t`, *default:* `nil`) - Required. A CA pool resource used to issue interception certificates. The CA pool string has a relative resource path following the form "projects/{project}/locations/{location}/caPools/{ca_pool}".
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the resource was created.
  *   `customTlsFeatures` (*type:* `list(String.t)`, *default:* `nil`) - Optional. List of custom TLS cipher suites selected. This field is valid only if the selected tls_feature_profile is CUSTOM. The compute.SslPoliciesService.ListAvailableFeatures method returns the set of features that can be specified in this list. Note that Secure Web Proxy does not yet honor this field.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Free-text description of the resource.
  *   `excludePublicCaSet` (*type:* `boolean()`, *default:* `nil`) - Optional. If FALSE (the default), use our default set of public CAs in addition to any CAs specified in trust_config. These public CAs are currently based on the Mozilla Root Program and are subject to change over time. If TRUE, do not accept our default set of public CAs. Only CAs specified in trust_config will be accepted. This defaults to FALSE (use public CAs in addition to trust_config) for backwards compatibility, but trusting public root CAs is *not recommended* unless the traffic in question is outbound to public web servers. When possible, prefer setting this to "false" and explicitly specifying trusted CAs and certificates in a TrustConfig. Note that Secure Web Proxy does not yet honor this field.
  *   `minTlsVersion` (*type:* `String.t`, *default:* `nil`) - Optional. Minimum TLS version that the firewall should use when negotiating connections with both clients and servers. If this is not set, then the default value is to allow the broadest set of clients and servers (TLS 1.0 or higher). Setting this to more restrictive values may improve security, but may also prevent the firewall from connecting to some clients or servers. Note that Secure Web Proxy does not yet honor this field.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. Name of the resource. Name is of the form projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy} tls_inspection_policy should match the pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
  *   `tlsFeatureProfile` (*type:* `String.t`, *default:* `nil`) - Optional. The selected Profile. If this is not set, then the default value is to allow the broadest set of clients and servers ("PROFILE_COMPATIBLE"). Setting this to more restrictive values may improve security, but may also prevent the TLS inspection proxy from connecting to some clients or servers. Note that Secure Web Proxy does not yet honor this field.
  *   `trustConfig` (*type:* `String.t`, *default:* `nil`) - Optional. A TrustConfig resource used when making a connection to the TLS server. This is a relative resource path following the form "projects/{project}/locations/{location}/trustConfigs/{trust_config}". This is necessary to intercept TLS connections to servers with certificates signed by a private CA or self-signed certificates. Note that Secure Web Proxy does not yet honor this field.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the resource was updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :caPool => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :customTlsFeatures => list(String.t()) | nil,
          :description => String.t() | nil,
          :excludePublicCaSet => boolean() | nil,
          :minTlsVersion => String.t() | nil,
          :name => String.t() | nil,
          :tlsFeatureProfile => String.t() | nil,
          :trustConfig => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:caPool)
  field(:createTime, as: DateTime)
  field(:customTlsFeatures, type: :list)
  field(:description)
  field(:excludePublicCaSet)
  field(:minTlsVersion)
  field(:name)
  field(:tlsFeatureProfile)
  field(:trustConfig)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.NetworkSecurity.V1.Model.TlsInspectionPolicy do
  def decode(value, options) do
    GoogleApi.NetworkSecurity.V1.Model.TlsInspectionPolicy.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.NetworkSecurity.V1.Model.TlsInspectionPolicy do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
