delete-private-otp-devices-DEVICE_ID.h (3493B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2014-2026 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU Lesser General Public License as published by the Free Software 7 Foundation; either version 2.1, or (at your option) any later version. 8 9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 12 13 You should have received a copy of the GNU Lesser General Public License along with 14 TALER; see the file COPYING.LGPL. If not, see 15 <http://www.gnu.org/licenses/> 16 */ 17 /** 18 * @file src/include/taler/merchant/delete-private-otp-devices-DEVICE_ID.h 19 * @brief C interface for DELETE /private/otp-devices/$DEVICE_ID 20 * @author Christian Grothoff 21 */ 22 #ifndef _TALER_MERCHANT__DELETE_PRIVATE_OTP_DEVICES_DEVICE_ID_H 23 #define _TALER_MERCHANT__DELETE_PRIVATE_OTP_DEVICES_DEVICE_ID_H 24 25 #include <taler/merchant/common.h> 26 27 28 /** 29 * Handle for a DELETE /private/otp-devices/$DEVICE_ID operation. 30 */ 31 struct TALER_MERCHANT_DeletePrivateOtpDeviceHandle; 32 33 34 /** 35 * Set up DELETE /private/otp-devices/$DEVICE_ID operation. 36 * Note that you must explicitly start the operation after setup. 37 * 38 * @param ctx curl context 39 * @param url merchant backend base URL 40 * @param otp_device_id identifier of the OTP device to delete 41 * @return handle to operation, NULL on error 42 */ 43 struct TALER_MERCHANT_DeletePrivateOtpDeviceHandle * 44 TALER_MERCHANT_delete_private_otp_device_create ( 45 struct GNUNET_CURL_Context *ctx, 46 const char *url, 47 const char *otp_device_id); 48 49 50 /** 51 * Response details for a DELETE /private/otp-devices/$DEVICE_ID request. 52 */ 53 struct TALER_MERCHANT_DeletePrivateOtpDeviceResponse 54 { 55 /** 56 * HTTP response details. 57 */ 58 struct TALER_MERCHANT_HttpResponse hr; 59 }; 60 61 62 #ifndef TALER_MERCHANT_DELETE_PRIVATE_OTP_DEVICE_RESULT_CLOSURE 63 /** 64 * Type of the closure used by 65 * the #TALER_MERCHANT_DeletePrivateOtpDeviceCallback. 66 */ 67 #define TALER_MERCHANT_DELETE_PRIVATE_OTP_DEVICE_RESULT_CLOSURE void 68 #endif /* TALER_MERCHANT_DELETE_PRIVATE_OTP_DEVICE_RESULT_CLOSURE */ 69 70 /** 71 * Type of the function that receives the result of a 72 * DELETE /private/otp-devices/$DEVICE_ID request. 73 * 74 * @param cls closure 75 * @param result result returned by the HTTP server 76 */ 77 typedef void 78 (*TALER_MERCHANT_DeletePrivateOtpDeviceCallback)( 79 TALER_MERCHANT_DELETE_PRIVATE_OTP_DEVICE_RESULT_CLOSURE *cls, 80 const struct TALER_MERCHANT_DeletePrivateOtpDeviceResponse *result); 81 82 83 /** 84 * Start DELETE /private/otp-devices/$DEVICE_ID operation. 85 * 86 * @param[in,out] handle operation to start 87 * @param cb function to call with the result 88 * @param cb_cls closure for @a cb 89 * @return status code, #TALER_EC_NONE on success 90 */ 91 enum TALER_ErrorCode 92 TALER_MERCHANT_delete_private_otp_device_start ( 93 struct TALER_MERCHANT_DeletePrivateOtpDeviceHandle *handle, 94 TALER_MERCHANT_DeletePrivateOtpDeviceCallback cb, 95 TALER_MERCHANT_DELETE_PRIVATE_OTP_DEVICE_RESULT_CLOSURE *cb_cls); 96 97 98 /** 99 * Cancel DELETE /private/otp-devices/$DEVICE_ID operation. 100 * This function must not be called by clients after the 101 * callback has been invoked. 102 * 103 * @param[in] handle operation to cancel 104 */ 105 void 106 TALER_MERCHANT_delete_private_otp_device_cancel ( 107 struct TALER_MERCHANT_DeletePrivateOtpDeviceHandle *handle); 108 109 110 #endif /* _TALER_MERCHANT__DELETE_PRIVATE_OTP_DEVICES_DEVICE_ID_H */