Class: Twitch::StreamMarkersResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/twitch/resources/stream_markers.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Twitch::Resource

Instance Method Details

#create(user_id:, **params) ⇒ Object

Required scope: channel:manage:broadcast



11
12
13
14
15
# File 'lib/twitch/resources/stream_markers.rb', line 11

def create(user_id:, **params)
  response = post_request("streams/markers", body: params.merge(user_id: user_id))

  StreamMarker.new(response.body.dig("data")[0]) if response.success?
end

#list(**params) ⇒ Object

Required scope: user:read:broadcast



4
5
6
7
8
# File 'lib/twitch/resources/stream_markers.rb', line 4

def list(**params)
  response = get_request("streams/markers", params: params)

  Collection.from_response(response, type: StreamMarker)
end