# 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.SafeBrowsing.V5.Model.GoogleSecuritySafebrowsingV5FullHashFullHashDetail do
  @moduledoc """
  Details about a matching full hash. An important note about forward compatibility: new threat types and threat attributes may be added by the server at any time; those additions are considered minor version changes. It is Google's policy not to expose minor version numbers in APIs (see https://cloud.google.com/apis/design/versioning for the versioning policy), so clients MUST be prepared to receive `FullHashDetail` messages containing `ThreatType` enum values or `ThreatAttribute` enum values that are considered invalid by the client. Therefore, it is the client's responsibility to check for the validity of all `ThreatType` and `ThreatAttribute` enum values; if any value is considered invalid, the client MUST disregard the entire `FullHashDetail` message.

  ## Attributes

  *   `attributes` (*type:* `list(String.t)`, *default:* `nil`) - Unordered list. Additional attributes about those full hashes. This may be empty.
  *   `threatType` (*type:* `String.t`, *default:* `nil`) - The type of threat. This field will never be empty.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attributes => list(String.t()) | nil,
          :threatType => String.t() | nil
        }

  field(:attributes, type: :list)
  field(:threatType)
end

defimpl Poison.Decoder,
  for: GoogleApi.SafeBrowsing.V5.Model.GoogleSecuritySafebrowsingV5FullHashFullHashDetail do
  def decode(value, options) do
    GoogleApi.SafeBrowsing.V5.Model.GoogleSecuritySafebrowsingV5FullHashFullHashDetail.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.SafeBrowsing.V5.Model.GoogleSecuritySafebrowsingV5FullHashFullHashDetail do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
