// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as ContentAPI from 'cloudflare/resources/snippets/content';
import * as RulesAPI from 'cloudflare/resources/snippets/rules';
import { multipartFormRequestOptions } from 'cloudflare/core';
export class Snippets extends APIResource {
    constructor() {
        super(...arguments);
        this.content = new ContentAPI.Content(this._client);
        this.rules = new RulesAPI.Rules(this._client);
    }
    update(zoneIdentifier, snippetName, body = {}, options) {
        if (isRequestOptions(body)) {
            return this.update(zoneIdentifier, snippetName, {}, body);
        }
        return this._client.put(`/zones/${zoneIdentifier}/snippets/${snippetName}`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
    }
    /**
     * All Snippets
     */
    list(zoneIdentifier, options) {
        return this._client.get(`/zones/${zoneIdentifier}/snippets`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Delete Snippet
     */
    delete(zoneIdentifier, snippetName, options) {
        return this._client.delete(`/zones/${zoneIdentifier}/snippets/${snippetName}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Snippet
     */
    get(zoneIdentifier, snippetName, options) {
        return this._client.get(`/zones/${zoneIdentifier}/snippets/${snippetName}`, options)._thenUnwrap((obj) => obj.result);
    }
}
(function (Snippets) {
    Snippets.Content = ContentAPI.Content;
    Snippets.Rules = RulesAPI.Rules;
})(Snippets || (Snippets = {}));
//# sourceMappingURL=snippets.mjs.map