# 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.CloudTrace.V2.Model.StackFrame do
  @moduledoc """
  Represents a single stack frame in a stack trace.

  ## Attributes

  *   `columnNumber` (*type:* `String.t`, *default:* `nil`) - The column number where the function call appears, if available. This is important in JavaScript because of its anonymous functions.
  *   `fileName` (*type:* `GoogleApi.CloudTrace.V2.Model.TruncatableString.t`, *default:* `nil`) - The name of the source file where the function call appears (up to 256 bytes).
  *   `functionName` (*type:* `GoogleApi.CloudTrace.V2.Model.TruncatableString.t`, *default:* `nil`) - The fully-qualified name that uniquely identifies the function or method that is active in this frame (up to 1024 bytes).
  *   `lineNumber` (*type:* `String.t`, *default:* `nil`) - The line number in `file_name` where the function call appears.
  *   `loadModule` (*type:* `GoogleApi.CloudTrace.V2.Model.Module.t`, *default:* `nil`) - The binary module from where the code was loaded.
  *   `originalFunctionName` (*type:* `GoogleApi.CloudTrace.V2.Model.TruncatableString.t`, *default:* `nil`) - An un-mangled function name, if `function_name` is mangled. To get information about name mangling, run [this search](https://www.google.com/search?q=cxx+name+mangling). The name can be fully-qualified (up to 1024 bytes).
  *   `sourceVersion` (*type:* `GoogleApi.CloudTrace.V2.Model.TruncatableString.t`, *default:* `nil`) - The version of the deployed source code (up to 128 bytes).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :columnNumber => String.t() | nil,
          :fileName => GoogleApi.CloudTrace.V2.Model.TruncatableString.t() | nil,
          :functionName => GoogleApi.CloudTrace.V2.Model.TruncatableString.t() | nil,
          :lineNumber => String.t() | nil,
          :loadModule => GoogleApi.CloudTrace.V2.Model.Module.t() | nil,
          :originalFunctionName => GoogleApi.CloudTrace.V2.Model.TruncatableString.t() | nil,
          :sourceVersion => GoogleApi.CloudTrace.V2.Model.TruncatableString.t() | nil
        }

  field(:columnNumber)
  field(:fileName, as: GoogleApi.CloudTrace.V2.Model.TruncatableString)
  field(:functionName, as: GoogleApi.CloudTrace.V2.Model.TruncatableString)
  field(:lineNumber)
  field(:loadModule, as: GoogleApi.CloudTrace.V2.Model.Module)
  field(:originalFunctionName, as: GoogleApi.CloudTrace.V2.Model.TruncatableString)
  field(:sourceVersion, as: GoogleApi.CloudTrace.V2.Model.TruncatableString)
end

defimpl Poison.Decoder, for: GoogleApi.CloudTrace.V2.Model.StackFrame do
  def decode(value, options) do
    GoogleApi.CloudTrace.V2.Model.StackFrame.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudTrace.V2.Model.StackFrame do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
