@iotize/tap
Version:
IoTize Device client for Javascript
473 lines (462 loc) • 10.9 kB
JavaScript
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 = {
getIp: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/ethernet/ip',
path: '/1024//85',
responseBodyDecoder: allConverters.stringIpv4,
},
putIp: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/ethernet/ip',
path: '/1024//85',
bodyEncoder: allConverters.stringIpv4,
},
getGatewayIp: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/ethernet/gateway-ip',
path: '/1024//86',
responseBodyDecoder: allConverters.stringIpv4,
},
putGatewayIp: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/ethernet/gateway-ip',
path: '/1024//86',
bodyEncoder: allConverters.stringIpv4,
},
getIpMask: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/ethernet/ip-mask',
path: '/1024//87',
responseBodyDecoder: allConverters.stringIpv4mask,
},
putIpMask: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/ethernet/ip-mask',
path: '/1024//87',
bodyEncoder: allConverters.stringIpv4mask,
},
getHostname: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/ethernet/hostname',
path: '/1024//93',
responseBodyDecoder: allConverters.ascii,
},
getDnsIp: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/ethernet/dns-ip',
path: '/1024//124',
responseBodyDecoder: allConverters.stringIpv4,
},
putDnsIp: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/ethernet/dns-ip',
path: '/1024//124',
bodyEncoder: allConverters.stringIpv4,
},
getEnabled: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/ethernet/enabled',
path: '/1024//130',
responseBodyDecoder: allConverters.boolean,
},
putEnabled: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/ethernet/enabled',
path: '/1024//130',
bodyEncoder: allConverters.boolean,
},
};
class EthernetService extends AbstractService {
constructor() {
super(...arguments);
this.resources = SERVICE_CALLS;
}
/**
* Get Ethernet IP
*
* LWM2M path: /1024//85
*
* @tapVersion(">=2.7")
* @return
*/
getIp() {
return this.serviceCallRunner.execute(this.getIpCall());
}
/**
*
*
* LWM2M path: /1024//85
*
* @tapVersion(">=2.7")
* @return call options
*/
getIpCall() {
const callOptions = Object.assign({}, this.resources.getIp);
return callOptions;
}
/**
* Set ethernet IP address
*
* LWM2M path: /1024//85
*
* @tapVersion(">=2.7")
* @param data input
* @return
*/
putIp(
/*
*
*/
data) {
return this.serviceCallRunner.execute(this.putIpCall(data));
}
/**
*
*
* LWM2M path: /1024//85
*
* @tapVersion(">=2.7")
* @param data input
* @return call options
*/
putIpCall(
/*
*
*/
data) {
const callOptions = Object.assign({}, this.resources.putIp);
callOptions.body = data;
return callOptions;
}
/**
* Get gateway IP address
*
* LWM2M path: /1024//86
*
* @tapVersion(">=2.7")
* @return
*/
getGatewayIp() {
return this.serviceCallRunner.execute(this.getGatewayIpCall());
}
/**
*
*
* LWM2M path: /1024//86
*
* @tapVersion(">=2.7")
* @return call options
*/
getGatewayIpCall() {
const callOptions = Object.assign({}, this.resources.getGatewayIp);
return callOptions;
}
/**
* Write gateway IP address
*
* LWM2M path: /1024//86
*
* @tapVersion(">=2.7")
* @param data input
* @return
*/
putGatewayIp(
/*
*
*/
data) {
return this.serviceCallRunner.execute(this.putGatewayIpCall(data));
}
/**
*
*
* LWM2M path: /1024//86
*
* @tapVersion(">=2.7")
* @param data input
* @return call options
*/
putGatewayIpCall(
/*
*
*/
data) {
const callOptions = Object.assign({}, this.resources.putGatewayIp);
callOptions.body = data;
return callOptions;
}
/**
* Get ethernet gateway IP mask
*
* LWM2M path: /1024//87
*
* @tapVersion(">=2.7")
* @return
*/
getIpMask() {
return this.serviceCallRunner.execute(this.getIpMaskCall());
}
/**
*
*
* LWM2M path: /1024//87
*
* @tapVersion(">=2.7")
* @return call options
*/
getIpMaskCall() {
const callOptions = Object.assign({}, this.resources.getIpMask);
return callOptions;
}
/**
* Write ethernet gateway IP mask
*
* LWM2M path: /1024//87
*
* @tapVersion(">=2.7")
* @param data input
* @return
*/
putIpMask(
/*
*
*/
data) {
return this.serviceCallRunner.execute(this.putIpMaskCall(data));
}
/**
*
*
* LWM2M path: /1024//87
*
* @tapVersion(">=2.7")
* @param data input
* @return call options
*/
putIpMaskCall(
/*
*
*/
data) {
const callOptions = Object.assign({}, this.resources.putIpMask);
callOptions.body = data;
return callOptions;
}
/**
* Get ethernet hostname
*
* LWM2M path: /1024//93
*
* @tapVersion(">=2.7")
* @return
*/
getHostname() {
return this.serviceCallRunner.execute(this.getHostnameCall());
}
/**
*
*
* LWM2M path: /1024//93
*
* @tapVersion(">=2.7")
* @return call options
*/
getHostnameCall() {
const callOptions = Object.assign({}, this.resources.getHostname);
return callOptions;
}
/**
* Get ethernet network dns ip
*
* LWM2M path: /1024//124
*
* @tapVersion(">=2.7")
* @return
*/
getDnsIp() {
return this.serviceCallRunner.execute(this.getDnsIpCall());
}
/**
*
*
* LWM2M path: /1024//124
*
* @tapVersion(">=2.7")
* @return call options
*/
getDnsIpCall() {
const callOptions = Object.assign({}, this.resources.getDnsIp);
return callOptions;
}
/**
* Write ethernet network dns ip
*
* LWM2M path: /1024//124
*
* @tapVersion(">=2.7")
* @param key input
* @return
*/
putDnsIp(
/*
*
*/
key) {
return this.serviceCallRunner.execute(this.putDnsIpCall(key));
}
/**
*
*
* LWM2M path: /1024//124
*
* @tapVersion(">=2.7")
* @param key input
* @return call options
*/
putDnsIpCall(
/*
*
*/
key) {
const callOptions = Object.assign({}, this.resources.putDnsIp);
callOptions.body = key;
return callOptions;
}
/**
* Get Ethernet enable status
*
* LWM2M path: /1024//130
*
* @tapVersion(">=2.7")
* @return
*/
getEnabled() {
return this.serviceCallRunner.execute(this.getEnabledCall());
}
/**
*
*
* LWM2M path: /1024//130
*
* @tapVersion(">=2.7")
* @return call options
*/
getEnabledCall() {
const callOptions = Object.assign({}, this.resources.getEnabled);
return callOptions;
}
/**
* Write Ethernet enable status
*
* LWM2M path: /1024//130
*
* @tapVersion(">=2.7")
* @param isEnabled input
* @return
*/
putEnabled(
/*
*
*/
isEnabled) {
return this.serviceCallRunner.execute(this.putEnabledCall(isEnabled));
}
/**
*
*
* LWM2M path: /1024//130
*
* @tapVersion(">=2.7")
* @param isEnabled input
* @return call options
*/
putEnabledCall(
/*
*
*/
isEnabled) {
const callOptions = Object.assign({}, this.resources.putEnabled);
callOptions.body = isEnabled;
return callOptions;
}
}
const _TAP_SERVICE_EXTENSION_ETHERNET_ = extendServiceContainer('ethernet', EthernetService);
/**
* Generated file. Do not edit
*/
/**
* Generated file. Do not edit
*/
/**
* Generated file. Do not edit
*/
const ResourceMetaData = {
'/ethernet/ip': {
put: {
minApiVersion: 2.7,
configModeRequired: false,
schema: {
type: 'string',
format: 'ipv4',
examples: ['0.0.0.0', '192.168.1.134'],
},
},
},
'/ethernet/gateway-ip': {
put: {
minApiVersion: 2.7,
configModeRequired: false,
schema: {
type: 'string',
format: 'ipv4',
},
},
},
'/ethernet/ip-mask': {
put: {
minApiVersion: 2.7,
configModeRequired: false,
schema: {
type: 'string',
format: 'ipv4mask',
},
},
},
'/ethernet/dns-ip': {
put: {
minApiVersion: 2.7,
configModeRequired: false,
schema: {
type: 'string',
format: 'ipv4',
},
},
},
'/ethernet/enabled': {
put: {
minApiVersion: 2.7,
configModeRequired: false,
schema: {
type: 'boolean',
},
},
},
};
/**
* Generated bundle index. Do not edit.
*/
export { SERVICE_CALLS as ETHERNET_SERVICE_CALLS, ResourceMetaData as EthernetResourceMetaData, EthernetService, _TAP_SERVICE_EXTENSION_ETHERNET_, serviceConverters as ethernetConverters };
//# sourceMappingURL=iotize-tap-service-impl-ethernet.js.map