# 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.DoubleClickBidManager.V11.Model.Query do
  @moduledoc """
  Represents a query.

  ## Attributes

  *   `kind` (*type:* `String.t`, *default:* `nil`) - Identifies what kind of resource this is. Value: the fixed string "doubleclickbidmanager#query".
  *   `metadata` (*type:* `GoogleApi.DoubleClickBidManager.V11.Model.QueryMetadata.t`, *default:* `nil`) - Query metadata.
  *   `params` (*type:* `GoogleApi.DoubleClickBidManager.V11.Model.Parameters.t`, *default:* `nil`) - Query parameters.
  *   `queryId` (*type:* `String.t`, *default:* `nil`) - Query ID.
  *   `reportDataEndTimeMs` (*type:* `String.t`, *default:* `nil`) - The ending time for the data that is shown in the report. Note, reportDataEndTimeMs is required if metadata.dataRange is CUSTOM_DATES and ignored otherwise.
  *   `reportDataStartTimeMs` (*type:* `String.t`, *default:* `nil`) - The starting time for the data that is shown in the report. Note, reportDataStartTimeMs is required if metadata.dataRange is CUSTOM_DATES and ignored otherwise.
  *   `schedule` (*type:* `GoogleApi.DoubleClickBidManager.V11.Model.QuerySchedule.t`, *default:* `nil`) - Information on how often and when to run a query.
  *   `timezoneCode` (*type:* `String.t`, *default:* `nil`) - Canonical timezone code for report data time. Defaults to America/New_York.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :kind => String.t() | nil,
          :metadata => GoogleApi.DoubleClickBidManager.V11.Model.QueryMetadata.t() | nil,
          :params => GoogleApi.DoubleClickBidManager.V11.Model.Parameters.t() | nil,
          :queryId => String.t() | nil,
          :reportDataEndTimeMs => String.t() | nil,
          :reportDataStartTimeMs => String.t() | nil,
          :schedule => GoogleApi.DoubleClickBidManager.V11.Model.QuerySchedule.t() | nil,
          :timezoneCode => String.t() | nil
        }

  field(:kind)
  field(:metadata, as: GoogleApi.DoubleClickBidManager.V11.Model.QueryMetadata)
  field(:params, as: GoogleApi.DoubleClickBidManager.V11.Model.Parameters)
  field(:queryId)
  field(:reportDataEndTimeMs)
  field(:reportDataStartTimeMs)
  field(:schedule, as: GoogleApi.DoubleClickBidManager.V11.Model.QuerySchedule)
  field(:timezoneCode)
end

defimpl Poison.Decoder, for: GoogleApi.DoubleClickBidManager.V11.Model.Query do
  def decode(value, options) do
    GoogleApi.DoubleClickBidManager.V11.Model.Query.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DoubleClickBidManager.V11.Model.Query do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
