# 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.Slides.V1.Model.AffineTransform do
  @moduledoc """
  AffineTransform uses a 3x3 matrix with an implied last row of [ 0 0 1 ] to transform source coordinates (x,y) into destination coordinates (x', y') according to: x' x = shear_y scale_y translate_y 1 [ 1 ] After transformation, x' = scale_x * x + shear_x * y + translate_x; y' = scale_y * y + shear_y * x + translate_y; This message is therefore composed of these six matrix elements.

  ## Attributes

  *   `scaleX` (*type:* `float()`, *default:* `nil`) - The X coordinate scaling element.
  *   `scaleY` (*type:* `float()`, *default:* `nil`) - The Y coordinate scaling element.
  *   `shearX` (*type:* `float()`, *default:* `nil`) - The X coordinate shearing element.
  *   `shearY` (*type:* `float()`, *default:* `nil`) - The Y coordinate shearing element.
  *   `translateX` (*type:* `float()`, *default:* `nil`) - The X coordinate translation element.
  *   `translateY` (*type:* `float()`, *default:* `nil`) - The Y coordinate translation element.
  *   `unit` (*type:* `String.t`, *default:* `nil`) - The units for translate elements.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :scaleX => float() | nil,
          :scaleY => float() | nil,
          :shearX => float() | nil,
          :shearY => float() | nil,
          :translateX => float() | nil,
          :translateY => float() | nil,
          :unit => String.t() | nil
        }

  field(:scaleX)
  field(:scaleY)
  field(:shearX)
  field(:shearY)
  field(:translateX)
  field(:translateY)
  field(:unit)
end

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

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