UNPKG

originstamp-client-fetch

Version:
124 lines (99 loc) 5.47 kB
/* tslint:disable */ /* eslint-disable */ /** * OriginStamp Timestamping * OriginStamp Timestamping leverages decentralized blockchain technology to create anonymous, tamper-proof timestamps for digital content. This service enables users to timestamp files, emails, or plain text, and store the resulting hashes on the blockchain. Users can also retrieve and verify timestamps that have been committed. The trusted timestamping mechanism ensures that a hash fingerprint can be generated and used as proof that specific data existed at a given point in time. * * The version of the OpenAPI document: 1.0.0 * Contact: support@originstamp.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import type { ErrorMessage, Notification, ProofWebhook, TimestampData, } from '../models/index'; import { ErrorMessageFromJSON, ErrorMessageToJSON, NotificationFromJSON, NotificationToJSON, ProofWebhookFromJSON, ProofWebhookToJSON, TimestampDataFromJSON, TimestampDataToJSON, } from '../models/index'; export interface GetProofWebhookExampleRequest { notification?: Notification; } export interface GetTreeWebhookExampleRequest { notification?: Notification; } /** * */ export class WebhookApi extends runtime.BaseAPI { /** * Test interface that simulates a proof webhook. When called, it immediately returns a static example of a proof webhook payload and also sends this payload as a POST request to the `target` URL, if available. This endpoint is intended for testing webhook receivers and validating integration workflows. * Webhook for Proof */ async getProofWebhookExampleRaw(requestParameters: GetProofWebhookExampleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProofWebhook>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // API_Key_Authorization authentication } let urlPath = `/v1/webhook/proof`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: NotificationToJSON(requestParameters['notification']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ProofWebhookFromJSON(jsonValue)); } /** * Test interface that simulates a proof webhook. When called, it immediately returns a static example of a proof webhook payload and also sends this payload as a POST request to the `target` URL, if available. This endpoint is intended for testing webhook receivers and validating integration workflows. * Webhook for Proof */ async getProofWebhookExample(requestParameters: GetProofWebhookExampleRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProofWebhook> { const response = await this.getProofWebhookExampleRaw(requestParameters, initOverrides); return await response.value(); } /** * Test interface that simulates a verified tree webhook. When called, it immediately returns a static example of a verified tree response and also triggers a webhook callback to the `target` URL, if available. This is useful for testing webhook integrations without waiting for actual blockchain verification. * Webhook for Tree */ async getTreeWebhookExampleRaw(requestParameters: GetTreeWebhookExampleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TimestampData>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // API_Key_Authorization authentication } let urlPath = `/v1/webhook/tree`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: NotificationToJSON(requestParameters['notification']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => TimestampDataFromJSON(jsonValue)); } /** * Test interface that simulates a verified tree webhook. When called, it immediately returns a static example of a verified tree response and also triggers a webhook callback to the `target` URL, if available. This is useful for testing webhook integrations without waiting for actual blockchain verification. * Webhook for Tree */ async getTreeWebhookExample(requestParameters: GetTreeWebhookExampleRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TimestampData> { const response = await this.getTreeWebhookExampleRaw(requestParameters, initOverrides); return await response.value(); } }