openai 0.90.0 → 0.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/README.md +1 -1
- data/examples/realtime/README.md +8 -0
- data/examples/realtime/browser/README.md +167 -0
- data/examples/realtime/browser/index.html +19 -0
- data/examples/realtime/browser/page.js +21 -0
- data/examples/realtime/browser/peer.js +180 -0
- data/examples/realtime/browser/server.rb +281 -0
- data/examples/responses/websocket_workflows.rb +66 -6
- data/lib/openai/auth/workload_identity.rb +5 -1
- data/lib/openai/auth/workload_identity_auth.rb +2 -2
- data/lib/openai/auth/x509_token_exchange.rb +1 -1
- data/lib/openai/helpers/local_audio/process.rb +1 -1
- data/lib/openai/helpers/responses_websocket/connection.rb +2 -1
- data/lib/openai/helpers/responses_websocket/session.rb +551 -0
- data/lib/openai/helpers/responses_websocket.rb +1 -0
- data/lib/openai/helpers/sorbet.rb +1 -1
- data/lib/openai/helpers/websocket/async_websocket_transport.rb +6 -1
- data/lib/openai/internal/poller.rb +2 -2
- data/lib/openai/internal/transport/base_client.rb +1 -1
- data/lib/openai/internal/util.rb +1 -1
- data/lib/openai/models/beta/agents/session_update_params.rb +108 -1
- data/lib/openai/models/beta/beta_response.rb +9 -3
- data/lib/openai/models/beta/beta_response_compaction_compacting_event.rb +75 -0
- data/lib/openai/models/beta/beta_response_stream_event.rb +4 -1
- data/lib/openai/models/beta/beta_responses_client_event.rb +25 -4
- data/lib/openai/models/beta/beta_responses_server_event.rb +39 -1
- data/lib/openai/models/beta/beta_tool.rb +16 -0
- data/lib/openai/models/beta/response_compact_params.rb +9 -3
- data/lib/openai/models/beta/response_create_params.rb +21 -4
- data/lib/openai/models/beta/session_turn_error.rb +3 -0
- data/lib/openai/models/chat_model.rb +3 -1
- data/lib/openai/models/realtime/realtime_response_create_mcp_tool.rb +16 -0
- data/lib/openai/models/realtime/realtime_session_create_response.rb +16 -0
- data/lib/openai/models/realtime/realtime_tools_config_union.rb +16 -0
- data/lib/openai/models/responses/response_compact_params.rb +9 -3
- data/lib/openai/models/responses/response_compaction_compacting_event.rb +49 -0
- data/lib/openai/models/responses/response_create_params.rb +12 -1
- data/lib/openai/models/responses/response_stream_event.rb +4 -1
- data/lib/openai/models/responses/responses_client_event.rb +12 -1
- data/lib/openai/models/responses/responses_server_event.rb +36 -1
- data/lib/openai/models/responses/tool.rb +16 -0
- data/lib/openai/models/webhooks/deleted_webhook_endpoint.rb +38 -0
- data/lib/openai/models/webhooks/event_type_list_params.rb +16 -0
- data/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb +6 -8
- data/lib/openai/models/webhooks/webhook_create_params.rb +73 -0
- data/lib/openai/models/webhooks/webhook_delete_params.rb +22 -0
- data/lib/openai/models/webhooks/webhook_endpoint.rb +85 -0
- data/lib/openai/models/webhooks/webhook_endpoint_list.rb +55 -0
- data/lib/openai/models/webhooks/webhook_endpoint_test_result.rb +58 -0
- data/lib/openai/models/webhooks/webhook_endpoint_with_secret.rb +105 -0
- data/lib/openai/models/webhooks/webhook_event_type_list.rb +28 -0
- data/lib/openai/models/webhooks/webhook_list_params.rb +34 -0
- data/lib/openai/models/webhooks/webhook_retrieve_params.rb +22 -0
- data/lib/openai/models/webhooks/webhook_rotate_secret_params.rb +34 -0
- data/lib/openai/models/webhooks/webhook_test_params.rb +59 -0
- data/lib/openai/models/webhooks/webhook_update_params.rb +80 -0
- data/lib/openai/resources/beta/agents/sessions.rb +6 -2
- data/lib/openai/resources/beta/responses.rb +2 -2
- data/lib/openai/resources/responses.rb +2 -2
- data/lib/openai/resources/webhooks/event_types.rb +35 -0
- data/lib/openai/resources/webhooks.rb +195 -0
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +17 -0
- data/rbi/openai/helpers/responses_websocket/connection.rbi +5 -0
- data/rbi/openai/helpers/responses_websocket/session.rbi +206 -0
- data/rbi/openai/models/beta/agents/session_update_params.rbi +178 -0
- data/rbi/openai/models/beta/beta_response.rbi +6 -1
- data/rbi/openai/models/beta/beta_response_compaction_compacting_event.rbi +136 -0
- data/rbi/openai/models/beta/beta_response_stream_event.rbi +1 -0
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +27 -4
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +77 -0
- data/rbi/openai/models/beta/beta_tool.rbi +12 -0
- data/rbi/openai/models/beta/response_compact_params.rbi +6 -1
- data/rbi/openai/models/beta/response_create_params.rbi +21 -1
- data/rbi/openai/models/beta/session_turn_error.rbi +6 -0
- data/rbi/openai/models/chat_model.rbi +3 -1
- data/rbi/openai/models/realtime/realtime_response_create_mcp_tool.rbi +12 -0
- data/rbi/openai/models/realtime/realtime_session_create_response.rbi +12 -0
- data/rbi/openai/models/realtime/realtime_tools_config_union.rbi +12 -0
- data/rbi/openai/models/responses/response_compact_params.rbi +6 -1
- data/rbi/openai/models/responses/response_compaction_compacting_event.rbi +78 -0
- data/rbi/openai/models/responses/response_create_params.rbi +15 -0
- data/rbi/openai/models/responses/response_stream_event.rbi +1 -0
- data/rbi/openai/models/responses/responses_client_event.rbi +15 -0
- data/rbi/openai/models/responses/responses_server_event.rbi +71 -0
- data/rbi/openai/models/responses/tool.rbi +12 -0
- data/rbi/openai/models/webhooks/deleted_webhook_endpoint.rbi +67 -0
- data/rbi/openai/models/webhooks/event_type_list_params.rbi +37 -0
- data/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi +6 -8
- data/rbi/openai/models/webhooks/webhook_create_params.rbi +139 -0
- data/rbi/openai/models/webhooks/webhook_delete_params.rbi +53 -0
- data/rbi/openai/models/webhooks/webhook_endpoint.rbi +126 -0
- data/rbi/openai/models/webhooks/webhook_endpoint_list.rbi +91 -0
- data/rbi/openai/models/webhooks/webhook_endpoint_test_result.rbi +87 -0
- data/rbi/openai/models/webhooks/webhook_endpoint_with_secret.rbi +138 -0
- data/rbi/openai/models/webhooks/webhook_event_type_list.rbi +58 -0
- data/rbi/openai/models/webhooks/webhook_list_params.rbi +67 -0
- data/rbi/openai/models/webhooks/webhook_retrieve_params.rbi +53 -0
- data/rbi/openai/models/webhooks/webhook_rotate_secret_params.rbi +71 -0
- data/rbi/openai/models/webhooks/webhook_test_params.rbi +124 -0
- data/rbi/openai/models/webhooks/webhook_update_params.rbi +156 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +5 -1
- data/rbi/openai/resources/webhooks/event_types.rbi +24 -0
- data/rbi/openai/resources/webhooks.rbi +126 -0
- data/responses-websocket.md +117 -10
- data/sig/openai/helpers/responses_websocket/connection.rbs +5 -0
- data/sig/openai/helpers/responses_websocket/session.rbs +123 -0
- data/sig/openai/models/beta/agents/session_update_params.rbs +99 -0
- data/sig/openai/models/beta/beta_response.rbs +6 -2
- data/sig/openai/models/beta/beta_response_compaction_compacting_event.rbs +58 -0
- data/sig/openai/models/beta/beta_response_stream_event.rbs +1 -0
- data/sig/openai/models/beta/beta_responses_client_event.rbs +13 -2
- data/sig/openai/models/beta/beta_responses_server_event.rbs +35 -0
- data/sig/openai/models/beta/response_compact_params.rbs +6 -2
- data/sig/openai/models/beta/response_create_params.rbs +13 -2
- data/sig/openai/models/beta/session_turn_error.rbs +4 -0
- data/sig/openai/models/chat_model.rbs +6 -2
- data/sig/openai/models/responses/response_compact_params.rbs +6 -2
- data/sig/openai/models/responses/response_compaction_compacting_event.rbs +37 -0
- data/sig/openai/models/responses/response_create_params.rbs +7 -0
- data/sig/openai/models/responses/response_stream_event.rbs +1 -0
- data/sig/openai/models/responses/responses_client_event.rbs +7 -0
- data/sig/openai/models/responses/responses_server_event.rbs +32 -0
- data/sig/openai/models/webhooks/deleted_webhook_endpoint.rbs +28 -0
- data/sig/openai/models/webhooks/event_type_list_params.rbs +16 -0
- data/sig/openai/models/webhooks/webhook_create_params.rbs +83 -0
- data/sig/openai/models/webhooks/webhook_delete_params.rbs +25 -0
- data/sig/openai/models/webhooks/webhook_endpoint.rbs +59 -0
- data/sig/openai/models/webhooks/webhook_endpoint_list.rbs +42 -0
- data/sig/openai/models/webhooks/webhook_endpoint_test_result.rbs +42 -0
- data/sig/openai/models/webhooks/webhook_endpoint_with_secret.rbs +64 -0
- data/sig/openai/models/webhooks/webhook_event_type_list.rbs +17 -0
- data/sig/openai/models/webhooks/webhook_list_params.rbs +35 -0
- data/sig/openai/models/webhooks/webhook_retrieve_params.rbs +25 -0
- data/sig/openai/models/webhooks/webhook_rotate_secret_params.rbs +35 -0
- data/sig/openai/models/webhooks/webhook_test_params.rbs +78 -0
- data/sig/openai/models/webhooks/webhook_update_params.rbs +96 -0
- data/sig/openai/resources/beta/agents/sessions.rbs +1 -0
- data/sig/openai/resources/webhooks/event_types.rbs +13 -0
- data/sig/openai/resources/webhooks.rbs +45 -0
- metadata +61 -2
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class WebhookCreateParams < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
11
|
+
include OpenAI::Internal::Type::RequestParameters
|
|
12
|
+
|
|
13
|
+
OrHash = T.type_alias do
|
|
14
|
+
T.any(
|
|
15
|
+
OpenAI::Webhooks::WebhookCreateParams,
|
|
16
|
+
OpenAI::Internal::AnyHash
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# The event types that trigger deliveries to this endpoint.
|
|
21
|
+
sig { returns(T::Array[OpenAI::Webhooks::WebhookCreateParams::EventType::OrSymbol]) }
|
|
22
|
+
attr_accessor :event_types
|
|
23
|
+
|
|
24
|
+
# A human-readable name for the webhook endpoint.
|
|
25
|
+
sig { returns(String) }
|
|
26
|
+
attr_accessor :name
|
|
27
|
+
|
|
28
|
+
# The HTTPS URL that receives webhook deliveries.
|
|
29
|
+
sig { returns(String) }
|
|
30
|
+
attr_accessor :url
|
|
31
|
+
|
|
32
|
+
sig do
|
|
33
|
+
params(
|
|
34
|
+
|
|
35
|
+
event_types: T::Array[OpenAI::Webhooks::WebhookCreateParams::EventType::OrSymbol],
|
|
36
|
+
|
|
37
|
+
name: String,
|
|
38
|
+
|
|
39
|
+
url: String,
|
|
40
|
+
|
|
41
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
42
|
+
)
|
|
43
|
+
.returns(T.attached_class)
|
|
44
|
+
end
|
|
45
|
+
def self.new(
|
|
46
|
+
|
|
47
|
+
# The event types that trigger deliveries to this endpoint.
|
|
48
|
+
event_types:,
|
|
49
|
+
|
|
50
|
+
# A human-readable name for the webhook endpoint.
|
|
51
|
+
name:,
|
|
52
|
+
|
|
53
|
+
# The HTTPS URL that receives webhook deliveries.
|
|
54
|
+
url:,
|
|
55
|
+
|
|
56
|
+
request_options: {}
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
sig do
|
|
61
|
+
override.returns(
|
|
62
|
+
{
|
|
63
|
+
event_types: T::Array[OpenAI::Webhooks::WebhookCreateParams::EventType::OrSymbol],
|
|
64
|
+
name: String,
|
|
65
|
+
url: String,
|
|
66
|
+
request_options: OpenAI::RequestOptions
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
def to_hash
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# The event type to send as a sample delivery.
|
|
74
|
+
module EventType
|
|
75
|
+
extend OpenAI::Internal::Type::Enum
|
|
76
|
+
|
|
77
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Webhooks::WebhookCreateParams::EventType) }
|
|
78
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
79
|
+
|
|
80
|
+
BATCH_COMPLETED = T.let(:"batch.completed", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
|
|
81
|
+
BATCH_FAILED = T.let(:"batch.failed", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
|
|
82
|
+
BATCH_EXPIRED = T.let(:"batch.expired", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
|
|
83
|
+
BATCH_CANCELLED = T.let(:"batch.cancelled", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
|
|
84
|
+
RESPONSE_COMPLETED = T.let(
|
|
85
|
+
:"response.completed",
|
|
86
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
87
|
+
)
|
|
88
|
+
RESPONSE_FAILED = T.let(:"response.failed", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
|
|
89
|
+
RESPONSE_CANCELLED = T.let(
|
|
90
|
+
:"response.cancelled",
|
|
91
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
92
|
+
)
|
|
93
|
+
RESPONSE_INCOMPLETE = T.let(
|
|
94
|
+
:"response.incomplete",
|
|
95
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
96
|
+
)
|
|
97
|
+
EVAL_RUN_SUCCEEDED = T.let(
|
|
98
|
+
:"eval.run.succeeded",
|
|
99
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
100
|
+
)
|
|
101
|
+
EVAL_RUN_FAILED = T.let(:"eval.run.failed", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
|
|
102
|
+
EVAL_RUN_CANCELED = T.let(
|
|
103
|
+
:"eval.run.canceled",
|
|
104
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
105
|
+
)
|
|
106
|
+
FINE_TUNING_JOB_SUCCEEDED = T.let(
|
|
107
|
+
:"fine_tuning.job.succeeded",
|
|
108
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
109
|
+
)
|
|
110
|
+
FINE_TUNING_JOB_FAILED = T.let(
|
|
111
|
+
:"fine_tuning.job.failed",
|
|
112
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
113
|
+
)
|
|
114
|
+
FINE_TUNING_JOB_CANCELLED = T.let(
|
|
115
|
+
:"fine_tuning.job.cancelled",
|
|
116
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
117
|
+
)
|
|
118
|
+
REALTIME_CALL_INCOMING = T.let(
|
|
119
|
+
:"realtime.call.incoming",
|
|
120
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
121
|
+
)
|
|
122
|
+
VIDEO_COMPLETED = T.let(:"video.completed", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
|
|
123
|
+
VIDEO_FAILED = T.let(:"video.failed", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
|
|
124
|
+
SAFETY_ALERT_CREATED = T.let(
|
|
125
|
+
:"safety.alert.created",
|
|
126
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
sig { override.returns(T::Array[OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol]) }
|
|
130
|
+
def self.values
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
end
|
|
139
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class WebhookDeleteParams < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
11
|
+
include OpenAI::Internal::Type::RequestParameters
|
|
12
|
+
|
|
13
|
+
OrHash = T.type_alias do
|
|
14
|
+
T.any(
|
|
15
|
+
OpenAI::Webhooks::WebhookDeleteParams,
|
|
16
|
+
OpenAI::Internal::AnyHash
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :webhook_endpoint_id
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
|
|
26
|
+
webhook_endpoint_id: String,
|
|
27
|
+
|
|
28
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
29
|
+
)
|
|
30
|
+
.returns(T.attached_class)
|
|
31
|
+
end
|
|
32
|
+
def self.new(
|
|
33
|
+
|
|
34
|
+
webhook_endpoint_id:,
|
|
35
|
+
|
|
36
|
+
request_options: {}
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
sig do
|
|
41
|
+
override.returns(
|
|
42
|
+
{webhook_endpoint_id: String, request_options: OpenAI::RequestOptions}
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
def to_hash
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class WebhookEndpoint < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::WebhookEndpoint,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The unique ID of the webhook endpoint.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# The Unix timestamp when the endpoint was created.
|
|
22
|
+
sig { returns(Integer) }
|
|
23
|
+
attr_accessor :created_at
|
|
24
|
+
|
|
25
|
+
# The event types that trigger deliveries to this endpoint.
|
|
26
|
+
sig { returns(T::Array[String]) }
|
|
27
|
+
attr_accessor :event_types
|
|
28
|
+
|
|
29
|
+
# The human-readable name of the endpoint.
|
|
30
|
+
sig { returns(String) }
|
|
31
|
+
attr_accessor :name
|
|
32
|
+
|
|
33
|
+
# The object type, which is always webhook_endpoint.
|
|
34
|
+
sig { returns(Symbol) }
|
|
35
|
+
attr_accessor :object
|
|
36
|
+
|
|
37
|
+
# A masked hint for the endpoint's signing secret.
|
|
38
|
+
sig { returns(T.nilable(String)) }
|
|
39
|
+
attr_accessor :signing_secret_hint
|
|
40
|
+
|
|
41
|
+
# The HTTPS URL that receives webhook deliveries.
|
|
42
|
+
sig { returns(String) }
|
|
43
|
+
attr_accessor :url
|
|
44
|
+
|
|
45
|
+
# The Unix timestamp of the last endpoint configuration or signing-secret change.
|
|
46
|
+
# Initialized at creation; tests and unchanged updates do not advance it.
|
|
47
|
+
sig { returns(T.nilable(Integer)) }
|
|
48
|
+
attr_reader :updated_at
|
|
49
|
+
|
|
50
|
+
sig { params(updated_at: Integer).void }
|
|
51
|
+
attr_writer :updated_at
|
|
52
|
+
|
|
53
|
+
sig do
|
|
54
|
+
params(
|
|
55
|
+
|
|
56
|
+
id: String,
|
|
57
|
+
|
|
58
|
+
created_at: Integer,
|
|
59
|
+
|
|
60
|
+
event_types: T::Array[String],
|
|
61
|
+
|
|
62
|
+
name: String,
|
|
63
|
+
|
|
64
|
+
signing_secret_hint: T.nilable(String),
|
|
65
|
+
|
|
66
|
+
url: String,
|
|
67
|
+
|
|
68
|
+
updated_at: Integer,
|
|
69
|
+
|
|
70
|
+
object: Symbol
|
|
71
|
+
)
|
|
72
|
+
.returns(T.attached_class)
|
|
73
|
+
end
|
|
74
|
+
def self.new(
|
|
75
|
+
|
|
76
|
+
# The unique ID of the webhook endpoint.
|
|
77
|
+
id:,
|
|
78
|
+
|
|
79
|
+
# The Unix timestamp when the endpoint was created.
|
|
80
|
+
created_at:,
|
|
81
|
+
|
|
82
|
+
# The event types that trigger deliveries to this endpoint.
|
|
83
|
+
event_types:,
|
|
84
|
+
|
|
85
|
+
# The human-readable name of the endpoint.
|
|
86
|
+
name:,
|
|
87
|
+
|
|
88
|
+
# A masked hint for the endpoint's signing secret.
|
|
89
|
+
signing_secret_hint:,
|
|
90
|
+
|
|
91
|
+
# The HTTPS URL that receives webhook deliveries.
|
|
92
|
+
url:,
|
|
93
|
+
|
|
94
|
+
# The Unix timestamp of the last endpoint configuration or signing-secret change.
|
|
95
|
+
# Initialized at creation; tests and unchanged updates do not advance it.
|
|
96
|
+
updated_at: nil,
|
|
97
|
+
|
|
98
|
+
# The object type, which is always webhook_endpoint.
|
|
99
|
+
|
|
100
|
+
object: :webhook_endpoint
|
|
101
|
+
)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
sig do
|
|
105
|
+
override.returns(
|
|
106
|
+
{
|
|
107
|
+
id: String,
|
|
108
|
+
created_at: Integer,
|
|
109
|
+
event_types: T::Array[String],
|
|
110
|
+
name: String,
|
|
111
|
+
object: Symbol,
|
|
112
|
+
signing_secret_hint: T.nilable(String),
|
|
113
|
+
url: String,
|
|
114
|
+
updated_at: Integer
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
def to_hash
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
end
|
|
126
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class WebhookEndpointList < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::WebhookEndpointList,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The webhook endpoints in this page.
|
|
18
|
+
sig { returns(T::Array[OpenAI::Webhooks::WebhookEndpoint]) }
|
|
19
|
+
attr_accessor :data
|
|
20
|
+
|
|
21
|
+
# The ID of the first endpoint in this page.
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_accessor :first_id
|
|
24
|
+
|
|
25
|
+
# Whether more webhook endpoints are available.
|
|
26
|
+
sig { returns(T::Boolean) }
|
|
27
|
+
attr_accessor :has_more
|
|
28
|
+
|
|
29
|
+
# The ID of the last endpoint in this page.
|
|
30
|
+
sig { returns(T.nilable(String)) }
|
|
31
|
+
attr_accessor :last_id
|
|
32
|
+
|
|
33
|
+
# The object type, which is always list.
|
|
34
|
+
sig { returns(Symbol) }
|
|
35
|
+
attr_accessor :object
|
|
36
|
+
|
|
37
|
+
sig do
|
|
38
|
+
params(
|
|
39
|
+
|
|
40
|
+
data: T::Array[OpenAI::Webhooks::WebhookEndpoint::OrHash],
|
|
41
|
+
|
|
42
|
+
first_id: T.nilable(String),
|
|
43
|
+
|
|
44
|
+
has_more: T::Boolean,
|
|
45
|
+
|
|
46
|
+
last_id: T.nilable(String),
|
|
47
|
+
|
|
48
|
+
object: Symbol
|
|
49
|
+
)
|
|
50
|
+
.returns(T.attached_class)
|
|
51
|
+
end
|
|
52
|
+
def self.new(
|
|
53
|
+
|
|
54
|
+
# The webhook endpoints in this page.
|
|
55
|
+
data:,
|
|
56
|
+
|
|
57
|
+
# The ID of the first endpoint in this page.
|
|
58
|
+
first_id:,
|
|
59
|
+
|
|
60
|
+
# Whether more webhook endpoints are available.
|
|
61
|
+
has_more:,
|
|
62
|
+
|
|
63
|
+
# The ID of the last endpoint in this page.
|
|
64
|
+
last_id:,
|
|
65
|
+
|
|
66
|
+
# The object type, which is always list.
|
|
67
|
+
|
|
68
|
+
object: :list
|
|
69
|
+
)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
sig do
|
|
73
|
+
override.returns(
|
|
74
|
+
{
|
|
75
|
+
data: T::Array[OpenAI::Webhooks::WebhookEndpoint],
|
|
76
|
+
first_id: T.nilable(String),
|
|
77
|
+
has_more: T::Boolean,
|
|
78
|
+
last_id: T.nilable(String),
|
|
79
|
+
object: Symbol
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
def to_hash
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class WebhookEndpointTestResult < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::WebhookEndpointTestResult,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The event type sent in the test.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :event_type
|
|
20
|
+
|
|
21
|
+
# The object type, which is always webhook_endpoint.test.
|
|
22
|
+
sig { returns(Symbol) }
|
|
23
|
+
attr_accessor :object
|
|
24
|
+
|
|
25
|
+
# The HTTP status code returned by the endpoint.
|
|
26
|
+
sig { returns(Integer) }
|
|
27
|
+
attr_accessor :status_code
|
|
28
|
+
|
|
29
|
+
# Whether the test request completed. Always true for returned results; use
|
|
30
|
+
# status_code to determine the endpoint response.
|
|
31
|
+
sig { returns(T::Boolean) }
|
|
32
|
+
attr_accessor :success
|
|
33
|
+
|
|
34
|
+
# The ID of the webhook endpoint that received the test.
|
|
35
|
+
sig { returns(String) }
|
|
36
|
+
attr_accessor :webhook_endpoint_id
|
|
37
|
+
|
|
38
|
+
sig do
|
|
39
|
+
params(
|
|
40
|
+
|
|
41
|
+
event_type: String,
|
|
42
|
+
|
|
43
|
+
status_code: Integer,
|
|
44
|
+
|
|
45
|
+
success: T::Boolean,
|
|
46
|
+
|
|
47
|
+
webhook_endpoint_id: String,
|
|
48
|
+
|
|
49
|
+
object: Symbol
|
|
50
|
+
)
|
|
51
|
+
.returns(T.attached_class)
|
|
52
|
+
end
|
|
53
|
+
def self.new(
|
|
54
|
+
|
|
55
|
+
# The event type sent in the test.
|
|
56
|
+
event_type:,
|
|
57
|
+
|
|
58
|
+
# The HTTP status code returned by the endpoint.
|
|
59
|
+
status_code:,
|
|
60
|
+
|
|
61
|
+
# Whether the test request completed. Always true for returned results; use
|
|
62
|
+
# status_code to determine the endpoint response.
|
|
63
|
+
success:,
|
|
64
|
+
|
|
65
|
+
# The ID of the webhook endpoint that received the test.
|
|
66
|
+
webhook_endpoint_id:,
|
|
67
|
+
|
|
68
|
+
# The object type, which is always webhook_endpoint.test.
|
|
69
|
+
|
|
70
|
+
object: :"webhook_endpoint.test"
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
sig do
|
|
75
|
+
override.returns(
|
|
76
|
+
{event_type: String, object: Symbol, status_code: Integer, success: T::Boolean, webhook_endpoint_id: String}
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
def to_hash
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
end
|
|
87
|
+
end
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class WebhookEndpointWithSecret < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::WebhookEndpointWithSecret,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The unique ID of the webhook endpoint.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# The Unix timestamp when the endpoint was created.
|
|
22
|
+
sig { returns(Integer) }
|
|
23
|
+
attr_accessor :created_at
|
|
24
|
+
|
|
25
|
+
# The event types that trigger deliveries to this endpoint.
|
|
26
|
+
sig { returns(T::Array[String]) }
|
|
27
|
+
attr_accessor :event_types
|
|
28
|
+
|
|
29
|
+
# The human-readable name of the endpoint.
|
|
30
|
+
sig { returns(String) }
|
|
31
|
+
attr_accessor :name
|
|
32
|
+
|
|
33
|
+
# The object type, which is always webhook_endpoint.
|
|
34
|
+
sig { returns(Symbol) }
|
|
35
|
+
attr_accessor :object
|
|
36
|
+
|
|
37
|
+
# The endpoint's signing secret. This is returned only when the endpoint is
|
|
38
|
+
# created or the secret is rotated.
|
|
39
|
+
sig { returns(String) }
|
|
40
|
+
attr_accessor :signing_secret
|
|
41
|
+
|
|
42
|
+
# A masked hint for the endpoint's signing secret.
|
|
43
|
+
sig { returns(T.nilable(String)) }
|
|
44
|
+
attr_accessor :signing_secret_hint
|
|
45
|
+
|
|
46
|
+
# The HTTPS URL that receives webhook deliveries.
|
|
47
|
+
sig { returns(String) }
|
|
48
|
+
attr_accessor :url
|
|
49
|
+
|
|
50
|
+
# The Unix timestamp of the last endpoint configuration or signing-secret change.
|
|
51
|
+
# Initialized at creation; tests and unchanged updates do not advance it.
|
|
52
|
+
sig { returns(T.nilable(Integer)) }
|
|
53
|
+
attr_reader :updated_at
|
|
54
|
+
|
|
55
|
+
sig { params(updated_at: Integer).void }
|
|
56
|
+
attr_writer :updated_at
|
|
57
|
+
|
|
58
|
+
sig do
|
|
59
|
+
params(
|
|
60
|
+
|
|
61
|
+
id: String,
|
|
62
|
+
|
|
63
|
+
created_at: Integer,
|
|
64
|
+
|
|
65
|
+
event_types: T::Array[String],
|
|
66
|
+
|
|
67
|
+
name: String,
|
|
68
|
+
|
|
69
|
+
signing_secret: String,
|
|
70
|
+
|
|
71
|
+
signing_secret_hint: T.nilable(String),
|
|
72
|
+
|
|
73
|
+
url: String,
|
|
74
|
+
|
|
75
|
+
updated_at: Integer,
|
|
76
|
+
|
|
77
|
+
object: Symbol
|
|
78
|
+
)
|
|
79
|
+
.returns(T.attached_class)
|
|
80
|
+
end
|
|
81
|
+
def self.new(
|
|
82
|
+
|
|
83
|
+
# The unique ID of the webhook endpoint.
|
|
84
|
+
id:,
|
|
85
|
+
|
|
86
|
+
# The Unix timestamp when the endpoint was created.
|
|
87
|
+
created_at:,
|
|
88
|
+
|
|
89
|
+
# The event types that trigger deliveries to this endpoint.
|
|
90
|
+
event_types:,
|
|
91
|
+
|
|
92
|
+
# The human-readable name of the endpoint.
|
|
93
|
+
name:,
|
|
94
|
+
|
|
95
|
+
# The endpoint's signing secret. This is returned only when the endpoint is
|
|
96
|
+
# created or the secret is rotated.
|
|
97
|
+
signing_secret:,
|
|
98
|
+
|
|
99
|
+
# A masked hint for the endpoint's signing secret.
|
|
100
|
+
signing_secret_hint:,
|
|
101
|
+
|
|
102
|
+
# The HTTPS URL that receives webhook deliveries.
|
|
103
|
+
url:,
|
|
104
|
+
|
|
105
|
+
# The Unix timestamp of the last endpoint configuration or signing-secret change.
|
|
106
|
+
# Initialized at creation; tests and unchanged updates do not advance it.
|
|
107
|
+
updated_at: nil,
|
|
108
|
+
|
|
109
|
+
# The object type, which is always webhook_endpoint.
|
|
110
|
+
|
|
111
|
+
object: :webhook_endpoint
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
sig do
|
|
116
|
+
override.returns(
|
|
117
|
+
{
|
|
118
|
+
id: String,
|
|
119
|
+
created_at: Integer,
|
|
120
|
+
event_types: T::Array[String],
|
|
121
|
+
name: String,
|
|
122
|
+
object: Symbol,
|
|
123
|
+
signing_secret: String,
|
|
124
|
+
signing_secret_hint: T.nilable(String),
|
|
125
|
+
url: String,
|
|
126
|
+
updated_at: Integer
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
end
|
|
130
|
+
def to_hash
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
end
|
|
138
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class WebhookEventTypeList < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::WebhookEventTypeList,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The webhook event types available to the authenticated project.
|
|
18
|
+
sig { returns(T::Array[String]) }
|
|
19
|
+
attr_accessor :data
|
|
20
|
+
|
|
21
|
+
# The object type, which is always list.
|
|
22
|
+
sig { returns(Symbol) }
|
|
23
|
+
attr_accessor :object
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
|
|
28
|
+
data: T::Array[String],
|
|
29
|
+
|
|
30
|
+
object: Symbol
|
|
31
|
+
)
|
|
32
|
+
.returns(T.attached_class)
|
|
33
|
+
end
|
|
34
|
+
def self.new(
|
|
35
|
+
|
|
36
|
+
# The webhook event types available to the authenticated project.
|
|
37
|
+
data:,
|
|
38
|
+
|
|
39
|
+
# The object type, which is always list.
|
|
40
|
+
|
|
41
|
+
object: :list
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
sig do
|
|
46
|
+
override.returns(
|
|
47
|
+
{data: T::Array[String], object: Symbol}
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
def to_hash
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
end
|
|
58
|
+
end
|