# 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.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1alpha1IngestConversationsRequestGcsSource do
  @moduledoc """
  Configuration for Cloud Storage bucket sources.

  ## Attributes

  *   `bucketObjectType` (*type:* `String.t`, *default:* `nil`) - Optional. Specifies the type of the objects in `bucket_uri`.
  *   `bucketUri` (*type:* `String.t`, *default:* `nil`) - Required. The Cloud Storage bucket containing source objects.
  *   `customMetadataKeys` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Custom keys to extract as conversation labels from metadata files in `metadata_bucket_uri`. Keys not included in this field will be ignored. Note that there is a limit of 100 labels per conversation.
  *   `metadataBucketUri` (*type:* `String.t`, *default:* `nil`) - Optional. The Cloud Storage path to the conversation metadata. Note that: [1] Metadata files are expected to be in JSON format. [2] Metadata and source files (transcripts or audio) must be in separate buckets. [3] A source file and its corresponding metadata file must share the same name to be properly ingested, E.g. `gs://bucket/audio/conversation1.mp3` and `gs://bucket/metadata/conversation1.json`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bucketObjectType => String.t() | nil,
          :bucketUri => String.t() | nil,
          :customMetadataKeys => list(String.t()) | nil,
          :metadataBucketUri => String.t() | nil
        }

  field(:bucketObjectType)
  field(:bucketUri)
  field(:customMetadataKeys, type: :list)
  field(:metadataBucketUri)
end

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

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