flickr-reflection.ss
#lang scheme
;; This module implements flickr.reflection.{getMethods, getMethodInfo} in
;; a non-reflective manner.

(require "method.ss")

(define current-api-key (make-parameter "123"))  ;; A bogus API key.
(define current-sec-key (make-parameter "456"))  ;; A bogus secret key.

(define (flickr.reflection.getMethods #:api_key [key (current-api-key)])
  (invoke-method `((method . "flickr.reflection.getMethods")
                   (api_key . ,key))))

(define (flickr.reflection.getMethodInfo #:api_key [key (current-api-key)]
                                         #:method_name method_name)
  (invoke-method `((method . "flickr.reflection.getMethodInfo")
                   (api_key . ,key)
                   (method_name . ,method_name))))

(provide flickr.reflection.getMethodInfo
         flickr.reflection.getMethods
         current-api-key
         current-sec-key)