safetykit 0.29.0 → 0.30.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.
@@ -0,0 +1,87 @@
1
+ # typed: strong
2
+
3
+ module SafetyKit
4
+ module Models
5
+ module Beta
6
+ class EventCreateAsyncResponse < SafetyKit::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ SafetyKit::Models::Beta::EventCreateAsyncResponse,
11
+ SafetyKit::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Number of events queued from the request.
16
+ sig { returns(Integer) }
17
+ attr_accessor :queued_events
18
+
19
+ # Events were queued for asynchronous ingestion.
20
+ sig do
21
+ returns(
22
+ SafetyKit::Models::Beta::EventCreateAsyncResponse::Status::TaggedSymbol
23
+ )
24
+ end
25
+ attr_accessor :status
26
+
27
+ # Response returned after SafetyKit queues one event or an ordered event batch.
28
+ sig do
29
+ params(
30
+ queued_events: Integer,
31
+ status:
32
+ SafetyKit::Models::Beta::EventCreateAsyncResponse::Status::OrSymbol
33
+ ).returns(T.attached_class)
34
+ end
35
+ def self.new(
36
+ # Number of events queued from the request.
37
+ queued_events:,
38
+ # Events were queued for asynchronous ingestion.
39
+ status:
40
+ )
41
+ end
42
+
43
+ sig do
44
+ override.returns(
45
+ {
46
+ queued_events: Integer,
47
+ status:
48
+ SafetyKit::Models::Beta::EventCreateAsyncResponse::Status::TaggedSymbol
49
+ }
50
+ )
51
+ end
52
+ def to_hash
53
+ end
54
+
55
+ # Events were queued for asynchronous ingestion.
56
+ module Status
57
+ extend SafetyKit::Internal::Type::Enum
58
+
59
+ TaggedSymbol =
60
+ T.type_alias do
61
+ T.all(
62
+ Symbol,
63
+ SafetyKit::Models::Beta::EventCreateAsyncResponse::Status
64
+ )
65
+ end
66
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
67
+
68
+ QUEUED =
69
+ T.let(
70
+ :queued,
71
+ SafetyKit::Models::Beta::EventCreateAsyncResponse::Status::TaggedSymbol
72
+ )
73
+
74
+ sig do
75
+ override.returns(
76
+ T::Array[
77
+ SafetyKit::Models::Beta::EventCreateAsyncResponse::Status::TaggedSymbol
78
+ ]
79
+ )
80
+ end
81
+ def self.values
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
@@ -46,6 +46,45 @@ module SafetyKit
46
46
  )
47
47
  end
48
48
 
49
+ # Beta. Queue backend events for asynchronous ingestion. This endpoint accepts the
50
+ # same request body as POST /v1/events, writes one SQS message per event, and
51
+ # returns after the events are queued. SafetyKit later processes the queued events
52
+ # through the standard event ingestion path.
53
+ sig do
54
+ params(
55
+ body:
56
+ T.any(
57
+ SafetyKit::Beta::EventCreateAsyncParams::Body::UserContactEventRequest::OrHash,
58
+ SafetyKit::Beta::EventCreateAsyncParams::Body::ContentUploadedEventRequest::OrHash,
59
+ SafetyKit::Beta::EventCreateAsyncParams::Body::ProductChangedEventRequest::OrHash,
60
+ SafetyKit::Beta::EventCreateAsyncParams::Body::CreateAccountEventRequest::OrHash,
61
+ SafetyKit::Beta::EventCreateAsyncParams::Body::UpdateAccountEventRequest::OrHash,
62
+ SafetyKit::Beta::EventCreateAsyncParams::Body::UserReportEventRequest::OrHash,
63
+ SafetyKit::Beta::EventCreateAsyncParams::Body::ModerationDecisionEventRequest::OrHash,
64
+ T::Array[
65
+ T.any(
66
+ SafetyKit::Beta::EventCreateAsyncParams::Body::UnionMember7::UserContact::OrHash,
67
+ SafetyKit::Beta::EventCreateAsyncParams::Body::UnionMember7::ContentUploaded::OrHash,
68
+ SafetyKit::Beta::EventCreateAsyncParams::Body::UnionMember7::ProductChanged::OrHash,
69
+ SafetyKit::Beta::EventCreateAsyncParams::Body::UnionMember7::CreateAccount::OrHash,
70
+ SafetyKit::Beta::EventCreateAsyncParams::Body::UnionMember7::UpdateAccount::OrHash,
71
+ SafetyKit::Beta::EventCreateAsyncParams::Body::UnionMember7::UserReport::OrHash,
72
+ SafetyKit::Beta::EventCreateAsyncParams::Body::UnionMember7::ModerationDecision::OrHash
73
+ )
74
+ ]
75
+ ),
76
+ request_options: SafetyKit::RequestOptions::OrHash
77
+ ).returns(SafetyKit::Models::Beta::EventCreateAsyncResponse)
78
+ end
79
+ def create_async(
80
+ # Backend event or ordered batch of events to send to SafetyKit. Send events from
81
+ # your server after an action has happened in your product. Do not send these
82
+ # events directly from a browser or mobile client.
83
+ body:,
84
+ request_options: {}
85
+ )
86
+ end
87
+
49
88
  # @api private
50
89
  sig { params(client: SafetyKit::Client).returns(T.attached_class) }
51
90
  def self.new(client:)