# 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.Genomics.V1.Model.Pipeline do
  @moduledoc """
  Specifies a series of actions to execute, expressed as Docker containers.

  ## Attributes

  *   `actions` (*type:* `list(GoogleApi.Genomics.V1.Model.Action.t)`, *default:* `nil`) - The list of actions to execute, in the order they are specified.
  *   `encryptedEnvironment` (*type:* `GoogleApi.Genomics.V1.Model.Secret.t`, *default:* `nil`) - The encrypted environment to pass into every action. Each action can also specify its own encrypted environment. The secret must decrypt to a JSON-encoded dictionary where key-value pairs serve as environment variable names and their values. The decoded environment variables can overwrite the values specified by the `environment` field.
  *   `environment` (*type:* `map()`, *default:* `nil`) - The environment to pass into every action. Each action can also specify additional environment variables but cannot delete an entry from this map (though they can overwrite it with a different value).
  *   `resources` (*type:* `GoogleApi.Genomics.V1.Model.Resources.t`, *default:* `nil`) - The resources required for execution.
  *   `timeout` (*type:* `String.t`, *default:* `nil`) - The maximum amount of time to give the pipeline to complete. This includes the time spent waiting for a worker to be allocated. If the pipeline fails to complete before the timeout, it will be cancelled and the error code will be set to DEADLINE_EXCEEDED. If unspecified, it will default to 7 days.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :actions => list(GoogleApi.Genomics.V1.Model.Action.t()) | nil,
          :encryptedEnvironment => GoogleApi.Genomics.V1.Model.Secret.t() | nil,
          :environment => map() | nil,
          :resources => GoogleApi.Genomics.V1.Model.Resources.t() | nil,
          :timeout => String.t() | nil
        }

  field(:actions, as: GoogleApi.Genomics.V1.Model.Action, type: :list)
  field(:encryptedEnvironment, as: GoogleApi.Genomics.V1.Model.Secret)
  field(:environment, type: :map)
  field(:resources, as: GoogleApi.Genomics.V1.Model.Resources)
  field(:timeout)
end

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

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