# 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.GoogleCloudContactcenterinsightsV1PhraseMatcher do
  @moduledoc """
  The phrase matcher resource.

  ## Attributes

  *   `activationUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The most recent time at which the activation status was updated.
  *   `active` (*type:* `boolean()`, *default:* `nil`) - Applies the phrase matcher only when it is active.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The human-readable name of the phrase matcher.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The resource name of the phrase matcher. Format: projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher}
  *   `phraseMatchRuleGroups` (*type:* `list(GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1PhraseMatchRuleGroup.t)`, *default:* `nil`) - A list of phase match rule groups that are included in this matcher.
  *   `revisionCreateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp of when the revision was created. It is also the create time when a new matcher is added.
  *   `revisionId` (*type:* `String.t`, *default:* `nil`) - Output only. Immutable. The revision ID of the phrase matcher. A new revision is committed whenever the matcher is changed, except when it is activated or deactivated. A server generated random ID will be used. Example: locations/global/phraseMatchers/my-first-matcher@1234567
  *   `roleMatch` (*type:* `String.t`, *default:* `nil`) - The role whose utterances the phrase matcher should be matched against. If the role is ROLE_UNSPECIFIED it will be matched against any utterances in the transcript.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Required. The type of this phrase matcher.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The most recent time at which the phrase matcher was updated.
  *   `versionTag` (*type:* `String.t`, *default:* `nil`) - The customized version tag to use for the phrase matcher. If not specified, it will default to `revision_id`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :activationUpdateTime => DateTime.t() | nil,
          :active => boolean() | nil,
          :displayName => String.t() | nil,
          :name => String.t() | nil,
          :phraseMatchRuleGroups =>
            list(
              GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1PhraseMatchRuleGroup.t()
            )
            | nil,
          :revisionCreateTime => DateTime.t() | nil,
          :revisionId => String.t() | nil,
          :roleMatch => String.t() | nil,
          :type => String.t() | nil,
          :updateTime => DateTime.t() | nil,
          :versionTag => String.t() | nil
        }

  field(:activationUpdateTime, as: DateTime)
  field(:active)
  field(:displayName)
  field(:name)

  field(:phraseMatchRuleGroups,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1PhraseMatchRuleGroup,
    type: :list
  )

  field(:revisionCreateTime, as: DateTime)
  field(:revisionId)
  field(:roleMatch)
  field(:type)
  field(:updateTime, as: DateTime)
  field(:versionTag)
end

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

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