# 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.V4.Model.GoogleSecuritySafebrowsingV4ThreatEntry do
  @moduledoc """
  An individual threat; for example, a malicious URL or its hash representation. Only one of these fields should be set.

  ## Attributes

  *   `digest` (*type:* `String.t`, *default:* `nil`) - The digest of an executable in SHA256 format. The API supports both binary and hex digests. For JSON requests, digests are base64-encoded.
  *   `hash` (*type:* `String.t`, *default:* `nil`) - A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. This field is in binary format. For JSON requests, hashes are base64-encoded.
  *   `url` (*type:* `String.t`, *default:* `nil`) - A URL.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :digest => String.t() | nil,
          :hash => String.t() | nil,
          :url => String.t() | nil
        }

  field(:digest)
  field(:hash)
  field(:url)
end

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

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