// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as ContentAPI from 'cloudflaredev/resources/snippets/content';
import * as RulesAPI from 'cloudflaredev/resources/snippets/rules';
import { multipartFormRequestOptions } from 'cloudflaredev/core';
import { SinglePage } from 'cloudflaredev/pagination';
export class Snippets extends APIResource {
    constructor() {
        super(...arguments);
        this.content = new ContentAPI.Content(this._client);
        this.rules = new RulesAPI.Rules(this._client);
    }
    /**
     * Put Snippet
     */
    update(snippetName, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/snippets/${snippetName}`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
    }
    /**
     * All Snippets
     */
    list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/snippets`, SnippetsSinglePage, options);
    }
    /**
     * Delete Snippet
     */
    delete(snippetName, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/snippets/${snippetName}`, options);
    }
    /**
     * Snippet
     */
    get(snippetName, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/snippets/${snippetName}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class SnippetsSinglePage extends SinglePage {
}
(function (Snippets) {
    Snippets.Content = ContentAPI.Content;
    Snippets.Rules = RulesAPI.Rules;
    Snippets.RuleListResponsesSinglePage = RulesAPI.RuleListResponsesSinglePage;
})(Snippets || (Snippets = {}));
//# sourceMappingURL=snippets.mjs.map