The studio-client Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The studio-client Reference Manual

This is the studio-client Reference Manual, version 1.0.0, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Mon Apr 08 15:05:23 2019 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

About Studio-Client

This is a common lisp client library for the Studio image gallery hosting software.

How To

Note that this requires the r-oauth module to be present on the Radiance instance Studio is hosted on. You will also need to create an oAuth application on the Radiance instance to authenticate through. On the default TyNET instance, this can be done in the admin panel.

Create your application and load up Studio-Client, including the North backend of your choice.

(ql:quickload '(studio-client north-drakma))

Once armed with an application key and secret, you can create a client instance:

(defvar *client* (make-instance 'studio-client:client 
                   :api-base <API-URL>
                   :key <KEY>
                   :secret <SECRET>))

On the default TyNET instance the api-base would be "https://studio.tymoon.eu/api/". Once a client has been created, start the oAuth flow with north:initiate-authentication and visit the URL it returns.

(north:initiate-authentication *client*)
; => https://studio.tymoon.eu/api/oauth/authorize....

Once you have authorised the application on the page, copy the code it gives you and pass it to north:complete-authentication

(north:complete-authentication *client* "3D6E639C-A0A8-...")

If this succeeds you should be ready to query the Studio API without any problems.

(studio-client:galleries *client*)
; => (#<STUDIO-CLIENT:GALLERY shinmera #1> #<STUDIO-CLIENT:GALLERY anon #11> ...)
(studio-client:uploads *client* (first *))
; => (#<STUDIO-CLIENT:UPLOAD "I know everything" #1286> ...)
(studio-client:file-url *client* (first (studio-client:files (first *))))
; => http://studio.tymoon.eu/api/studio/file?id=1365

See the two primary objects gallery and upload for more information.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 studio-client

Maintainer

Nicolas Hafner <shinmera@tymoon.eu>

Author

Nicolas Hafner <shinmera@tymoon.eu>

Home Page

https://github.com/Shinmera/studio-client

License

Artistic

Description

A client library for the Studio image hosting service

Version

1.0.0

Dependencies
Source

studio-client.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 studio-client.asd

Location

studio-client.asd

Systems

studio-client (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 studio-client/package.lisp

Parent

studio-client (system)

Location

package.lisp

Packages

studio-client


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 studio-client/client.lisp

Dependency

package.lisp (file)

Parent

studio-client (system)

Location

client.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.4 studio-client/documentation.lisp

Dependency

client.lisp (file)

Parent

studio-client (system)

Location

documentation.lisp


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 studio-client

Source

package.lisp (file)

Nickname

org.shirakumo.studio.client

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Generic functions

Generic Function: api-base OBJECT

Returns the base API URL that the client will send API requests to.

See CLIENT

Package

studio-client

Methods
Method: api-base (CLIENT client)

automatically generated reader method

Source

client.lisp (file)

Generic Function: author OBJECT

Returns the name of the author of the object.

See GALLERY
See UPLOAD

Package

studio-client

Methods
Method: author (UPLOAD upload)

automatically generated reader method

Source

client.lisp (file)

Method: author (GALLERY gallery)

automatically generated reader method

Source

client.lisp (file)

Generic Function: cover OBJECT

Returns the ID of the upload that was set as the gallery’s cover image, if any.

See GALLERY

Package

studio-client

Writer

(setf cover) (generic function)

Methods
Method: cover (GALLERY gallery)

automatically generated reader method

Source

client.lisp (file)

Generic Function: (setf cover) NEW-VALUE OBJECT
Package

studio-client

Reader

cover (generic function)

Methods
Method: (setf cover) NEW-VALUE (GALLERY gallery)

automatically generated writer method

Source

client.lisp (file)

Generic Function: created OBJECT

Returns the universal-time timestamp of when the upload was created.

See UPLOAD

Package

studio-client

Writer

(setf created) (generic function)

Methods
Method: created (UPLOAD upload)

automatically generated reader method

Source

client.lisp (file)

Generic Function: (setf created) NEW-VALUE OBJECT
Package

studio-client

Reader

created (generic function)

Methods
Method: (setf created) NEW-VALUE (UPLOAD upload)

automatically generated writer method

Source

client.lisp (file)

Generic Function: delete CLIENT GALLERY

Delete the given object on the Studio instance.

This may fail if the authenticated user lacks the necessary permissions.

See GALLERY
See UPLOAD
See CLIENT

Package

studio-client

Methods
Method: delete (CLIENT client) (UPLOAD upload)
Source

client.lisp (file)

Method: delete (CLIENT client) (GALLERY gallery)
Source

client.lisp (file)

Generic Function: description OBJECT

Returns the object’s description string.

See GALLERY
See UPLOAD

Package

studio-client

Writer

(setf description) (generic function)

Methods
Method: description (UPLOAD upload)

automatically generated reader method

Source

client.lisp (file)

Method: description (GALLERY gallery)

automatically generated reader method

Source

client.lisp (file)

Generic Function: (setf description) NEW-VALUE OBJECT
Package

studio-client

Reader

description (generic function)

Methods
Method: (setf description) NEW-VALUE (UPLOAD upload)

automatically generated writer method

Source

client.lisp (file)

Method: (setf description) NEW-VALUE (GALLERY gallery)

automatically generated writer method

Source

client.lisp (file)

Generic Function: file-content CLIENT ID &key THUMB

Returns the file’s binary payload data as returned by the server.

Returns an unsigned-byte 8 vector.

This function will error if the requested file does not exist.

Package

studio-client

Methods
Method: file-content (CLIENT client) ID &key THUMB
Source

client.lisp (file)

Generic Function: file-url CLIENT ID &key THUMB

Returns the public URL to the file.

Package

studio-client

Methods
Method: file-url (CLIENT client) ID &key THUMB
Source

client.lisp (file)

Generic Function: files OBJECT

Accessor to the list of files of the upload.

Returned by the server are merely the file IDs, which you can turn into URLs and payloads with FILE-URL and FILE-CONTENT respectively.

If you want to add new files, add the pathname to the file at the appropriate position in the file list.

Note that setting this will only change the local object. In order to persist the changes, use SAVE.

See UPLOAD
See SAVE
See FILE-URL
See FILE-CONTENT

Package

studio-client

Writer

(setf files) (generic function)

Methods
Method: files (UPLOAD upload)

automatically generated reader method

Source

client.lisp (file)

Generic Function: (setf files) NEW-VALUE OBJECT
Package

studio-client

Reader

files (generic function)

Methods
Method: (setf files) NEW-VALUE (UPLOAD upload)

automatically generated writer method

Source

client.lisp (file)

Generic Function: galleries CLIENT &key START END

Retrieve a listing of existing galleries on the Studio instance.

Note that this may return less than the specified END if the server caps the number of galleries it returns (by default limited to 10).

See GALLERY
See CLIENT

Package

studio-client

Methods
Method: galleries (CLIENT client) &key START END
Source

client.lisp (file)

Retrieve the gallery of the given author.

See GALLERY
See CLIENT

Package

studio-client

Methods
Source

client.lisp (file)

Generic Function: id OBJECT

Returns an ID that identifies this object on Studio.

See GALLERY
See UPLOAD

Package

studio-client

Methods
Method: id (UPLOAD upload)

automatically generated reader method

Source

client.lisp (file)

Method: id (GALLERY gallery)

automatically generated reader method

Source

client.lisp (file)

Generic Function: make-gallery CLIENT &key DESCRIPTION

Create a gallery for the authenticated user.

Note that this will fail if a gallery already exists.

This may fail if the authenticated user lacks the necessary permissions.

Returns a fresh GALLERY instance if successful.

See GALLERY
See CLIENT

Package

studio-client

Methods
Method: make-gallery (CLIENT client) &key DESCRIPTION
Source

client.lisp (file)

Generic Function: make-upload CLIENT TITLE FILES &key DESCRIPTION TAGS VISIBILITY

Create a new upload.

FILES should be a list of pathnames to upload as the upload’s files. VISIBILITY can be one of :PUBLIC :HIDDEN :PRIVATE.

This may fail if the authenticated user lacks the necessary permissions.

Returns a fresh UPLOAD instance if successful.

See UPLOAD
See CLIENT

Package

studio-client

Methods
Method: make-upload (CLIENT client) TITLE FILES &key DESCRIPTION TAGS VISIBILITY
Source

client.lisp (file)

Generic Function: save CLIENT GALLERY

Save potential changes made to the fields of the object on the Studio instance.

This may fail if the authenticated user lacks the necessary permissions.

Returns a fresh instance of the saved object as returned by the API.

See GALLERY
See UPLOAD
See CLIENT

Package

studio-client

Methods
Method: save (CLIENT client) (UPLOAD upload)
Source

client.lisp (file)

Method: save (CLIENT client) (GALLERY gallery)
Source

client.lisp (file)

Generic Function: tags OBJECT

Accessor to the list of tags the upload is marked with.

Note that setting this will only change the local object. In order to persist the changes, use SAVE.

See UPLOAD
See SAVE

Package

studio-client

Writer

(setf tags) (generic function)

Methods
Method: tags (UPLOAD upload)

automatically generated reader method

Source

client.lisp (file)

Generic Function: (setf tags) NEW-VALUE OBJECT
Package

studio-client

Reader

tags (generic function)

Methods
Method: (setf tags) NEW-VALUE (UPLOAD upload)

automatically generated writer method

Source

client.lisp (file)

Generic Function: title OBJECT

Accessor to the upload’s title.

Note that setting this will only change the local object. In order to persist the changes, use SAVE.

See UPLOAD
See SAVE

Package

studio-client

Writer

(setf title) (generic function)

Methods
Method: title (UPLOAD upload)

automatically generated reader method

Source

client.lisp (file)

Generic Function: (setf title) NEW-VALUE OBJECT
Package

studio-client

Reader

title (generic function)

Methods
Method: (setf title) NEW-VALUE (UPLOAD upload)

automatically generated writer method

Source

client.lisp (file)

Generic Function: upload CLIENT ID

Retrieve the upload with the given ID.

See UPLOAD
See CLIENT

Package

studio-client

Methods
Method: upload (CLIENT client) ID
Source

client.lisp (file)

Generic Function: uploads CLIENT AUTHOR &key TAG DATE START END

Retrieve a list of uploads for the given user or gallery.

DATE should be a date string in the format "MM.YYYY".

Note that this may return less than the specified END if the server caps the number of uploads it returns (by default limited to 40).

See GALLERY
See CLIENT
See UPLOAD

Package

studio-client

Methods
Method: uploads (CLIENT client) (GALLERY gallery) &rest ARGS
Source

client.lisp (file)

Method: uploads (CLIENT client) (AUTHOR string) &key TAG DATE START END
Source

client.lisp (file)

Generic Function: url OBJECT

Returns the public URL to the given object.

See GALLERY
See UPLOAD

Package

studio-client

Methods
Method: url (UPLOAD upload)

automatically generated reader method

Source

client.lisp (file)

Method: url (GALLERY gallery)

automatically generated reader method

Source

client.lisp (file)

Generic Function: visibility OBJECT

Accessor to the visibility of the upload.

The value may be one of: :PUBLIC :HIDDEN :PRIVATE

Note that setting this will only change the local object. In order to persist the changes, use SAVE.

See UPLOAD
See SAVE

Package

studio-client

Writer

(setf visibility) (generic function)

Methods
Method: visibility (UPLOAD upload)

automatically generated reader method

Source

client.lisp (file)

Generic Function: (setf visibility) NEW-VALUE OBJECT
Package

studio-client

Reader

visibility (generic function)

Methods
Method: (setf visibility) NEW-VALUE (UPLOAD upload)

automatically generated writer method

Source

client.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Classes

Class: client ()

The base client class for Studio connections.

To start, you should create an instance of this client with the appropriate :API-BASE, which defaults to "https://studio.tymoon.eu/api/". Then use North’s functions NORTH:INITIATE-AUTHENTICATION and NORTH:COMPLETE-AUTHENTICATION to complete the authentication cycle.

See NORTH:CLIENT
See API-BASE

Package

studio-client

Source

client.lisp (file)

Direct superclasses

client (class)

Direct methods
Direct slots
Slot: api-base
Readers

api-base (generic function)

Direct Default Initargs
InitargValue
:api-base"https://studio.tymoon.eu/api/"
:request-token-urinil
:authorize-urinil
:access-token-urinil

Representation of a user’s gallery in Studio.

See ID
See AUTHOR
See URL
See COVER
See DESCRIPTION
See MAKE-GALLERY
See GALLERY
See GALLERIES
See DELETE
See SAVE

Package

studio-client

Source

client.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: id
Initargs

:id

Readers

id (generic function)

Slot: url
Initargs

:url

Readers

url (generic function)

Slot: author
Initargs

:author

Readers

author (generic function)

Slot: cover
Initargs

:cover

Readers

cover (generic function)

Writers

(setf cover) (generic function)

Slot: description
Initargs

:description

Readers

description (generic function)

Writers

(setf description) (generic function)

Class: upload ()

Representation of an upload in a gallery on a Studio instance.

See ID
See URL
See TITLE
See AUTHOR
See TAGS
See CREATED
See VISIBILITY
See DESCRIPTION
See FILES
See MAKE-UPLOAD
See UPLOADS
See UPLOAD

Package

studio-client

Source

client.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: id
Initargs

:id

Readers

id (generic function)

Slot: url
Initargs

:url

Readers

url (generic function)

Slot: title
Initargs

:title

Readers

title (generic function)

Writers

(setf title) (generic function)

Slot: author
Initargs

:author

Readers

author (generic function)

Slot: tags
Initargs

:tags

Readers

tags (generic function)

Writers

(setf tags) (generic function)

Slot: created
Initargs

:created

Readers

created (generic function)

Writers

(setf created) (generic function)

Slot: visibility
Initargs

:visibility

Readers

visibility (generic function)

Writers

(setf visibility) (generic function)

Slot: description
Initargs

:description

Readers

description (generic function)

Writers

(setf description) (generic function)

Slot: files
Initargs

:files

Readers

files (generic function)

Writers

(setf files) (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Functions

Function: decode-radiance-payload DATA
Package

studio-client

Source

client.lisp (file)

Function: parse-gallery DATA
Package

studio-client

Source

client.lisp (file)

Function: parse-upload DATA
Package

studio-client

Source

client.lisp (file)

Function: plist->params PLIST
Package

studio-client

Source

client.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Generic functions

Generic Function: post CLIENT ENDPOINT &rest PARAMETERS
Package

studio-client

Source

client.lisp (file)

Methods
Method: post (CLIENT client) ENDPOINT &rest PARAMETERS
Generic Function: post-file CLIENT ENDPOINT DATA &rest PARAMETERS
Package

studio-client

Methods
Method: post-file (CLIENT client) ENDPOINT DATA &rest PARAMETERS
Source

client.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, studio-client.asd: The studio-client<dot>asd file
File, Lisp, studio-client/client.lisp: The studio-client/client<dot>lisp file
File, Lisp, studio-client/documentation.lisp: The studio-client/documentation<dot>lisp file
File, Lisp, studio-client/package.lisp: The studio-client/package<dot>lisp file

L
Lisp File, studio-client.asd: The studio-client<dot>asd file
Lisp File, studio-client/client.lisp: The studio-client/client<dot>lisp file
Lisp File, studio-client/documentation.lisp: The studio-client/documentation<dot>lisp file
Lisp File, studio-client/package.lisp: The studio-client/package<dot>lisp file

S
studio-client.asd: The studio-client<dot>asd file
studio-client/client.lisp: The studio-client/client<dot>lisp file
studio-client/documentation.lisp: The studio-client/documentation<dot>lisp file
studio-client/package.lisp: The studio-client/package<dot>lisp file

Jump to:   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   C   D   F   G   I   M   P   S   T   U   V  
Index Entry  Section

(
(setf cover): Exported generic functions
(setf cover): Exported generic functions
(setf created): Exported generic functions
(setf created): Exported generic functions
(setf description): Exported generic functions
(setf description): Exported generic functions
(setf description): Exported generic functions
(setf files): Exported generic functions
(setf files): Exported generic functions
(setf tags): Exported generic functions
(setf tags): Exported generic functions
(setf title): Exported generic functions
(setf title): Exported generic functions
(setf visibility): Exported generic functions
(setf visibility): Exported generic functions

A
api-base: Exported generic functions
api-base: Exported generic functions
author: Exported generic functions
author: Exported generic functions
author: Exported generic functions

C
cover: Exported generic functions
cover: Exported generic functions
created: Exported generic functions
created: Exported generic functions

D
decode-radiance-payload: Internal functions
delete: Exported generic functions
delete: Exported generic functions
delete: Exported generic functions
description: Exported generic functions
description: Exported generic functions
description: Exported generic functions

F
file-content: Exported generic functions
file-content: Exported generic functions
file-url: Exported generic functions
file-url: Exported generic functions
files: Exported generic functions
files: Exported generic functions
Function, decode-radiance-payload: Internal functions
Function, parse-gallery: Internal functions
Function, parse-upload: Internal functions
Function, plist->params: Internal functions

G
galleries: Exported generic functions
galleries: Exported generic functions
gallery: Exported generic functions
gallery: Exported generic functions
Generic Function, (setf cover): Exported generic functions
Generic Function, (setf created): Exported generic functions
Generic Function, (setf description): Exported generic functions
Generic Function, (setf files): Exported generic functions
Generic Function, (setf tags): Exported generic functions
Generic Function, (setf title): Exported generic functions
Generic Function, (setf visibility): Exported generic functions
Generic Function, api-base: Exported generic functions
Generic Function, author: Exported generic functions
Generic Function, cover: Exported generic functions
Generic Function, created: Exported generic functions
Generic Function, delete: Exported generic functions
Generic Function, description: Exported generic functions
Generic Function, file-content: Exported generic functions
Generic Function, file-url: Exported generic functions
Generic Function, files: Exported generic functions
Generic Function, galleries: Exported generic functions
Generic Function, gallery: Exported generic functions
Generic Function, id: Exported generic functions
Generic Function, make-gallery: Exported generic functions
Generic Function, make-upload: Exported generic functions
Generic Function, post: Internal generic functions
Generic Function, post-file: Internal generic functions
Generic Function, save: Exported generic functions
Generic Function, tags: Exported generic functions
Generic Function, title: Exported generic functions
Generic Function, upload: Exported generic functions
Generic Function, uploads: Exported generic functions
Generic Function, url: Exported generic functions
Generic Function, visibility: Exported generic functions

I
id: Exported generic functions
id: Exported generic functions
id: Exported generic functions

M
make-gallery: Exported generic functions
make-gallery: Exported generic functions
make-upload: Exported generic functions
make-upload: Exported generic functions
Method, (setf cover): Exported generic functions
Method, (setf created): Exported generic functions
Method, (setf description): Exported generic functions
Method, (setf description): Exported generic functions
Method, (setf files): Exported generic functions
Method, (setf tags): Exported generic functions
Method, (setf title): Exported generic functions
Method, (setf visibility): Exported generic functions
Method, api-base: Exported generic functions
Method, author: Exported generic functions
Method, author: Exported generic functions
Method, cover: Exported generic functions
Method, created: Exported generic functions
Method, delete: Exported generic functions
Method, delete: Exported generic functions
Method, description: Exported generic functions
Method, description: Exported generic functions
Method, file-content: Exported generic functions
Method, file-url: Exported generic functions
Method, files: Exported generic functions
Method, galleries: Exported generic functions
Method, gallery: Exported generic functions
Method, id: Exported generic functions
Method, id: Exported generic functions
Method, make-gallery: Exported generic functions
Method, make-upload: Exported generic functions
Method, post: Internal generic functions
Method, post-file: Internal generic functions
Method, save: Exported generic functions
Method, save: Exported generic functions
Method, tags: Exported generic functions
Method, title: Exported generic functions
Method, upload: Exported generic functions
Method, uploads: Exported generic functions
Method, uploads: Exported generic functions
Method, url: Exported generic functions
Method, url: Exported generic functions
Method, visibility: Exported generic functions

P
parse-gallery: Internal functions
parse-upload: Internal functions
plist->params: Internal functions
post: Internal generic functions
post: Internal generic functions
post-file: Internal generic functions
post-file: Internal generic functions

S
save: Exported generic functions
save: Exported generic functions
save: Exported generic functions

T
tags: Exported generic functions
tags: Exported generic functions
title: Exported generic functions
title: Exported generic functions

U
upload: Exported generic functions
upload: Exported generic functions
uploads: Exported generic functions
uploads: Exported generic functions
uploads: Exported generic functions
url: Exported generic functions
url: Exported generic functions
url: Exported generic functions

V
visibility: Exported generic functions
visibility: Exported generic functions

Jump to:   (  
A   C   D   F   G   I   M   P   S   T   U   V  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   A   C   D   F   I   S   T   U   V  
Index Entry  Section

A
api-base: Exported classes
author: Exported classes
author: Exported classes

C
cover: Exported classes
created: Exported classes

D
description: Exported classes
description: Exported classes

F
files: Exported classes

I
id: Exported classes
id: Exported classes

S
Slot, api-base: Exported classes
Slot, author: Exported classes
Slot, author: Exported classes
Slot, cover: Exported classes
Slot, created: Exported classes
Slot, description: Exported classes
Slot, description: Exported classes
Slot, files: Exported classes
Slot, id: Exported classes
Slot, id: Exported classes
Slot, tags: Exported classes
Slot, title: Exported classes
Slot, url: Exported classes
Slot, url: Exported classes
Slot, visibility: Exported classes

T
tags: Exported classes
title: Exported classes

U
url: Exported classes
url: Exported classes

V
visibility: Exported classes

Jump to:   A   C   D   F   I   S   T   U   V  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   G   P   S   U  
Index Entry  Section

C
Class, client: Exported classes
Class, gallery: Exported classes
Class, upload: Exported classes
client: Exported classes

G
gallery: Exported classes

P
Package, studio-client: The studio-client package

S
studio-client: The studio-client system
studio-client: The studio-client package
System, studio-client: The studio-client system

U
upload: Exported classes

Jump to:   C   G   P   S   U