[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/excorporate 24a625f 86/93: Excorporate: Add an operatio
From: |
Stefan Monnier |
Subject: |
[elpa] externals/excorporate 24a625f 86/93: Excorporate: Add an operation arity function |
Date: |
Sun, 29 Nov 2020 15:43:15 -0500 (EST) |
branch: externals/excorporate
commit 24a625f17078737e82cae7ff030fc0aadbfe6db3
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Excorporate: Add an operation arity function
* packages/excorporate/excorporate.texi (API Usage): Document
exco-operation-arity-nils.
* packages/excorporate/excorporate.el (exco-operation-arity-nils):
New function.
(exco-calendar-item-meeting-create): Call
exco-operation-arity-nils.
(exco-calendar-item-meeting-reply): Likewise.
(exco-calendar-item-meeting-cancel): Likewise.
(exco-get-meetings-for-day): Likewise.
---
excorporate.el | 39 ++++++++++++---------------------------
excorporate.texi | 17 ++++++-----------
2 files changed, 18 insertions(+), 38 deletions(-)
diff --git a/excorporate.el b/excorporate.el
index b9d1748..724e72c 100644
--- a/excorporate.el
+++ b/excorporate.el
@@ -692,6 +692,14 @@ Return a structure, or nil, suitable for splicing into
(list (cons (if required 'RequiredAttendees 'OptionalAttendees)
(nreverse attendee-list))))))
+(defun exco-operation-arity-nils (identifier operation)
+ "Return a list of nil arguments for OPERATION.
+IDENTIFIER is the connection for which to look up OPERATION."
+ (let* ((wsdl (exco--with-fsm identifier
+ (plist-get (fsm-get-state-data fsm) :service-wsdl)))
+ (arity (soap-operation-arity wsdl "ExchangeServicePort" operation)))
+ (make-list arity nil)))
+
(defun exco-calendar-item-meeting-create (identifier
subject body start end location
main-invitees optional-invitees
@@ -725,12 +733,7 @@ creation."
,@(exco--create-attendee-structure main-invitees t)
,@(exco--create-attendee-structure optional-invitees nil))))
;; Empty arguments.
- ,@(let* ((wsdl (exco--with-fsm identifier
- (plist-get (fsm-get-state-data fsm) :service-wsdl)))
- (arity (soap-operation-arity wsdl
- "ExchangeServicePort"
- "CreateItem")))
- (make-list (- arity 1) nil)))
+ ,@(cdr (exco-operation-arity-nils identifier "CreateItem")))
callback))
(defun exco-calendar-item-meeting-reply (identifier
@@ -759,13 +762,7 @@ RESPONSE, the server's response to the meeting
cancellation."
(ReferenceItemId ,@(cdr item-identifier))
,@(when message (list `(Body (BodyType . "Text") ,message))))))
;; Empty arguments.
- ,@(let* ((wsdl (exco--with-fsm identifier
- (plist-get (fsm-get-state-data fsm)
- :service-wsdl)))
- (arity (soap-operation-arity wsdl
- "ExchangeServicePort"
- "CreateItem")))
- (make-list (- arity 1) nil)))
+ ,@(cdr (exco-operation-arity-nils identifier "CreateItem")))
callback)))
(defun exco-calendar-item-meeting-cancel (identifier
@@ -786,13 +783,7 @@ server's response to the meeting cancellation."
(ReferenceItemId ,@(cdr item-identifier))
(NewBodyContent (BodyType . "Text") ,message))))
;; Empty arguments.
- ,@(let* ((wsdl (exco--with-fsm identifier
- (plist-get (fsm-get-state-data fsm)
- :service-wsdl)))
- (arity (soap-operation-arity wsdl
- "ExchangeServicePort"
- "CreateItem")))
- (make-list (- arity 1) nil)))
+ ,@(cdr (exco-operation-arity-nils identifier "CreateItem")))
callback))
(defun exco-calendar-item-appointment-create (identifier
@@ -1070,13 +1061,7 @@ arguments, IDENTIFIER and the server's response."
(ParentFolderIds
(DistinguishedFolderId (Id . "calendar"))))
;; Empty arguments.
- ,@(let* ((wsdl (exco--with-fsm identifier
- (plist-get (fsm-get-state-data fsm)
- :service-wsdl)))
- (arity (soap-operation-arity wsdl
- "ExchangeServicePort"
- "FindItem")))
- (make-list (- arity 1) nil)))
+ ,@(cdr (exco-operation-arity-nils identifier "FindItem")))
callback)))
(defun exco-connection-iterate (initialize-function
diff --git a/excorporate.texi b/excorporate.texi
index 1154547..4067a10 100644
--- a/excorporate.texi
+++ b/excorporate.texi
@@ -567,11 +567,11 @@ hacker2@@gnu.org, in the Eastern Time time zone.
@noindent
This example shows how to create a recurrence in the ``Eastern Standard
-Time'' time zone. The spliced-in code fragment shows how to query how
-many @code{nil} arguments should be specified for the @code{CreateItem}
-operation. Arguments other than the first (``request'') argument may be
-needed in the future to use more complicated server functionality, but
-for now they can all be left @code{nil}.
+Time'' time zone. The @{exco-operation-arity-nils} call returns the
+number of arguments (all @code{nil}) that the @code{CreateItem}
+operation takes. Arguments other than the first (``request'') argument
+may be needed in the future to use more complicated server
+functionality, but for now they can all be left @code{nil}.
@example
@group
@@ -598,12 +598,7 @@ for now they can all be left @code{nil}.
(StartDate . "2020-09-25-04:00")
(NumberOfOccurrences . 4))))))
;; Empty arguments.
- ,@@(let* ((wsdl (exco--with-fsm (car exco--connection-identifiers)
- (plist-get (fsm-get-state-data fsm) :service-wsdl)))
- (arity (soap-operation-arity wsdl
- "ExchangeServicePort"
- "CreateItem")))
- (make-list (- arity 1) nil)))
+ ,@@(cdr (exco-operation-arity-nils identifier "CreateItem")))
(lambda (identifier response)
(message "%S: %S" identifier response)))
@result{}
- [elpa] externals/excorporate b37aecf 51/93: excorporate-diary: Fix percent signs in appt, (continued)
- [elpa] externals/excorporate b37aecf 51/93: excorporate-diary: Fix percent signs in appt, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 00ef8e7 55/93: excorporate: Update HTTPS proxy and GSSAPI status in manual, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate fac0fee 56/93: packages/excorporate/excorporate.el: Add an acknowledgment, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 0080f33 62/93: Excorporate: Add item identifiers to Org buffer, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate b228664 69/93: Excorporate: Support replying to meeting requests, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate cee32a6 65/93: Excorporate: Add support for synchronous operations, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 166b417 72/93: Excorporate: Add an organizer resolver function, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 936eb4a 61/93: Excorporate: Change identifier format in Org buffer, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate d43e575 58/93: Excorporate: Add an item iteration macro, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 212c8bd 80/93: Excorporate: Rewrite exco-org functions for Org 9.1, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 24a625f 86/93: Excorporate: Add an operation arity function,
Stefan Monnier <=
- [elpa] externals/excorporate 23d19b3 79/93: Excorporate: Document API usage in manual, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate bf88ded 83/93: Excorporate: Add more API usage examples to manual, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate c72216a 92/93: Excorporate: Bump version to 0.9.1, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 98a5284 82/93: Excorporate: Do not explicitly require Org package, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 4253da4 84/93: Excorporate: Add timeout for synchronous operations, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 29bef79 87/93: Excorporate: Bump soap-client required version to 3.2.0, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 4fb4450 93/93: * .gitignore: New file, Stefan Monnier, 2020/11/29