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.



777
778
779
780
781
782
783
784
# File 'lib/temporalio/client/schedule.rb', line 777

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.



756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
# File 'lib/temporalio/client/schedule.rb', line 756

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.



756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
# File 'lib/temporalio/client/schedule.rb', line 756

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.



756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
# File 'lib/temporalio/client/schedule.rb', line 756

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.



756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
# File 'lib/temporalio/client/schedule.rb', line 756

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