# 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.GKEBackup.V1.Model.TransformationRuleAction do
  @moduledoc """
  TransformationRuleAction defines a TransformationRule action based on the JSON Patch RFC (https://www.rfc-editor.org/rfc/rfc6902)

  ## Attributes

  *   `fromPath` (*type:* `String.t`, *default:* `nil`) - Optional. A string containing a JSON Pointer value that references the location in the target document to move the value from.
  *   `op` (*type:* `String.t`, *default:* `nil`) - Required. op specifies the operation to perform.
  *   `path` (*type:* `String.t`, *default:* `nil`) - Optional. A string containing a JSON-Pointer value that references a location within the target document where the operation is performed.
  *   `value` (*type:* `String.t`, *default:* `nil`) - Optional. A string that specifies the desired value in string format to use for transformation.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :fromPath => String.t() | nil,
          :op => String.t() | nil,
          :path => String.t() | nil,
          :value => String.t() | nil
        }

  field(:fromPath)
  field(:op)
  field(:path)
  field(:value)
end

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

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