Class: OpenAI::Models::Beta::Agents::OneTimeAutomation

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/beta/agents/one_time_automation.rb,
sig/openai/models/beta/agents/one_time_automation.rbs

Defined Under Namespace

Modules: PauseReason, Status

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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(id:, created_at:, created_by:, metadata:, name:, run_at:, status:, target:, pause_reason: nil, object: :"agent.automation", type: :once) ⇒ OneTimeAutomation

Returns a new instance of OneTimeAutomation.

Parameters:

  • id —

    The automation ID.

  • created_at —

    The creation time as a Unix timestamp in seconds.

  • created_by —

    Service-recorded provenance; callers cannot supply this field.

  • metadata —

    Custom string key-value pairs attached to the automation.

  • name —

    The automation's display name.

  • run_at —

    The Unix timestamp, in seconds, of the scheduled occurrence.

  • status —

    Completion means the schedule has finished, not the agent's work.

  • target —

    The session configuration or existing session receiving invocations.

  • pause_reason (defaults to: nil) —

    Why the service paused this schedule, or null for other schedules.

  • object (defaults to: :"agent.automation") —

    Always agent.automation.

  • type (defaults to: :once) —

    The type of the object. Always once.

  • id: (String)
  • created_at: (Integer)
  • created_by: (OpenAI::Models::Beta::Agents::automation_created_by)
  • metadata: (::Hash[Symbol, String])
  • name: (String)
  • run_at: (Integer)
  • status: (OpenAI::Models::Beta::Agents::OneTimeAutomation::status)
  • target: (OpenAI::Models::Beta::Agents::automation_target)
  • pause_reason: (OpenAI::Models::Beta::Agents::OneTimeAutomation::pause_reason, nil) (defaults to: nil)
  • object: (:"agent.automation") (defaults to: :"agent.automation")
  • type: (:once) (defaults to: :once)


# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 80

Instance Attribute Details

#created_at ⇒ Integer

The creation time as a Unix timestamp in seconds.

Returns:

  • (Integer)


18
# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 18

required :created_at, Integer

#created_by ⇒ OpenAI::Models::Beta::Agents::automation_created_by

Service-recorded provenance; callers cannot supply this field.

Returns:

  • (OpenAI::Models::Beta::Agents::automation_created_by)


24
# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 24

required :created_by, union: -> { OpenAI::Beta::Agents::AutomationCreatedBy }

#id ⇒ String

The automation ID.

Returns:

  • (String)


12
# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 12

required :id, String

#metadata ⇒ ::Hash[Symbol, String]

Custom string key-value pairs attached to the automation.

Returns:

  • (::Hash[Symbol, String])


30
# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 30

required :metadata, OpenAI::Internal::Type::HashOf[String]

#name ⇒ String

The automation's display name.

Returns:

  • (String)


36
# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 36

required :name, String

#object ⇒ :"agent.automation"

Always agent.automation.

Returns:

  • (:"agent.automation")


42
# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 42

required :object, const: :"agent.automation"

#pause_reason ⇒ OpenAI::Models::Beta::Agents::OneTimeAutomation::pause_reason?

Why the service paused this schedule, or null for other schedules.

Returns:

  • (OpenAI::Models::Beta::Agents::OneTimeAutomation::pause_reason, nil)


72
73
74
75
76
77
78
# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 72

optional(
  :pause_reason,
  enum: -> {
    OpenAI::Beta::Agents::OneTimeAutomation::PauseReason
  },
  nil?: true
)

#run_at ⇒ Integer

The Unix timestamp, in seconds, of the scheduled occurrence.

Returns:

  • (Integer)


48
# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 48

required :run_at, Integer

#status ⇒ OpenAI::Models::Beta::Agents::OneTimeAutomation::status

Completion means the schedule has finished, not the agent's work.

Returns:

  • (OpenAI::Models::Beta::Agents::OneTimeAutomation::status)


54
# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 54

required :status, enum: -> { OpenAI::Beta::Agents::OneTimeAutomation::Status }

#target ⇒ OpenAI::Models::Beta::Agents::automation_target

The session configuration or existing session receiving invocations.

Returns:

  • (OpenAI::Models::Beta::Agents::automation_target)


60
# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 60

required :target, union: -> { OpenAI::Beta::Agents::AutomationTarget }

#type ⇒ :once

The type of the object. Always once.

Returns:

  • (:once)


66
# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 66

required :type, const: :once

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/beta/agents/one_time_automation.rb', line 126

Instance Method Details

#to_hash ⇒ { id: String, created_at: Integer, created_by: OpenAI::Models::Beta::Agents::automation_created_by, metadata: ::Hash[Symbol, String], name: String, ?object: :"agent.automation", run_at: Integer, status: OpenAI::Models::Beta::Agents::OneTimeAutomation::status, target: OpenAI::Models::Beta::Agents::automation_target, ?type: :once, ?pause_reason: OpenAI::Models::Beta::Agents::OneTimeAutomation::pause_reason? }

Returns:

  • ({ id: String, created_at: Integer, created_by: OpenAI::Models::Beta::Agents::automation_created_by, metadata: ::Hash[Symbol, String], name: String, ?object: :"agent.automation", run_at: Integer, status: OpenAI::Models::Beta::Agents::OneTimeAutomation::status, target: OpenAI::Models::Beta::Agents::automation_target, ?type: :once, ?pause_reason: OpenAI::Models::Beta::Agents::OneTimeAutomation::pause_reason? })


90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'sig/openai/models/beta/agents/one_time_automation.rbs', line 90

def to_hash: -> {
  id: String,
  created_at: Integer,
  created_by: OpenAI::Models::Beta::Agents::automation_created_by,
  metadata: ::Hash[Symbol, String],
  name: String,
  ?object: :"agent.automation",
  run_at: Integer,
  status: OpenAI::Models::Beta::Agents::OneTimeAutomation::status,
  target: OpenAI::Models::Beta::Agents::automation_target,
  ?type: :once,
  ?pause_reason: OpenAI::Models::Beta::Agents::OneTimeAutomation::pause_reason?
}