Class: Svix::StreamingEventType

Inherits:
Object
  • Object
show all
Defined in:
lib/svix/api/streaming_event_type.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ StreamingEventType

Returns a new instance of StreamingEventType.



8
9
10
# File 'lib/svix/api/streaming_event_type.rb', line 8

def initialize(client)
  @client = client
end

Instance Method Details

#create(stream_event_type_in, options = {}) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/svix/api/streaming_event_type.rb', line 27

def create(stream_event_type_in, options = {})
  options = options.transform_keys(&:to_s)
  res = @client.execute_request(
    "POST",
    "/api/v1/stream/event-type",
    headers: {
      "idempotency-key" => options["idempotency-key"]
    },
    body: stream_event_type_in
  )
  StreamEventTypeOut.deserialize(res)
end

#delete(name, options = {}) ⇒ Object



57
58
59
60
61
62
63
64
65
66
# File 'lib/svix/api/streaming_event_type.rb', line 57

def delete(name, options = {})
  options = options.transform_keys(&:to_s)
  @client.execute_request(
    "DELETE",
    "/api/v1/stream/event-type/#{name}",
    query_params: {
      "expunge" => options["expunge"]
    }
  )
end

#get(name) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/svix/api/streaming_event_type.rb', line 40

def get(name)
  res = @client.execute_request(
    "GET",
    "/api/v1/stream/event-type/#{name}"
  )
  StreamEventTypeOut.deserialize(res)
end

#list(options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/svix/api/streaming_event_type.rb', line 12

def list(options = {})
  options = options.transform_keys(&:to_s)
  res = @client.execute_request(
    "GET",
    "/api/v1/stream/event-type",
    query_params: {
      "limit" => options["limit"],
      "iterator" => options["iterator"],
      "order" => options["order"],
      "include_archived" => options["include_archived"]
    }
  )
  ListResponseStreamEventTypeOut.deserialize(res)
end

#patch(name, stream_event_type_patch) ⇒ Object



68
69
70
71
72
73
74
75
# File 'lib/svix/api/streaming_event_type.rb', line 68

def patch(name, stream_event_type_patch)
  res = @client.execute_request(
    "PATCH",
    "/api/v1/stream/event-type/#{name}",
    body: stream_event_type_patch
  )
  StreamEventTypeOut.deserialize(res)
end

#update(name, stream_event_type_in) ⇒ Object



48
49
50
51
52
53
54
55
# File 'lib/svix/api/streaming_event_type.rb', line 48

def update(name, stream_event_type_in)
  res = @client.execute_request(
    "PUT",
    "/api/v1/stream/event-type/#{name}",
    body: stream_event_type_in
  )
  StreamEventTypeOut.deserialize(res)
end