# 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.Composer.V1.Model.EnvironmentConfig do
  @moduledoc """
  Configuration information for an environment.

  ## Attributes

  *   `airflowByoidUri` (*type:* `String.t`, *default:* `nil`) - Output only. The 'bring your own identity' variant of the URI of the Apache Airflow Web UI hosted within this environment, to be accessed with external identities using workforce identity federation (see [Access environments with workforce identity federation](/composer/docs/composer-2/access-environments-with-workforce-identity-federation)).
  *   `airflowUri` (*type:* `String.t`, *default:* `nil`) - Output only. The URI of the Apache Airflow Web UI hosted within this environment (see [Airflow web interface](/composer/docs/how-to/accessing/airflow-web-interface)).
  *   `dagGcsPrefix` (*type:* `String.t`, *default:* `nil`) - Output only. The Cloud Storage prefix of the DAGs for this environment. Although Cloud Storage objects reside in a flat namespace, a hierarchical file tree can be simulated using "/"-delimited object name prefixes. DAG objects for this environment reside in a simulated directory with the given prefix.
  *   `dataRetentionConfig` (*type:* `GoogleApi.Composer.V1.Model.DataRetentionConfig.t`, *default:* `nil`) - Optional. The configuration setting for Airflow database data retention mechanism.
  *   `databaseConfig` (*type:* `GoogleApi.Composer.V1.Model.DatabaseConfig.t`, *default:* `nil`) - Optional. The configuration settings for Cloud SQL instance used internally by Apache Airflow software.
  *   `encryptionConfig` (*type:* `GoogleApi.Composer.V1.Model.EncryptionConfig.t`, *default:* `nil`) - Optional. The encryption options for the Cloud Composer environment and its dependencies. Cannot be updated.
  *   `environmentSize` (*type:* `String.t`, *default:* `nil`) - Optional. The size of the Cloud Composer environment. This field is supported for Cloud Composer environments in versions composer-2.*.*-airflow-*.*.* and newer.
  *   `gkeCluster` (*type:* `String.t`, *default:* `nil`) - Output only. The Kubernetes Engine cluster used to run this environment.
  *   `maintenanceWindow` (*type:* `GoogleApi.Composer.V1.Model.MaintenanceWindow.t`, *default:* `nil`) - Optional. The maintenance window is the period when Cloud Composer components may undergo maintenance. It is defined so that maintenance is not executed during peak hours or critical time periods. The system will not be under maintenance for every occurrence of this window, but when maintenance is planned, it will be scheduled during the window. The maintenance window period must encompass at least 12 hours per week. This may be split into multiple chunks, each with a size of at least 4 hours. If this value is omitted, the default value for maintenance window is applied. By default, maintenance windows are from 00:00:00 to 04:00:00 (GMT) on Friday, Saturday, and Sunday every week.
  *   `masterAuthorizedNetworksConfig` (*type:* `GoogleApi.Composer.V1.Model.MasterAuthorizedNetworksConfig.t`, *default:* `nil`) - Optional. The configuration options for GKE cluster master authorized networks. By default master authorized networks feature is: - in case of private environment: enabled with no external networks allowlisted. - in case of public environment: disabled.
  *   `nodeConfig` (*type:* `GoogleApi.Composer.V1.Model.NodeConfig.t`, *default:* `nil`) - Optional. The configuration used for the Kubernetes Engine cluster.
  *   `nodeCount` (*type:* `integer()`, *default:* `nil`) - The number of nodes in the Kubernetes Engine cluster that will be used to run this environment. This field is supported for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*.
  *   `privateEnvironmentConfig` (*type:* `GoogleApi.Composer.V1.Model.PrivateEnvironmentConfig.t`, *default:* `nil`) - Optional. The configuration used for the Private IP Cloud Composer environment.
  *   `recoveryConfig` (*type:* `GoogleApi.Composer.V1.Model.RecoveryConfig.t`, *default:* `nil`) - Optional. The Recovery settings configuration of an environment. This field is supported for Cloud Composer environments in versions composer-2.*.*-airflow-*.*.* and newer.
  *   `resilienceMode` (*type:* `String.t`, *default:* `nil`) - Optional. Resilience mode of the Cloud Composer Environment. This field is supported for Cloud Composer environments in versions composer-2.2.0-airflow-*.*.* and newer.
  *   `softwareConfig` (*type:* `GoogleApi.Composer.V1.Model.SoftwareConfig.t`, *default:* `nil`) - Optional. The configuration settings for software inside the environment.
  *   `webServerConfig` (*type:* `GoogleApi.Composer.V1.Model.WebServerConfig.t`, *default:* `nil`) - Optional. The configuration settings for the Airflow web server App Engine instance.
  *   `webServerNetworkAccessControl` (*type:* `GoogleApi.Composer.V1.Model.WebServerNetworkAccessControl.t`, *default:* `nil`) - Optional. The network-level access control policy for the Airflow web server. If unspecified, no network-level access restrictions will be applied.
  *   `workloadsConfig` (*type:* `GoogleApi.Composer.V1.Model.WorkloadsConfig.t`, *default:* `nil`) - Optional. The workloads configuration settings for the GKE cluster associated with the Cloud Composer environment. The GKE cluster runs Airflow scheduler, web server and workers workloads. This field is supported for Cloud Composer environments in versions composer-2.*.*-airflow-*.*.* and newer.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :airflowByoidUri => String.t() | nil,
          :airflowUri => String.t() | nil,
          :dagGcsPrefix => String.t() | nil,
          :dataRetentionConfig => GoogleApi.Composer.V1.Model.DataRetentionConfig.t() | nil,
          :databaseConfig => GoogleApi.Composer.V1.Model.DatabaseConfig.t() | nil,
          :encryptionConfig => GoogleApi.Composer.V1.Model.EncryptionConfig.t() | nil,
          :environmentSize => String.t() | nil,
          :gkeCluster => String.t() | nil,
          :maintenanceWindow => GoogleApi.Composer.V1.Model.MaintenanceWindow.t() | nil,
          :masterAuthorizedNetworksConfig =>
            GoogleApi.Composer.V1.Model.MasterAuthorizedNetworksConfig.t() | nil,
          :nodeConfig => GoogleApi.Composer.V1.Model.NodeConfig.t() | nil,
          :nodeCount => integer() | nil,
          :privateEnvironmentConfig =>
            GoogleApi.Composer.V1.Model.PrivateEnvironmentConfig.t() | nil,
          :recoveryConfig => GoogleApi.Composer.V1.Model.RecoveryConfig.t() | nil,
          :resilienceMode => String.t() | nil,
          :softwareConfig => GoogleApi.Composer.V1.Model.SoftwareConfig.t() | nil,
          :webServerConfig => GoogleApi.Composer.V1.Model.WebServerConfig.t() | nil,
          :webServerNetworkAccessControl =>
            GoogleApi.Composer.V1.Model.WebServerNetworkAccessControl.t() | nil,
          :workloadsConfig => GoogleApi.Composer.V1.Model.WorkloadsConfig.t() | nil
        }

  field(:airflowByoidUri)
  field(:airflowUri)
  field(:dagGcsPrefix)
  field(:dataRetentionConfig, as: GoogleApi.Composer.V1.Model.DataRetentionConfig)
  field(:databaseConfig, as: GoogleApi.Composer.V1.Model.DatabaseConfig)
  field(:encryptionConfig, as: GoogleApi.Composer.V1.Model.EncryptionConfig)
  field(:environmentSize)
  field(:gkeCluster)
  field(:maintenanceWindow, as: GoogleApi.Composer.V1.Model.MaintenanceWindow)

  field(:masterAuthorizedNetworksConfig,
    as: GoogleApi.Composer.V1.Model.MasterAuthorizedNetworksConfig
  )

  field(:nodeConfig, as: GoogleApi.Composer.V1.Model.NodeConfig)
  field(:nodeCount)
  field(:privateEnvironmentConfig, as: GoogleApi.Composer.V1.Model.PrivateEnvironmentConfig)
  field(:recoveryConfig, as: GoogleApi.Composer.V1.Model.RecoveryConfig)
  field(:resilienceMode)
  field(:softwareConfig, as: GoogleApi.Composer.V1.Model.SoftwareConfig)
  field(:webServerConfig, as: GoogleApi.Composer.V1.Model.WebServerConfig)

  field(:webServerNetworkAccessControl,
    as: GoogleApi.Composer.V1.Model.WebServerNetworkAccessControl
  )

  field(:workloadsConfig, as: GoogleApi.Composer.V1.Model.WorkloadsConfig)
end

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

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