UNPKG

@iotize/tap

Version:

IoTize Device client for Javascript

513 lines (501 loc) 11.7 kB
import { AbstractService, extendServiceContainer } from '@iotize/tap'; import { TapRequestFrame } from '@iotize/tap/client/api'; import { converters } from '@iotize/tap/service/core'; /** * Generated file. Do not edit */ var serviceConverters = /*#__PURE__*/Object.freeze({ __proto__: null }); /** * Generated file. Do not edit */ const allConverters = Object.assign(Object.assign({}, converters), serviceConverters); const SERVICE_CALLS = { getName: { method: TapRequestFrame.MethodType.GET, pathAlias: '/group/{groupId}/name', path: '/1025/{groupId}/0', responseBodyDecoder: allConverters.ascii, }, putName: { method: TapRequestFrame.MethodType.PUT, pathAlias: '/group/{groupId}/name', path: '/1025/{groupId}/0', bodyEncoder: allConverters.ascii, }, changePassword: { method: TapRequestFrame.MethodType.POST, pathAlias: '/group/{groupId}/password', path: '/1025/{groupId}/2', bodyEncoder: allConverters.ascii, }, changePasswordKey: { method: TapRequestFrame.MethodType.POST, pathAlias: '/group/{groupId}/password-key', path: '/1025/{groupId}/2', }, getSessionLifetime: { method: TapRequestFrame.MethodType.GET, pathAlias: '/group/{groupId}/session-lifetime', path: '/1025/{groupId}/4', responseBodyDecoder: allConverters.uint16, }, putSessionLifetime: { method: TapRequestFrame.MethodType.PUT, pathAlias: '/group/{groupId}/session-lifetime', path: '/1025/{groupId}/4', bodyEncoder: allConverters.uint16, }, getAlias: { method: TapRequestFrame.MethodType.GET, pathAlias: '/group/{groupId}/alias', path: '/1025/{groupId}/5', responseBodyDecoder: allConverters.uint16, }, putAlias: { method: TapRequestFrame.MethodType.PUT, pathAlias: '/group/{groupId}/alias', path: '/1025/{groupId}/5', bodyEncoder: allConverters.uint16, }, create: { method: TapRequestFrame.MethodType.POST, pathAlias: '/group/{groupId}/create', path: '/1025/{groupId}/65535', }, }; class GroupService extends AbstractService { constructor() { super(...arguments); this.resources = SERVICE_CALLS; } /** * Get the name of the group * * LWM2M path: /1025/{groupId}/0 * * @tapVersion(">=1.0") * @param groupId input * @return */ getName( /* * Group id */ groupId) { return this.serviceCallRunner.execute(this.getNameCall(groupId)); } /** * * * LWM2M path: /1025/{groupId}/0 * * @tapVersion(">=1.0") * @param groupId input * @return call options */ getNameCall( /* * Group id */ groupId) { const callOptions = Object.assign({}, this.resources.getName); callOptions.pathParameters = { groupId: groupId, }; return callOptions; } /** * Write group name * * LWM2M path: /1025/{groupId}/0 * * @tapVersion(">=1.0") * @param groupId input * @param name input * @return */ putName( /* * Group id to return */ groupId, /* * */ name) { return this.serviceCallRunner.execute(this.putNameCall(groupId, name)); } /** * * * LWM2M path: /1025/{groupId}/0 * * @tapVersion(">=1.0") * @param groupId input * @param name input * @return call options */ putNameCall( /* * Group id to return */ groupId, /* * */ name) { const callOptions = Object.assign({}, this.resources.putName); callOptions.body = name; callOptions.pathParameters = { groupId: groupId, }; return callOptions; } /** * Update password * * LWM2M path: /1025/{groupId}/2 * * @tapVersion(">=1.0") * @param groupId input * @param password input * @return */ changePassword( /* * Group id */ groupId, /* * */ password) { return this.serviceCallRunner.execute(this.changePasswordCall(groupId, password)); } /** * * * LWM2M path: /1025/{groupId}/2 * * @tapVersion(">=1.0") * @param groupId input * @param password input * @return call options */ changePasswordCall( /* * Group id */ groupId, /* * */ password) { const callOptions = Object.assign({}, this.resources.changePassword); callOptions.body = password; callOptions.pathParameters = { groupId: groupId, }; return callOptions; } /** * Change password using bytes data * * LWM2M path: /1025/{groupId}/2 * * @tapVersion(">=1.0") * @param groupId input * @param password input * @return */ changePasswordKey( /* * Group id */ groupId, /* * */ password) { return this.serviceCallRunner.execute(this.changePasswordKeyCall(groupId, password)); } /** * * * LWM2M path: /1025/{groupId}/2 * * @tapVersion(">=1.0") * @param groupId input * @param password input * @return call options */ changePasswordKeyCall( /* * Group id */ groupId, /* * */ password) { const callOptions = Object.assign({}, this.resources.changePasswordKey); callOptions.body = password; callOptions.pathParameters = { groupId: groupId, }; return callOptions; } /** * Get the maximum session lifetime * * LWM2M path: /1025/{groupId}/4 * * @tapVersion(">=1.0") * @param groupId input * @return */ getSessionLifetime( /* * Group id */ groupId) { return this.serviceCallRunner.execute(this.getSessionLifetimeCall(groupId)); } /** * * * LWM2M path: /1025/{groupId}/4 * * @tapVersion(">=1.0") * @param groupId input * @return call options */ getSessionLifetimeCall( /* * Group id */ groupId) { const callOptions = Object.assign({}, this.resources.getSessionLifetime); callOptions.pathParameters = { groupId: groupId, }; return callOptions; } /** * Write session lifetime in configuration * * LWM2M path: /1025/{groupId}/4 * * @tapVersion(">=1.0") * @param groupId input * @param value input * @return */ putSessionLifetime( /* * Group id to return */ groupId, /* * */ value) { return this.serviceCallRunner.execute(this.putSessionLifetimeCall(groupId, value)); } /** * * * LWM2M path: /1025/{groupId}/4 * * @tapVersion(">=1.0") * @param groupId input * @param value input * @return call options */ putSessionLifetimeCall( /* * Group id to return */ groupId, /* * */ value) { const callOptions = Object.assign({}, this.resources.putSessionLifetime); callOptions.body = value; callOptions.pathParameters = { groupId: groupId, }; return callOptions; } /** * Get group alias * * LWM2M path: /1025/{groupId}/5 * * @tapVersion(">=1.0") * @param groupId input * @return */ getAlias( /* * Group id */ groupId) { return this.serviceCallRunner.execute(this.getAliasCall(groupId)); } /** * * * LWM2M path: /1025/{groupId}/5 * * @tapVersion(">=1.0") * @param groupId input * @return call options */ getAliasCall( /* * Group id */ groupId) { const callOptions = Object.assign({}, this.resources.getAlias); callOptions.pathParameters = { groupId: groupId, }; return callOptions; } /** * Write group alias in configuration * * LWM2M path: /1025/{groupId}/5 * * @tapVersion(">=1.0") * @param groupId input * @param value input * @return */ putAlias( /* * Group id to return */ groupId, /* * */ value) { return this.serviceCallRunner.execute(this.putAliasCall(groupId, value)); } /** * * * LWM2M path: /1025/{groupId}/5 * * @tapVersion(">=1.0") * @param groupId input * @param value input * @return call options */ putAliasCall( /* * Group id to return */ groupId, /* * */ value) { const callOptions = Object.assign({}, this.resources.putAlias); callOptions.body = value; callOptions.pathParameters = { groupId: groupId, }; return callOptions; } /** * Create group * * LWM2M path: /1025/{groupId}/65535 * * @tapVersion(">=1.0") * @param groupId input * @return */ create( /* * Group id */ groupId) { return this.serviceCallRunner.execute(this.createCall(groupId)); } /** * * * LWM2M path: /1025/{groupId}/65535 * * @tapVersion(">=1.0") * @param groupId input * @return call options */ createCall( /* * Group id */ groupId) { const callOptions = Object.assign({}, this.resources.create); callOptions.pathParameters = { groupId: groupId, }; return callOptions; } } const _TAP_SERVICE_EXTENSION_GROUP_ = extendServiceContainer('group', GroupService); /** * Generated file. Do not edit */ /** * Generated file. Do not edit */ /** * Generated file. Do not edit */ const ResourceMetaData = { '/group/{groupId}/name': { put: { minApiVersion: 1.0, configModeRequired: false, schema: { type: 'string', maxLength: 16, }, }, }, '/group/{groupId}/session-lifetime': { put: { minApiVersion: 1.0, configModeRequired: false, schema: { type: 'integer', format: 'uint16', minimum: 1, }, }, }, '/group/{groupId}/alias': { put: { minApiVersion: 1.0, configModeRequired: true, schema: { type: 'integer', format: 'uint16', }, }, }, }; // import './lib/custom/extension'; /** * Generated bundle index. Do not edit. */ export { SERVICE_CALLS as GROUP_SERVICE_CALLS, ResourceMetaData as GroupResourceMetaData, GroupService, _TAP_SERVICE_EXTENSION_GROUP_, serviceConverters as groupConverters }; //# sourceMappingURL=iotize-tap-service-impl-group.js.map