# 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.Sheets.V4.Model.RefreshDataSourceRequest do
  @moduledoc """
  Refreshes one or multiple data source objects in the spreadsheet by the specified references. The request requires an additional `bigquery.readonly` OAuth scope if you are refreshing a BigQuery data source. If there are multiple refresh requests referencing the same data source objects in one batch, only the last refresh request is processed, and all those requests will have the same response accordingly.

  ## Attributes

  *   `dataSourceId` (*type:* `String.t`, *default:* `nil`) - Reference to a DataSource. If specified, refreshes all associated data source objects for the data source.
  *   `force` (*type:* `boolean()`, *default:* `nil`) - Refreshes the data source objects regardless of the current state. If not set and a referenced data source object was in error state, the refresh will fail immediately.
  *   `isAll` (*type:* `boolean()`, *default:* `nil`) - Refreshes all existing data source objects in the spreadsheet.
  *   `references` (*type:* `GoogleApi.Sheets.V4.Model.DataSourceObjectReferences.t`, *default:* `nil`) - References to data source objects to refresh.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dataSourceId => String.t() | nil,
          :force => boolean() | nil,
          :isAll => boolean() | nil,
          :references => GoogleApi.Sheets.V4.Model.DataSourceObjectReferences.t() | nil
        }

  field(:dataSourceId)
  field(:force)
  field(:isAll)
  field(:references, as: GoogleApi.Sheets.V4.Model.DataSourceObjectReferences)
end

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

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