2024-06-05 10:06:41 +02:00
|
|
|
/* tslint:disable */
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
/**
|
|
|
|
|
* Signal Cli REST API
|
|
|
|
|
* This is the Signal Cli REST API documentation.
|
|
|
|
|
*
|
|
|
|
|
* The version of the OpenAPI document: 1.0
|
2024-06-28 07:49:39 +02:00
|
|
|
*
|
2024-06-05 10:06:41 +02:00
|
|
|
*
|
|
|
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
|
|
|
* https://openapi-generator.tech
|
|
|
|
|
* Do not edit the class manually.
|
|
|
|
|
*/
|
|
|
|
|
|
2024-06-28 07:49:39 +02:00
|
|
|
import * as runtime from "../runtime.js";
|
|
|
|
|
import type { ApiError, ApiReceipt } from "../models/index.js";
|
2024-06-05 10:06:41 +02:00
|
|
|
import {
|
2024-06-28 07:49:39 +02:00
|
|
|
ApiErrorFromJSON,
|
|
|
|
|
ApiErrorToJSON,
|
|
|
|
|
ApiReceiptFromJSON,
|
|
|
|
|
ApiReceiptToJSON,
|
|
|
|
|
} from "../models/index.js";
|
2024-06-05 10:06:41 +02:00
|
|
|
|
|
|
|
|
export interface V1ReceiptsNumberPostRequest {
|
2024-06-28 07:49:39 +02:00
|
|
|
data: ApiReceipt;
|
2024-06-05 10:06:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-28 07:49:39 +02:00
|
|
|
*
|
2024-06-05 10:06:41 +02:00
|
|
|
*/
|
|
|
|
|
export class ReceiptsApi extends runtime.BaseAPI {
|
2024-06-28 07:49:39 +02:00
|
|
|
/**
|
|
|
|
|
* Send a read or viewed receipt
|
|
|
|
|
* Send a receipt.
|
|
|
|
|
*/
|
|
|
|
|
async v1ReceiptsNumberPostRaw(
|
|
|
|
|
requestParameters: V1ReceiptsNumberPostRequest,
|
|
|
|
|
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
|
|
|
|
): Promise<runtime.ApiResponse<string>> {
|
|
|
|
|
if (requestParameters["data"] == null) {
|
|
|
|
|
throw new runtime.RequiredError(
|
|
|
|
|
"data",
|
|
|
|
|
'Required parameter "data" was null or undefined when calling v1ReceiptsNumberPost().',
|
|
|
|
|
);
|
|
|
|
|
}
|
2024-06-05 10:06:41 +02:00
|
|
|
|
2024-06-28 07:49:39 +02:00
|
|
|
const queryParameters: any = {};
|
2024-06-05 10:06:41 +02:00
|
|
|
|
2024-06-28 07:49:39 +02:00
|
|
|
const headerParameters: runtime.HTTPHeaders = {};
|
2024-06-05 10:06:41 +02:00
|
|
|
|
2024-06-28 07:49:39 +02:00
|
|
|
headerParameters["Content-Type"] = "application/json";
|
2024-06-05 10:06:41 +02:00
|
|
|
|
2024-06-28 07:49:39 +02:00
|
|
|
const response = await this.request(
|
|
|
|
|
{
|
|
|
|
|
path: `/v1/receipts/{number}`,
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: headerParameters,
|
|
|
|
|
query: queryParameters,
|
|
|
|
|
body: ApiReceiptToJSON(requestParameters["data"]),
|
|
|
|
|
},
|
|
|
|
|
initOverrides,
|
|
|
|
|
);
|
2024-06-05 10:06:41 +02:00
|
|
|
|
2024-06-28 07:49:39 +02:00
|
|
|
if (this.isJsonMime(response.headers.get("content-type"))) {
|
|
|
|
|
return new runtime.JSONApiResponse<string>(response);
|
|
|
|
|
} else {
|
|
|
|
|
return new runtime.TextApiResponse(response) as any;
|
2024-06-05 10:06:41 +02:00
|
|
|
}
|
2024-06-28 07:49:39 +02:00
|
|
|
}
|
2024-06-05 10:06:41 +02:00
|
|
|
|
2024-06-28 07:49:39 +02:00
|
|
|
/**
|
|
|
|
|
* Send a read or viewed receipt
|
|
|
|
|
* Send a receipt.
|
|
|
|
|
*/
|
|
|
|
|
async v1ReceiptsNumberPost(
|
|
|
|
|
requestParameters: V1ReceiptsNumberPostRequest,
|
|
|
|
|
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
|
|
|
|
): Promise<string> {
|
|
|
|
|
const response = await this.v1ReceiptsNumberPostRaw(
|
|
|
|
|
requestParameters,
|
|
|
|
|
initOverrides,
|
|
|
|
|
);
|
|
|
|
|
return await response.value();
|
|
|
|
|
}
|
2024-06-05 10:06:41 +02:00
|
|
|
}
|