# 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.Dataplex.V1.Model.GoogleCloudDataplexV1Action do
  @moduledoc """
  Action represents an issue requiring administrator action for resolution.

  ## Attributes

  *   `asset` (*type:* `String.t`, *default:* `nil`) - Output only. The relative resource name of the asset, of the form: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}.
  *   `category` (*type:* `String.t`, *default:* `nil`) - The category of issue associated with the action.
  *   `dataLocations` (*type:* `list(String.t)`, *default:* `nil`) - The list of data locations associated with this action. Cloud Storage locations are represented as URI paths(E.g. gs://bucket/table1/year=2020/month=Jan/). BigQuery locations refer to resource names(E.g. bigquery.googleapis.com/projects/project-id/datasets/dataset-id).
  *   `detectTime` (*type:* `DateTime.t`, *default:* `nil`) - The time that the issue was detected.
  *   `failedSecurityPolicyApply` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionFailedSecurityPolicyApply.t`, *default:* `nil`) - Details for issues related to applying security policy.
  *   `incompatibleDataSchema` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionIncompatibleDataSchema.t`, *default:* `nil`) - Details for issues related to incompatible schemas detected within data.
  *   `invalidDataFormat` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionInvalidDataFormat.t`, *default:* `nil`) - Details for issues related to invalid or unsupported data formats.
  *   `invalidDataOrganization` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionInvalidDataOrganization.t`, *default:* `nil`) - Details for issues related to invalid data arrangement.
  *   `invalidDataPartition` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionInvalidDataPartition.t`, *default:* `nil`) - Details for issues related to invalid or unsupported data partition structure.
  *   `issue` (*type:* `String.t`, *default:* `nil`) - Detailed description of the issue requiring action.
  *   `lake` (*type:* `String.t`, *default:* `nil`) - Output only. The relative resource name of the lake, of the form: projects/{project_number}/locations/{location_id}/lakes/{lake_id}.
  *   `missingData` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionMissingData.t`, *default:* `nil`) - Details for issues related to absence of data within managed resources.
  *   `missingResource` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionMissingResource.t`, *default:* `nil`) - Details for issues related to absence of a managed resource.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The relative resource name of the action, of the form: projects/{project}/locations/{location}/lakes/{lake}/actions/{action} projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/actions/{action} projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}/actions/{action}.
  *   `unauthorizedResource` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionUnauthorizedResource.t`, *default:* `nil`) - Details for issues related to lack of permissions to access data resources.
  *   `zone` (*type:* `String.t`, *default:* `nil`) - Output only. The relative resource name of the zone, of the form: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :asset => String.t() | nil,
          :category => String.t() | nil,
          :dataLocations => list(String.t()) | nil,
          :detectTime => DateTime.t() | nil,
          :failedSecurityPolicyApply =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionFailedSecurityPolicyApply.t()
            | nil,
          :incompatibleDataSchema =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionIncompatibleDataSchema.t()
            | nil,
          :invalidDataFormat =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionInvalidDataFormat.t() | nil,
          :invalidDataOrganization =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionInvalidDataOrganization.t()
            | nil,
          :invalidDataPartition =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionInvalidDataPartition.t() | nil,
          :issue => String.t() | nil,
          :lake => String.t() | nil,
          :missingData =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionMissingData.t() | nil,
          :missingResource =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionMissingResource.t() | nil,
          :name => String.t() | nil,
          :unauthorizedResource =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionUnauthorizedResource.t() | nil,
          :zone => String.t() | nil
        }

  field(:asset)
  field(:category)
  field(:dataLocations, type: :list)
  field(:detectTime, as: DateTime)

  field(:failedSecurityPolicyApply,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionFailedSecurityPolicyApply
  )

  field(:incompatibleDataSchema,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionIncompatibleDataSchema
  )

  field(:invalidDataFormat,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionInvalidDataFormat
  )

  field(:invalidDataOrganization,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionInvalidDataOrganization
  )

  field(:invalidDataPartition,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionInvalidDataPartition
  )

  field(:issue)
  field(:lake)
  field(:missingData, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionMissingData)

  field(:missingResource,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionMissingResource
  )

  field(:name)

  field(:unauthorizedResource,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ActionUnauthorizedResource
  )

  field(:zone)
end

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

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