Class: Telnyx::Models::AI::ArithmeticExpression

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/ai/arithmetic_expression.rb

Defined Under Namespace

Modules: Op

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(left:, op:, right:, type: :arithmetic) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::AI::ArithmeticExpression for more details.

Numeric expression: applies an arithmetic operator to two sub-expressions.

Useful for derived numeric checks, e.g. ‘cart_total + shipping > 50`. Both operands should resolve to numbers at runtime.

Parameters:

  • left (Object)

    Operand sub-expression (Expression AST node). Typed as free-form JSON to support

  • op (Symbol, Telnyx::Models::AI::ArithmeticExpression::Op)

    Arithmetic operator applied to ‘left` and `right`.

  • right (Object)

    Operand sub-expression (Expression AST node). Typed as free-form JSON to support

  • type (Symbol, :arithmetic) (defaults to: :arithmetic)


# File 'lib/telnyx/models/ai/arithmetic_expression.rb', line 34

Instance Attribute Details

#leftObject

Operand sub-expression (Expression AST node). Typed as free-form JSON to support arbitrary recursion depth without an uncompilable by-value self-reference; see the Expression schema for the variant structure.

Returns:

  • (Object)


13
# File 'lib/telnyx/models/ai/arithmetic_expression.rb', line 13

required :left, Telnyx::Internal::Type::Unknown

#opSymbol, Telnyx::Models::AI::ArithmeticExpression::Op

Arithmetic operator applied to ‘left` and `right`.



19
# File 'lib/telnyx/models/ai/arithmetic_expression.rb', line 19

required :op, enum: -> { Telnyx::AI::ArithmeticExpression::Op }

#rightObject

Operand sub-expression (Expression AST node). Typed as free-form JSON to support arbitrary recursion depth without an uncompilable by-value self-reference; see the Expression schema for the variant structure.

Returns:

  • (Object)


27
# File 'lib/telnyx/models/ai/arithmetic_expression.rb', line 27

required :right, Telnyx::Internal::Type::Unknown

#typeSymbol, :arithmetic

Returns:

  • (Symbol, :arithmetic)


32
# File 'lib/telnyx/models/ai/arithmetic_expression.rb', line 32

required :type, const: :arithmetic