cloudflare
Version:
The official TypeScript library for the Cloudflare API
45 lines • 1.53 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import * as TagsAPI from 'cloudflare/resources/zero-trust/access/tags';
import { SinglePage } from 'cloudflare/pagination';
export class Tags extends APIResource {
/**
* Create a tag
*/
create(identifier, body, options) {
return this._client.post(`/accounts/${identifier}/access/tags`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Update a tag
*/
update(identifier, tagName, body, options) {
return this._client.put(`/accounts/${identifier}/access/tags/${tagName}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* List tags
*/
list(identifier, options) {
return this._client.getAPIList(`/accounts/${identifier}/access/tags`, TagsSinglePage, options);
}
/**
* Delete a tag
*/
delete(identifier, name, options) {
return this._client.delete(`/accounts/${identifier}/access/tags/${name}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Get a tag
*/
get(identifier, name, options) {
return this._client.get(`/accounts/${identifier}/access/tags/${name}`, options)._thenUnwrap((obj) => obj.result);
}
}
export class TagsSinglePage extends SinglePage {
}
(function (Tags) {
Tags.TagsSinglePage = TagsAPI.TagsSinglePage;
})(Tags || (Tags = {}));
//# sourceMappingURL=tags.mjs.map