# 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.Batch.V1.Model.LogsPolicy do
  @moduledoc """
  LogsPolicy describes how outputs from a Job's Tasks (stdout/stderr) will be preserved.

  ## Attributes

  *   `cloudLoggingOption` (*type:* `GoogleApi.Batch.V1.Model.CloudLoggingOption.t`, *default:* `nil`) - Optional. Additional settings for Cloud Logging. It will only take effect when the destination of `LogsPolicy` is set to `CLOUD_LOGGING`.
  *   `destination` (*type:* `String.t`, *default:* `nil`) - Where logs should be saved.
  *   `logsPath` (*type:* `String.t`, *default:* `nil`) - The path to which logs are saved when the destination = PATH. This can be a local file path on the VM, or under the mount point of a Persistent Disk or Filestore, or a Cloud Storage path.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cloudLoggingOption => GoogleApi.Batch.V1.Model.CloudLoggingOption.t() | nil,
          :destination => String.t() | nil,
          :logsPath => String.t() | nil
        }

  field(:cloudLoggingOption, as: GoogleApi.Batch.V1.Model.CloudLoggingOption)
  field(:destination)
  field(:logsPath)
end

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

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