UNPKG

@canonical/jujulib

Version:
58 lines (57 loc) 1.69 kB
/** Juju Annotations version 2. This facade is available on: Models NOTE: This file was generated using the Juju schema from Juju 3.3 at the git SHA 65fa4c1ee5. Do not manually edit this file. */ import { autoBind } from "../../utils.js"; /** API implements the service interface and is the concrete implementation of the api end point. */ class AnnotationsV2 { constructor(transport, info) { this.NAME = "Annotations"; this.VERSION = 2; this._transport = transport; this._info = info; // Automatically bind all methods to instances. autoBind(this); } /** Get returns annotations for given entities. If annotations cannot be retrieved for a given entity, an error is returned. Each entity is treated independently and, hence, will fail or succeed independently. */ get(params) { return new Promise((resolve, reject) => { const req = { type: "Annotations", request: "Get", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** Set stores annotations for given entities */ set(params) { return new Promise((resolve, reject) => { const req = { type: "Annotations", request: "Set", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } } AnnotationsV2.NAME = "Annotations"; AnnotationsV2.VERSION = 2; export default AnnotationsV2; //# sourceMappingURL=AnnotationsV2.js.map