# 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.ReplaceAllShapesWithImageRequest do
  @moduledoc """
  Replaces all shapes that match the given criteria with the provided image. The images replacing the shapes are rectangular after being inserted into the presentation and do not take on the forms of the shapes.

  ## Attributes

  *   `containsText` (*type:* `GoogleApi.Slides.V1.Model.SubstringMatchCriteria.t`, *default:* `nil`) - If set, this request will replace all of the shapes that contain the given text.
  *   `imageReplaceMethod` (*type:* `String.t`, *default:* `nil`) - The image replace method. If you specify both a `replace_method` and an `image_replace_method`, the `image_replace_method` takes precedence. If you do not specify a value for `image_replace_method`, but specify a value for `replace_method`, then the specified `replace_method` value is used. If you do not specify either, then CENTER_INSIDE is used.
  *   `imageUrl` (*type:* `String.t`, *default:* `nil`) - The image URL. The image is fetched once at insertion time and a copy is stored for display inside the presentation. Images must be less than 50MB in size, cannot exceed 25 megapixels, and must be in one of PNG, JPEG, or GIF format. The provided URL can be at most 2 kB in length. The URL itself is saved with the image, and exposed via the Image.source_url field.
  *   `pageObjectIds` (*type:* `list(String.t)`, *default:* `nil`) - If non-empty, limits the matches to page elements only on the given pages. Returns a 400 bad request error if given the page object ID of a notes page or a notes master, or if a page with that object ID doesn't exist in the presentation.
  *   `replaceMethod` (*type:* `String.t`, *default:* `nil`) - The replace method. *Deprecated*: use `image_replace_method` instead. If you specify both a `replace_method` and an `image_replace_method`, the `image_replace_method` takes precedence.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :containsText => GoogleApi.Slides.V1.Model.SubstringMatchCriteria.t() | nil,
          :imageReplaceMethod => String.t() | nil,
          :imageUrl => String.t() | nil,
          :pageObjectIds => list(String.t()) | nil,
          :replaceMethod => String.t() | nil
        }

  field(:containsText, as: GoogleApi.Slides.V1.Model.SubstringMatchCriteria)
  field(:imageReplaceMethod)
  field(:imageUrl)
  field(:pageObjectIds, type: :list)
  field(:replaceMethod)
end

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

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