# 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.GooglePrivacyDlpV2Deidentify do
  @moduledoc """
  Create a de-identified copy of the requested table or files. A TransformationDetail will be created for each transformation. If any rows in BigQuery are skipped during de-identification (transformation errors or row size exceeds BigQuery insert API limits) they are placed in the failure output table. If the original row exceeds the BigQuery insert API limit it will be truncated when written to the failure output table. The failure output table can be set in the action.deidentify.output.big_query_output.deidentified_failure_output_table field, if no table is set, a table will be automatically created in the same project and dataset as the original table. Compatible with: Inspect

  ## Attributes

  *   `cloudStorageOutput` (*type:* `String.t`, *default:* `nil`) - Required. User settable Cloud Storage bucket and folders to store de-identified files. This field must be set for Cloud Storage deidentification. The output Cloud Storage bucket must be different from the input bucket. De-identified files will overwrite files in the output path. Form of: gs://bucket/folder/ or gs://bucket
  *   `fileTypesToTransform` (*type:* `list(String.t)`, *default:* `nil`) - List of user-specified file type groups to transform. If specified, only the files with these file types will be transformed. If empty, all supported files will be transformed. Supported types may be automatically added over time. If a file type is set in this field that isn't supported by the Deidentify action then the job will fail and will not be successfully created/started. Currently the only file types supported are: IMAGES, TEXT_FILES, CSV, TSV.
  *   `transformationConfig` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TransformationConfig.t`, *default:* `nil`) - User specified deidentify templates and configs for structured, unstructured, and image files.
  *   `transformationDetailsStorageConfig` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TransformationDetailsStorageConfig.t`, *default:* `nil`) - Config for storing transformation details. This is separate from the de-identified content, and contains metadata about the successful transformations and/or failures that occurred while de-identifying. This needs to be set in order for users to access information about the status of each transformation (see TransformationDetails message for more information about what is noted).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cloudStorageOutput => String.t() | nil,
          :fileTypesToTransform => list(String.t()) | nil,
          :transformationConfig =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TransformationConfig.t() | nil,
          :transformationDetailsStorageConfig =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TransformationDetailsStorageConfig.t() | nil
        }

  field(:cloudStorageOutput)
  field(:fileTypesToTransform, type: :list)
  field(:transformationConfig, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TransformationConfig)

  field(:transformationDetailsStorageConfig,
    as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TransformationDetailsStorageConfig
  )
end

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

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