The webapi Reference Manual

Table of Contents

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

The webapi Reference Manual

This is the webapi Reference Manual, version 0.1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Wed Oct 13 13:03:23 2021 GMT+0.


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

1 Introduction

WebAPI

CLOS-based wrapper builder for Web APIs.

Usage

(ql:quickload '(:webapi :jonathan))

;; Define GitHub API request class.
(defclass github-request () ()
  (:default-initargs :base-uri "https://api.github.com"))
  
(defmethod webapi:parse ((request github-request) response)
  (jojo:parse (webapi:response-body response) :as :alist))

;; Request class for /users/:name/repos.
(defclass user-repositories (github-request)
  ((user :initarg :user))
  (:metaclass webapi:request-class)
  (:http :get))
  
(defmethod webapi:request-path ((request user-repositories))
  (format nil "/users/~A/repos" (slot-value request 'user)))

;; Request class for /search/repositories.
(defclass search-repositories (github-request)
  ((q :initarg :q))
  (:metaclass webapi:request-class)
  (:http :get "/search/repositories"))
  
(defmethod webapi:query-parameters ((request search-repositories))
  `(("q" . ,(slot-value request 'q))))
  
;;
;; Send a request

;; Get repositories of "fukamachi".
(webapi:send (make-instance 'user-repositories :user "fukamachi"))

;; Search repositories with related to "Common Lisp".
(webapi:send (make-instance 'search-repositories :q "Common Lisp"))

Author

Copyright

Copyright (c) 2017 Eitaro Fukamachi (e.arrows@gmail.com)

License

Licensed under the BSD 2-Clause License.


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

2 Systems

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


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

2.1 webapi

Author

Eitaro Fukamachi

License

BSD 2-Clause

Description

CLOS-based wrapper builder for Web APIs

Version

0.1.0

Dependency

webapi/main (system)

Source

webapi.asd (file)


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

2.2 webapi/main

Author

Eitaro Fukamachi

License

BSD 2-Clause

Dependencies
Source

webapi.asd (file)

Component

file-type.lisp (file)


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

2.3 webapi/request

Author

Eitaro Fukamachi

License

BSD 2-Clause

Dependencies
Source

webapi.asd (file)

Component

file-type.lisp (file)


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

2.4 webapi/response

Author

Eitaro Fukamachi

License

BSD 2-Clause

Source

webapi.asd (file)

Component

file-type.lisp (file)


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

2.5 webapi/codable

Author

Eitaro Fukamachi

License

BSD 2-Clause

Dependencies
Source

webapi.asd (file)

Component

file-type.lisp (file)


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 webapi.asd

Location

webapi.asd

Systems

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

3.1.2 webapi/main/file-type.lisp

Parent

webapi/main (system)

Location

main.lisp

Packages

webapi


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

3.1.3 webapi/request/file-type.lisp

Parent

webapi/request (system)

Location

request.lisp

Packages

webapi/request

Exported Definitions
Internal Definitions

contains-class-or-subclasses (function)


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

3.1.4 webapi/response/file-type.lisp

Parent

webapi/response (system)

Location

response.lisp

Packages

webapi/response

Exported Definitions

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

3.1.5 webapi/codable/file-type.lisp

Parent

webapi/codable (system)

Location

codable.lisp

Packages

webapi/codable

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 webapi

Source

file-type.lisp (file)

Nickname

webapi/main

Use List

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

4.2 webapi/request

Source

file-type.lisp (file)

Use List

common-lisp

Used By List

webapi

Exported Definitions
Internal Definitions

contains-class-or-subclasses (function)


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

4.3 webapi/response

Source

file-type.lisp (file)

Use List

common-lisp

Used By List

webapi

Exported Definitions

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

4.4 webapi/codable

Source

file-type.lisp (file)

Use List

common-lisp

Used By List

webapi

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 Special variables

Special Variable: *keep-alive*
Package

webapi/request

Source

file-type.lisp (file)


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

5.1.2 Macros

Macro: defcodable NAME SUPERCLASSES SLOTS &rest CLASS-OPTIONS
Package

webapi/codable

Source

file-type.lisp (file)


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

5.1.3 Generic functions

Generic Function: body-parameters REQUEST
Package

webapi/request

Source

file-type.lisp (file)

Methods
Method: body-parameters (REQUEST request)
Generic Function: decode-object INPUT CLASS
Package

webapi/codable

Source

file-type.lisp (file)

Methods
Method: decode-object INPUT (CLASS null)
Method: decode-object INPUT (CLASS symbol)
Method: decode-object (INPUT string) CLASS
Method: decode-object (INPUT jso) CLASS
Method: decode-object (INPUT cons) (CLASS codable-class)
Generic Function: encode-object OBJECT
Package

webapi/codable

Source

file-type.lisp (file)

Methods
Method: encode-object OBJECT
Method: encode-object (OBJECT codable)
Generic Function: http-method REQUEST
Package

webapi/request

Source

file-type.lisp (file)

Methods
Method: http-method (REQUEST request)
Generic Function: http-uri REQUEST
Package

webapi/request

Source

file-type.lisp (file)

Methods
Method: http-uri (REQUEST request)
Generic Function: parse REQUEST RESPONSE
Package

webapi/request

Source

file-type.lisp (file)

Methods
Method: parse REQUEST RESPONSE
Generic Function: query-parameters REQUEST
Package

webapi/request

Source

file-type.lisp (file)

Methods
Method: query-parameters (REQUEST request)
Generic Function: request-headers REQUEST
Package

webapi/request

Source

file-type.lisp (file)

Methods
Method: request-headers (REQUEST request)
Generic Function: request-parameters REQUEST
Package

webapi/request

Source

file-type.lisp (file)

Methods
Method: request-parameters (REQUEST request)
Generic Function: request-path REQUEST
Package

webapi/request

Source

file-type.lisp (file)

Methods
Method: request-path (REQUEST request)
Generic Function: response-body OBJECT
Package

webapi/response

Methods
Method: response-body (RESPONSE response)

automatically generated reader method

Source

file-type.lisp (file)

Generic Function: response-headers OBJECT
Package

webapi/response

Methods
Method: response-headers (RESPONSE response)

automatically generated reader method

Source

file-type.lisp (file)

Generic Function: response-status OBJECT
Package

webapi/response

Methods
Method: response-status (RESPONSE response)

automatically generated reader method

Source

file-type.lisp (file)

Generic Function: response-uri OBJECT
Package

webapi/response

Methods
Method: response-uri (RESPONSE response)

automatically generated reader method

Source

file-type.lisp (file)

Generic Function: send REQUEST &key KEEP-ALIVE
Package

webapi/request

Source

file-type.lisp (file)

Methods
Method: send (REQUEST request) &key KEEP-ALIVE

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

5.1.4 Classes

Class: codable ()
Package

webapi/codable

Source

file-type.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Class: codable-class ()
Package

webapi/codable

Source

file-type.lisp (file)

Direct superclasses

standard-class (class)

Direct methods
  • decode-object (method)
  • reinitialize-instance (method)
  • initialize-instance (method)
  • validate-superclass (method)
  • direct-slot-definition-class (method)
Direct slots
Slot: conc-name
Initargs

:conc-name

Slot: key-mapper
Initform

(make-hash-table :test (quote equal))

Class: request ()
Package

webapi/request

Source

file-type.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: base-uri
Initargs

:base-uri

Class: request-class ()
Package

webapi/request

Source

file-type.lisp (file)

Direct superclasses

standard-class (class)

Direct methods
  • reinitialize-instance (method)
  • initialize-instance (method)
  • validate-superclass (method)
Direct slots
Slot: http
Initargs

:http

Class: response ()
Package

webapi/response

Source

file-type.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: status
Initargs

:status

Readers

response-status (generic function)

Slot: headers
Initargs

:headers

Readers

response-headers (generic function)

Slot: body
Initargs

:body

Readers

response-body (generic function)

Slot: uri
Initargs

:uri

Readers

response-uri (generic function)


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

5.2 Internal definitions


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

5.2.1 Special variables

Special Variable: *conc-name*
Package

webapi/codable

Source

file-type.lisp (file)


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

5.2.2 Functions

Function: build-slot-mapper CLASS
Package

webapi/codable

Source

file-type.lisp (file)

Function: codable-slot-key SLOT
Package

webapi/codable

Source

file-type.lisp (file)

Function: contains-class-or-subclasses CLASS TARGET-CLASSES
Package

webapi/request

Source

file-type.lisp (file)

Function: decode-jso-as-type VALUE TYPE
Package

webapi/codable

Source

file-type.lisp (file)

Function: make-slot-decoder TYPE
Package

webapi/codable

Source

file-type.lisp (file)


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

5.2.3 Generic functions

Generic Function: %codable-slot-key OBJECT
Generic Function: (setf %codable-slot-key) NEW-VALUE OBJECT
Package

webapi/codable

Methods
Method: %codable-slot-key (CODABLE-SLOT-CLASS codable-slot-class)

automatically generated reader method

Source

file-type.lisp (file)

Method: (setf %codable-slot-key) NEW-VALUE (CODABLE-SLOT-CLASS codable-slot-class)

automatically generated writer method

Source

file-type.lisp (file)


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

5.2.4 Conditions

Condition: conversion-failed ()
Package

webapi/codable

Source

file-type.lisp (file)

Direct superclasses

error (condition)


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

5.2.5 Classes

Class: codable-slot-class ()
Package

webapi/codable

Source

file-type.lisp (file)

Direct superclasses

standard-direct-slot-definition (class)

Direct methods
Direct slots
Slot: key
Type

(or string null)

Initargs

:key

Readers

%codable-slot-key (generic function)

Writers

(setf %codable-slot-key) (generic function)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   W  
Index Entry  Section

F
File, Lisp, webapi.asd: The webapi․asd file
File, Lisp, webapi/codable/file-type.lisp: The webapi/codable/file-type․lisp file
File, Lisp, webapi/main/file-type.lisp: The webapi/main/file-type․lisp file
File, Lisp, webapi/request/file-type.lisp: The webapi/request/file-type․lisp file
File, Lisp, webapi/response/file-type.lisp: The webapi/response/file-type․lisp file

L
Lisp File, webapi.asd: The webapi․asd file
Lisp File, webapi/codable/file-type.lisp: The webapi/codable/file-type․lisp file
Lisp File, webapi/main/file-type.lisp: The webapi/main/file-type․lisp file
Lisp File, webapi/request/file-type.lisp: The webapi/request/file-type․lisp file
Lisp File, webapi/response/file-type.lisp: The webapi/response/file-type․lisp file

W
webapi.asd: The webapi․asd file
webapi/codable/file-type.lisp: The webapi/codable/file-type․lisp file
webapi/main/file-type.lisp: The webapi/main/file-type․lisp file
webapi/request/file-type.lisp: The webapi/request/file-type․lisp file
webapi/response/file-type.lisp: The webapi/response/file-type․lisp file

Jump to:   F   L   W  

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

A.2 Functions

Jump to:   %   (  
B   C   D   E   F   G   H   M   P   Q   R   S  
Index Entry  Section

%
%codable-slot-key: Internal generic functions
%codable-slot-key: Internal generic functions

(
(setf %codable-slot-key): Internal generic functions
(setf %codable-slot-key): Internal generic functions

B
body-parameters: Exported generic functions
body-parameters: Exported generic functions
build-slot-mapper: Internal functions

C
codable-slot-key: Internal functions
contains-class-or-subclasses: Internal functions

D
decode-jso-as-type: Internal functions
decode-object: Exported generic functions
decode-object: Exported generic functions
decode-object: Exported generic functions
decode-object: Exported generic functions
decode-object: Exported generic functions
decode-object: Exported generic functions
defcodable: Exported macros

E
encode-object: Exported generic functions
encode-object: Exported generic functions
encode-object: Exported generic functions

F
Function, build-slot-mapper: Internal functions
Function, codable-slot-key: Internal functions
Function, contains-class-or-subclasses: Internal functions
Function, decode-jso-as-type: Internal functions
Function, make-slot-decoder: Internal functions

G
Generic Function, %codable-slot-key: Internal generic functions
Generic Function, (setf %codable-slot-key): Internal generic functions
Generic Function, body-parameters: Exported generic functions
Generic Function, decode-object: Exported generic functions
Generic Function, encode-object: Exported generic functions
Generic Function, http-method: Exported generic functions
Generic Function, http-uri: Exported generic functions
Generic Function, parse: Exported generic functions
Generic Function, query-parameters: Exported generic functions
Generic Function, request-headers: Exported generic functions
Generic Function, request-parameters: Exported generic functions
Generic Function, request-path: Exported generic functions
Generic Function, response-body: Exported generic functions
Generic Function, response-headers: Exported generic functions
Generic Function, response-status: Exported generic functions
Generic Function, response-uri: Exported generic functions
Generic Function, send: Exported generic functions

H
http-method: Exported generic functions
http-method: Exported generic functions
http-uri: Exported generic functions
http-uri: Exported generic functions

M
Macro, defcodable: Exported macros
make-slot-decoder: Internal functions
Method, %codable-slot-key: Internal generic functions
Method, (setf %codable-slot-key): Internal generic functions
Method, body-parameters: Exported generic functions
Method, decode-object: Exported generic functions
Method, decode-object: Exported generic functions
Method, decode-object: Exported generic functions
Method, decode-object: Exported generic functions
Method, decode-object: Exported generic functions
Method, encode-object: Exported generic functions
Method, encode-object: Exported generic functions
Method, http-method: Exported generic functions
Method, http-uri: Exported generic functions
Method, parse: Exported generic functions
Method, query-parameters: Exported generic functions
Method, request-headers: Exported generic functions
Method, request-parameters: Exported generic functions
Method, request-path: Exported generic functions
Method, response-body: Exported generic functions
Method, response-headers: Exported generic functions
Method, response-status: Exported generic functions
Method, response-uri: Exported generic functions
Method, send: Exported generic functions

P
parse: Exported generic functions
parse: Exported generic functions

Q
query-parameters: Exported generic functions
query-parameters: Exported generic functions

R
request-headers: Exported generic functions
request-headers: Exported generic functions
request-parameters: Exported generic functions
request-parameters: Exported generic functions
request-path: Exported generic functions
request-path: Exported generic functions
response-body: Exported generic functions
response-body: Exported generic functions
response-headers: Exported generic functions
response-headers: Exported generic functions
response-status: Exported generic functions
response-status: Exported generic functions
response-uri: Exported generic functions
response-uri: Exported generic functions

S
send: Exported generic functions
send: Exported generic functions

Jump to:   %   (  
B   C   D   E   F   G   H   M   P   Q   R   S  

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

A.3 Variables

Jump to:   *  
B   C   H   K   S   U  
Index Entry  Section

*
*conc-name*: Internal special variables
*keep-alive*: Exported special variables

B
base-uri: Exported classes
body: Exported classes

C
conc-name: Exported classes

H
headers: Exported classes
http: Exported classes

K
key: Internal classes
key-mapper: Exported classes

S
Slot, base-uri: Exported classes
Slot, body: Exported classes
Slot, conc-name: Exported classes
Slot, headers: Exported classes
Slot, http: Exported classes
Slot, key: Internal classes
Slot, key-mapper: Exported classes
Slot, status: Exported classes
Slot, uri: Exported classes
Special Variable, *conc-name*: Internal special variables
Special Variable, *keep-alive*: Exported special variables
status: Exported classes

U
uri: Exported classes

Jump to:   *  
B   C   H   K   S   U  

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

A.4 Data types

Jump to:   C   P   R   S   W  
Index Entry  Section

C
Class, codable: Exported classes
Class, codable-class: Exported classes
Class, codable-slot-class: Internal classes
Class, request: Exported classes
Class, request-class: Exported classes
Class, response: Exported classes
codable: Exported classes
codable-class: Exported classes
codable-slot-class: Internal classes
Condition, conversion-failed: Internal conditions
conversion-failed: Internal conditions

P
Package, webapi: The webapi package
Package, webapi/codable: The webapi/codable package
Package, webapi/request: The webapi/request package
Package, webapi/response: The webapi/response package

R
request: Exported classes
request-class: Exported classes
response: Exported classes

S
System, webapi: The webapi system
System, webapi/codable: The webapi/codable system
System, webapi/main: The webapi/main system
System, webapi/request: The webapi/request system
System, webapi/response: The webapi/response system

W
webapi: The webapi system
webapi: The webapi package
webapi/codable: The webapi/codable system
webapi/codable: The webapi/codable package
webapi/main: The webapi/main system
webapi/request: The webapi/request system
webapi/request: The webapi/request package
webapi/response: The webapi/response system
webapi/response: The webapi/response package

Jump to:   C   P   R   S   W