/*
  This file is part of TALER
  Copyright (C) 2014-2026 Taler Systems SA

  TALER is free software; you can redistribute it and/or modify it under the
  terms of the GNU Lesser General Public License as published by the Free Software
  Foundation; either version 2.1, or (at your option) any later version.

  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public License along with
  TALER; see the file COPYING.LGPL.  If not, see
  <http://www.gnu.org/licenses/>
*/
/**
 * @file src/include/taler/merchant/delete-private-donau-DONAU_SERIAL.h
 * @brief C interface for DELETE /private/donau/$DONAU_SERIAL
 * @author Christian Grothoff
 */
#ifndef _TALER_MERCHANT__DELETE_PRIVATE_DONAU_DONAU_SERIAL_H
#define _TALER_MERCHANT__DELETE_PRIVATE_DONAU_DONAU_SERIAL_H

#include <taler/merchant/common.h>


/**
 * Handle for a DELETE /private/donau/$DONAU_SERIAL operation.
 */
struct TALER_MERCHANT_DeletePrivateDonauHandle;


/**
 * Set up DELETE /private/donau/$DONAU_SERIAL operation.
 * Note that you must explicitly start the operation after setup.
 *
 * @param ctx curl context
 * @param url merchant backend base URL
 * @param charity_id charity identifier to delete
 * @return handle to operation, NULL on error
 */
struct TALER_MERCHANT_DeletePrivateDonauHandle *
TALER_MERCHANT_delete_private_donau_create (
  struct GNUNET_CURL_Context *ctx,
  const char *url,
  uint64_t charity_id);


/**
 * Response details for a DELETE /private/donau/$DONAU_SERIAL request.
 */
struct TALER_MERCHANT_DeletePrivateDonauResponse
{
  /**
   * HTTP response details.
   */
  struct TALER_MERCHANT_HttpResponse hr;
};


#ifndef TALER_MERCHANT_DELETE_PRIVATE_DONAU_RESULT_CLOSURE
/**
 * Type of the closure used by
 * the #TALER_MERCHANT_DeletePrivateDonauCallback.
 */
#define TALER_MERCHANT_DELETE_PRIVATE_DONAU_RESULT_CLOSURE void
#endif /* TALER_MERCHANT_DELETE_PRIVATE_DONAU_RESULT_CLOSURE */

/**
 * Type of the function that receives the result of a
 * DELETE /private/donau/$DONAU_SERIAL request.
 *
 * @param cls closure
 * @param result result returned by the HTTP server
 */
typedef void
(*TALER_MERCHANT_DeletePrivateDonauCallback)(
  TALER_MERCHANT_DELETE_PRIVATE_DONAU_RESULT_CLOSURE *cls,
  const struct TALER_MERCHANT_DeletePrivateDonauResponse *result);


/**
 * Start DELETE /private/donau/$DONAU_SERIAL operation.
 *
 * @param[in,out] handle operation to start
 * @param cb function to call with the result
 * @param cb_cls closure for @a cb
 * @return status code, #TALER_EC_NONE on success
 */
enum TALER_ErrorCode
TALER_MERCHANT_delete_private_donau_start (
  struct TALER_MERCHANT_DeletePrivateDonauHandle *handle,
  TALER_MERCHANT_DeletePrivateDonauCallback cb,
  TALER_MERCHANT_DELETE_PRIVATE_DONAU_RESULT_CLOSURE *cb_cls);


/**
 * Cancel DELETE /private/donau/$DONAU_SERIAL operation.
 * This function must not be called by clients after the
 * callback has been invoked.
 *
 * @param[in] handle operation to cancel
 */
void
TALER_MERCHANT_delete_private_donau_cancel (
  struct TALER_MERCHANT_DeletePrivateDonauHandle *handle);


#endif /* _TALER_MERCHANT__DELETE_PRIVATE_DONAU_DONAU_SERIAL_H */
