"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Client = void 0;
const properties_1 = require("../properties");
const versioning_info_1 = require("../versioning-info");
class Client {
    constructor(request) {
        this.request = request;
    }
    async getEventDefinition(eventName) {
        return await this.request(`${properties_1.HUBSPOT_BASE_URL}/events/${versioning_info_1.HUBSPOT_CRM_API_VERSION}/event-definitions/${eventName}/?includeProperties=true`, {
            method: 'GET',
            skipResponseCloning: true,
            throwHttpErrors: false
        });
    }
    async send(json) {
        return this.request(`${properties_1.HUBSPOT_BASE_URL}/events/${versioning_info_1.HUBSPOT_CRM_API_VERSION}/send`, {
            method: 'POST',
            json
        });
    }
    async createEventDefinition(json) {
        return await this.request(`${properties_1.HUBSPOT_BASE_URL}/events/${versioning_info_1.HUBSPOT_CRM_API_VERSION}/event-definitions`, {
            method: 'POST',
            json,
            skipResponseCloning: true,
            throwHttpErrors: false
        });
    }
    async createPropertyDefinition(json, eventName) {
        return this.request(`${properties_1.HUBSPOT_BASE_URL}/events/${versioning_info_1.HUBSPOT_CRM_API_VERSION}/event-definitions/${eventName}/property`, {
            method: 'POST',
            json,
            throwHttpErrors: false
        });
    }
}
exports.Client = Client;
//# sourceMappingURL=client.js.map