# 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.AdExchangeBuyer.V14.Model.MarketplaceNote do
  @moduledoc """
  A proposal is associated with a bunch of notes which may optionally be associated with a deal and/or revision number.

  ## Attributes

  *   `creatorRole` (*type:* `String.t`, *default:* `nil`) - The role of the person (buyer/seller) creating the note. (readonly)
  *   `dealId` (*type:* `String.t`, *default:* `nil`) - Notes can optionally be associated with a deal. (readonly, except on create)
  *   `kind` (*type:* `String.t`, *default:* `adexchangebuyer#marketplaceNote`) - Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#marketplaceNote".
  *   `note` (*type:* `String.t`, *default:* `nil`) - The actual note to attach. (readonly, except on create)
  *   `noteId` (*type:* `String.t`, *default:* `nil`) - The unique id for the note. (readonly)
  *   `proposalId` (*type:* `String.t`, *default:* `nil`) - The proposalId that a note is attached to. (readonly)
  *   `proposalRevisionNumber` (*type:* `String.t`, *default:* `nil`) - If the note is associated with a proposal revision number, then store that here. (readonly, except on create)
  *   `timestampMs` (*type:* `String.t`, *default:* `nil`) - The timestamp (ms since epoch) that this note was created. (readonly)
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :creatorRole => String.t() | nil,
          :dealId => String.t() | nil,
          :kind => String.t() | nil,
          :note => String.t() | nil,
          :noteId => String.t() | nil,
          :proposalId => String.t() | nil,
          :proposalRevisionNumber => String.t() | nil,
          :timestampMs => String.t() | nil
        }

  field(:creatorRole)
  field(:dealId)
  field(:kind)
  field(:note)
  field(:noteId)
  field(:proposalId)
  field(:proposalRevisionNumber)
  field(:timestampMs)
end

defimpl Poison.Decoder, for: GoogleApi.AdExchangeBuyer.V14.Model.MarketplaceNote do
  def decode(value, options) do
    GoogleApi.AdExchangeBuyer.V14.Model.MarketplaceNote.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AdExchangeBuyer.V14.Model.MarketplaceNote do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
