# 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.DLP.V2.Model.GooglePrivacyDlpV2DlpJob do
  @moduledoc """
  Combines all of the information about a DLP job.

  ## Attributes

  *   `actionDetails` (*type:* `list(GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2ActionDetails.t)`, *default:* `nil`) - Events that should occur after the job has completed.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the job was created.
  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the job finished.
  *   `errors` (*type:* `list(GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Error.t)`, *default:* `nil`) - A stream of errors encountered running the job.
  *   `inspectDetails` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InspectDataSourceDetails.t`, *default:* `nil`) - Results from inspecting a data source.
  *   `jobTriggerName` (*type:* `String.t`, *default:* `nil`) - If created by a job trigger, the resource name of the trigger that instantiated the job.
  *   `lastModified` (*type:* `DateTime.t`, *default:* `nil`) - Time when the job was last modified by the system.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The server-assigned name.
  *   `riskDetails` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails.t`, *default:* `nil`) - Results from analyzing risk of a data source.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the job started.
  *   `state` (*type:* `String.t`, *default:* `nil`) - State of a job.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of job.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :actionDetails =>
            list(GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2ActionDetails.t()) | nil,
          :createTime => DateTime.t() | nil,
          :endTime => DateTime.t() | nil,
          :errors => list(GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Error.t()) | nil,
          :inspectDetails =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InspectDataSourceDetails.t() | nil,
          :jobTriggerName => String.t() | nil,
          :lastModified => DateTime.t() | nil,
          :name => String.t() | nil,
          :riskDetails =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails.t() | nil,
          :startTime => DateTime.t() | nil,
          :state => String.t() | nil,
          :type => String.t() | nil
        }

  field(:actionDetails, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2ActionDetails, type: :list)
  field(:createTime, as: DateTime)
  field(:endTime, as: DateTime)
  field(:errors, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Error, type: :list)
  field(:inspectDetails, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InspectDataSourceDetails)
  field(:jobTriggerName)
  field(:lastModified, as: DateTime)
  field(:name)
  field(:riskDetails, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails)
  field(:startTime, as: DateTime)
  field(:state)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DlpJob do
  def decode(value, options) do
    GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DlpJob.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DlpJob do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
