This assumes that you have setup the default client, or will inject your own client.
linked_file = Clubhouse::LinkedFile.new(
name: "LinkedFile One",
type: 'url',
url: 'https://dropbox.com/1/files/image.png'
)
linked_file.save
Once saved the linked file object will be reloaded with the response from clubhouse so now your new object will have the created_at and updated_at time that is returned from the API.
- name
- type (google, url, dropbox, box, onedrive)
- url
linked_file = Clubhouse::LinkedFile.find(23)
linked_file.thumbnail_url = 'https://dropbox.com/1/files/image.png?size=thumbnail'
linked_file.save # Save works for both creating and updating
=> <#Clubhouse::LinkedFile... >
linked_file = Clubhouse::LinkedFile.find(23)
=> #<Clubhouse::LinkedFile:0x007ffcd58002d0 @url='https://dropbox.com/1/file/image.png', @id=23 ... >
When an empty hash is returned this means it was successfull otherwise it will raise an exception
Clubhouse::LinkedFile.delete(23)
=> {}
Returns a list of all linked files uploaded by the API
Clubhouse::LinkedFile.all
=> [#<Clubhouse::LinkedFile:0x007fb142223508 @content_type="", @description="", @name="attachment0", @size=230, @story_id=nil, @thumbnail_u...>]