summaryrefslogtreecommitdiff
path: root/language
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-03-07 13:03:30 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-03-07 13:08:10 +0100
commitb76ae8c42a2198fa206b472c2a6a5dbef257925b (patch)
treec17caaa00eafa37ac15e90c1150eaa34c6a2ef94 /language
parent54b59f500d4b45a3879b2a7bfc489fb53ba2b3c3 (diff)
base: aws-operation: Pass request arguments to request constructor.
Instead of expecting a single input of the required type, the procedure returned by AWS-OPERATION now accepts keyword arguments intended for the request constructor. This makes for a much less verbose DSL. Compare the explicit style (DeleteFileSystem (DeleteFileSystemRequest #:FileSystemId "fs-cabba9e")) with the new implicit style: (DeleteFileSystem #:FileSystemId "fs-cabba9e") * aws/base.scm (aws-operation): Accept an input-constructor; apply it to a provided list of keyword arguments. * language/aws/spec.scm (compile-operation): Generate code that specifies the input constructor. * README.org: Update examples.
Diffstat (limited to 'language')
-rw-r--r--language/aws/spec.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/language/aws/spec.scm b/language/aws/spec.scm
index c40367b..f271d27 100644
--- a/language/aws/spec.scm
+++ b/language/aws/spec.scm
@@ -200,6 +200,10 @@ if this is not a primitive data type."
(aws-operation
operation->request
#:name ,name
+ #:input-constructor
+ ,(and=> (assoc-ref spec "input")
+ (lambda (input)
+ (and=> (assoc-ref input "shape") string->symbol)))
#:input-type
',(and=> (assoc-ref spec "input")
(lambda (input)