Class: Wave::Clips

Inherits:
Object
  • Object
show all
Defined in:
lib/wave/clips.rb

Overview

Clips — AI-powered highlight detection and clip management

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Clips

Returns a new instance of Clips.



6
7
8
# File 'lib/wave/clips.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#create(body) ⇒ Object

Create a clip (operationId: createClip, POST /clips).



23
24
25
# File 'lib/wave/clips.rb', line 23

def create(body)
  @client.request("POST", "/clips", body: body)
end

#delete(clip_id) ⇒ Object

Delete a clip (operationId: deleteClip, DELETE /clips/clipId).



38
39
40
# File 'lib/wave/clips.rb', line 38

def delete(clip_id)
  @client.request("DELETE", "/clips/#{clip_id}")
end

#detect(body) ⇒ Object

Start AI clip detection (operationId: detectClips, POST /clips/detect).



43
44
45
# File 'lib/wave/clips.rb', line 43

def detect(body)
  @client.request("POST", "/clips/detect", body: body)
end

#get(clip_id) ⇒ Object

Get a clip (operationId: getClip, GET /clips/clipId).



28
29
30
# File 'lib/wave/clips.rb', line 28

def get(clip_id)
  @client.request("GET", "/clips/#{clip_id}")
end

#list(page: nil, per_page: nil, video_id: nil, status: nil, category: nil) ⇒ Object

List clips (operationId: listClips, GET /clips).



11
12
13
14
15
16
17
18
19
20
# File 'lib/wave/clips.rb', line 11

def list(page: nil, per_page: nil, video_id: nil, status: nil, category: nil)
  query = {
    "page" => page,
    "perPage" => per_page,
    "videoId" => video_id,
    "status" => status,
    "category" => category,
  }
  @client.request("GET", "/clips", query: query)
end

#update(clip_id, body) ⇒ Object

Update a clip (operationId: updateClip, PATCH /clips/clipId).



33
34
35
# File 'lib/wave/clips.rb', line 33

def update(clip_id, body)
  @client.request("PATCH", "/clips/#{clip_id}", body: body)
end