Class: Temporalio::Client::Schedule::State

Inherits:
Object
  • Object
show all
Defined in:
lib/temporalio/client/schedule.rb

Overview

State of a schedule.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(note: nil, paused: false, limited_actions: false, remaining_actions: 0) ⇒ State

Create a schedule state.

Parameters:

  • note (String, nil) (defaults to: nil)

    Human readable message for the schedule. The system may overwrite this value on certain conditions like pause-on-failure.

  • paused (Boolean) (defaults to: false)

    Whether the schedule is paused.

  • limited_actions (Boolean) (defaults to: false)

    If true, remaining actions will be decremented for each action taken. On schedule create, this must be set to true if ‘remaining_actions` is non-zero and left false if `remaining_actions` is zero.

  • remaining_actions (Integer) (defaults to: 0)

    Actions remaining on this schedule. Once this number hits 0, no further actions are scheduled automatically.



801
802
803
804
805
806
807
808
# File 'lib/temporalio/client/schedule.rb', line 801

def initialize(
  note: nil,
  paused: false,
  limited_actions: false,
  remaining_actions: 0
)
  super
end

Instance Attribute Details

#limited_actionsBoolean

Returns If true, remaining actions will be decremented for each action taken. On schedule create, this must be set to true if ‘remaining_actions` is non-zero and left false if `remaining_actions` is zero.

Returns:

  • (Boolean)

    If true, remaining actions will be decremented for each action taken. On schedule create, this must be set to true if ‘remaining_actions` is non-zero and left false if `remaining_actions` is zero.



780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/temporalio/client/schedule.rb', line 780

class State
  # @!visibility private
  def self._from_proto(raw_state)
    Schedule::State.new(
      note: Internal::ProtoUtils.string_or(raw_state.notes),
      paused: raw_state.paused,
      limited_actions: raw_state.limited_actions,
      remaining_actions: raw_state.remaining_actions
    )
  end

  # Create a schedule state.
  #
  # @param note [String, nil] Human readable message for the schedule. The system may overwrite this value on
  #   certain conditions like pause-on-failure.
  # @param paused [Boolean] Whether the schedule is paused.
  # @param limited_actions [Boolean] If true, remaining actions will be decremented for each action taken. On
  #   schedule create, this must be set to true if `remaining_actions` is non-zero and left false if
  #   `remaining_actions` is zero.
  # @param remaining_actions [Integer] Actions remaining on this schedule. Once this number hits 0, no further
  #   actions are scheduled automatically.
  def initialize(
    note: nil,
    paused: false,
    limited_actions: false,
    remaining_actions: 0
  )
    super
  end

  # @!visibility private
  def _to_proto
    Api::Schedule::V1::ScheduleState.new(
      notes: note || '',
      paused:,
      limited_actions:,
      remaining_actions:
    )
  end
end

#noteString?

Returns Human readable message for the schedule. The system may overwrite this value on certain conditions like pause-on-failure.

Returns:

  • (String, nil)

    Human readable message for the schedule. The system may overwrite this value on certain conditions like pause-on-failure.



780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/temporalio/client/schedule.rb', line 780

class State
  # @!visibility private
  def self._from_proto(raw_state)
    Schedule::State.new(
      note: Internal::ProtoUtils.string_or(raw_state.notes),
      paused: raw_state.paused,
      limited_actions: raw_state.limited_actions,
      remaining_actions: raw_state.remaining_actions
    )
  end

  # Create a schedule state.
  #
  # @param note [String, nil] Human readable message for the schedule. The system may overwrite this value on
  #   certain conditions like pause-on-failure.
  # @param paused [Boolean] Whether the schedule is paused.
  # @param limited_actions [Boolean] If true, remaining actions will be decremented for each action taken. On
  #   schedule create, this must be set to true if `remaining_actions` is non-zero and left false if
  #   `remaining_actions` is zero.
  # @param remaining_actions [Integer] Actions remaining on this schedule. Once this number hits 0, no further
  #   actions are scheduled automatically.
  def initialize(
    note: nil,
    paused: false,
    limited_actions: false,
    remaining_actions: 0
  )
    super
  end

  # @!visibility private
  def _to_proto
    Api::Schedule::V1::ScheduleState.new(
      notes: note || '',
      paused:,
      limited_actions:,
      remaining_actions:
    )
  end
end

#pausedBoolean

Returns Whether the schedule is paused.

Returns:

  • (Boolean)

    Whether the schedule is paused.



780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/temporalio/client/schedule.rb', line 780

class State
  # @!visibility private
  def self._from_proto(raw_state)
    Schedule::State.new(
      note: Internal::ProtoUtils.string_or(raw_state.notes),
      paused: raw_state.paused,
      limited_actions: raw_state.limited_actions,
      remaining_actions: raw_state.remaining_actions
    )
  end

  # Create a schedule state.
  #
  # @param note [String, nil] Human readable message for the schedule. The system may overwrite this value on
  #   certain conditions like pause-on-failure.
  # @param paused [Boolean] Whether the schedule is paused.
  # @param limited_actions [Boolean] If true, remaining actions will be decremented for each action taken. On
  #   schedule create, this must be set to true if `remaining_actions` is non-zero and left false if
  #   `remaining_actions` is zero.
  # @param remaining_actions [Integer] Actions remaining on this schedule. Once this number hits 0, no further
  #   actions are scheduled automatically.
  def initialize(
    note: nil,
    paused: false,
    limited_actions: false,
    remaining_actions: 0
  )
    super
  end

  # @!visibility private
  def _to_proto
    Api::Schedule::V1::ScheduleState.new(
      notes: note || '',
      paused:,
      limited_actions:,
      remaining_actions:
    )
  end
end

#remaining_actionsInteger

Returns Actions remaining on this schedule. Once this number hits 0, no further actions are scheduled automatically.

Returns:

  • (Integer)

    Actions remaining on this schedule. Once this number hits 0, no further actions are scheduled automatically.



780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/temporalio/client/schedule.rb', line 780

class State
  # @!visibility private
  def self._from_proto(raw_state)
    Schedule::State.new(
      note: Internal::ProtoUtils.string_or(raw_state.notes),
      paused: raw_state.paused,
      limited_actions: raw_state.limited_actions,
      remaining_actions: raw_state.remaining_actions
    )
  end

  # Create a schedule state.
  #
  # @param note [String, nil] Human readable message for the schedule. The system may overwrite this value on
  #   certain conditions like pause-on-failure.
  # @param paused [Boolean] Whether the schedule is paused.
  # @param limited_actions [Boolean] If true, remaining actions will be decremented for each action taken. On
  #   schedule create, this must be set to true if `remaining_actions` is non-zero and left false if
  #   `remaining_actions` is zero.
  # @param remaining_actions [Integer] Actions remaining on this schedule. Once this number hits 0, no further
  #   actions are scheduled automatically.
  def initialize(
    note: nil,
    paused: false,
    limited_actions: false,
    remaining_actions: 0
  )
    super
  end

  # @!visibility private
  def _to_proto
    Api::Schedule::V1::ScheduleState.new(
      notes: note || '',
      paused:,
      limited_actions:,
      remaining_actions:
    )
  end
end