# 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.ChartHistogramRule do
  @moduledoc """
  Allows you to organize numeric values in a source data column into buckets of constant size.

  ## Attributes

  *   `intervalSize` (*type:* `float()`, *default:* `nil`) - The size of the buckets that are created. Must be positive.
  *   `maxValue` (*type:* `float()`, *default:* `nil`) - The maximum value at which items are placed into buckets. Values greater than the maximum are grouped into a single bucket. If omitted, it is determined by the maximum item value.
  *   `minValue` (*type:* `float()`, *default:* `nil`) - The minimum value at which items are placed into buckets. Values that are less than the minimum are grouped into a single bucket. If omitted, it is determined by the minimum item value.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :intervalSize => float() | nil,
          :maxValue => float() | nil,
          :minValue => float() | nil
        }

  field(:intervalSize)
  field(:maxValue)
  field(:minValue)
end

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

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