# 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.CommentAnalyzer.V1alpha1.Model.SuggestCommentScoreRequest do
  @moduledoc """
  The comment score suggestion request message.

  ## Attributes

  *   `attributeScores` (*type:* `%{optional(String.t) => GoogleApi.CommentAnalyzer.V1alpha1.Model.AttributeScores.t}`, *default:* `nil`) - Attribute scores for the comment. The map keys are attribute names, same as the requested_attribute field in AnalyzeCommentRequest (for example "ATTACK_ON_AUTHOR", "INFLAMMATORY", etc.). This field has the same type as the `attribute_scores` field in AnalyzeCommentResponse. To specify an overall attribute score for the entire comment as a whole, use the `summary_score` field of the mapped AttributeScores object. To specify scores on specific subparts of the comment, use the `span_scores` field. All SpanScore objects must have begin and end fields set. All Score objects must be explicitly set (for binary classification, use the score values 0 and 1). If Score objects don't include a ScoreType, `PROBABILITY` is assumed. `attribute_scores` must not be empty. The mapped AttributeScores objects also must not be empty. An `INVALID_ARGUMENT` error is returned for all malformed requests.
  *   `clientToken` (*type:* `String.t`, *default:* `nil`) - Opaque token that is echoed from the request to the response.
  *   `comment` (*type:* `GoogleApi.CommentAnalyzer.V1alpha1.Model.TextEntry.t`, *default:* `nil`) - The comment being scored.
  *   `communityId` (*type:* `String.t`, *default:* `nil`) - Optional identifier associating this comment score suggestion with a particular sub-community. Different communities may have different norms and rules. Specifying this value enables training community-specific models.
  *   `context` (*type:* `GoogleApi.CommentAnalyzer.V1alpha1.Model.Context.t`, *default:* `nil`) - The context of the comment.
  *   `languages` (*type:* `list(String.t)`, *default:* `nil`) - The language(s) of the comment and context. If none are specified, we attempt to automatically detect the language. Both ISO and BCP-47 language codes are accepted.
  *   `sessionId` (*type:* `String.t`, *default:* `nil`) - Session ID. Used to join related RPCs into a single session. For example, an interactive tool that calls both the AnalyzeComment and SuggestCommentScore RPCs should set all invocations of both RPCs to the same Session ID, typically a random 64-bit integer.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attributeScores => %{
            optional(String.t()) => GoogleApi.CommentAnalyzer.V1alpha1.Model.AttributeScores.t()
          },
          :clientToken => String.t(),
          :comment => GoogleApi.CommentAnalyzer.V1alpha1.Model.TextEntry.t(),
          :communityId => String.t(),
          :context => GoogleApi.CommentAnalyzer.V1alpha1.Model.Context.t(),
          :languages => list(String.t()),
          :sessionId => String.t()
        }

  field(:attributeScores, as: GoogleApi.CommentAnalyzer.V1alpha1.Model.AttributeScores, type: :map)

  field(:clientToken)
  field(:comment, as: GoogleApi.CommentAnalyzer.V1alpha1.Model.TextEntry)
  field(:communityId)
  field(:context, as: GoogleApi.CommentAnalyzer.V1alpha1.Model.Context)
  field(:languages, type: :list)
  field(:sessionId)
end

defimpl Poison.Decoder, for: GoogleApi.CommentAnalyzer.V1alpha1.Model.SuggestCommentScoreRequest do
  def decode(value, options) do
    GoogleApi.CommentAnalyzer.V1alpha1.Model.SuggestCommentScoreRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CommentAnalyzer.V1alpha1.Model.SuggestCommentScoreRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
