# 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.ServiceNetworking.V1.Model.LongRunning do
  @moduledoc """
  Describes settings to use when generating API methods that use the long-running operation pattern. All default values below are from those used in the client library generators (e.g. [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)).

  ## Attributes

  *   `initialPollDelay` (*type:* `String.t`, *default:* `nil`) - Initial delay after which the first poll request will be made. Default value: 5 seconds.
  *   `maxPollDelay` (*type:* `String.t`, *default:* `nil`) - Maximum time between two subsequent poll requests. Default value: 45 seconds.
  *   `pollDelayMultiplier` (*type:* `number()`, *default:* `nil`) - Multiplier to gradually increase delay between subsequent polls until it reaches max_poll_delay. Default value: 1.5.
  *   `totalPollTimeout` (*type:* `String.t`, *default:* `nil`) - Total polling timeout. Default value: 5 minutes.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :initialPollDelay => String.t() | nil,
          :maxPollDelay => String.t() | nil,
          :pollDelayMultiplier => number() | nil,
          :totalPollTimeout => String.t() | nil
        }

  field(:initialPollDelay)
  field(:maxPollDelay)
  field(:pollDelayMultiplier)
  field(:totalPollTimeout)
end

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

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