# 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.GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints do
  @moduledoc """
  The constraints for this update.

  ## Attributes

  *   `deviceLocation` (*type:* `String.t`, *default:* `nil`) - A client's physical location, expressed as a ISO 31166-1 alpha-2 region code.
  *   `language` (*type:* `String.t`, *default:* `nil`) - Requests the lists for a specific language. Expects ISO 639 alpha-2 format.
  *   `maxDatabaseEntries` (*type:* `integer()`, *default:* `nil`) - Sets the maximum number of entries that the client is willing to have in the local database for the specified list. This should be a power of 2 between 2**10 and 2**20. If zero, no database size limit is set.
  *   `maxUpdateEntries` (*type:* `integer()`, *default:* `nil`) - The maximum size in number of entries. The update will not contain more entries than this value. This should be a power of 2 between 2**10 and 2**20. If zero, no update size limit is set.
  *   `region` (*type:* `String.t`, *default:* `nil`) - Requests the list for a specific geographic location. If not set the server may pick that value based on the user's IP address. Expects ISO 3166-1 alpha-2 format.
  *   `supportedCompressions` (*type:* `list(String.t)`, *default:* `nil`) - The compression types supported by the client.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :deviceLocation => String.t() | nil,
          :language => String.t() | nil,
          :maxDatabaseEntries => integer() | nil,
          :maxUpdateEntries => integer() | nil,
          :region => String.t() | nil,
          :supportedCompressions => list(String.t()) | nil
        }

  field(:deviceLocation)
  field(:language)
  field(:maxDatabaseEntries)
  field(:maxUpdateEntries)
  field(:region)
  field(:supportedCompressions, type: :list)
end

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

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