From 0dcbd0b8d41c942bf506e4b24f90febe265b4f70 Mon Sep 17 00:00:00 2001 From: aws Date: Thu, 17 Sep 2020 02:07:22 +0000 Subject: [PATCH] Release of Version 1.7.0 --- aws-greengrass-core-sdk/package.json | 2 +- aws-greengrass-core-sdk/secretsmanager.js | 23 +- .../stream-manager/client.js | 84 +- .../stream-manager/data/index.js | 9540 +++++++++++----- .../stream-manager/exceptions.js | 6 + .../stream-manager/util.js | 191 +- .../stream-manager/utilInternal.js | 207 + docs/aws-greengrass-core-sdk.IotData.html | 4 +- docs/aws-greengrass-core-sdk.Lambda.html | 4 +- ...ws-greengrass-core-sdk.SecretsManager.html | 31 +- ...dk.StreamManager.AppendMessageRequest.html | 26 +- ...k.StreamManager.AppendMessageResponse.html | 32 +- ...-sdk.StreamManager.AssetPropertyValue.html | 1107 ++ ...core-sdk.StreamManager.ConnectRequest.html | 332 +- ...ore-sdk.StreamManager.ConnectResponse.html | 50 +- ...eamManager.CreateMessageStreamRequest.html | 20 +- ...amManager.CreateMessageStreamResponse.html | 26 +- ...eamManager.DeleteMessageStreamRequest.html | 20 +- ...amManager.DeleteMessageStreamResponse.html | 26 +- ...mManager.DescribeMessageStreamRequest.html | 20 +- ...Manager.DescribeMessageStreamResponse.html | 32 +- ...rass-core-sdk.StreamManager.EventType.html | 243 + ...re-sdk.StreamManager.ExportDefinition.html | 684 +- ...s-core-sdk.StreamManager.ExportFormat.html | 313 + ...ass-core-sdk.StreamManager.HTTPConfig.html | 1168 +- ...-sdk.StreamManager.IoTAnalyticsConfig.html | 740 +- ...e-sdk.StreamManager.IoTSiteWiseConfig.html | 2022 ++++ ...-core-sdk.StreamManager.KinesisConfig.html | 740 +- ...-sdk.StreamManager.ListStreamsRequest.html | 12 +- ...sdk.StreamManager.ListStreamsResponse.html | 32 +- ...ngrass-core-sdk.StreamManager.Message.html | 32 +- ...s-core-sdk.StreamManager.MessageFrame.html | 20 +- ...StreamManager.MessageStreamDefinition.html | 56 +- ...nfo-MessageStreamInfo._exportStatuses.html | 68 +- ...Info-MessageStreamInfo._storageStatus.html | 6 +- ...e-sdk.StreamManager.MessageStreamInfo.html | 616 +- ...rass-core-sdk.StreamManager.Operation.html | 242 +- ...ss-core-sdk.StreamManager.Persistence.html | 10 +- ...eamManager.PutAssetPropertyValueEntry.html | 1707 +++ ...ngrass-core-sdk.StreamManager.Quality.html | 375 + ...sdk.StreamManager.ReadMessagesOptions.html | 30 +- ...sdk.StreamManager.ReadMessagesRequest.html | 24 +- ...dk.StreamManager.ReadMessagesResponse.html | 32 +- ...-sdk.StreamManager.ResponseStatusCode.html | 215 +- ....StreamManager.S3ExportTaskDefinition.html | 1413 +++ ...eamManager.S3ExportTaskExecutorConfig.html | 1710 +++ ...engrass-core-sdk.StreamManager.Status.html | 515 + ...s-core-sdk.StreamManager.StatusConfig.html | 810 ++ ...-core-sdk.StreamManager.StatusContext.html | 1407 +++ ...ss-core-sdk.StreamManager.StatusLevel.html | 515 + ...-core-sdk.StreamManager.StatusMessage.html | 1991 ++++ ...core-sdk.StreamManager.StrategyOnFull.html | 10 +- ...sdk.StreamManager.StreamManagerClient.html | 180 +- ...ss-core-sdk.StreamManager.TimeInNanos.html | 807 ++ ...re-sdk.StreamManager.TraceableRequest.html | 503 + ...k.StreamManager.UnknownOperationError.html | 1095 ++ ...eamManager.UpdateMessageStreamRequest.html | 799 ++ ...amManager.UpdateMessageStreamResponse.html | 1095 ++ ...ngrass-core-sdk.StreamManager.Variant.html | 1407 +++ ...ss-core-sdk.StreamManager.VersionInfo.html | 243 + ...aws-greengrass-core-sdk.StreamManager.html | 64 +- docs/aws-greengrass-core-sdk.html | 4 +- docs/global.html | 512 +- docs/index.html | 12 +- docs/index.js.html | 4 +- docs/iotdata.js.html | 4 +- docs/lambda.js.html | 4 +- docs/secretsmanager.js.html | 27 +- docs/stream-manager_client.js.html | 88 +- docs/stream-manager_data_index.js.html | 9544 ++++++++++++----- docs/stream-manager_index.js.html | 4 +- docs/stream-manager_util.js.html | 86 + .../StreamManagerIoTSiteWise/index.js | 95 + greengrassExamples/StreamManagerS3/index.js | 118 + readme.md | 16 + 75 files changed, 39874 insertions(+), 6378 deletions(-) create mode 100644 aws-greengrass-core-sdk/stream-manager/utilInternal.js create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.AssetPropertyValue.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.EventType.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.ExportFormat.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.Quality.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.Status.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.StatusConfig.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.StatusContext.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.StatusLevel.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.StatusMessage.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.TimeInNanos.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.TraceableRequest.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.UnknownOperationError.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.Variant.html create mode 100644 docs/aws-greengrass-core-sdk.StreamManager.VersionInfo.html create mode 100644 docs/stream-manager_util.js.html create mode 100644 greengrassExamples/StreamManagerIoTSiteWise/index.js create mode 100644 greengrassExamples/StreamManagerS3/index.js diff --git a/aws-greengrass-core-sdk/package.json b/aws-greengrass-core-sdk/package.json index 5586008..cba6da2 100644 --- a/aws-greengrass-core-sdk/package.json +++ b/aws-greengrass-core-sdk/package.json @@ -1,6 +1,6 @@ { "name": "aws-greengrass-core-sdk", - "version": "1.6.1", + "version": "1.7.0", "main": "index.js", "dependencies": { "cbor": "5.0.1" diff --git a/aws-greengrass-core-sdk/secretsmanager.js b/aws-greengrass-core-sdk/secretsmanager.js index ff1a673..5e02568 100644 --- a/aws-greengrass-core-sdk/secretsmanager.js +++ b/aws-greengrass-core-sdk/secretsmanager.js @@ -13,6 +13,7 @@ const KEY_VERSION_STAGE = 'VersionStage'; const KEY_SECRET_ARN = 'ARN'; const KEY_SECRET_NAME = 'Name'; const KEY_CREATED_DATE = 'CreatedDate'; +const KEY_JSON_RESULT_FLAG = 'DeStringifyResultFlag'; const { envVars } = GreengrassCommon; const { SECRETS_MANAGER_FUNCTION_ARN } = envVars; @@ -38,14 +39,14 @@ class SecretsManager { * * @callback secretsManagerCallback * @param err {Error} The error object returned from the request. Set to null if the request is successful. - * @param data {String} The json-serialized data returned from the request. Set to null if a request error occurs. This string can be parsed to get the Object with the following info: - * data.ARN {String} The ARN of the secret. - * data.Name {String} The friendly name of the secret. - * data.VersionId {String} The unique identifier of this version of the secret. - * data.SecretBinary {Buffer|TypedArray|Blob|String} The decrypted part of the protected secret information that was originally provided as binary data in the form of a byte array. + * @param data {Object|String} data returned from the request. Return type is decided on DeStringifyResultFlag flag in request. Set to null if a request error occurs. + * @param data.ARN {String} The ARN of the secret. + * @param data.Name {String} The friendly name of the secret. + * @param data.VersionId {String} The unique identifier of this version of the secret. + * @param data.SecretBinary {Buffer|TypedArray|Blob|String} The decrypted part of the protected secret information that was originally provided as binary data in the form of a byte array. * The response parameter represents the binary data as a base64-encoded string. - * data.SecretString {String} The decrypted part of the protected secret information that was originally provided as a string. - * data.VersionStages {String[]} Specifies the secret version that you want to retrieve by the staging label attached to the version. + * @param data.SecretString {String} The decrypted part of the protected secret information that was originally provided as a string. + * @param data.VersionStages {String[]} Specifies the secret version that you want to retrieve by the staging label attached to the version. *
Staging labels are used to keep track of different versions during the rotation process. */ @@ -56,6 +57,7 @@ class SecretsManager { * @param params.SecretId {String} Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret. * @param params.VersionStage {String} Specifies the secret version that you want to retrieve by the staging label attached to the version. *
Staging labels are used to keep track of different versions during the rotation process. + * @param params.DeStringifyResultFlag {boolean} Optional Flag to decide the return type from getSecretValue. If set, it returns de-serialized data object, otherwise it returns stringified response. * @param callback {secretsManagerCallback} The callback. * * @example Retrieving a local secret value @@ -74,6 +76,7 @@ class SecretsManager { const secretId = Util.getParameter(params, KEY_SECRET_ID); const versionId = Util.getParameter(params, KEY_VERSION_ID); const versionStage = Util.getParameter(params, KEY_VERSION_STAGE); + const isJSONResultFlagSet = Util.getParameter(params, KEY_JSON_RESULT_FLAG); if (secretId === undefined) { callback(new Error(`"${KEY_SECRET_ID}" is a required parameter`), null); @@ -102,7 +105,11 @@ class SecretsManager { if (err) { callback(err, null); // an error occurred } else if (SecretsManager._is200Response(data.Payload)) { - callback(null, data.Payload); // successful response + // successful response + if (isJSONResultFlagSet) { + callback(null, JSON.parse(data.Payload)); + } + callback(null, data.Payload); } else { callback(new Error(JSON.stringify(data.Payload)), null); // error response } diff --git a/aws-greengrass-core-sdk/stream-manager/client.js b/aws-greengrass-core-sdk/stream-manager/client.js index 2f88686..60ab2cb 100644 --- a/aws-greengrass-core-sdk/stream-manager/client.js +++ b/aws-greengrass-core-sdk/stream-manager/client.js @@ -9,11 +9,20 @@ const cbor = require('cbor'); const net = require('net'); const smData = require('aws-greengrass-core-sdk/stream-manager/data'); const exceptions = require('./exceptions'); +const utilInternal = require('./utilInternal'); const util = require('./util'); // Consts -const PROTOCOL_VERSION = '1.0.0'; -const SDK_VERSION = '1.0.0'; + +// Version of the Java SDK. +// NOTE: When you bump this version, +// consider adding the old version to olderSupportedProtocolVersions list (if you intend to support it) +const SDK_VERSION = '1.1.0'; + +// List of supported protocol protocol. +// These are meant to be used for graceful degradation if the server does not support the current SDK version. +const OLD_SUPPORTED_PROTOCOL_VERSIONS = ['1.0.0']; + const CONNECT_VERSION = 1; const removeFromArray = (arr, f) => { @@ -73,6 +82,7 @@ class StreamManagerClient { error: console.error, debug: console.debug, info: console.info, + warn: console.warn, }, }; @@ -132,7 +142,7 @@ class StreamManagerClient { // Set high water mark so that we can read 1 full packet (1GB) at a time instead of needing to // try to read multiple times and combine the results. The HWM adjusts how much the socket will // buffer when reading. - readableHighWaterMark: util.MAX_PACKET_SIZE, + readableHighWaterMark: utilInternal.MAX_PACKET_SIZE, }, async () => { try { // Connection started @@ -140,17 +150,18 @@ class StreamManagerClient { this.#connected = false; const request = new smData.ConnectRequest() - .withProtocolVersion(PROTOCOL_VERSION) + .withProtocolVersion(smData.VersionInfo.PROTOCOL_VERSION.asMap()) .withSdkVersion(SDK_VERSION) .withAuthToken(this.#authToken) - .withRequestId(util.uuidv4()); + .withOtherSupportedProtocolVersions(OLD_SUPPORTED_PROTOCOL_VERSIONS) + .withRequestId(utilInternal.uuidv4()); // Write the connect version - newSock.write(util.intToBuffer(CONNECT_VERSION, 1)); + newSock.write(utilInternal.intToBuffer(CONNECT_VERSION, 1)); // Write request to socket const frame = new smData.MessageFrame(smData.Operation.Connect, cbor.encode(request.asMap())); - const byteFrame = util.encodeFrame(frame); + const byteFrame = utilInternal.encodeFrame(frame); newSock.write(byteFrame.header); newSock.write(byteFrame.payload); @@ -233,7 +244,7 @@ class StreamManagerClient { this.__handleReadResponse(cbor.decodeFirstSync(frame.payload), frame); } else { // Read connect version - const connectResponseVersion = util.intFromBuffer(await this.__readSocket(1, socket)); + const connectResponseVersion = utilInternal.intFromBuffer(await this.__readSocket(1, socket)); if (connectResponseVersion !== CONNECT_VERSION) { this.#logger.error('Unexpected response from the server, Connect version:', connectResponseVersion); throw new exceptions.ConnectFailedException('Failed to establish connection with the server'); @@ -255,6 +266,14 @@ class StreamManagerClient { this.#logger.error('Received ConnectResponse with unexpected status', response.status); throw new exceptions.ConnectFailedException('Failed to establish connection with the server'); } + + if (response.protocolVersion !== smData.VersionInfo.PROTOCOL_VERSION.asMap()) { + this.#logger.warn('SDK with version %s using Protocol version %s is not fully compatible with ' + + 'Server with version %s. ' + + 'Client has connected in a compatibility mode using protocol version %s. ' + + 'Some features will not work as expected', SDK_VERSION, smData.VersionInfo.PROTOCOL_VERSION.asMap(), + response.serverVersion, response.protocolVersion); + } } // Put ourselves back in the event loop to handle the next messages @@ -271,8 +290,8 @@ class StreamManagerClient { } async __readMessageFrame(socket) { - const length = util.intFromBuffer(await this.__readSocket(4, socket)); - const operation = util.intFromBuffer(await this.__readSocket(1, socket)); + const length = utilInternal.intFromBuffer(await this.__readSocket(4, socket)); + const operation = utilInternal.intFromBuffer(await this.__readSocket(1, socket)); let op = smData.Operation.fromMap(operation); if (typeof op === 'undefined') { @@ -292,6 +311,10 @@ class StreamManagerClient { const response = smData.CreateMessageStreamResponse.fromMap(data); this.#logger.debug('Received CreateMessageStreamResponse from server', frame); this.#requestMap[response.requestId](response); + } else if (frame.operation === smData.Operation.UpdateMessageStreamResponse) { + const response = smData.UpdateMessageStreamResponse.fromMap(data); + this.#logger.debug('Received UpdateMessageStreamResponse from server', frame); + this.#requestMap[response.requestId](response); } else if (frame.operation === smData.Operation.DeleteMessageStreamResponse) { const response = smData.DeleteMessageStreamResponse.fromMap(data); this.#logger.debug('Received DeleteMessageStreamResponse from server', frame); @@ -308,6 +331,10 @@ class StreamManagerClient { const response = smData.DescribeMessageStreamResponse.fromMap(data); this.#logger.debug('Received DescribeMessageStreamResponse from server', frame); this.#requestMap[response.requestId](response); + } else if (frame.operation === smData.Operation.UnknownOperationError) { + this.#logger.error('Received response with UnknownOperation Error from server. You should update your server version'); + const response = smData.UnknownOperationError.fromMap(data); + this.#requestMap[response.requestId](response); } else if (frame.operation === smData.Operation.Unknown) { this.#logger.error('Received response with unknown operation from server', frame); try { @@ -330,10 +357,10 @@ class StreamManagerClient { if (data.requestId === null) { // eslint-disable-next-line no-param-reassign - data.requestId = util.uuidv4(); + data.requestId = utilInternal.uuidv4(); } - const validation = util.isInvalid(data); + const validation = utilInternal.isInvalid(data); if (validation) { throw new exceptions.ValidationException(validation); } @@ -357,7 +384,7 @@ class StreamManagerClient { // Write request to socket const frame = new smData.MessageFrame(operation, cbor.encode(data.asMap())); - const byteFrame = util.encodeFrame(frame); + const byteFrame = utilInternal.encodeFrame(frame); this.#socket.write(byteFrame.header); this.#socket.write(byteFrame.payload); @@ -369,7 +396,7 @@ class StreamManagerClient { if (!(options instanceof smData.ReadMessagesOptions)) { throw new exceptions.ValidationException('options argument to read_messages must be a ReadMessageOptions object'); } - const validation = util.isInvalid(options); + const validation = utilInternal.isInvalid(options); if (validation) { throw new exceptions.ValidationException(validation); } @@ -395,7 +422,7 @@ class StreamManagerClient { async appendMessage(streamName, data) { const request = new smData.AppendMessageRequest().withName(streamName).withPayload(data); const result = await this._sendAndReceive(smData.Operation.AppendMessage, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); return result.sequenceNumber; } @@ -411,7 +438,23 @@ class StreamManagerClient { } const request = new smData.CreateMessageStreamRequest().withDefinition(definition); const result = await this._sendAndReceive(smData.Operation.CreateMessageStream, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); + } + + /** + * Updates a message stream with the new definition. + * Minimum version requirements: StreamManager server version 1.1 (or AWS IoT Greengrass Core 1.11.0) + * + * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @returns {Promise} + */ + async updateMessageStream(definition) { + if (!(definition instanceof smData.MessageStreamDefinition)) { + throw new exceptions.ValidationException('definition argument to update_stream must be a MessageStreamDefinition object'); + } + const request = new smData.UpdateMessageStreamRequest().withDefinition(definition); + const result = await this._sendAndReceive(smData.Operation.UpdateMessageStream, request); + utilInternal.throwOnErrorResponse(result); } /** @@ -424,7 +467,7 @@ class StreamManagerClient { async deleteMessageStream(streamName) { const request = new smData.DeleteMessageStreamRequest().withName(streamName); const result = await this._sendAndReceive(smData.Operation.DeleteMessageStream, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); } /** @@ -452,7 +495,7 @@ class StreamManagerClient { StreamManagerClient.__validateReadMessagesOptions(options); const request = new smData.ReadMessagesRequest().withStreamName(streamName).withReadMessagesOptions(options); const result = await this._sendAndReceive(smData.Operation.ReadMessages, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); return result.messages; } @@ -464,7 +507,7 @@ class StreamManagerClient { async listStreams() { const request = new smData.ListStreamsRequest(); const result = await this._sendAndReceive(smData.Operation.ListStreams, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); return result.streams; } @@ -478,7 +521,7 @@ class StreamManagerClient { async describeMessageStream(streamName) { const request = new smData.DescribeMessageStreamRequest().withName(streamName); const result = await this._sendAndReceive(smData.Operation.DescribeMessageStream, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); return result.messageStreamInfo; } @@ -517,4 +560,5 @@ module.exports = { ...smData, StreamManagerClient: StreamManagerClient, ...exceptions, + util, }; diff --git a/aws-greengrass-core-sdk/stream-manager/data/index.js b/aws-greengrass-core-sdk/stream-manager/data/index.js index e720f69..d503b58 100644 --- a/aws-greengrass-core-sdk/stream-manager/data/index.js +++ b/aws-greengrass-core-sdk/stream-manager/data/index.js @@ -1,117 +1,49 @@ /** - * StrategyOnFull is used in the MessageStreamDefinition when creating a stream. - It defines the behavior when the stream has reached the maximum size. - RejectNewData: any append message request after the stream is full will be rejected with an exception. - OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. - * - * @class - * @memberOf aws-greengrass-core-sdk.StreamManager - */ -class StrategyOnFull { - - #value = null; - constructor(value = null) { - if (!(value in Object.values(StrategyOnFull.options))) { - throw new Error("Value must be one of the enumerated options"); - } - this.#value = value; - } - - static fromMap(d) { - return StrategyOnFull[StrategyOnFull.optionsFlipped[d]]; - } - - asMap() { - return this.#value; - } -}; -Object.defineProperty(StrategyOnFull, "options", { - value: { - RejectNewData: 0, - OverwriteOldestData: 1, - } -}); -Object.defineProperty(StrategyOnFull, "optionsFlipped", { - value: { - 0: "RejectNewData", - 1: "OverwriteOldestData", - } -}); - -/** - * @member {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} RejectNewData - * @memberOf aws-greengrass-core-sdk.StreamManager.StrategyOnFull# - * @readonly - */ -Object.defineProperty(StrategyOnFull, "RejectNewData", { - value: new StrategyOnFull(0) -}); -/** - * @member {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} OverwriteOldestData - * @memberOf aws-greengrass-core-sdk.StreamManager.StrategyOnFull# - * @readonly - */ -Object.defineProperty(StrategyOnFull, "OverwriteOldestData", { - value: new StrategyOnFull(1) -}); - -/** - * Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. - Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. + * (Internal Only) Version information. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class Persistence { +class VersionInfo { #value = null; constructor(value = null) { - if (!(value in Object.values(Persistence.options))) { + if (!Object.values(VersionInfo.options).includes(value)) { throw new Error("Value must be one of the enumerated options"); } this.#value = value; } static fromMap(d) { - return Persistence[Persistence.optionsFlipped[d]]; + return VersionInfo[VersionInfo.optionsFlipped[d]]; } asMap() { return this.#value; } }; -Object.defineProperty(Persistence, "options", { +Object.defineProperty(VersionInfo, "options", { value: { - File: 0, - Memory: 1, + PROTOCOL_VERSION: "1.1.0", } }); -Object.defineProperty(Persistence, "optionsFlipped", { +Object.defineProperty(VersionInfo, "optionsFlipped", { value: { - 0: "File", - 1: "Memory", + "1.1.0": "PROTOCOL_VERSION", } }); /** - * @member {aws-greengrass-core-sdk.StreamManager.Persistence} File - * @memberOf aws-greengrass-core-sdk.StreamManager.Persistence# - * @readonly - */ -Object.defineProperty(Persistence, "File", { - value: new Persistence(0) -}); -/** - * @member {aws-greengrass-core-sdk.StreamManager.Persistence} Memory - * @memberOf aws-greengrass-core-sdk.StreamManager.Persistence# + * @member {aws-greengrass-core-sdk.StreamManager.VersionInfo} PROTOCOL_VERSION + * @memberOf aws-greengrass-core-sdk.StreamManager.VersionInfo# * @readonly */ -Object.defineProperty(Persistence, "Memory", { - value: new Persistence(1) +Object.defineProperty(VersionInfo, "PROTOCOL_VERSION", { + value: new VersionInfo("1.1.0") }); /** - * (Internal Only) Request object to connect to the service + * (Internal Only) Request object to connect to the service. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager @@ -119,18 +51,21 @@ Object.defineProperty(Persistence, "Memory", { class ConnectRequest { #__requestId = null; #__protocolVersion = null; + #__otherSupportedProtocolVersions = null; #__sdkVersion = null; #__authToken = null; /** * @param requestId {String} * @param protocolVersion {String} + * @param otherSupportedProtocolVersions {String[]} * @param sdkVersion {String} * @param authToken {String} */ constructor( requestId = null, protocolVersion = null, + otherSupportedProtocolVersions = null, sdkVersion = null, authToken = null, ) { @@ -142,6 +77,13 @@ class ConnectRequest { throw new Error("protocolVersion must be String"); } + if (otherSupportedProtocolVersions !== null && !(otherSupportedProtocolVersions instanceof Array)) { + throw new Error("otherSupportedProtocolVersions must be Array"); + } + if (otherSupportedProtocolVersions !== null && !otherSupportedProtocolVersions.every((v) => typeof v === "string")) { + throw new Error("otherSupportedProtocolVersions array values must be String"); + } + if (sdkVersion !== null && !(typeof sdkVersion === "string")) { throw new Error("sdkVersion must be String"); } @@ -152,6 +94,7 @@ class ConnectRequest { this.#__requestId = requestId; this.#__protocolVersion = protocolVersion; + this.#__otherSupportedProtocolVersions = otherSupportedProtocolVersions; this.#__sdkVersion = sdkVersion; this.#__authToken = authToken; } @@ -208,6 +151,35 @@ class ConnectRequest { return this; } + /** + * @returns {String[]} + + */ + get otherSupportedProtocolVersions() { + return this.#__otherSupportedProtocolVersions; + } + /** + * @param value {String[]} + */ + set otherSupportedProtocolVersions(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("otherSupportedProtocolVersions must be Array"); + } + if (value !== null && !value.every((v) => typeof v === "string")) { + throw new Error("otherSupportedProtocolVersions array values must be String"); + } + + this.#__otherSupportedProtocolVersions = value; + } + /** + * @param value {String[]} + * @returns {aws-greengrass-core-sdk.StreamManager.ConnectRequest} + */ + withOtherSupportedProtocolVersions(value) { + this.otherSupportedProtocolVersions = value; + return this; + } + /** * @returns {String} @@ -268,6 +240,12 @@ class ConnectRequest { if ("protocolVersion" in d) { ret.protocolVersion = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["protocolVersion"]) : d["protocolVersion"]; } + if ("otherSupportedProtocolVersions" in d) { + ret.otherSupportedProtocolVersions = d["otherSupportedProtocolVersions"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(v) : v); + return acc; + }, []); + } if ("sdkVersion" in d) { ret.sdkVersion = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["sdkVersion"]) : d["sdkVersion"]; } @@ -285,6 +263,12 @@ class ConnectRequest { if (this.protocolVersion !== null) { d["protocolVersion"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.protocolVersion), "asMap") ? this.protocolVersion.asMap() : this.protocolVersion; } + if (this.otherSupportedProtocolVersions !== null) { + d["otherSupportedProtocolVersions"] = this.otherSupportedProtocolVersions.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } if (this.sdkVersion !== null) { d["sdkVersion"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sdkVersion), "asMap") ? this.sdkVersion.asMap() : this.sdkVersion; } @@ -305,6 +289,10 @@ Object.defineProperty(ConnectRequest, "typesMap", { 'type': String, 'subtype': null }, + otherSupportedProtocolVersions: { + 'type': Array, + 'subtype': String + }, sdkVersion: { 'type': String, 'subtype': null @@ -328,6 +316,9 @@ Object.defineProperty(ConnectRequest, "validationsMap", { 'protocolVersion': { 'required': true, }, + 'otherSupportedProtocolVersions': { + 'required': false, + }, 'sdkVersion': { 'required': false, }, @@ -355,6 +346,9 @@ Object.defineProperty(ConnectRequest, "validationsMap", { NotEnoughMessages: There is not enough messages to return. MessageStoreReadError: Read messages encountered an error. OutOfMemoryError: Server ran out of memory. + UpdateFailed: Update operation failed. + UpdateNotAllowed: One or more fields are not allowed to be updated. + UnknownOperation: Client request is not recognized by the server. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager @@ -363,7 +357,7 @@ class ResponseStatusCode { #value = null; constructor(value = null) { - if (!(value in Object.values(ResponseStatusCode.options))) { + if (!Object.values(ResponseStatusCode.options).includes(value)) { throw new Error("Value must be one of the enumerated options"); } this.#value = value; @@ -395,6 +389,9 @@ Object.defineProperty(ResponseStatusCode, "options", { NotEnoughMessages: 13, MessageStoreReadError: 14, OutOfMemoryError: 15, + UpdateFailed: 16, + UpdateNotAllowed: 17, + UnknownOperation: 18, } }); Object.defineProperty(ResponseStatusCode, "optionsFlipped", { @@ -415,6 +412,9 @@ Object.defineProperty(ResponseStatusCode, "optionsFlipped", { 13: "NotEnoughMessages", 14: "MessageStoreReadError", 15: "OutOfMemoryError", + 16: "UpdateFailed", + 17: "UpdateNotAllowed", + 18: "UnknownOperation", } }); @@ -546,9 +546,33 @@ Object.defineProperty(ResponseStatusCode, "MessageStoreReadError", { Object.defineProperty(ResponseStatusCode, "OutOfMemoryError", { value: new ResponseStatusCode(15) }); +/** + * @member {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} UpdateFailed + * @memberOf aws-greengrass-core-sdk.StreamManager.ResponseStatusCode# + * @readonly + */ +Object.defineProperty(ResponseStatusCode, "UpdateFailed", { + value: new ResponseStatusCode(16) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} UpdateNotAllowed + * @memberOf aws-greengrass-core-sdk.StreamManager.ResponseStatusCode# + * @readonly + */ +Object.defineProperty(ResponseStatusCode, "UpdateNotAllowed", { + value: new ResponseStatusCode(17) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} UnknownOperation + * @memberOf aws-greengrass-core-sdk.StreamManager.ResponseStatusCode# + * @readonly + */ +Object.defineProperty(ResponseStatusCode, "UnknownOperation", { + value: new ResponseStatusCode(18) +}); /** - * Internal Only + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager @@ -928,7 +952,7 @@ Object.defineProperty(ConnectResponse, "validationsMap", { }); /** - * Internal Only + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager @@ -937,7 +961,7 @@ class Operation { #value = null; constructor(value = null) { - if (!(value in Object.values(Operation.options))) { + if (!Object.values(Operation.options).includes(value)) { throw new Error("Value must be one of the enumerated options"); } this.#value = value; @@ -968,6 +992,9 @@ Object.defineProperty(Operation, "options", { ListStreamsResponse: 12, DescribeMessageStream: 13, DescribeMessageStreamResponse: 14, + UpdateMessageStream: 15, + UpdateMessageStreamResponse: 16, + UnknownOperationError: 17, } }); Object.defineProperty(Operation, "optionsFlipped", { @@ -987,6 +1014,9 @@ Object.defineProperty(Operation, "optionsFlipped", { 12: "ListStreamsResponse", 13: "DescribeMessageStream", 14: "DescribeMessageStreamResponse", + 15: "UpdateMessageStream", + 16: "UpdateMessageStreamResponse", + 17: "UnknownOperationError", } }); @@ -1110,9 +1140,33 @@ Object.defineProperty(Operation, "DescribeMessageStream", { Object.defineProperty(Operation, "DescribeMessageStreamResponse", { value: new Operation(14) }); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Operation} UpdateMessageStream + * @memberOf aws-greengrass-core-sdk.StreamManager.Operation# + * @readonly + */ +Object.defineProperty(Operation, "UpdateMessageStream", { + value: new Operation(15) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Operation} UpdateMessageStreamResponse + * @memberOf aws-greengrass-core-sdk.StreamManager.Operation# + * @readonly + */ +Object.defineProperty(Operation, "UpdateMessageStreamResponse", { + value: new Operation(16) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Operation} UnknownOperationError + * @memberOf aws-greengrass-core-sdk.StreamManager.Operation# + * @readonly + */ +Object.defineProperty(Operation, "UnknownOperationError", { + value: new Operation(17) +}); /** - * Internal Only + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager @@ -1243,2773 +1297,6380 @@ Object.defineProperty(MessageFrame, "validationsMap", { }); /** - * This export destination is not supported! The interface may change at any time without notice and should not be relied on for any production use. - There are no guarantees around its correctness. - This configures an HTTP endpoint which sends a POST request to the provided URI. Each request contains a single message in the body of the request. + * The type of event, which determines how to interpret the status payload. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class HTTPConfig { - #__identifier = null; - #__uri = null; - #__batchSize = null; - #__batchIntervalMillis = null; - #__priority = null; +class EventType { - /** - * @param identifier {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @param uri {String} URL for HTTP endpoint which should receive the POST requests for export. - * @param batchSize {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum batch size is 1 and the maximum is 500. - * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. - */ - constructor( - identifier = null, - uri = null, - batchSize = null, - batchIntervalMillis = null, - priority = null, - ) { - if (identifier !== null && !(typeof identifier === "string")) { - throw new Error("identifier must be String"); + #value = null; + constructor(value = null) { + if (!Object.values(EventType.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); } + this.#value = value; + } - if (uri !== null && !(typeof uri === "string")) { - throw new Error("uri must be String"); - } + static fromMap(d) { + return EventType[EventType.optionsFlipped[d]]; + } - if (batchSize !== null && !(typeof batchSize === "number")) { - throw new Error("batchSize must be Number"); - } + asMap() { + return this.#value; + } +}; +Object.defineProperty(EventType, "options", { + value: { + S3Task: 0, + } +}); +Object.defineProperty(EventType, "optionsFlipped", { + value: { + 0: "S3Task", + } +}); - if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { - throw new Error("batchIntervalMillis must be Number"); - } +/** + * @member {aws-greengrass-core-sdk.StreamManager.EventType} S3Task + * @memberOf aws-greengrass-core-sdk.StreamManager.EventType# + * @readonly + */ +Object.defineProperty(EventType, "S3Task", { + value: new EventType(0) +}); - if (priority !== null && !(typeof priority === "number")) { - throw new Error("priority must be Number"); - } +/** + * The status of the event. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class Status { - this.#__identifier = identifier; - this.#__uri = uri; - this.#__batchSize = batchSize; - this.#__batchIntervalMillis = batchIntervalMillis; - this.#__priority = priority; + #value = null; + constructor(value = null) { + if (!Object.values(Status.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; } - /** - * A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {String} - - */ - get identifier() { - return this.#__identifier; + static fromMap(d) { + return Status[Status.optionsFlipped[d]]; } - /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - */ - set identifier(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("identifier must be String"); - } - this.#__identifier = value; + asMap() { + return this.#value; } - /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} - */ - withIdentifier(value) { - this.identifier = value; - return this; +}; +Object.defineProperty(Status, "options", { + value: { + Success: 0, + Failure: 1, + InProgress: 2, + Warning: 3, + Canceled: 4, } - - /** - * URL for HTTP endpoint which should receive the POST requests for export. +}); +Object.defineProperty(Status, "optionsFlipped", { + value: { + 0: "Success", + 1: "Failure", + 2: "InProgress", + 3: "Warning", + 4: "Canceled", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.Status} Success + * @memberOf aws-greengrass-core-sdk.StreamManager.Status# + * @readonly + */ +Object.defineProperty(Status, "Success", { + value: new Status(0) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Status} Failure + * @memberOf aws-greengrass-core-sdk.StreamManager.Status# + * @readonly + */ +Object.defineProperty(Status, "Failure", { + value: new Status(1) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Status} InProgress + * @memberOf aws-greengrass-core-sdk.StreamManager.Status# + * @readonly + */ +Object.defineProperty(Status, "InProgress", { + value: new Status(2) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Status} Warning + * @memberOf aws-greengrass-core-sdk.StreamManager.Status# + * @readonly + */ +Object.defineProperty(Status, "Warning", { + value: new Status(3) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Status} Canceled + * @memberOf aws-greengrass-core-sdk.StreamManager.Status# + * @readonly + */ +Object.defineProperty(Status, "Canceled", { + value: new Status(4) +}); + +/** + * Defines the verbosity of status messages in a status-stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class StatusLevel { + + #value = null; + constructor(value = null) { + if (!Object.values(StatusLevel.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; + } + + static fromMap(d) { + return StatusLevel[StatusLevel.optionsFlipped[d]]; + } + + asMap() { + return this.#value; + } +}; +Object.defineProperty(StatusLevel, "options", { + value: { + ERROR: 0, + WARN: 1, + INFO: 2, + DEBUG: 3, + TRACE: 4, + } +}); +Object.defineProperty(StatusLevel, "optionsFlipped", { + value: { + 0: "ERROR", + 1: "WARN", + 2: "INFO", + 3: "DEBUG", + 4: "TRACE", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.StatusLevel} ERROR + * @memberOf aws-greengrass-core-sdk.StreamManager.StatusLevel# + * @readonly + */ +Object.defineProperty(StatusLevel, "ERROR", { + value: new StatusLevel(0) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.StatusLevel} WARN + * @memberOf aws-greengrass-core-sdk.StreamManager.StatusLevel# + * @readonly + */ +Object.defineProperty(StatusLevel, "WARN", { + value: new StatusLevel(1) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.StatusLevel} INFO + * @memberOf aws-greengrass-core-sdk.StreamManager.StatusLevel# + * @readonly + */ +Object.defineProperty(StatusLevel, "INFO", { + value: new StatusLevel(2) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.StatusLevel} DEBUG + * @memberOf aws-greengrass-core-sdk.StreamManager.StatusLevel# + * @readonly + */ +Object.defineProperty(StatusLevel, "DEBUG", { + value: new StatusLevel(3) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.StatusLevel} TRACE + * @memberOf aws-greengrass-core-sdk.StreamManager.StatusLevel# + * @readonly + */ +Object.defineProperty(StatusLevel, "TRACE", { + value: new StatusLevel(4) +}); + +/** + * S3 Task definition containing all the information necessary to export the data to S3. This will contain the S3 bucket and key as well as the file's URL where the data is stored. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class S3ExportTaskDefinition { + #__inputUrl = null; + #__bucket = null; + #__key = null; + #__userMetadata = null; + + /** + * @param inputUrl {String} The URL of the file that contains the data to upload. The file should be local on the disk. + * @param bucket {String} The name of the S3 bucket that this file should be uploaded to. + * @param key {String} The key for the S3 object that this file should be uploaded to. + The string can have placeholder expressions which are resolved at upload time. Valid expressions are strings that are valid Java DateTimeFormatter strings. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html + Example: myKeyNamePrefix/!{timestamp:yyyy/MM/dd}/myKeyNameSuffix. + * @param userMetadata {Object} User metadata. For key of a user metadata, callers should not include the internal "x-amz-meta-" prefix. Keys are case insensitive and will appear as lowercase strings on S3, even if they were originally specified with uppercase strings. Reserved key names start with "$aws-gg-" prefix. + */ + constructor( + inputUrl = null, + bucket = null, + key = null, + userMetadata = null, + ) { + if (inputUrl !== null && !(typeof inputUrl === "string")) { + throw new Error("inputUrl must be String"); + } + + if (bucket !== null && !(typeof bucket === "string")) { + throw new Error("bucket must be String"); + } + + if (key !== null && !(typeof key === "string")) { + throw new Error("key must be String"); + } + + if (userMetadata !== null && !(userMetadata instanceof Object)) { + throw new Error("userMetadata must be Object"); + } + + this.#__inputUrl = inputUrl; + this.#__bucket = bucket; + this.#__key = key; + this.#__userMetadata = userMetadata; + } + + /** + * The URL of the file that contains the data to upload. The file should be local on the disk. * @returns {String} */ - get uri() { - return this.#__uri; + get inputUrl() { + return this.#__inputUrl; } /** - * @param value {String} URL for HTTP endpoint which should receive the POST requests for export. + * @param value {String} The URL of the file that contains the data to upload. The file should be local on the disk. */ - set uri(value) { + set inputUrl(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("uri must be String"); + throw new Error("inputUrl must be String"); } - this.#__uri = value; + this.#__inputUrl = value; } /** - * @param value {String} URL for HTTP endpoint which should receive the POST requests for export. - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + * @param value {String} The URL of the file that contains the data to upload. The file should be local on the disk. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} */ - withUri(value) { - this.uri = value; + withInputUrl(value) { + this.inputUrl = value; return this; } /** - * The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum batch size is 1 and the maximum is 500. - * @returns {Number} - + * The name of the S3 bucket that this file should be uploaded to. + * @returns {String} + */ - get batchSize() { - return this.#__batchSize; + get bucket() { + return this.#__bucket; } /** - * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum batch size is 1 and the maximum is 500. + * @param value {String} The name of the S3 bucket that this file should be uploaded to. */ - set batchSize(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchSize must be Number"); + set bucket(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("bucket must be String"); } - this.#__batchSize = value; + this.#__bucket = value; } /** - * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum batch size is 1 and the maximum is 500. - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + * @param value {String} The name of the S3 bucket that this file should be uploaded to. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} */ - withBatchSize(value) { - this.batchSize = value; + withBucket(value) { + this.bucket = value; return this; } /** - * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {Number} + * The key for the S3 object that this file should be uploaded to. + The string can have placeholder expressions which are resolved at upload time. Valid expressions are strings that are valid Java DateTimeFormatter strings. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html + Example: myKeyNamePrefix/!{timestamp:yyyy/MM/dd}/myKeyNameSuffix. + * @returns {String} */ - get batchIntervalMillis() { - return this.#__batchIntervalMillis; + get key() { + return this.#__key; } /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param value {String} The key for the S3 object that this file should be uploaded to. + The string can have placeholder expressions which are resolved at upload time. Valid expressions are strings that are valid Java DateTimeFormatter strings. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html + Example: myKeyNamePrefix/!{timestamp:yyyy/MM/dd}/myKeyNameSuffix. */ - set batchIntervalMillis(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchIntervalMillis must be Number"); + set key(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("key must be String"); } - this.#__batchIntervalMillis = value; + this.#__key = value; } /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + * @param value {String} The key for the S3 object that this file should be uploaded to. + The string can have placeholder expressions which are resolved at upload time. Valid expressions are strings that are valid Java DateTimeFormatter strings. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html + Example: myKeyNamePrefix/!{timestamp:yyyy/MM/dd}/myKeyNameSuffix. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} */ - withBatchIntervalMillis(value) { - this.batchIntervalMillis = value; + withKey(value) { + this.key = value; return this; } /** - * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. - * @returns {Number} + * User metadata. For key of a user metadata, callers should not include the internal "x-amz-meta-" prefix. Keys are case insensitive and will appear as lowercase strings on S3, even if they were originally specified with uppercase strings. Reserved key names start with "$aws-gg-" prefix. + * @returns {Object} */ - get priority() { - return this.#__priority; + get userMetadata() { + return this.#__userMetadata; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param value {Object} User metadata. For key of a user metadata, callers should not include the internal "x-amz-meta-" prefix. Keys are case insensitive and will appear as lowercase strings on S3, even if they were originally specified with uppercase strings. Reserved key names start with "$aws-gg-" prefix. */ - set priority(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("priority must be Number"); + set userMetadata(value) { + if (value !== null && !(value instanceof Object)) { + throw new Error("userMetadata must be Object"); } - this.#__priority = value; + this.#__userMetadata = value; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + * @param value {Object} User metadata. For key of a user metadata, callers should not include the internal "x-amz-meta-" prefix. Keys are case insensitive and will appear as lowercase strings on S3, even if they were originally specified with uppercase strings. Reserved key names start with "$aws-gg-" prefix. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} */ - withPriority(value) { - this.priority = value; + withUserMetadata(value) { + this.userMetadata = value; return this; } static fromMap(d) { - const ret = new HTTPConfig(); - if ("identifier" in d) { - ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; - } - if ("uri" in d) { - ret.uri = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["uri"]) : d["uri"]; + const ret = new S3ExportTaskDefinition(); + if ("inputUrl" in d) { + ret.inputUrl = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["inputUrl"]) : d["inputUrl"]; } - if ("batchSize" in d) { - ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + if ("bucket" in d) { + ret.bucket = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["bucket"]) : d["bucket"]; } - if ("batchIntervalMillis" in d) { - ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + if ("key" in d) { + ret.key = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["key"]) : d["key"]; } - if ("priority" in d) { - ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + if ("userMetadata" in d) { + ret.userMetadata = Object.prototype.hasOwnProperty.call(Object, "fromMap") ? Object.fromMap(d["userMetadata"]) : d["userMetadata"]; } return ret; } asMap() { const d = {}; - if (this.identifier !== null) { - d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; - } - if (this.uri !== null) { - d["uri"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.uri), "asMap") ? this.uri.asMap() : this.uri; + if (this.inputUrl !== null) { + d["inputUrl"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.inputUrl), "asMap") ? this.inputUrl.asMap() : this.inputUrl; } - if (this.batchSize !== null) { - d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + if (this.bucket !== null) { + d["bucket"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.bucket), "asMap") ? this.bucket.asMap() : this.bucket; } - if (this.batchIntervalMillis !== null) { - d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + if (this.key !== null) { + d["key"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.key), "asMap") ? this.key.asMap() : this.key; } - if (this.priority !== null) { - d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + if (this.userMetadata !== null) { + d["userMetadata"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.userMetadata), "asMap") ? this.userMetadata.asMap() : this.userMetadata; } return d; } }; -Object.defineProperty(HTTPConfig, "typesMap", { +Object.defineProperty(S3ExportTaskDefinition, "typesMap", { value: { - identifier: { + inputUrl: { 'type': String, 'subtype': null }, - uri: { + bucket: { 'type': String, 'subtype': null }, - batchSize: { - 'type': Number, - 'subtype': null - }, - batchIntervalMillis: { - 'type': Number, + key: { + 'type': String, 'subtype': null }, - priority: { - 'type': Number, + userMetadata: { + 'type': Object, 'subtype': null }, } }); -Object.defineProperty(HTTPConfig, "formatsMap", { +Object.defineProperty(S3ExportTaskDefinition, "formatsMap", { value: {} }); -Object.defineProperty(HTTPConfig, "validationsMap", { +Object.defineProperty(S3ExportTaskDefinition, "validationsMap", { value: { - 'identifier': { + 'inputUrl': { 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, }, - 'uri': { + 'bucket': { 'required': true, - 'minLength': 1, - }, - 'batchSize': { - 'required': false, - 'maximum': 500, - 'minimum': 1, + 'minLength': 3, + 'maxLength': 63, + 'pattern': /(?=^.{3,63}$)(?!^(\d+\.)+\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$)/, }, - 'batchIntervalMillis': { - 'required': false, - 'maximum': 9223372036854, - 'minimum': 60000, + 'key': { + 'required': true, + 'minLength': 1, + 'maxLength': 1024, + 'pattern': /^([^\\\{ \}%\`\[\]\"\'\>\<\~\#\^\?\|]|!\{[a-zA-Z]+:[a-zA-Z\/]+\})*$/, }, - 'priority': { + 'userMetadata': { 'required': false, - 'maximum': 10, - 'minimum': 1, }, } }); /** - * Configuration object for IoT Analytics export destination. + * Context associated with a status message. Describes which stream, export config, message, the status is associated with. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class IoTAnalyticsConfig { - #__identifier = null; - #__iotChannel = null; - #__iotMsgIdPrefix = null; - #__batchSize = null; - #__batchIntervalMillis = null; - #__priority = null; +class StatusContext { + #__s3ExportTaskDefinition = null; + #__exportIdentifier = null; + #__streamName = null; + #__sequenceNumber = null; /** - * @param identifier {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @param iotChannel {String} The name of the IoT Analytics Channel that this exporter should upload to - * @param iotMsgIdPrefix {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. - This prefix must be less than 32 characters. - * @param batchSize {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 100. - * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param s3ExportTaskDefinition {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} The task definition of an S3 upload task if the status is associated with it, ie, if the eventType = S3Task. + * @param exportIdentifier {String} The export identifier the status is associated with. + * @param streamName {String} The name of the stream the status is associated with. + * @param sequenceNumber {Number} The sequence number of the message the status is associated with. */ constructor( - identifier = null, - iotChannel = null, - iotMsgIdPrefix = null, - batchSize = null, - batchIntervalMillis = null, - priority = null, + s3ExportTaskDefinition = null, + exportIdentifier = null, + streamName = null, + sequenceNumber = null, ) { - if (identifier !== null && !(typeof identifier === "string")) { - throw new Error("identifier must be String"); + if (s3ExportTaskDefinition !== null && !(s3ExportTaskDefinition instanceof S3ExportTaskDefinition)) { + throw new Error("s3ExportTaskDefinition must be S3ExportTaskDefinition"); } - if (iotChannel !== null && !(typeof iotChannel === "string")) { - throw new Error("iotChannel must be String"); + if (exportIdentifier !== null && !(typeof exportIdentifier === "string")) { + throw new Error("exportIdentifier must be String"); } - if (iotMsgIdPrefix !== null && !(typeof iotMsgIdPrefix === "string")) { - throw new Error("iotMsgIdPrefix must be String"); + if (streamName !== null && !(typeof streamName === "string")) { + throw new Error("streamName must be String"); } - if (batchSize !== null && !(typeof batchSize === "number")) { - throw new Error("batchSize must be Number"); - } - - if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { - throw new Error("batchIntervalMillis must be Number"); - } - - if (priority !== null && !(typeof priority === "number")) { - throw new Error("priority must be Number"); + if (sequenceNumber !== null && !(typeof sequenceNumber === "number")) { + throw new Error("sequenceNumber must be Number"); } - this.#__identifier = identifier; - this.#__iotChannel = iotChannel; - this.#__iotMsgIdPrefix = iotMsgIdPrefix; - this.#__batchSize = batchSize; - this.#__batchIntervalMillis = batchIntervalMillis; - this.#__priority = priority; + this.#__s3ExportTaskDefinition = s3ExportTaskDefinition; + this.#__exportIdentifier = exportIdentifier; + this.#__streamName = streamName; + this.#__sequenceNumber = sequenceNumber; } /** - * A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {String} - + * The task definition of an S3 upload task if the status is associated with it, ie, if the eventType = S3Task. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} + */ - get identifier() { - return this.#__identifier; + get s3ExportTaskDefinition() { + return this.#__s3ExportTaskDefinition; } /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param value {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} The task definition of an S3 upload task if the status is associated with it, ie, if the eventType = S3Task. */ - set identifier(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("identifier must be String"); + set s3ExportTaskDefinition(value) { + if (value !== null && !(value instanceof S3ExportTaskDefinition)) { + throw new Error("s3ExportTaskDefinition must be S3ExportTaskDefinition"); } - this.#__identifier = value; + this.#__s3ExportTaskDefinition = value; } /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + * @param value {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} The task definition of an S3 upload task if the status is associated with it, ie, if the eventType = S3Task. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusContext} */ - withIdentifier(value) { - this.identifier = value; + withS3ExportTaskDefinition(value) { + this.s3ExportTaskDefinition = value; return this; } /** - * The name of the IoT Analytics Channel that this exporter should upload to + * The export identifier the status is associated with. * @returns {String} */ - get iotChannel() { - return this.#__iotChannel; + get exportIdentifier() { + return this.#__exportIdentifier; } /** - * @param value {String} The name of the IoT Analytics Channel that this exporter should upload to + * @param value {String} The export identifier the status is associated with. */ - set iotChannel(value) { + set exportIdentifier(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("iotChannel must be String"); + throw new Error("exportIdentifier must be String"); } - this.#__iotChannel = value; + this.#__exportIdentifier = value; } /** - * @param value {String} The name of the IoT Analytics Channel that this exporter should upload to - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + * @param value {String} The export identifier the status is associated with. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusContext} */ - withIotChannel(value) { - this.iotChannel = value; + withExportIdentifier(value) { + this.exportIdentifier = value; return this; } /** - * A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. - This prefix must be less than 32 characters. + * The name of the stream the status is associated with. * @returns {String} - + */ - get iotMsgIdPrefix() { - return this.#__iotMsgIdPrefix; + get streamName() { + return this.#__streamName; } /** - * @param value {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. - This prefix must be less than 32 characters. + * @param value {String} The name of the stream the status is associated with. */ - set iotMsgIdPrefix(value) { + set streamName(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("iotMsgIdPrefix must be String"); - } - - this.#__iotMsgIdPrefix = value; - } - /** - * @param value {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. - This prefix must be less than 32 characters. - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} - */ - withIotMsgIdPrefix(value) { - this.iotMsgIdPrefix = value; - return this; - } - - /** - * The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 100. - * @returns {Number} - - */ - get batchSize() { - return this.#__batchSize; - } - /** - * @param value {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 100. - */ - set batchSize(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchSize must be Number"); - } - - this.#__batchSize = value; - } - /** - * @param value {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 100. - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} - */ - withBatchSize(value) { - this.batchSize = value; - return this; - } - - /** - * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {Number} - - */ - get batchIntervalMillis() { - return this.#__batchIntervalMillis; - } - /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - */ - set batchIntervalMillis(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchIntervalMillis must be Number"); + throw new Error("streamName must be String"); } - this.#__batchIntervalMillis = value; + this.#__streamName = value; } /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + * @param value {String} The name of the stream the status is associated with. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusContext} */ - withBatchIntervalMillis(value) { - this.batchIntervalMillis = value; + withStreamName(value) { + this.streamName = value; return this; } /** - * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * The sequence number of the message the status is associated with. * @returns {Number} */ - get priority() { - return this.#__priority; + get sequenceNumber() { + return this.#__sequenceNumber; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param value {Number} The sequence number of the message the status is associated with. */ - set priority(value) { + set sequenceNumber(value) { if (value !== null && !(typeof value === "number")) { - throw new Error("priority must be Number"); + throw new Error("sequenceNumber must be Number"); } - this.#__priority = value; + this.#__sequenceNumber = value; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + * @param value {Number} The sequence number of the message the status is associated with. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusContext} */ - withPriority(value) { - this.priority = value; + withSequenceNumber(value) { + this.sequenceNumber = value; return this; } static fromMap(d) { - const ret = new IoTAnalyticsConfig(); - if ("identifier" in d) { - ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; - } - if ("iotChannel" in d) { - ret.iotChannel = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["iotChannel"]) : d["iotChannel"]; - } - if ("iotMsgIdPrefix" in d) { - ret.iotMsgIdPrefix = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["iotMsgIdPrefix"]) : d["iotMsgIdPrefix"]; + const ret = new StatusContext(); + if ("s3ExportTaskDefinition" in d) { + ret.s3ExportTaskDefinition = Object.prototype.hasOwnProperty.call(S3ExportTaskDefinition, "fromMap") ? S3ExportTaskDefinition.fromMap(d["s3ExportTaskDefinition"]) : d["s3ExportTaskDefinition"]; } - if ("batchSize" in d) { - ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + if ("exportIdentifier" in d) { + ret.exportIdentifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["exportIdentifier"]) : d["exportIdentifier"]; } - if ("batchIntervalMillis" in d) { - ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + if ("streamName" in d) { + ret.streamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["streamName"]) : d["streamName"]; } - if ("priority" in d) { - ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + if ("sequenceNumber" in d) { + ret.sequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sequenceNumber"]) : d["sequenceNumber"]; } return ret; } asMap() { const d = {}; - if (this.identifier !== null) { - d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + if (this.s3ExportTaskDefinition !== null) { + d["s3ExportTaskDefinition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.s3ExportTaskDefinition), "asMap") ? this.s3ExportTaskDefinition.asMap() : this.s3ExportTaskDefinition; } - if (this.iotChannel !== null) { - d["iotChannel"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.iotChannel), "asMap") ? this.iotChannel.asMap() : this.iotChannel; - } - if (this.iotMsgIdPrefix !== null) { - d["iotMsgIdPrefix"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.iotMsgIdPrefix), "asMap") ? this.iotMsgIdPrefix.asMap() : this.iotMsgIdPrefix; - } - if (this.batchSize !== null) { - d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + if (this.exportIdentifier !== null) { + d["exportIdentifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportIdentifier), "asMap") ? this.exportIdentifier.asMap() : this.exportIdentifier; } - if (this.batchIntervalMillis !== null) { - d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + if (this.streamName !== null) { + d["streamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamName), "asMap") ? this.streamName.asMap() : this.streamName; } - if (this.priority !== null) { - d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + if (this.sequenceNumber !== null) { + d["sequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sequenceNumber), "asMap") ? this.sequenceNumber.asMap() : this.sequenceNumber; } return d; } }; -Object.defineProperty(IoTAnalyticsConfig, "typesMap", { +Object.defineProperty(StatusContext, "typesMap", { value: { - identifier: { - 'type': String, + s3ExportTaskDefinition: { + 'type': S3ExportTaskDefinition, 'subtype': null }, - iotChannel: { + exportIdentifier: { 'type': String, 'subtype': null }, - iotMsgIdPrefix: { + streamName: { 'type': String, 'subtype': null }, - batchSize: { - 'type': Number, - 'subtype': null - }, - batchIntervalMillis: { - 'type': Number, - 'subtype': null - }, - priority: { + sequenceNumber: { 'type': Number, 'subtype': null }, } }); -Object.defineProperty(IoTAnalyticsConfig, "formatsMap", { +Object.defineProperty(StatusContext, "formatsMap", { value: {} }); -Object.defineProperty(IoTAnalyticsConfig, "validationsMap", { +Object.defineProperty(StatusContext, "validationsMap", { value: { - 'identifier': { - 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, - }, - 'iotChannel': { - 'required': true, - 'minLength': 1, - }, - 'iotMsgIdPrefix': { + 's3ExportTaskDefinition': { 'required': false, - 'maxLength': 32, }, - 'batchSize': { + 'exportIdentifier': { 'required': false, - 'maximum': 100, - 'minimum': 1, }, - 'batchIntervalMillis': { + 'streamName': { 'required': false, - 'maximum': 9223372036854, - 'minimum': 60000, }, - 'priority': { + 'sequenceNumber': { 'required': false, - 'maximum': 10, - 'minimum': 1, }, } }); /** - * Configuration object for Kinesis data streams export destination. + * Status object appended to a status-stream. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class KinesisConfig { - #__identifier = null; - #__kinesisStreamName = null; - #__batchSize = null; - #__batchIntervalMillis = null; - #__priority = null; +class StatusMessage { + #__eventType = null; + #__statusLevel = null; + #__status = null; + #__statusContext = null; + #__message = null; + #__timestampEpochMs = null; /** - * @param identifier {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @param kinesisStreamName {String} The name of the Kinesis data stream that this exporter should upload to - * @param batchSize {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 500. - * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param eventType {aws-greengrass-core-sdk.StreamManager.EventType} + * @param statusLevel {aws-greengrass-core-sdk.StreamManager.StatusLevel} + * @param status {aws-greengrass-core-sdk.StreamManager.Status} + * @param statusContext {aws-greengrass-core-sdk.StreamManager.StatusContext} + * @param message {String} String describing the status message. + * @param timestampEpochMs {Number} The time this status was added to the status-stream (in milliseconds since epoch). */ constructor( - identifier = null, - kinesisStreamName = null, - batchSize = null, - batchIntervalMillis = null, - priority = null, + eventType = null, + statusLevel = null, + status = null, + statusContext = null, + message = null, + timestampEpochMs = null, ) { - if (identifier !== null && !(typeof identifier === "string")) { - throw new Error("identifier must be String"); + if (eventType !== null && !(eventType instanceof EventType)) { + throw new Error("eventType must be EventType"); } - if (kinesisStreamName !== null && !(typeof kinesisStreamName === "string")) { - throw new Error("kinesisStreamName must be String"); + if (statusLevel !== null && !(statusLevel instanceof StatusLevel)) { + throw new Error("statusLevel must be StatusLevel"); } - if (batchSize !== null && !(typeof batchSize === "number")) { - throw new Error("batchSize must be Number"); + if (status !== null && !(status instanceof Status)) { + throw new Error("status must be Status"); } - if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { - throw new Error("batchIntervalMillis must be Number"); + if (statusContext !== null && !(statusContext instanceof StatusContext)) { + throw new Error("statusContext must be StatusContext"); } - if (priority !== null && !(typeof priority === "number")) { - throw new Error("priority must be Number"); + if (message !== null && !(typeof message === "string")) { + throw new Error("message must be String"); } - this.#__identifier = identifier; - this.#__kinesisStreamName = kinesisStreamName; - this.#__batchSize = batchSize; - this.#__batchIntervalMillis = batchIntervalMillis; - this.#__priority = priority; + if (timestampEpochMs !== null && !(typeof timestampEpochMs === "number")) { + throw new Error("timestampEpochMs must be Number"); + } + + this.#__eventType = eventType; + this.#__statusLevel = statusLevel; + this.#__status = status; + this.#__statusContext = statusContext; + this.#__message = message; + this.#__timestampEpochMs = timestampEpochMs; } /** - * A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {String} - + * @returns {aws-greengrass-core-sdk.StreamManager.EventType} + */ - get identifier() { - return this.#__identifier; + get eventType() { + return this.#__eventType; } /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param value {aws-greengrass-core-sdk.StreamManager.EventType} */ - set identifier(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("identifier must be String"); + set eventType(value) { + if (value !== null && !(value instanceof EventType)) { + throw new Error("eventType must be EventType"); } - this.#__identifier = value; + this.#__eventType = value; } /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + * @param value {aws-greengrass-core-sdk.StreamManager.EventType} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - withIdentifier(value) { - this.identifier = value; + withEventType(value) { + this.eventType = value; return this; } /** - * The name of the Kinesis data stream that this exporter should upload to - * @returns {String} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusLevel} */ - get kinesisStreamName() { - return this.#__kinesisStreamName; + get statusLevel() { + return this.#__statusLevel; } /** - * @param value {String} The name of the Kinesis data stream that this exporter should upload to + * @param value {aws-greengrass-core-sdk.StreamManager.StatusLevel} */ - set kinesisStreamName(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("kinesisStreamName must be String"); + set statusLevel(value) { + if (value !== null && !(value instanceof StatusLevel)) { + throw new Error("statusLevel must be StatusLevel"); } - this.#__kinesisStreamName = value; + this.#__statusLevel = value; } /** - * @param value {String} The name of the Kinesis data stream that this exporter should upload to - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + * @param value {aws-greengrass-core-sdk.StreamManager.StatusLevel} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - withKinesisStreamName(value) { - this.kinesisStreamName = value; + withStatusLevel(value) { + this.statusLevel = value; return this; } /** - * The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 500. - * @returns {Number} - + * @returns {aws-greengrass-core-sdk.StreamManager.Status} + */ - get batchSize() { - return this.#__batchSize; + get status() { + return this.#__status; } /** - * @param value {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 500. + * @param value {aws-greengrass-core-sdk.StreamManager.Status} */ - set batchSize(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchSize must be Number"); + set status(value) { + if (value !== null && !(value instanceof Status)) { + throw new Error("status must be Status"); } - this.#__batchSize = value; + this.#__status = value; } /** - * @param value {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 500. - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + * @param value {aws-greengrass-core-sdk.StreamManager.Status} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - withBatchSize(value) { - this.batchSize = value; + withStatus(value) { + this.status = value; return this; } /** - * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {Number} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusContext} + + */ + get statusContext() { + return this.#__statusContext; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusContext} + */ + set statusContext(value) { + if (value !== null && !(value instanceof StatusContext)) { + throw new Error("statusContext must be StatusContext"); + } + this.#__statusContext = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusContext} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - get batchIntervalMillis() { - return this.#__batchIntervalMillis; + withStatusContext(value) { + this.statusContext = value; + return this; } + /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * String describing the status message. + * @returns {String} + */ - set batchIntervalMillis(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchIntervalMillis must be Number"); + get message() { + return this.#__message; + } + /** + * @param value {String} String describing the status message. + */ + set message(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("message must be String"); } - this.#__batchIntervalMillis = value; + this.#__message = value; } /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + * @param value {String} String describing the status message. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - withBatchIntervalMillis(value) { - this.batchIntervalMillis = value; + withMessage(value) { + this.message = value; return this; } /** - * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * The time this status was added to the status-stream (in milliseconds since epoch). * @returns {Number} */ - get priority() { - return this.#__priority; + get timestampEpochMs() { + return this.#__timestampEpochMs; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param value {Number} The time this status was added to the status-stream (in milliseconds since epoch). */ - set priority(value) { + set timestampEpochMs(value) { if (value !== null && !(typeof value === "number")) { - throw new Error("priority must be Number"); + throw new Error("timestampEpochMs must be Number"); } - this.#__priority = value; + this.#__timestampEpochMs = value; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + * @param value {Number} The time this status was added to the status-stream (in milliseconds since epoch). + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - withPriority(value) { - this.priority = value; + withTimestampEpochMs(value) { + this.timestampEpochMs = value; return this; } static fromMap(d) { - const ret = new KinesisConfig(); - if ("identifier" in d) { - ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; + const ret = new StatusMessage(); + if ("eventType" in d) { + ret.eventType = Object.prototype.hasOwnProperty.call(EventType, "fromMap") ? EventType.fromMap(d["eventType"]) : d["eventType"]; } - if ("kinesisStreamName" in d) { - ret.kinesisStreamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["kinesisStreamName"]) : d["kinesisStreamName"]; + if ("statusLevel" in d) { + ret.statusLevel = Object.prototype.hasOwnProperty.call(StatusLevel, "fromMap") ? StatusLevel.fromMap(d["statusLevel"]) : d["statusLevel"]; } - if ("batchSize" in d) { - ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(Status, "fromMap") ? Status.fromMap(d["status"]) : d["status"]; } - if ("batchIntervalMillis" in d) { - ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + if ("statusContext" in d) { + ret.statusContext = Object.prototype.hasOwnProperty.call(StatusContext, "fromMap") ? StatusContext.fromMap(d["statusContext"]) : d["statusContext"]; } - if ("priority" in d) { - ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + if ("message" in d) { + ret.message = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["message"]) : d["message"]; + } + if ("timestampEpochMs" in d) { + ret.timestampEpochMs = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["timestampEpochMs"]) : d["timestampEpochMs"]; } return ret; } asMap() { const d = {}; - if (this.identifier !== null) { - d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + if (this.eventType !== null) { + d["eventType"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.eventType), "asMap") ? this.eventType.asMap() : this.eventType; } - if (this.kinesisStreamName !== null) { - d["kinesisStreamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.kinesisStreamName), "asMap") ? this.kinesisStreamName.asMap() : this.kinesisStreamName; + if (this.statusLevel !== null) { + d["statusLevel"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.statusLevel), "asMap") ? this.statusLevel.asMap() : this.statusLevel; } - if (this.batchSize !== null) { - d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; } - if (this.batchIntervalMillis !== null) { - d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + if (this.statusContext !== null) { + d["statusContext"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.statusContext), "asMap") ? this.statusContext.asMap() : this.statusContext; } - if (this.priority !== null) { - d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + if (this.message !== null) { + d["message"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.message), "asMap") ? this.message.asMap() : this.message; + } + if (this.timestampEpochMs !== null) { + d["timestampEpochMs"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.timestampEpochMs), "asMap") ? this.timestampEpochMs.asMap() : this.timestampEpochMs; } return d; } }; -Object.defineProperty(KinesisConfig, "typesMap", { +Object.defineProperty(StatusMessage, "typesMap", { value: { - identifier: { - 'type': String, + eventType: { + 'type': EventType, 'subtype': null }, - kinesisStreamName: { - 'type': String, + statusLevel: { + 'type': StatusLevel, 'subtype': null }, - batchSize: { - 'type': Number, + status: { + 'type': Status, 'subtype': null }, - batchIntervalMillis: { - 'type': Number, + statusContext: { + 'type': StatusContext, 'subtype': null }, - priority: { + message: { + 'type': String, + 'subtype': null + }, + timestampEpochMs: { 'type': Number, 'subtype': null }, } }); -Object.defineProperty(KinesisConfig, "formatsMap", { +Object.defineProperty(StatusMessage, "formatsMap", { value: {} }); -Object.defineProperty(KinesisConfig, "validationsMap", { +Object.defineProperty(StatusMessage, "validationsMap", { value: { - 'identifier': { + 'eventType': { 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, }, - 'kinesisStreamName': { + 'statusLevel': { + 'required': false, + }, + 'status': { 'required': true, - 'minLength': 1, }, - 'batchSize': { + 'statusContext': { 'required': false, - 'maximum': 500, - 'minimum': 1, }, - 'batchIntervalMillis': { + 'message': { 'required': false, - 'maximum': 9223372036854, - 'minimum': 60000, }, - 'priority': { + 'timestampEpochMs': { 'required': false, - 'maximum': 10, - 'minimum': 1, }, } }); /** - * Defines how and where the stream is uploaded + * (Internal Only) TraceableRequest that contains only requestId. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class ExportDefinition { - #__http = null; - #__iotAnalytics = null; - #__kinesis = null; +class TraceableRequest { + #__requestId = null; /** - * @param http {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint - * @param iotAnalytics {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics - * @param kinesis {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis + * @param requestId {String} */ constructor( - http = null, - iotAnalytics = null, - kinesis = null, + requestId = null, ) { - if (http !== null && !(http instanceof Array)) { - throw new Error("http must be Array"); - } - if (http !== null && !http.every((v) => v instanceof HTTPConfig)) { - throw new Error("http array values must be HTTPConfig"); - } - - if (iotAnalytics !== null && !(iotAnalytics instanceof Array)) { - throw new Error("iotAnalytics must be Array"); - } - if (iotAnalytics !== null && !iotAnalytics.every((v) => v instanceof IoTAnalyticsConfig)) { - throw new Error("iotAnalytics array values must be IoTAnalyticsConfig"); - } - - if (kinesis !== null && !(kinesis instanceof Array)) { - throw new Error("kinesis must be Array"); - } - if (kinesis !== null && !kinesis.every((v) => v instanceof KinesisConfig)) { - throw new Error("kinesis array values must be KinesisConfig"); + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); } - this.#__http = http; - this.#__iotAnalytics = iotAnalytics; - this.#__kinesis = kinesis; + this.#__requestId = requestId; } /** - * Defines how the stream is uploaded to an HTTP endpoint - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} + * @returns {String} */ - get http() { - return this.#__http; + get requestId() { + return this.#__requestId; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint + * @param value {String} */ - set http(value) { - if (value !== null && !(value instanceof Array)) { - throw new Error("http must be Array"); - } - if (value !== null && !value.every((v) => v instanceof HTTPConfig)) { - throw new Error("http array values must be HTTPConfig"); + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); } - this.#__http = value; + this.#__requestId = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint - * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.TraceableRequest} */ - withHttp(value) { - this.http = value; + withRequestId(value) { + this.requestId = value; return this; } - /** - * Defines how the stream is uploaded to IoT Analytics - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} - - */ - get iotAnalytics() { - return this.#__iotAnalytics; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics - */ - set iotAnalytics(value) { - if (value !== null && !(value instanceof Array)) { - throw new Error("iotAnalytics must be Array"); - } - if (value !== null && !value.every((v) => v instanceof IoTAnalyticsConfig)) { - throw new Error("iotAnalytics array values must be IoTAnalyticsConfig"); + static fromMap(d) { + const ret = new TraceableRequest(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - - this.#__iotAnalytics = value; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics - * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} - */ - withIotAnalytics(value) { - this.iotAnalytics = value; - return this; - } - - /** - * Defines how the stream is uploaded to Kinesis - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} - - */ - get kinesis() { - return this.#__kinesis; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis - */ - set kinesis(value) { - if (value !== null && !(value instanceof Array)) { - throw new Error("kinesis must be Array"); - } - if (value !== null && !value.every((v) => v instanceof KinesisConfig)) { - throw new Error("kinesis array values must be KinesisConfig"); - } - - this.#__kinesis = value; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis - * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} - */ - withKinesis(value) { - this.kinesis = value; - return this; - } - - static fromMap(d) { - const ret = new ExportDefinition(); - if ("http" in d) { - ret.http = d["http"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(HTTPConfig, "fromMap") ? HTTPConfig.fromMap(v) : v); - return acc; - }, []); - } - if ("iotAnalytics" in d) { - ret.iotAnalytics = d["iotAnalytics"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(IoTAnalyticsConfig, "fromMap") ? IoTAnalyticsConfig.fromMap(v) : v); - return acc; - }, []); - } - if ("kinesis" in d) { - ret.kinesis = d["kinesis"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(KinesisConfig, "fromMap") ? KinesisConfig.fromMap(v) : v); - return acc; - }, []); - } - return ret; + return ret; } asMap() { const d = {}; - if (this.http !== null) { - d["http"] = this.http.reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); - return acc; - }, []); - } - if (this.iotAnalytics !== null) { - d["iotAnalytics"] = this.iotAnalytics.reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); - return acc; - }, []); - } - if (this.kinesis !== null) { - d["kinesis"] = this.kinesis.reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); - return acc; - }, []); + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } return d; } }; -Object.defineProperty(ExportDefinition, "typesMap", { +Object.defineProperty(TraceableRequest, "typesMap", { value: { - http: { - 'type': Array, - 'subtype': HTTPConfig - }, - iotAnalytics: { - 'type': Array, - 'subtype': IoTAnalyticsConfig - }, - kinesis: { - 'type': Array, - 'subtype': KinesisConfig + requestId: { + 'type': String, + 'subtype': null }, } }); -Object.defineProperty(ExportDefinition, "formatsMap", { +Object.defineProperty(TraceableRequest, "formatsMap", { value: {} }); -Object.defineProperty(ExportDefinition, "validationsMap", { +Object.defineProperty(TraceableRequest, "validationsMap", { value: { - 'http': { - 'required': false, - }, - 'iotAnalytics': { - 'required': false, - }, - 'kinesis': { - 'required': false, + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, }, } }); /** - * Object defining a message stream used in the CreateMessageStream API. + * (Internal Only) Response for UnknownOperationError. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class MessageStreamDefinition { - #__name = null; - #__maxSize = null; - #__streamSegmentSize = null; - #__timeToLiveMillis = null; - #__strategyOnFull = null; - #__persistence = null; - #__flushOnWrite = null; - #__exportDefinition = null; +class UnknownOperationError { + #__requestId = null; + #__status = null; + #__errorMessage = null; /** - * @param name {String} The unique name of the stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @param maxSize {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. - * @param streamSegmentSize {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. - Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. - * @param timeToLiveMillis {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @param strategyOnFull {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. - RejectNewData: any append message request after the stream is full will be rejected with an exception. - OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. - * @param persistence {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. - Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. - * @param flushOnWrite {Boolean} This only applies when Persistence is set to File mode. - Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. - * @param exportDefinition {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. + * @param requestId {String} + * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param errorMessage {String} */ constructor( - name = null, - maxSize = 268435456, - streamSegmentSize = 16777216, - timeToLiveMillis = null, - strategyOnFull = null, - persistence = null, - flushOnWrite = null, - exportDefinition = null, + requestId = null, + status = null, + errorMessage = null, ) { - if (name !== null && !(typeof name === "string")) { - throw new Error("name must be String"); - } - - if (maxSize !== null && !(typeof maxSize === "number")) { - throw new Error("maxSize must be Number"); - } - - if (streamSegmentSize !== null && !(typeof streamSegmentSize === "number")) { - throw new Error("streamSegmentSize must be Number"); - } - - if (timeToLiveMillis !== null && !(typeof timeToLiveMillis === "number")) { - throw new Error("timeToLiveMillis must be Number"); - } - - if (strategyOnFull !== null && !(strategyOnFull instanceof StrategyOnFull)) { - throw new Error("strategyOnFull must be StrategyOnFull"); - } - - if (persistence !== null && !(persistence instanceof Persistence)) { - throw new Error("persistence must be Persistence"); + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); } - if (flushOnWrite !== null && !(typeof flushOnWrite === "boolean")) { - throw new Error("flushOnWrite must be Boolean"); + if (status !== null && !(status instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); } - if (exportDefinition !== null && !(exportDefinition instanceof ExportDefinition)) { - throw new Error("exportDefinition must be ExportDefinition"); + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); } - this.#__name = name; - this.#__maxSize = maxSize; - this.#__streamSegmentSize = streamSegmentSize; - this.#__timeToLiveMillis = timeToLiveMillis; - this.#__strategyOnFull = strategyOnFull; - this.#__persistence = persistence; - this.#__flushOnWrite = flushOnWrite; - this.#__exportDefinition = exportDefinition; + this.#__requestId = requestId; + this.#__status = status; + this.#__errorMessage = errorMessage; } /** - * The unique name of the stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. * @returns {String} - + */ - get name() { - return this.#__name; + get requestId() { + return this.#__requestId; } /** - * @param value {String} The unique name of the stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param value {String} */ - set name(value) { + set requestId(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("name must be String"); + throw new Error("requestId must be String"); } - this.#__name = value; + this.#__requestId = value; } /** - * @param value {String} The unique name of the stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.UnknownOperationError} */ - withName(value) { - this.name = value; + withRequestId(value) { + this.requestId = value; return this; } /** - * The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. - * @returns {Number} + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} */ - get maxSize() { - return this.#__maxSize; + get status() { + return this.#__status; } /** - * @param value {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} */ - set maxSize(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("maxSize must be Number"); + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); } - this.#__maxSize = value; + this.#__status = value; } /** - * @param value {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.UnknownOperationError} */ - withMaxSize(value) { - this.maxSize = value; + withStatus(value) { + this.status = value; return this; } /** - * The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. - Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. - * @returns {Number} - + * @returns {String} + */ - get streamSegmentSize() { - return this.#__streamSegmentSize; + get errorMessage() { + return this.#__errorMessage; } /** - * @param value {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. - Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. + * @param value {String} */ - set streamSegmentSize(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("streamSegmentSize must be Number"); + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); } - this.#__streamSegmentSize = value; + this.#__errorMessage = value; } /** - * @param value {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. - Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.UnknownOperationError} */ - withStreamSegmentSize(value) { - this.streamSegmentSize = value; - return this; - } - - /** - * Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {Number} - - */ - get timeToLiveMillis() { - return this.#__timeToLiveMillis; - } - /** - * @param value {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - */ - set timeToLiveMillis(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("timeToLiveMillis must be Number"); - } - - this.#__timeToLiveMillis = value; - } - /** - * @param value {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - */ - withTimeToLiveMillis(value) { - this.timeToLiveMillis = value; - return this; - } - - /** - * What to do when the maximum size of the stream is reached. - RejectNewData: any append message request after the stream is full will be rejected with an exception. - OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. - * @returns {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} - - */ - get strategyOnFull() { - return this.#__strategyOnFull; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. - RejectNewData: any append message request after the stream is full will be rejected with an exception. - OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. - */ - set strategyOnFull(value) { - if (value !== null && !(value instanceof StrategyOnFull)) { - throw new Error("strategyOnFull must be StrategyOnFull"); - } - - this.#__strategyOnFull = value; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. - RejectNewData: any append message request after the stream is full will be rejected with an exception. - OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - */ - withStrategyOnFull(value) { - this.strategyOnFull = value; - return this; - } - - /** - * Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. - Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. - * @returns {aws-greengrass-core-sdk.StreamManager.Persistence} - - */ - get persistence() { - return this.#__persistence; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. - Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. - */ - set persistence(value) { - if (value !== null && !(value instanceof Persistence)) { - throw new Error("persistence must be Persistence"); - } - - this.#__persistence = value; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. - Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - */ - withPersistence(value) { - this.persistence = value; - return this; - } - - /** - * This only applies when Persistence is set to File mode. - Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. - * @returns {Boolean} - - */ - get flushOnWrite() { - return this.#__flushOnWrite; - } - /** - * @param value {Boolean} This only applies when Persistence is set to File mode. - Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. - */ - set flushOnWrite(value) { - if (value !== null && !(typeof value === "boolean")) { - throw new Error("flushOnWrite must be Boolean"); - } - - this.#__flushOnWrite = value; - } - /** - * @param value {Boolean} This only applies when Persistence is set to File mode. - Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - */ - withFlushOnWrite(value) { - this.flushOnWrite = value; - return this; - } - - /** - * Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. - * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} - - */ - get exportDefinition() { - return this.#__exportDefinition; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. - */ - set exportDefinition(value) { - if (value !== null && !(value instanceof ExportDefinition)) { - throw new Error("exportDefinition must be ExportDefinition"); - } - - this.#__exportDefinition = value; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - */ - withExportDefinition(value) { - this.exportDefinition = value; + withErrorMessage(value) { + this.errorMessage = value; return this; } static fromMap(d) { - const ret = new MessageStreamDefinition(); - if ("name" in d) { - ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; - } - if ("maxSize" in d) { - ret.maxSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["maxSize"]) : d["maxSize"]; - } - if ("streamSegmentSize" in d) { - ret.streamSegmentSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["streamSegmentSize"]) : d["streamSegmentSize"]; - } - if ("timeToLiveMillis" in d) { - ret.timeToLiveMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["timeToLiveMillis"]) : d["timeToLiveMillis"]; - } - if ("strategyOnFull" in d) { - ret.strategyOnFull = Object.prototype.hasOwnProperty.call(StrategyOnFull, "fromMap") ? StrategyOnFull.fromMap(d["strategyOnFull"]) : d["strategyOnFull"]; - } - if ("persistence" in d) { - ret.persistence = Object.prototype.hasOwnProperty.call(Persistence, "fromMap") ? Persistence.fromMap(d["persistence"]) : d["persistence"]; + const ret = new UnknownOperationError(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - if ("flushOnWrite" in d) { - ret.flushOnWrite = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["flushOnWrite"]) : d["flushOnWrite"]; + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; } - if ("exportDefinition" in d) { - ret.exportDefinition = Object.prototype.hasOwnProperty.call(ExportDefinition, "fromMap") ? ExportDefinition.fromMap(d["exportDefinition"]) : d["exportDefinition"]; + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; } return ret; } asMap() { const d = {}; - if (this.name !== null) { - d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; - } - if (this.maxSize !== null) { - d["maxSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.maxSize), "asMap") ? this.maxSize.asMap() : this.maxSize; - } - if (this.streamSegmentSize !== null) { - d["streamSegmentSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamSegmentSize), "asMap") ? this.streamSegmentSize.asMap() : this.streamSegmentSize; - } - if (this.timeToLiveMillis !== null) { - d["timeToLiveMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.timeToLiveMillis), "asMap") ? this.timeToLiveMillis.asMap() : this.timeToLiveMillis; - } - if (this.strategyOnFull !== null) { - d["strategyOnFull"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.strategyOnFull), "asMap") ? this.strategyOnFull.asMap() : this.strategyOnFull; - } - if (this.persistence !== null) { - d["persistence"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.persistence), "asMap") ? this.persistence.asMap() : this.persistence; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } - if (this.flushOnWrite !== null) { - d["flushOnWrite"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.flushOnWrite), "asMap") ? this.flushOnWrite.asMap() : this.flushOnWrite; + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; } - if (this.exportDefinition !== null) { - d["exportDefinition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportDefinition), "asMap") ? this.exportDefinition.asMap() : this.exportDefinition; + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; } return d; } }; -Object.defineProperty(MessageStreamDefinition, "typesMap", { +Object.defineProperty(UnknownOperationError, "typesMap", { value: { - name: { + requestId: { 'type': String, 'subtype': null }, - maxSize: { - 'type': Number, - 'subtype': null - }, - streamSegmentSize: { - 'type': Number, - 'subtype': null - }, - timeToLiveMillis: { - 'type': Number, - 'subtype': null - }, - strategyOnFull: { - 'type': StrategyOnFull, - 'subtype': null - }, - persistence: { - 'type': Persistence, - 'subtype': null - }, - flushOnWrite: { - 'type': Boolean, + status: { + 'type': ResponseStatusCode, 'subtype': null }, - exportDefinition: { - 'type': ExportDefinition, + errorMessage: { + 'type': String, 'subtype': null }, } }); -Object.defineProperty(MessageStreamDefinition, "formatsMap", { +Object.defineProperty(UnknownOperationError, "formatsMap", { value: {} }); -Object.defineProperty(MessageStreamDefinition, "validationsMap", { +Object.defineProperty(UnknownOperationError, "validationsMap", { value: { - 'name': { + 'requestId': { 'required': true, 'minLength': 1, - 'maxLength': 255, 'pattern': /^[\w ,.\-_]*$/, }, - 'maxSize': { - 'required': false, - 'maximum': 9223372036854775807, - 'minimum': 1024, + 'status': { + 'required': true, }, - 'streamSegmentSize': { - 'required': false, - 'maximum': 2147483647, - 'minimum': 1024, - }, - 'timeToLiveMillis': { - 'required': false, - 'maximum': 9223372036854, - 'minimum': 60000, - }, - 'strategyOnFull': { - 'required': true, - }, - 'persistence': { - 'required': false, - }, - 'flushOnWrite': { - 'required': false, - }, - 'exportDefinition': { + 'errorMessage': { 'required': false, }, } }); /** - * Message stream information including its definition, storage status and export status + * Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. + Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class MessageStreamInfo { - #__definition = null; - #__storageStatus = null; - #__exportStatuses = null; +class Persistence { + + #value = null; + constructor(value = null) { + if (!Object.values(Persistence.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; + } + + static fromMap(d) { + return Persistence[Persistence.optionsFlipped[d]]; + } + + asMap() { + return this.#value; + } +}; +Object.defineProperty(Persistence, "options", { + value: { + File: 0, + Memory: 1, + } +}); +Object.defineProperty(Persistence, "optionsFlipped", { + value: { + 0: "File", + 1: "Memory", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.Persistence} File + * @memberOf aws-greengrass-core-sdk.StreamManager.Persistence# + * @readonly + */ +Object.defineProperty(Persistence, "File", { + value: new Persistence(0) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Persistence} Memory + * @memberOf aws-greengrass-core-sdk.StreamManager.Persistence# + * @readonly + */ +Object.defineProperty(Persistence, "Memory", { + value: new Persistence(1) +}); + +/** + * ExportFormat is used to define how messages are batched and formatted in the export payload. + RAW_NOT_BATCHED: Each message in a batch will be sent as an individual HTTP POST with the payload as the body (even if batchSize is set). + JSON_BATCHED: Each batch of messages will be sent as a JSON list of Message objects as the body. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class ExportFormat { + + #value = null; + constructor(value = null) { + if (!Object.values(ExportFormat.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; + } + + static fromMap(d) { + return ExportFormat[ExportFormat.optionsFlipped[d]]; + } + + asMap() { + return this.#value; + } +}; +Object.defineProperty(ExportFormat, "options", { + value: { + RAW_NOT_BATCHED: 0, + JSON_BATCHED: 1, + } +}); +Object.defineProperty(ExportFormat, "optionsFlipped", { + value: { + 0: "RAW_NOT_BATCHED", + 1: "JSON_BATCHED", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.ExportFormat} RAW_NOT_BATCHED + * @memberOf aws-greengrass-core-sdk.StreamManager.ExportFormat# + * @readonly + */ +Object.defineProperty(ExportFormat, "RAW_NOT_BATCHED", { + value: new ExportFormat(0) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.ExportFormat} JSON_BATCHED + * @memberOf aws-greengrass-core-sdk.StreamManager.ExportFormat# + * @readonly + */ +Object.defineProperty(ExportFormat, "JSON_BATCHED", { + value: new ExportFormat(1) +}); + +/** + * This export destination is not supported! The interface may change at any time without notice and should not be relied on for any production use. + There are no guarantees around its correctness. + This configures an HTTP endpoint which sends a POST request to the provided URI. Each request contains a single message in the body of the request. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class HTTPConfig { + #__identifier = null; + #__uri = null; + #__batchSize = null; + #__batchIntervalMillis = null; + #__priority = null; + #__startSequenceNumber = null; + #__disabled = null; + #__exportFormat = null; /** - * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - * @param storageStatus {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes - * @param exportStatuses {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + * @param identifier {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param uri {String} URL for HTTP endpoint which should receive the POST requests for export. + * @param batchSize {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 500. + * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param startSequenceNumber {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @param disabled {Boolean} Enable or disable this export. Default is false. + * @param exportFormat {aws-greengrass-core-sdk.StreamManager.ExportFormat} Defines how messages are batched and formatted in the export payload. */ constructor( - definition = null, - storageStatus = null, - exportStatuses = null, + identifier = null, + uri = null, + batchSize = null, + batchIntervalMillis = null, + priority = null, + startSequenceNumber = null, + disabled = null, + exportFormat = null, ) { - if (definition !== null && !(definition instanceof MessageStreamDefinition)) { - throw new Error("definition must be MessageStreamDefinition"); + if (identifier !== null && !(typeof identifier === "string")) { + throw new Error("identifier must be String"); } - if (storageStatus !== null && !(storageStatus instanceof MessageStreamInfo._storageStatus)) { - throw new Error("storageStatus must be MessageStreamInfo._storageStatus"); + if (uri !== null && !(typeof uri === "string")) { + throw new Error("uri must be String"); } - if (exportStatuses !== null && !(exportStatuses instanceof Array)) { - throw new Error("exportStatuses must be Array"); + if (batchSize !== null && !(typeof batchSize === "number")) { + throw new Error("batchSize must be Number"); } - if (exportStatuses !== null && !exportStatuses.every((v) => v instanceof MessageStreamInfo._exportStatuses)) { - throw new Error("exportStatuses array values must be MessageStreamInfo._exportStatuses"); + + if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { + throw new Error("batchIntervalMillis must be Number"); } - this.#__definition = definition; - this.#__storageStatus = storageStatus; - this.#__exportStatuses = exportStatuses; + if (priority !== null && !(typeof priority === "number")) { + throw new Error("priority must be Number"); + } + + if (startSequenceNumber !== null && !(typeof startSequenceNumber === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + if (disabled !== null && !(typeof disabled === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + if (exportFormat !== null && !(exportFormat instanceof ExportFormat)) { + throw new Error("exportFormat must be ExportFormat"); + } + + this.#__identifier = identifier; + this.#__uri = uri; + this.#__batchSize = batchSize; + this.#__batchIntervalMillis = batchIntervalMillis; + this.#__priority = priority; + this.#__startSequenceNumber = startSequenceNumber; + this.#__disabled = disabled; + this.#__exportFormat = exportFormat; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - + * A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + */ - get definition() { - return this.#__definition; + get identifier() { + return this.#__identifier; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. */ - set definition(value) { - if (value !== null && !(value instanceof MessageStreamDefinition)) { - throw new Error("definition must be MessageStreamDefinition"); + set identifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("identifier must be String"); } - this.#__definition = value; + this.#__identifier = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} */ - withDefinition(value) { - this.definition = value; + withIdentifier(value) { + this.identifier = value; return this; } /** - * Stream status including oldest/newest sequence number and total bytes - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} + * URL for HTTP endpoint which should receive the POST requests for export. + * @returns {String} */ - get storageStatus() { - return this.#__storageStatus; + get uri() { + return this.#__uri; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes + * @param value {String} URL for HTTP endpoint which should receive the POST requests for export. */ - set storageStatus(value) { - if (value !== null && !(value instanceof MessageStreamInfo._storageStatus)) { - throw new Error("storageStatus must be MessageStreamInfo._storageStatus"); + set uri(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("uri must be String"); } - this.#__storageStatus = value; + this.#__uri = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + * @param value {String} URL for HTTP endpoint which should receive the POST requests for export. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} */ - withStorageStatus(value) { - this.storageStatus = value; + withUri(value) { + this.uri = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} - + * The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 500. + * @returns {Number} + */ - get exportStatuses() { - return this.#__exportStatuses; + get batchSize() { + return this.#__batchSize; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 500. */ - set exportStatuses(value) { - if (value !== null && !(value instanceof Array)) { - throw new Error("exportStatuses must be Array"); - } - if (value !== null && !value.every((v) => v instanceof MessageStreamInfo._exportStatuses)) { - throw new Error("exportStatuses array values must be MessageStreamInfo._exportStatuses"); + set batchSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchSize must be Number"); } - this.#__exportStatuses = value; + this.#__batchSize = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 500. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} */ - withExportStatuses(value) { - this.exportStatuses = value; - return this; + withBatchSize(value) { + this.batchSize = value; + return this; } - static fromMap(d) { - const ret = new MessageStreamInfo(); - if ("definition" in d) { - ret.definition = Object.prototype.hasOwnProperty.call(MessageStreamDefinition, "fromMap") ? MessageStreamDefinition.fromMap(d["definition"]) : d["definition"]; - } - if ("storageStatus" in d) { - ret.storageStatus = Object.prototype.hasOwnProperty.call(MessageStreamInfo._storageStatus, "fromMap") ? MessageStreamInfo._storageStatus.fromMap(d["storageStatus"]) : d["storageStatus"]; - } - if ("exportStatuses" in d) { - ret.exportStatuses = d["exportStatuses"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(MessageStreamInfo._exportStatuses, "fromMap") ? MessageStreamInfo._exportStatuses.fromMap(v) : v); - return acc; - }, []); + /** + * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {Number} + + */ + get batchIntervalMillis() { + return this.#__batchIntervalMillis; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + */ + set batchIntervalMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchIntervalMillis must be Number"); } - return ret; + + this.#__batchIntervalMillis = value; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + */ + withBatchIntervalMillis(value) { + this.batchIntervalMillis = value; + return this; } - asMap() { - const d = {}; - if (this.definition !== null) { - d["definition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.definition), "asMap") ? this.definition.asMap() : this.definition; - } - if (this.storageStatus !== null) { - d["storageStatus"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.storageStatus), "asMap") ? this.storageStatus.asMap() : this.storageStatus; - } - if (this.exportStatuses !== null) { - d["exportStatuses"] = this.exportStatuses.reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); - return acc; - }, []); + /** + * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {Number} + + */ + get priority() { + return this.#__priority; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + */ + set priority(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("priority must be Number"); } - return d; + + this.#__priority = value; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + */ + withPriority(value) { + this.priority = value; + return this; } -}; -MessageStreamInfo._storageStatus = /** - * Stream status including oldest/newest sequence number and total bytes - * - * @class - * @memberOf aws-greengrass-core-sdk.StreamManager + * The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {Number} + */ - class _storageStatus { - #__oldestSequenceNumber = null; - #__newestSequenceNumber = null; - #__totalBytes = null; + get startSequenceNumber() { + return this.#__startSequenceNumber; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + */ + set startSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("startSequenceNumber must be Number"); + } - /** - * @param oldestSequenceNumber {Number} The sequence number of the first message which is still accessible in the stream. - * @param newestSequenceNumber {Number} The sequence number of the last appended message. - * @param totalBytes {Number} The current total size of the stream in bytes. - */ - constructor( - oldestSequenceNumber = null, - newestSequenceNumber = null, - totalBytes = null, - ) { - if (oldestSequenceNumber !== null && !(typeof oldestSequenceNumber === "number")) { - throw new Error("oldestSequenceNumber must be Number"); - } + this.#__startSequenceNumber = value; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + */ + withStartSequenceNumber(value) { + this.startSequenceNumber = value; + return this; + } - if (newestSequenceNumber !== null && !(typeof newestSequenceNumber === "number")) { - throw new Error("newestSequenceNumber must be Number"); - } + /** + * Enable or disable this export. Default is false. + * @returns {Boolean} + + */ + get disabled() { + return this.#__disabled; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + */ + set disabled(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("disabled must be Boolean"); + } - if (totalBytes !== null && !(typeof totalBytes === "number")) { - throw new Error("totalBytes must be Number"); - } + this.#__disabled = value; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + */ + withDisabled(value) { + this.disabled = value; + return this; + } - this.#__oldestSequenceNumber = oldestSequenceNumber; - this.#__newestSequenceNumber = newestSequenceNumber; - this.#__totalBytes = totalBytes; + /** + * Defines how messages are batched and formatted in the export payload. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportFormat} + + */ + get exportFormat() { + return this.#__exportFormat; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ExportFormat} Defines how messages are batched and formatted in the export payload. + */ + set exportFormat(value) { + if (value !== null && !(value instanceof ExportFormat)) { + throw new Error("exportFormat must be ExportFormat"); } - /** - * The sequence number of the first message which is still accessible in the stream. - * @returns {Number} - - */ - get oldestSequenceNumber() { - return this.#__oldestSequenceNumber; - } - /** - * @param value {Number} The sequence number of the first message which is still accessible in the stream. - */ - set oldestSequenceNumber(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("oldestSequenceNumber must be Number"); - } + this.#__exportFormat = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ExportFormat} Defines how messages are batched and formatted in the export payload. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + */ + withExportFormat(value) { + this.exportFormat = value; + return this; + } - this.#__oldestSequenceNumber = value; - } - /** - * @param value {Number} The sequence number of the first message which is still accessible in the stream. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} - */ - withOldestSequenceNumber(value) { - this.oldestSequenceNumber = value; - return this; + static fromMap(d) { + const ret = new HTTPConfig(); + if ("identifier" in d) { + ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; } - - /** - * The sequence number of the last appended message. - * @returns {Number} - - */ - get newestSequenceNumber() { - return this.#__newestSequenceNumber; + if ("uri" in d) { + ret.uri = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["uri"]) : d["uri"]; } - /** - * @param value {Number} The sequence number of the last appended message. - */ - set newestSequenceNumber(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("newestSequenceNumber must be Number"); - } - - this.#__newestSequenceNumber = value; + if ("batchSize" in d) { + ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; } - /** - * @param value {Number} The sequence number of the last appended message. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} - */ - withNewestSequenceNumber(value) { - this.newestSequenceNumber = value; - return this; + if ("batchIntervalMillis" in d) { + ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; } - - /** - * The current total size of the stream in bytes. - * @returns {Number} - - */ - get totalBytes() { - return this.#__totalBytes; + if ("priority" in d) { + ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; } - /** - * @param value {Number} The current total size of the stream in bytes. - */ - set totalBytes(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("totalBytes must be Number"); - } - - this.#__totalBytes = value; + if ("startSequenceNumber" in d) { + ret.startSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["startSequenceNumber"]) : d["startSequenceNumber"]; } - /** - * @param value {Number} The current total size of the stream in bytes. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} - */ - withTotalBytes(value) { - this.totalBytes = value; - return this; + if ("disabled" in d) { + ret.disabled = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["disabled"]) : d["disabled"]; } - - static fromMap(d) { - const ret = new MessageStreamInfo._storageStatus(); - if ("oldestSequenceNumber" in d) { - ret.oldestSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["oldestSequenceNumber"]) : d["oldestSequenceNumber"]; - } - if ("newestSequenceNumber" in d) { - ret.newestSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["newestSequenceNumber"]) : d["newestSequenceNumber"]; - } - if ("totalBytes" in d) { - ret.totalBytes = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["totalBytes"]) : d["totalBytes"]; - } - return ret; + if ("exportFormat" in d) { + ret.exportFormat = Object.prototype.hasOwnProperty.call(ExportFormat, "fromMap") ? ExportFormat.fromMap(d["exportFormat"]) : d["exportFormat"]; } + return ret; + } - asMap() { - const d = {}; - if (this.oldestSequenceNumber !== null) { - d["oldestSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.oldestSequenceNumber), "asMap") ? this.oldestSequenceNumber.asMap() : this.oldestSequenceNumber; - } - if (this.newestSequenceNumber !== null) { - d["newestSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.newestSequenceNumber), "asMap") ? this.newestSequenceNumber.asMap() : this.newestSequenceNumber; - } - if (this.totalBytes !== null) { - d["totalBytes"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.totalBytes), "asMap") ? this.totalBytes.asMap() : this.totalBytes; - } - return d; + asMap() { + const d = {}; + if (this.identifier !== null) { + d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; } - }; + if (this.uri !== null) { + d["uri"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.uri), "asMap") ? this.uri.asMap() : this.uri; + } + if (this.batchSize !== null) { + d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + } + if (this.batchIntervalMillis !== null) { + d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + } + if (this.priority !== null) { + d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + } + if (this.startSequenceNumber !== null) { + d["startSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.startSequenceNumber), "asMap") ? this.startSequenceNumber.asMap() : this.startSequenceNumber; + } + if (this.disabled !== null) { + d["disabled"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.disabled), "asMap") ? this.disabled.asMap() : this.disabled; + } + if (this.exportFormat !== null) { + d["exportFormat"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportFormat), "asMap") ? this.exportFormat.asMap() : this.exportFormat; + } + return d; + } +}; -Object.defineProperty(MessageStreamInfo._storageStatus, "typesMap", { +Object.defineProperty(HTTPConfig, "typesMap", { value: { - oldestSequenceNumber: { + identifier: { + 'type': String, + 'subtype': null + }, + uri: { + 'type': String, + 'subtype': null + }, + batchSize: { 'type': Number, 'subtype': null }, - newestSequenceNumber: { + batchIntervalMillis: { 'type': Number, 'subtype': null }, - totalBytes: { + priority: { + 'type': Number, + 'subtype': null + }, + startSequenceNumber: { 'type': Number, 'subtype': null }, + disabled: { + 'type': Boolean, + 'subtype': null + }, + exportFormat: { + 'type': ExportFormat, + 'subtype': null + }, } }); -Object.defineProperty(MessageStreamInfo._storageStatus, "formatsMap", { +Object.defineProperty(HTTPConfig, "formatsMap", { value: {} }); -Object.defineProperty(MessageStreamInfo._storageStatus, "validationsMap", { +Object.defineProperty(HTTPConfig, "validationsMap", { value: { - 'oldestSequenceNumber': { + 'identifier': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'uri': { + 'required': true, + 'minLength': 1, + }, + 'batchSize': { 'required': false, + 'maximum': 500, + 'minimum': 1, }, - 'newestSequenceNumber': { + 'batchIntervalMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 60000, + }, + 'priority': { 'required': false, + 'maximum': 10, + 'minimum': 1, }, - 'totalBytes': { + 'startSequenceNumber': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 0, + }, + 'disabled': { + 'required': false, + }, + 'exportFormat': { 'required': false, }, } -}); +}); + +/** + * Configuration object for IoT Analytics export destination. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class IoTAnalyticsConfig { + #__identifier = null; + #__iotChannel = null; + #__iotMsgIdPrefix = null; + #__batchSize = null; + #__batchIntervalMillis = null; + #__priority = null; + #__startSequenceNumber = null; + #__disabled = null; + + /** + * @param identifier {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param iotChannel {String} The name of the IoT Analytics Channel that this exporter should upload to. + * @param iotMsgIdPrefix {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. + This prefix must be less than 32 characters. + * @param batchSize {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 100. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 100. + * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param startSequenceNumber {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @param disabled {Boolean} Enable or disable this export. Default is false. + */ + constructor( + identifier = null, + iotChannel = null, + iotMsgIdPrefix = null, + batchSize = null, + batchIntervalMillis = null, + priority = null, + startSequenceNumber = null, + disabled = null, + ) { + if (identifier !== null && !(typeof identifier === "string")) { + throw new Error("identifier must be String"); + } + + if (iotChannel !== null && !(typeof iotChannel === "string")) { + throw new Error("iotChannel must be String"); + } + + if (iotMsgIdPrefix !== null && !(typeof iotMsgIdPrefix === "string")) { + throw new Error("iotMsgIdPrefix must be String"); + } + + if (batchSize !== null && !(typeof batchSize === "number")) { + throw new Error("batchSize must be Number"); + } + + if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + if (priority !== null && !(typeof priority === "number")) { + throw new Error("priority must be Number"); + } + + if (startSequenceNumber !== null && !(typeof startSequenceNumber === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + if (disabled !== null && !(typeof disabled === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__identifier = identifier; + this.#__iotChannel = iotChannel; + this.#__iotMsgIdPrefix = iotMsgIdPrefix; + this.#__batchSize = batchSize; + this.#__batchIntervalMillis = batchIntervalMillis; + this.#__priority = priority; + this.#__startSequenceNumber = startSequenceNumber; + this.#__disabled = disabled; + } + + /** + * A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + + */ + get identifier() { + return this.#__identifier; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + */ + set identifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("identifier must be String"); + } + + this.#__identifier = value; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withIdentifier(value) { + this.identifier = value; + return this; + } + + /** + * The name of the IoT Analytics Channel that this exporter should upload to. + * @returns {String} + + */ + get iotChannel() { + return this.#__iotChannel; + } + /** + * @param value {String} The name of the IoT Analytics Channel that this exporter should upload to. + */ + set iotChannel(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("iotChannel must be String"); + } + + this.#__iotChannel = value; + } + /** + * @param value {String} The name of the IoT Analytics Channel that this exporter should upload to. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withIotChannel(value) { + this.iotChannel = value; + return this; + } + + /** + * A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. + This prefix must be less than 32 characters. + * @returns {String} + + */ + get iotMsgIdPrefix() { + return this.#__iotMsgIdPrefix; + } + /** + * @param value {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. + This prefix must be less than 32 characters. + */ + set iotMsgIdPrefix(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("iotMsgIdPrefix must be String"); + } + + this.#__iotMsgIdPrefix = value; + } + /** + * @param value {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. + This prefix must be less than 32 characters. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withIotMsgIdPrefix(value) { + this.iotMsgIdPrefix = value; + return this; + } + + /** + * The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 100. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 100. + * @returns {Number} + + */ + get batchSize() { + return this.#__batchSize; + } + /** + * @param value {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 100. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 100. + */ + set batchSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchSize must be Number"); + } + + this.#__batchSize = value; + } + /** + * @param value {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 100. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 100. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withBatchSize(value) { + this.batchSize = value; + return this; + } + + /** + * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {Number} + + */ + get batchIntervalMillis() { + return this.#__batchIntervalMillis; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + */ + set batchIntervalMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + this.#__batchIntervalMillis = value; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withBatchIntervalMillis(value) { + this.batchIntervalMillis = value; + return this; + } + + /** + * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {Number} + + */ + get priority() { + return this.#__priority; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + */ + set priority(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("priority must be Number"); + } + + this.#__priority = value; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withPriority(value) { + this.priority = value; + return this; + } + + /** + * The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {Number} + + */ + get startSequenceNumber() { + return this.#__startSequenceNumber; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + */ + set startSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + this.#__startSequenceNumber = value; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withStartSequenceNumber(value) { + this.startSequenceNumber = value; + return this; + } + + /** + * Enable or disable this export. Default is false. + * @returns {Boolean} + + */ + get disabled() { + return this.#__disabled; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + */ + set disabled(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__disabled = value; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withDisabled(value) { + this.disabled = value; + return this; + } + + static fromMap(d) { + const ret = new IoTAnalyticsConfig(); + if ("identifier" in d) { + ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; + } + if ("iotChannel" in d) { + ret.iotChannel = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["iotChannel"]) : d["iotChannel"]; + } + if ("iotMsgIdPrefix" in d) { + ret.iotMsgIdPrefix = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["iotMsgIdPrefix"]) : d["iotMsgIdPrefix"]; + } + if ("batchSize" in d) { + ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + } + if ("batchIntervalMillis" in d) { + ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + } + if ("priority" in d) { + ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + } + if ("startSequenceNumber" in d) { + ret.startSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["startSequenceNumber"]) : d["startSequenceNumber"]; + } + if ("disabled" in d) { + ret.disabled = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["disabled"]) : d["disabled"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.identifier !== null) { + d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + } + if (this.iotChannel !== null) { + d["iotChannel"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.iotChannel), "asMap") ? this.iotChannel.asMap() : this.iotChannel; + } + if (this.iotMsgIdPrefix !== null) { + d["iotMsgIdPrefix"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.iotMsgIdPrefix), "asMap") ? this.iotMsgIdPrefix.asMap() : this.iotMsgIdPrefix; + } + if (this.batchSize !== null) { + d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + } + if (this.batchIntervalMillis !== null) { + d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + } + if (this.priority !== null) { + d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + } + if (this.startSequenceNumber !== null) { + d["startSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.startSequenceNumber), "asMap") ? this.startSequenceNumber.asMap() : this.startSequenceNumber; + } + if (this.disabled !== null) { + d["disabled"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.disabled), "asMap") ? this.disabled.asMap() : this.disabled; + } + return d; + } +}; + +Object.defineProperty(IoTAnalyticsConfig, "typesMap", { + value: { + identifier: { + 'type': String, + 'subtype': null + }, + iotChannel: { + 'type': String, + 'subtype': null + }, + iotMsgIdPrefix: { + 'type': String, + 'subtype': null + }, + batchSize: { + 'type': Number, + 'subtype': null + }, + batchIntervalMillis: { + 'type': Number, + 'subtype': null + }, + priority: { + 'type': Number, + 'subtype': null + }, + startSequenceNumber: { + 'type': Number, + 'subtype': null + }, + disabled: { + 'type': Boolean, + 'subtype': null + }, + } +}); +Object.defineProperty(IoTAnalyticsConfig, "formatsMap", { + value: {} +}); +Object.defineProperty(IoTAnalyticsConfig, "validationsMap", { + value: { + 'identifier': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'iotChannel': { + 'required': true, + 'minLength': 1, + }, + 'iotMsgIdPrefix': { + 'required': false, + 'maxLength': 32, + }, + 'batchSize': { + 'required': false, + 'maximum': 100, + 'minimum': 1, + }, + 'batchIntervalMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 60000, + }, + 'priority': { + 'required': false, + 'maximum': 10, + 'minimum': 1, + }, + 'startSequenceNumber': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 0, + }, + 'disabled': { + 'required': false, + }, + } +}); + +/** + * Configuration object for Kinesis data streams export destination. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class KinesisConfig { + #__identifier = null; + #__kinesisStreamName = null; + #__batchSize = null; + #__batchIntervalMillis = null; + #__priority = null; + #__startSequenceNumber = null; + #__disabled = null; + + /** + * @param identifier {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param kinesisStreamName {String} The name of the Kinesis data stream that this exporter should upload to. + * @param batchSize {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 500. + * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param startSequenceNumber {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @param disabled {Boolean} Enable or disable this export. Default is false. + */ + constructor( + identifier = null, + kinesisStreamName = null, + batchSize = null, + batchIntervalMillis = null, + priority = null, + startSequenceNumber = null, + disabled = null, + ) { + if (identifier !== null && !(typeof identifier === "string")) { + throw new Error("identifier must be String"); + } + + if (kinesisStreamName !== null && !(typeof kinesisStreamName === "string")) { + throw new Error("kinesisStreamName must be String"); + } + + if (batchSize !== null && !(typeof batchSize === "number")) { + throw new Error("batchSize must be Number"); + } + + if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + if (priority !== null && !(typeof priority === "number")) { + throw new Error("priority must be Number"); + } + + if (startSequenceNumber !== null && !(typeof startSequenceNumber === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + if (disabled !== null && !(typeof disabled === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__identifier = identifier; + this.#__kinesisStreamName = kinesisStreamName; + this.#__batchSize = batchSize; + this.#__batchIntervalMillis = batchIntervalMillis; + this.#__priority = priority; + this.#__startSequenceNumber = startSequenceNumber; + this.#__disabled = disabled; + } + + /** + * A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + + */ + get identifier() { + return this.#__identifier; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + */ + set identifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("identifier must be String"); + } + + this.#__identifier = value; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withIdentifier(value) { + this.identifier = value; + return this; + } + + /** + * The name of the Kinesis data stream that this exporter should upload to. + * @returns {String} + + */ + get kinesisStreamName() { + return this.#__kinesisStreamName; + } + /** + * @param value {String} The name of the Kinesis data stream that this exporter should upload to. + */ + set kinesisStreamName(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("kinesisStreamName must be String"); + } + + this.#__kinesisStreamName = value; + } + /** + * @param value {String} The name of the Kinesis data stream that this exporter should upload to. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withKinesisStreamName(value) { + this.kinesisStreamName = value; + return this; + } + + /** + * The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 500. + * @returns {Number} + + */ + get batchSize() { + return this.#__batchSize; + } + /** + * @param value {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 500. + */ + set batchSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchSize must be Number"); + } + + this.#__batchSize = value; + } + /** + * @param value {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 500. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withBatchSize(value) { + this.batchSize = value; + return this; + } + + /** + * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {Number} + + */ + get batchIntervalMillis() { + return this.#__batchIntervalMillis; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + */ + set batchIntervalMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + this.#__batchIntervalMillis = value; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withBatchIntervalMillis(value) { + this.batchIntervalMillis = value; + return this; + } + + /** + * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {Number} + + */ + get priority() { + return this.#__priority; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + */ + set priority(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("priority must be Number"); + } + + this.#__priority = value; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withPriority(value) { + this.priority = value; + return this; + } + + /** + * The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {Number} + + */ + get startSequenceNumber() { + return this.#__startSequenceNumber; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + */ + set startSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + this.#__startSequenceNumber = value; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withStartSequenceNumber(value) { + this.startSequenceNumber = value; + return this; + } + + /** + * Enable or disable this export. Default is false. + * @returns {Boolean} + + */ + get disabled() { + return this.#__disabled; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + */ + set disabled(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__disabled = value; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withDisabled(value) { + this.disabled = value; + return this; + } + + static fromMap(d) { + const ret = new KinesisConfig(); + if ("identifier" in d) { + ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; + } + if ("kinesisStreamName" in d) { + ret.kinesisStreamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["kinesisStreamName"]) : d["kinesisStreamName"]; + } + if ("batchSize" in d) { + ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + } + if ("batchIntervalMillis" in d) { + ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + } + if ("priority" in d) { + ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + } + if ("startSequenceNumber" in d) { + ret.startSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["startSequenceNumber"]) : d["startSequenceNumber"]; + } + if ("disabled" in d) { + ret.disabled = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["disabled"]) : d["disabled"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.identifier !== null) { + d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + } + if (this.kinesisStreamName !== null) { + d["kinesisStreamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.kinesisStreamName), "asMap") ? this.kinesisStreamName.asMap() : this.kinesisStreamName; + } + if (this.batchSize !== null) { + d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + } + if (this.batchIntervalMillis !== null) { + d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + } + if (this.priority !== null) { + d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + } + if (this.startSequenceNumber !== null) { + d["startSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.startSequenceNumber), "asMap") ? this.startSequenceNumber.asMap() : this.startSequenceNumber; + } + if (this.disabled !== null) { + d["disabled"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.disabled), "asMap") ? this.disabled.asMap() : this.disabled; + } + return d; + } +}; + +Object.defineProperty(KinesisConfig, "typesMap", { + value: { + identifier: { + 'type': String, + 'subtype': null + }, + kinesisStreamName: { + 'type': String, + 'subtype': null + }, + batchSize: { + 'type': Number, + 'subtype': null + }, + batchIntervalMillis: { + 'type': Number, + 'subtype': null + }, + priority: { + 'type': Number, + 'subtype': null + }, + startSequenceNumber: { + 'type': Number, + 'subtype': null + }, + disabled: { + 'type': Boolean, + 'subtype': null + }, + } +}); +Object.defineProperty(KinesisConfig, "formatsMap", { + value: {} +}); +Object.defineProperty(KinesisConfig, "validationsMap", { + value: { + 'identifier': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'kinesisStreamName': { + 'required': true, + 'minLength': 1, + }, + 'batchSize': { + 'required': false, + 'maximum': 500, + 'minimum': 1, + }, + 'batchIntervalMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 60000, + }, + 'priority': { + 'required': false, + 'maximum': 10, + 'minimum': 1, + }, + 'startSequenceNumber': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 0, + }, + 'disabled': { + 'required': false, + }, + } +}); + +/** + * Configuration object for IotSiteWise data streams export destination. Minimum version requirements: StreamManager server version 1.1 (or AWS IoT Greengrass Core 1.11.0) + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class IoTSiteWiseConfig { + #__identifier = null; + #__batchSize = null; + #__batchIntervalMillis = null; + #__priority = null; + #__startSequenceNumber = null; + #__disabled = null; + + /** + * @param identifier {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param batchSize {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 10. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 10. + * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param startSequenceNumber {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @param disabled {Boolean} Enable or disable this export. Default is false. + */ + constructor( + identifier = null, + batchSize = null, + batchIntervalMillis = null, + priority = null, + startSequenceNumber = null, + disabled = null, + ) { + if (identifier !== null && !(typeof identifier === "string")) { + throw new Error("identifier must be String"); + } + + if (batchSize !== null && !(typeof batchSize === "number")) { + throw new Error("batchSize must be Number"); + } + + if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + if (priority !== null && !(typeof priority === "number")) { + throw new Error("priority must be Number"); + } + + if (startSequenceNumber !== null && !(typeof startSequenceNumber === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + if (disabled !== null && !(typeof disabled === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__identifier = identifier; + this.#__batchSize = batchSize; + this.#__batchIntervalMillis = batchIntervalMillis; + this.#__priority = priority; + this.#__startSequenceNumber = startSequenceNumber; + this.#__disabled = disabled; + } + + /** + * A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + + */ + get identifier() { + return this.#__identifier; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + */ + set identifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("identifier must be String"); + } + + this.#__identifier = value; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withIdentifier(value) { + this.identifier = value; + return this; + } + + /** + * The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 10. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 10. + * @returns {Number} + + */ + get batchSize() { + return this.#__batchSize; + } + /** + * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 10. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 10. + */ + set batchSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchSize must be Number"); + } + + this.#__batchSize = value; + } + /** + * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 10. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 10. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withBatchSize(value) { + this.batchSize = value; + return this; + } + + /** + * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {Number} + + */ + get batchIntervalMillis() { + return this.#__batchIntervalMillis; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + */ + set batchIntervalMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + this.#__batchIntervalMillis = value; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withBatchIntervalMillis(value) { + this.batchIntervalMillis = value; + return this; + } + + /** + * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {Number} + + */ + get priority() { + return this.#__priority; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + */ + set priority(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("priority must be Number"); + } + + this.#__priority = value; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withPriority(value) { + this.priority = value; + return this; + } + + /** + * The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {Number} + + */ + get startSequenceNumber() { + return this.#__startSequenceNumber; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + */ + set startSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + this.#__startSequenceNumber = value; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withStartSequenceNumber(value) { + this.startSequenceNumber = value; + return this; + } + + /** + * Enable or disable this export. Default is false. + * @returns {Boolean} + + */ + get disabled() { + return this.#__disabled; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + */ + set disabled(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__disabled = value; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withDisabled(value) { + this.disabled = value; + return this; + } + + static fromMap(d) { + const ret = new IoTSiteWiseConfig(); + if ("identifier" in d) { + ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; + } + if ("batchSize" in d) { + ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + } + if ("batchIntervalMillis" in d) { + ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + } + if ("priority" in d) { + ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + } + if ("startSequenceNumber" in d) { + ret.startSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["startSequenceNumber"]) : d["startSequenceNumber"]; + } + if ("disabled" in d) { + ret.disabled = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["disabled"]) : d["disabled"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.identifier !== null) { + d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + } + if (this.batchSize !== null) { + d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + } + if (this.batchIntervalMillis !== null) { + d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + } + if (this.priority !== null) { + d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + } + if (this.startSequenceNumber !== null) { + d["startSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.startSequenceNumber), "asMap") ? this.startSequenceNumber.asMap() : this.startSequenceNumber; + } + if (this.disabled !== null) { + d["disabled"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.disabled), "asMap") ? this.disabled.asMap() : this.disabled; + } + return d; + } +}; + +Object.defineProperty(IoTSiteWiseConfig, "typesMap", { + value: { + identifier: { + 'type': String, + 'subtype': null + }, + batchSize: { + 'type': Number, + 'subtype': null + }, + batchIntervalMillis: { + 'type': Number, + 'subtype': null + }, + priority: { + 'type': Number, + 'subtype': null + }, + startSequenceNumber: { + 'type': Number, + 'subtype': null + }, + disabled: { + 'type': Boolean, + 'subtype': null + }, + } +}); +Object.defineProperty(IoTSiteWiseConfig, "formatsMap", { + value: {} +}); +Object.defineProperty(IoTSiteWiseConfig, "validationsMap", { + value: { + 'identifier': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'batchSize': { + 'required': false, + 'maximum': 10, + 'minimum': 1, + }, + 'batchIntervalMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 60000, + }, + 'priority': { + 'required': false, + 'maximum': 10, + 'minimum': 1, + }, + 'startSequenceNumber': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 0, + }, + 'disabled': { + 'required': false, + }, + } +}); + +/** + * Configuration for status in a status-stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class StatusConfig { + #__statusLevel = null; + #__statusStreamName = null; + + /** + * @param statusLevel {aws-greengrass-core-sdk.StreamManager.StatusLevel} Defines the verbosity of status messages in a status-stream. + * @param statusStreamName {String} The name of the stream to which status messages are appended. + The status-stream should be created before associating it with another stream. + */ + constructor( + statusLevel = null, + statusStreamName = null, + ) { + if (statusLevel !== null && !(statusLevel instanceof StatusLevel)) { + throw new Error("statusLevel must be StatusLevel"); + } + + if (statusStreamName !== null && !(typeof statusStreamName === "string")) { + throw new Error("statusStreamName must be String"); + } + + this.#__statusLevel = statusLevel; + this.#__statusStreamName = statusStreamName; + } + + /** + * Defines the verbosity of status messages in a status-stream. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusLevel} + + */ + get statusLevel() { + return this.#__statusLevel; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusLevel} Defines the verbosity of status messages in a status-stream. + */ + set statusLevel(value) { + if (value !== null && !(value instanceof StatusLevel)) { + throw new Error("statusLevel must be StatusLevel"); + } + + this.#__statusLevel = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusLevel} Defines the verbosity of status messages in a status-stream. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusConfig} + */ + withStatusLevel(value) { + this.statusLevel = value; + return this; + } + + /** + * The name of the stream to which status messages are appended. + The status-stream should be created before associating it with another stream. + * @returns {String} + + */ + get statusStreamName() { + return this.#__statusStreamName; + } + /** + * @param value {String} The name of the stream to which status messages are appended. + The status-stream should be created before associating it with another stream. + */ + set statusStreamName(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("statusStreamName must be String"); + } + + this.#__statusStreamName = value; + } + /** + * @param value {String} The name of the stream to which status messages are appended. + The status-stream should be created before associating it with another stream. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusConfig} + */ + withStatusStreamName(value) { + this.statusStreamName = value; + return this; + } + + static fromMap(d) { + const ret = new StatusConfig(); + if ("statusLevel" in d) { + ret.statusLevel = Object.prototype.hasOwnProperty.call(StatusLevel, "fromMap") ? StatusLevel.fromMap(d["statusLevel"]) : d["statusLevel"]; + } + if ("statusStreamName" in d) { + ret.statusStreamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["statusStreamName"]) : d["statusStreamName"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.statusLevel !== null) { + d["statusLevel"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.statusLevel), "asMap") ? this.statusLevel.asMap() : this.statusLevel; + } + if (this.statusStreamName !== null) { + d["statusStreamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.statusStreamName), "asMap") ? this.statusStreamName.asMap() : this.statusStreamName; + } + return d; + } +}; + +Object.defineProperty(StatusConfig, "typesMap", { + value: { + statusLevel: { + 'type': StatusLevel, + 'subtype': null + }, + statusStreamName: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(StatusConfig, "formatsMap", { + value: {} +}); +Object.defineProperty(StatusConfig, "validationsMap", { + value: { + 'statusLevel': { + 'required': false, + }, + 'statusStreamName': { + 'required': false, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + } +}); + +/** + * Configuration object for S3 export tasks executor. Minimum version requirements: StreamManager server version 1.1 (or AWS IoT Greengrass Core 1.11.0) + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class S3ExportTaskExecutorConfig { + #__identifier = null; + #__sizeThresholdForMultipartUploadBytes = null; + #__priority = null; + #__disabled = null; + #__statusConfig = null; + + /** + * @param identifier {String} A unique identifier to identify this individual upload task. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param sizeThresholdForMultipartUploadBytes {Number} The size threshold in bytes for when to use multipart uploads. Uploads over this size will automatically use a multipart upload strategy, while uploads equal or smaller than this threshold will use a single connection to upload the whole object. + * @param priority {Number} Priority for this upload task. Lower values are higher priority. If not specified it will have the lowest priority. + * @param disabled {Boolean} Enable or disable this export. Default is false. + * @param statusConfig {aws-greengrass-core-sdk.StreamManager.StatusConfig} Event status configuration that specifies the target status stream and verbosity. + */ + constructor( + identifier = null, + sizeThresholdForMultipartUploadBytes = null, + priority = null, + disabled = null, + statusConfig = null, + ) { + if (identifier !== null && !(typeof identifier === "string")) { + throw new Error("identifier must be String"); + } + + if (sizeThresholdForMultipartUploadBytes !== null && !(typeof sizeThresholdForMultipartUploadBytes === "number")) { + throw new Error("sizeThresholdForMultipartUploadBytes must be Number"); + } + + if (priority !== null && !(typeof priority === "number")) { + throw new Error("priority must be Number"); + } + + if (disabled !== null && !(typeof disabled === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + if (statusConfig !== null && !(statusConfig instanceof StatusConfig)) { + throw new Error("statusConfig must be StatusConfig"); + } + + this.#__identifier = identifier; + this.#__sizeThresholdForMultipartUploadBytes = sizeThresholdForMultipartUploadBytes; + this.#__priority = priority; + this.#__disabled = disabled; + this.#__statusConfig = statusConfig; + } + + /** + * A unique identifier to identify this individual upload task. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + + */ + get identifier() { + return this.#__identifier; + } + /** + * @param value {String} A unique identifier to identify this individual upload task. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + */ + set identifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("identifier must be String"); + } + + this.#__identifier = value; + } + /** + * @param value {String} A unique identifier to identify this individual upload task. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig} + */ + withIdentifier(value) { + this.identifier = value; + return this; + } + + /** + * The size threshold in bytes for when to use multipart uploads. Uploads over this size will automatically use a multipart upload strategy, while uploads equal or smaller than this threshold will use a single connection to upload the whole object. + * @returns {Number} + + */ + get sizeThresholdForMultipartUploadBytes() { + return this.#__sizeThresholdForMultipartUploadBytes; + } + /** + * @param value {Number} The size threshold in bytes for when to use multipart uploads. Uploads over this size will automatically use a multipart upload strategy, while uploads equal or smaller than this threshold will use a single connection to upload the whole object. + */ + set sizeThresholdForMultipartUploadBytes(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("sizeThresholdForMultipartUploadBytes must be Number"); + } + + this.#__sizeThresholdForMultipartUploadBytes = value; + } + /** + * @param value {Number} The size threshold in bytes for when to use multipart uploads. Uploads over this size will automatically use a multipart upload strategy, while uploads equal or smaller than this threshold will use a single connection to upload the whole object. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig} + */ + withSizeThresholdForMultipartUploadBytes(value) { + this.sizeThresholdForMultipartUploadBytes = value; + return this; + } + + /** + * Priority for this upload task. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {Number} + + */ + get priority() { + return this.#__priority; + } + /** + * @param value {Number} Priority for this upload task. Lower values are higher priority. If not specified it will have the lowest priority. + */ + set priority(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("priority must be Number"); + } + + this.#__priority = value; + } + /** + * @param value {Number} Priority for this upload task. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig} + */ + withPriority(value) { + this.priority = value; + return this; + } + + /** + * Enable or disable this export. Default is false. + * @returns {Boolean} + + */ + get disabled() { + return this.#__disabled; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + */ + set disabled(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__disabled = value; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig} + */ + withDisabled(value) { + this.disabled = value; + return this; + } + + /** + * Event status configuration that specifies the target status stream and verbosity. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusConfig} + + */ + get statusConfig() { + return this.#__statusConfig; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusConfig} Event status configuration that specifies the target status stream and verbosity. + */ + set statusConfig(value) { + if (value !== null && !(value instanceof StatusConfig)) { + throw new Error("statusConfig must be StatusConfig"); + } + + this.#__statusConfig = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusConfig} Event status configuration that specifies the target status stream and verbosity. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig} + */ + withStatusConfig(value) { + this.statusConfig = value; + return this; + } + + static fromMap(d) { + const ret = new S3ExportTaskExecutorConfig(); + if ("identifier" in d) { + ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; + } + if ("sizeThresholdForMultipartUploadBytes" in d) { + ret.sizeThresholdForMultipartUploadBytes = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sizeThresholdForMultipartUploadBytes"]) : d["sizeThresholdForMultipartUploadBytes"]; + } + if ("priority" in d) { + ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + } + if ("disabled" in d) { + ret.disabled = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["disabled"]) : d["disabled"]; + } + if ("statusConfig" in d) { + ret.statusConfig = Object.prototype.hasOwnProperty.call(StatusConfig, "fromMap") ? StatusConfig.fromMap(d["statusConfig"]) : d["statusConfig"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.identifier !== null) { + d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + } + if (this.sizeThresholdForMultipartUploadBytes !== null) { + d["sizeThresholdForMultipartUploadBytes"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sizeThresholdForMultipartUploadBytes), "asMap") ? this.sizeThresholdForMultipartUploadBytes.asMap() : this.sizeThresholdForMultipartUploadBytes; + } + if (this.priority !== null) { + d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + } + if (this.disabled !== null) { + d["disabled"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.disabled), "asMap") ? this.disabled.asMap() : this.disabled; + } + if (this.statusConfig !== null) { + d["statusConfig"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.statusConfig), "asMap") ? this.statusConfig.asMap() : this.statusConfig; + } + return d; + } +}; + +Object.defineProperty(S3ExportTaskExecutorConfig, "typesMap", { + value: { + identifier: { + 'type': String, + 'subtype': null + }, + sizeThresholdForMultipartUploadBytes: { + 'type': Number, + 'subtype': null + }, + priority: { + 'type': Number, + 'subtype': null + }, + disabled: { + 'type': Boolean, + 'subtype': null + }, + statusConfig: { + 'type': StatusConfig, + 'subtype': null + }, + } +}); +Object.defineProperty(S3ExportTaskExecutorConfig, "formatsMap", { + value: {} +}); +Object.defineProperty(S3ExportTaskExecutorConfig, "validationsMap", { + value: { + 'identifier': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'sizeThresholdForMultipartUploadBytes': { + 'required': false, + 'minimum': 5242880, + }, + 'priority': { + 'required': false, + 'maximum': 10, + 'minimum': 1, + }, + 'disabled': { + 'required': false, + }, + 'statusConfig': { + 'required': false, + }, + } +}); + +/** + * Defines how and where the stream is uploaded. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class ExportDefinition { + #__http = null; + #__iotAnalytics = null; + #__kinesis = null; + #__IotSitewise = null; + #__s3TaskExecutor = null; + + /** + * @param http {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint. + * @param iotAnalytics {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics. + * @param kinesis {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis. + * @param IotSitewise {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig[]} Defines how the stream is uploaded to IoT SiteWise. + * @param s3TaskExecutor {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig[]} Defines the list of configs for S3 task executors. + */ + constructor( + http = null, + iotAnalytics = null, + kinesis = null, + IotSitewise = null, + s3TaskExecutor = null, + ) { + if (http !== null && !(http instanceof Array)) { + throw new Error("http must be Array"); + } + if (http !== null && !http.every((v) => v instanceof HTTPConfig)) { + throw new Error("http array values must be HTTPConfig"); + } + + if (iotAnalytics !== null && !(iotAnalytics instanceof Array)) { + throw new Error("iotAnalytics must be Array"); + } + if (iotAnalytics !== null && !iotAnalytics.every((v) => v instanceof IoTAnalyticsConfig)) { + throw new Error("iotAnalytics array values must be IoTAnalyticsConfig"); + } + + if (kinesis !== null && !(kinesis instanceof Array)) { + throw new Error("kinesis must be Array"); + } + if (kinesis !== null && !kinesis.every((v) => v instanceof KinesisConfig)) { + throw new Error("kinesis array values must be KinesisConfig"); + } + + if (IotSitewise !== null && !(IotSitewise instanceof Array)) { + throw new Error("IotSitewise must be Array"); + } + if (IotSitewise !== null && !IotSitewise.every((v) => v instanceof IoTSiteWiseConfig)) { + throw new Error("IotSitewise array values must be IoTSiteWiseConfig"); + } + + if (s3TaskExecutor !== null && !(s3TaskExecutor instanceof Array)) { + throw new Error("s3TaskExecutor must be Array"); + } + if (s3TaskExecutor !== null && !s3TaskExecutor.every((v) => v instanceof S3ExportTaskExecutorConfig)) { + throw new Error("s3TaskExecutor array values must be S3ExportTaskExecutorConfig"); + } + + this.#__http = http; + this.#__iotAnalytics = iotAnalytics; + this.#__kinesis = kinesis; + this.#__IotSitewise = IotSitewise; + this.#__s3TaskExecutor = s3TaskExecutor; + } + + /** + * Defines how the stream is uploaded to an HTTP endpoint. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} + + */ + get http() { + return this.#__http; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint. + */ + set http(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("http must be Array"); + } + if (value !== null && !value.every((v) => v instanceof HTTPConfig)) { + throw new Error("http array values must be HTTPConfig"); + } + + this.#__http = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + */ + withHttp(value) { + this.http = value; + return this; + } + + /** + * Defines how the stream is uploaded to IoT Analytics. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} + + */ + get iotAnalytics() { + return this.#__iotAnalytics; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics. + */ + set iotAnalytics(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("iotAnalytics must be Array"); + } + if (value !== null && !value.every((v) => v instanceof IoTAnalyticsConfig)) { + throw new Error("iotAnalytics array values must be IoTAnalyticsConfig"); + } + + this.#__iotAnalytics = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + */ + withIotAnalytics(value) { + this.iotAnalytics = value; + return this; + } + + /** + * Defines how the stream is uploaded to Kinesis. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} + + */ + get kinesis() { + return this.#__kinesis; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis. + */ + set kinesis(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("kinesis must be Array"); + } + if (value !== null && !value.every((v) => v instanceof KinesisConfig)) { + throw new Error("kinesis array values must be KinesisConfig"); + } + + this.#__kinesis = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + */ + withKinesis(value) { + this.kinesis = value; + return this; + } + + /** + * Defines how the stream is uploaded to IoT SiteWise. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig[]} + + */ + get IotSitewise() { + return this.#__IotSitewise; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig[]} Defines how the stream is uploaded to IoT SiteWise. + */ + set IotSitewise(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("IotSitewise must be Array"); + } + if (value !== null && !value.every((v) => v instanceof IoTSiteWiseConfig)) { + throw new Error("IotSitewise array values must be IoTSiteWiseConfig"); + } + + this.#__IotSitewise = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig[]} Defines how the stream is uploaded to IoT SiteWise. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + */ + withIotSitewise(value) { + this.IotSitewise = value; + return this; + } + + /** + * Defines the list of configs for S3 task executors. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig[]} + + */ + get s3TaskExecutor() { + return this.#__s3TaskExecutor; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig[]} Defines the list of configs for S3 task executors. + */ + set s3TaskExecutor(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("s3TaskExecutor must be Array"); + } + if (value !== null && !value.every((v) => v instanceof S3ExportTaskExecutorConfig)) { + throw new Error("s3TaskExecutor array values must be S3ExportTaskExecutorConfig"); + } + + this.#__s3TaskExecutor = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig[]} Defines the list of configs for S3 task executors. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + */ + withS3TaskExecutor(value) { + this.s3TaskExecutor = value; + return this; + } + + static fromMap(d) { + const ret = new ExportDefinition(); + if ("http" in d) { + ret.http = d["http"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(HTTPConfig, "fromMap") ? HTTPConfig.fromMap(v) : v); + return acc; + }, []); + } + if ("iotAnalytics" in d) { + ret.iotAnalytics = d["iotAnalytics"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(IoTAnalyticsConfig, "fromMap") ? IoTAnalyticsConfig.fromMap(v) : v); + return acc; + }, []); + } + if ("kinesis" in d) { + ret.kinesis = d["kinesis"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(KinesisConfig, "fromMap") ? KinesisConfig.fromMap(v) : v); + return acc; + }, []); + } + if ("IotSitewise" in d) { + ret.IotSitewise = d["IotSitewise"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(IoTSiteWiseConfig, "fromMap") ? IoTSiteWiseConfig.fromMap(v) : v); + return acc; + }, []); + } + if ("s3TaskExecutor" in d) { + ret.s3TaskExecutor = d["s3TaskExecutor"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(S3ExportTaskExecutorConfig, "fromMap") ? S3ExportTaskExecutorConfig.fromMap(v) : v); + return acc; + }, []); + } + return ret; + } + + asMap() { + const d = {}; + if (this.http !== null) { + d["http"] = this.http.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + if (this.iotAnalytics !== null) { + d["iotAnalytics"] = this.iotAnalytics.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + if (this.kinesis !== null) { + d["kinesis"] = this.kinesis.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + if (this.IotSitewise !== null) { + d["IotSitewise"] = this.IotSitewise.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + if (this.s3TaskExecutor !== null) { + d["s3TaskExecutor"] = this.s3TaskExecutor.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + return d; + } +}; + +Object.defineProperty(ExportDefinition, "typesMap", { + value: { + http: { + 'type': Array, + 'subtype': HTTPConfig + }, + iotAnalytics: { + 'type': Array, + 'subtype': IoTAnalyticsConfig + }, + kinesis: { + 'type': Array, + 'subtype': KinesisConfig + }, + IotSitewise: { + 'type': Array, + 'subtype': IoTSiteWiseConfig + }, + s3TaskExecutor: { + 'type': Array, + 'subtype': S3ExportTaskExecutorConfig + }, + } +}); +Object.defineProperty(ExportDefinition, "formatsMap", { + value: {} +}); +Object.defineProperty(ExportDefinition, "validationsMap", { + value: { + 'http': { + 'required': false, + }, + 'iotAnalytics': { + 'required': false, + }, + 'kinesis': { + 'required': false, + }, + 'IotSitewise': { + 'required': false, + }, + 's3TaskExecutor': { + 'required': false, + }, + } +}); + +/** + * StrategyOnFull is used in the MessageStreamDefinition when creating a stream. + It defines the behavior when the stream has reached the maximum size. + RejectNewData: any append message request after the stream is full will be rejected with an exception. + OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class StrategyOnFull { + + #value = null; + constructor(value = null) { + if (!Object.values(StrategyOnFull.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; + } + + static fromMap(d) { + return StrategyOnFull[StrategyOnFull.optionsFlipped[d]]; + } + + asMap() { + return this.#value; + } +}; +Object.defineProperty(StrategyOnFull, "options", { + value: { + RejectNewData: 0, + OverwriteOldestData: 1, + } +}); +Object.defineProperty(StrategyOnFull, "optionsFlipped", { + value: { + 0: "RejectNewData", + 1: "OverwriteOldestData", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} RejectNewData + * @memberOf aws-greengrass-core-sdk.StreamManager.StrategyOnFull# + * @readonly + */ +Object.defineProperty(StrategyOnFull, "RejectNewData", { + value: new StrategyOnFull(0) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} OverwriteOldestData + * @memberOf aws-greengrass-core-sdk.StreamManager.StrategyOnFull# + * @readonly + */ +Object.defineProperty(StrategyOnFull, "OverwriteOldestData", { + value: new StrategyOnFull(1) +}); + +/** + * Object defining a message stream used in the CreateMessageStream and UpdateMessageStream API. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class MessageStreamDefinition { + #__name = null; + #__maxSize = null; + #__streamSegmentSize = null; + #__timeToLiveMillis = null; + #__strategyOnFull = null; + #__persistence = null; + #__flushOnWrite = null; + #__exportDefinition = null; + + /** + * @param name {String} The unique name of the stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param maxSize {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. + * @param streamSegmentSize {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. + Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. + * @param timeToLiveMillis {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param strategyOnFull {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. + RejectNewData: any append message request after the stream is full will be rejected with an exception. + OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. + * @param persistence {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. + Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. + * @param flushOnWrite {Boolean} This only applies when Persistence is set to File mode. + Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. + * @param exportDefinition {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. + */ + constructor( + name = null, + maxSize = 268435456, + streamSegmentSize = 16777216, + timeToLiveMillis = null, + strategyOnFull = null, + persistence = null, + flushOnWrite = null, + exportDefinition = null, + ) { + if (name !== null && !(typeof name === "string")) { + throw new Error("name must be String"); + } + + if (maxSize !== null && !(typeof maxSize === "number")) { + throw new Error("maxSize must be Number"); + } + + if (streamSegmentSize !== null && !(typeof streamSegmentSize === "number")) { + throw new Error("streamSegmentSize must be Number"); + } + + if (timeToLiveMillis !== null && !(typeof timeToLiveMillis === "number")) { + throw new Error("timeToLiveMillis must be Number"); + } + + if (strategyOnFull !== null && !(strategyOnFull instanceof StrategyOnFull)) { + throw new Error("strategyOnFull must be StrategyOnFull"); + } + + if (persistence !== null && !(persistence instanceof Persistence)) { + throw new Error("persistence must be Persistence"); + } + + if (flushOnWrite !== null && !(typeof flushOnWrite === "boolean")) { + throw new Error("flushOnWrite must be Boolean"); + } + + if (exportDefinition !== null && !(exportDefinition instanceof ExportDefinition)) { + throw new Error("exportDefinition must be ExportDefinition"); + } + + this.#__name = name; + this.#__maxSize = maxSize; + this.#__streamSegmentSize = streamSegmentSize; + this.#__timeToLiveMillis = timeToLiveMillis; + this.#__strategyOnFull = strategyOnFull; + this.#__persistence = persistence; + this.#__flushOnWrite = flushOnWrite; + this.#__exportDefinition = exportDefinition; + } + + /** + * The unique name of the stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + + */ + get name() { + return this.#__name; + } + /** + * @param value {String} The unique name of the stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + */ + set name(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("name must be String"); + } + + this.#__name = value; + } + /** + * @param value {String} The unique name of the stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withName(value) { + this.name = value; + return this; + } + + /** + * The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. + * @returns {Number} + + */ + get maxSize() { + return this.#__maxSize; + } + /** + * @param value {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. + */ + set maxSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("maxSize must be Number"); + } + + this.#__maxSize = value; + } + /** + * @param value {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withMaxSize(value) { + this.maxSize = value; + return this; + } + + /** + * The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. + Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. + * @returns {Number} + + */ + get streamSegmentSize() { + return this.#__streamSegmentSize; + } + /** + * @param value {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. + Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. + */ + set streamSegmentSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("streamSegmentSize must be Number"); + } + + this.#__streamSegmentSize = value; + } + /** + * @param value {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. + Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withStreamSegmentSize(value) { + this.streamSegmentSize = value; + return this; + } + + /** + * Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {Number} + + */ + get timeToLiveMillis() { + return this.#__timeToLiveMillis; + } + /** + * @param value {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + */ + set timeToLiveMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("timeToLiveMillis must be Number"); + } + + this.#__timeToLiveMillis = value; + } + /** + * @param value {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withTimeToLiveMillis(value) { + this.timeToLiveMillis = value; + return this; + } + + /** + * What to do when the maximum size of the stream is reached. + RejectNewData: any append message request after the stream is full will be rejected with an exception. + OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. + * @returns {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} + + */ + get strategyOnFull() { + return this.#__strategyOnFull; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. + RejectNewData: any append message request after the stream is full will be rejected with an exception. + OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. + */ + set strategyOnFull(value) { + if (value !== null && !(value instanceof StrategyOnFull)) { + throw new Error("strategyOnFull must be StrategyOnFull"); + } + + this.#__strategyOnFull = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. + RejectNewData: any append message request after the stream is full will be rejected with an exception. + OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withStrategyOnFull(value) { + this.strategyOnFull = value; + return this; + } + + /** + * Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. + Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. + * @returns {aws-greengrass-core-sdk.StreamManager.Persistence} + + */ + get persistence() { + return this.#__persistence; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. + Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. + */ + set persistence(value) { + if (value !== null && !(value instanceof Persistence)) { + throw new Error("persistence must be Persistence"); + } + + this.#__persistence = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. + Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withPersistence(value) { + this.persistence = value; + return this; + } + + /** + * This only applies when Persistence is set to File mode. + Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. + * @returns {Boolean} + + */ + get flushOnWrite() { + return this.#__flushOnWrite; + } + /** + * @param value {Boolean} This only applies when Persistence is set to File mode. + Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. + */ + set flushOnWrite(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("flushOnWrite must be Boolean"); + } + + this.#__flushOnWrite = value; + } + /** + * @param value {Boolean} This only applies when Persistence is set to File mode. + Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withFlushOnWrite(value) { + this.flushOnWrite = value; + return this; + } + + /** + * Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + + */ + get exportDefinition() { + return this.#__exportDefinition; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. + */ + set exportDefinition(value) { + if (value !== null && !(value instanceof ExportDefinition)) { + throw new Error("exportDefinition must be ExportDefinition"); + } + + this.#__exportDefinition = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withExportDefinition(value) { + this.exportDefinition = value; + return this; + } + + static fromMap(d) { + const ret = new MessageStreamDefinition(); + if ("name" in d) { + ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + } + if ("maxSize" in d) { + ret.maxSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["maxSize"]) : d["maxSize"]; + } + if ("streamSegmentSize" in d) { + ret.streamSegmentSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["streamSegmentSize"]) : d["streamSegmentSize"]; + } + if ("timeToLiveMillis" in d) { + ret.timeToLiveMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["timeToLiveMillis"]) : d["timeToLiveMillis"]; + } + if ("strategyOnFull" in d) { + ret.strategyOnFull = Object.prototype.hasOwnProperty.call(StrategyOnFull, "fromMap") ? StrategyOnFull.fromMap(d["strategyOnFull"]) : d["strategyOnFull"]; + } + if ("persistence" in d) { + ret.persistence = Object.prototype.hasOwnProperty.call(Persistence, "fromMap") ? Persistence.fromMap(d["persistence"]) : d["persistence"]; + } + if ("flushOnWrite" in d) { + ret.flushOnWrite = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["flushOnWrite"]) : d["flushOnWrite"]; + } + if ("exportDefinition" in d) { + ret.exportDefinition = Object.prototype.hasOwnProperty.call(ExportDefinition, "fromMap") ? ExportDefinition.fromMap(d["exportDefinition"]) : d["exportDefinition"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.name !== null) { + d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + } + if (this.maxSize !== null) { + d["maxSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.maxSize), "asMap") ? this.maxSize.asMap() : this.maxSize; + } + if (this.streamSegmentSize !== null) { + d["streamSegmentSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamSegmentSize), "asMap") ? this.streamSegmentSize.asMap() : this.streamSegmentSize; + } + if (this.timeToLiveMillis !== null) { + d["timeToLiveMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.timeToLiveMillis), "asMap") ? this.timeToLiveMillis.asMap() : this.timeToLiveMillis; + } + if (this.strategyOnFull !== null) { + d["strategyOnFull"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.strategyOnFull), "asMap") ? this.strategyOnFull.asMap() : this.strategyOnFull; + } + if (this.persistence !== null) { + d["persistence"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.persistence), "asMap") ? this.persistence.asMap() : this.persistence; + } + if (this.flushOnWrite !== null) { + d["flushOnWrite"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.flushOnWrite), "asMap") ? this.flushOnWrite.asMap() : this.flushOnWrite; + } + if (this.exportDefinition !== null) { + d["exportDefinition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportDefinition), "asMap") ? this.exportDefinition.asMap() : this.exportDefinition; + } + return d; + } +}; + +Object.defineProperty(MessageStreamDefinition, "typesMap", { + value: { + name: { + 'type': String, + 'subtype': null + }, + maxSize: { + 'type': Number, + 'subtype': null + }, + streamSegmentSize: { + 'type': Number, + 'subtype': null + }, + timeToLiveMillis: { + 'type': Number, + 'subtype': null + }, + strategyOnFull: { + 'type': StrategyOnFull, + 'subtype': null + }, + persistence: { + 'type': Persistence, + 'subtype': null + }, + flushOnWrite: { + 'type': Boolean, + 'subtype': null + }, + exportDefinition: { + 'type': ExportDefinition, + 'subtype': null + }, + } +}); +Object.defineProperty(MessageStreamDefinition, "formatsMap", { + value: {} +}); +Object.defineProperty(MessageStreamDefinition, "validationsMap", { + value: { + 'name': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'maxSize': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 1024, + }, + 'streamSegmentSize': { + 'required': false, + 'maximum': 2147483647, + 'minimum': 1024, + }, + 'timeToLiveMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 60000, + }, + 'strategyOnFull': { + 'required': true, + }, + 'persistence': { + 'required': false, + }, + 'flushOnWrite': { + 'required': false, + }, + 'exportDefinition': { + 'required': false, + }, + } +}); + +/** + * (Internal Only) Request object for creating a message stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class CreateMessageStreamRequest { + #__requestId = null; + #__definition = null; + + /** + * @param requestId {String} + * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + constructor( + requestId = null, + definition = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (definition !== null && !(definition instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + this.#__requestId = requestId; + this.#__definition = definition; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + + */ + get definition() { + return this.#__definition; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + set definition(value) { + if (value !== null && !(value instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + this.#__definition = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest} + */ + withDefinition(value) { + this.definition = value; + return this; + } + + static fromMap(d) { + const ret = new CreateMessageStreamRequest(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("definition" in d) { + ret.definition = Object.prototype.hasOwnProperty.call(MessageStreamDefinition, "fromMap") ? MessageStreamDefinition.fromMap(d["definition"]) : d["definition"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.definition !== null) { + d["definition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.definition), "asMap") ? this.definition.asMap() : this.definition; + } + return d; + } +}; + +Object.defineProperty(CreateMessageStreamRequest, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + definition: { + 'type': MessageStreamDefinition, + 'subtype': null + }, + } +}); +Object.defineProperty(CreateMessageStreamRequest, "formatsMap", { + value: {} +}); +Object.defineProperty(CreateMessageStreamRequest, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'definition': { + 'required': true, + }, + } +}); + +/** + * Internal Only. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class CreateMessageStreamResponse { + #__requestId = null; + #__status = null; + #__errorMessage = null; + + /** + * @param requestId {String} + * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param errorMessage {String} + */ + constructor( + requestId = null, + status = null, + errorMessage = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (status !== null && !(status instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__requestId = requestId; + this.#__status = status; + this.#__errorMessage = errorMessage; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + + */ + get status() { + return this.#__status; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + */ + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + this.#__status = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + */ + withStatus(value) { + this.status = value; + return this; + } + + /** + * @returns {String} + + */ + get errorMessage() { + return this.#__errorMessage; + } + /** + * @param value {String} + */ + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__errorMessage = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + */ + withErrorMessage(value) { + this.errorMessage = value; + return this; + } + + static fromMap(d) { + const ret = new CreateMessageStreamResponse(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + } + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + } + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + } + return d; + } +}; + +Object.defineProperty(CreateMessageStreamResponse, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + status: { + 'type': ResponseStatusCode, + 'subtype': null + }, + errorMessage: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(CreateMessageStreamResponse, "formatsMap", { + value: {} +}); +Object.defineProperty(CreateMessageStreamResponse, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'status': { + 'required': true, + }, + 'errorMessage': { + 'required': false, + }, + } +}); + +/** + * (Internal Only) Request object for updating a message stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class UpdateMessageStreamRequest { + #__requestId = null; + #__definition = null; + + /** + * @param requestId {String} + * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + constructor( + requestId = null, + definition = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (definition !== null && !(definition instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + this.#__requestId = requestId; + this.#__definition = definition; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + + */ + get definition() { + return this.#__definition; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + set definition(value) { + if (value !== null && !(value instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + this.#__definition = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @returns {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest} + */ + withDefinition(value) { + this.definition = value; + return this; + } + + static fromMap(d) { + const ret = new UpdateMessageStreamRequest(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("definition" in d) { + ret.definition = Object.prototype.hasOwnProperty.call(MessageStreamDefinition, "fromMap") ? MessageStreamDefinition.fromMap(d["definition"]) : d["definition"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.definition !== null) { + d["definition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.definition), "asMap") ? this.definition.asMap() : this.definition; + } + return d; + } +}; + +Object.defineProperty(UpdateMessageStreamRequest, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + definition: { + 'type': MessageStreamDefinition, + 'subtype': null + }, + } +}); +Object.defineProperty(UpdateMessageStreamRequest, "formatsMap", { + value: {} +}); +Object.defineProperty(UpdateMessageStreamRequest, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'definition': { + 'required': true, + }, + } +}); + +/** + * (Internal Only) Response for UpdateMessageStreamRequest. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class UpdateMessageStreamResponse { + #__requestId = null; + #__status = null; + #__errorMessage = null; + + /** + * @param requestId {String} + * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param errorMessage {String} + */ + constructor( + requestId = null, + status = null, + errorMessage = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (status !== null && !(status instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__requestId = requestId; + this.#__status = status; + this.#__errorMessage = errorMessage; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + + */ + get status() { + return this.#__status; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + */ + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + this.#__status = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse} + */ + withStatus(value) { + this.status = value; + return this; + } + + /** + * @returns {String} + + */ + get errorMessage() { + return this.#__errorMessage; + } + /** + * @param value {String} + */ + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__errorMessage = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse} + */ + withErrorMessage(value) { + this.errorMessage = value; + return this; + } + + static fromMap(d) { + const ret = new UpdateMessageStreamResponse(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + } + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + } + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + } + return d; + } +}; + +Object.defineProperty(UpdateMessageStreamResponse, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + status: { + 'type': ResponseStatusCode, + 'subtype': null + }, + errorMessage: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(UpdateMessageStreamResponse, "formatsMap", { + value: {} +}); +Object.defineProperty(UpdateMessageStreamResponse, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'status': { + 'required': true, + }, + 'errorMessage': { + 'required': false, + }, + } +}); + +/** + * (Internal Only) Request object for deleting a message stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class DeleteMessageStreamRequest { + #__requestId = null; + #__name = null; + + /** + * @param requestId {String} + * @param name {String} + */ + constructor( + requestId = null, + name = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (name !== null && !(typeof name === "string")) { + throw new Error("name must be String"); + } + + this.#__requestId = requestId; + this.#__name = name; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {String} + + */ + get name() { + return this.#__name; + } + /** + * @param value {String} + */ + set name(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("name must be String"); + } + + this.#__name = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest} + */ + withName(value) { + this.name = value; + return this; + } + + static fromMap(d) { + const ret = new DeleteMessageStreamRequest(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("name" in d) { + ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.name !== null) { + d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + } + return d; + } +}; + +Object.defineProperty(DeleteMessageStreamRequest, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + name: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(DeleteMessageStreamRequest, "formatsMap", { + value: {} +}); +Object.defineProperty(DeleteMessageStreamRequest, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'name': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + } +}); + +/** + * Internal Only. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class DeleteMessageStreamResponse { + #__requestId = null; + #__status = null; + #__errorMessage = null; + + /** + * @param requestId {String} + * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param errorMessage {String} + */ + constructor( + requestId = null, + status = null, + errorMessage = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (status !== null && !(status instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__requestId = requestId; + this.#__status = status; + this.#__errorMessage = errorMessage; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + + */ + get status() { + return this.#__status; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + */ + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + this.#__status = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + */ + withStatus(value) { + this.status = value; + return this; + } + + /** + * @returns {String} + + */ + get errorMessage() { + return this.#__errorMessage; + } + /** + * @param value {String} + */ + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__errorMessage = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + */ + withErrorMessage(value) { + this.errorMessage = value; + return this; + } + + static fromMap(d) { + const ret = new DeleteMessageStreamResponse(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + } + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + } + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + } + return d; + } +}; + +Object.defineProperty(DeleteMessageStreamResponse, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + status: { + 'type': ResponseStatusCode, + 'subtype': null + }, + errorMessage: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(DeleteMessageStreamResponse, "formatsMap", { + value: {} +}); +Object.defineProperty(DeleteMessageStreamResponse, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'status': { + 'required': true, + }, + 'errorMessage': { + 'required': false, + }, + } +}); + +/** + * (Internal Only) Request object for describing a message stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class DescribeMessageStreamRequest { + #__requestId = null; + #__name = null; + + /** + * @param requestId {String} + * @param name {String} + */ + constructor( + requestId = null, + name = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (name !== null && !(typeof name === "string")) { + throw new Error("name must be String"); + } + + this.#__requestId = requestId; + this.#__name = name; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {String} + + */ + get name() { + return this.#__name; + } + /** + * @param value {String} + */ + set name(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("name must be String"); + } + + this.#__name = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest} + */ + withName(value) { + this.name = value; + return this; + } + + static fromMap(d) { + const ret = new DescribeMessageStreamRequest(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("name" in d) { + ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.name !== null) { + d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + } + return d; + } +}; + +Object.defineProperty(DescribeMessageStreamRequest, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + name: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(DescribeMessageStreamRequest, "formatsMap", { + value: {} +}); +Object.defineProperty(DescribeMessageStreamRequest, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'name': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + } +}); + +/** + * Message stream information including its definition, storage status and export status. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class MessageStreamInfo { + #__definition = null; + #__storageStatus = null; + #__exportStatuses = null; + + /** + * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param storageStatus {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes. + * @param exportStatuses {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + */ + constructor( + definition = null, + storageStatus = null, + exportStatuses = null, + ) { + if (definition !== null && !(definition instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + if (storageStatus !== null && !(storageStatus instanceof MessageStreamInfo._storageStatus)) { + throw new Error("storageStatus must be MessageStreamInfo._storageStatus"); + } + + if (exportStatuses !== null && !(exportStatuses instanceof Array)) { + throw new Error("exportStatuses must be Array"); + } + if (exportStatuses !== null && !exportStatuses.every((v) => v instanceof MessageStreamInfo._exportStatuses)) { + throw new Error("exportStatuses array values must be MessageStreamInfo._exportStatuses"); + } + + this.#__definition = definition; + this.#__storageStatus = storageStatus; + this.#__exportStatuses = exportStatuses; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + + */ + get definition() { + return this.#__definition; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + set definition(value) { + if (value !== null && !(value instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + this.#__definition = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + */ + withDefinition(value) { + this.definition = value; + return this; + } + + /** + * Stream status including oldest/newest sequence number and total bytes. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} + + */ + get storageStatus() { + return this.#__storageStatus; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes. + */ + set storageStatus(value) { + if (value !== null && !(value instanceof MessageStreamInfo._storageStatus)) { + throw new Error("storageStatus must be MessageStreamInfo._storageStatus"); + } + + this.#__storageStatus = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + */ + withStorageStatus(value) { + this.storageStatus = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + + */ + get exportStatuses() { + return this.#__exportStatuses; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + */ + set exportStatuses(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("exportStatuses must be Array"); + } + if (value !== null && !value.every((v) => v instanceof MessageStreamInfo._exportStatuses)) { + throw new Error("exportStatuses array values must be MessageStreamInfo._exportStatuses"); + } + + this.#__exportStatuses = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + */ + withExportStatuses(value) { + this.exportStatuses = value; + return this; + } + + static fromMap(d) { + const ret = new MessageStreamInfo(); + if ("definition" in d) { + ret.definition = Object.prototype.hasOwnProperty.call(MessageStreamDefinition, "fromMap") ? MessageStreamDefinition.fromMap(d["definition"]) : d["definition"]; + } + if ("storageStatus" in d) { + ret.storageStatus = Object.prototype.hasOwnProperty.call(MessageStreamInfo._storageStatus, "fromMap") ? MessageStreamInfo._storageStatus.fromMap(d["storageStatus"]) : d["storageStatus"]; + } + if ("exportStatuses" in d) { + ret.exportStatuses = d["exportStatuses"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(MessageStreamInfo._exportStatuses, "fromMap") ? MessageStreamInfo._exportStatuses.fromMap(v) : v); + return acc; + }, []); + } + return ret; + } -MessageStreamInfo._exportStatuses = + asMap() { + const d = {}; + if (this.definition !== null) { + d["definition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.definition), "asMap") ? this.definition.asMap() : this.definition; + } + if (this.storageStatus !== null) { + d["storageStatus"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.storageStatus), "asMap") ? this.storageStatus.asMap() : this.storageStatus; + } + if (this.exportStatuses !== null) { + d["exportStatuses"] = this.exportStatuses.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + return d; + } +}; + +MessageStreamInfo._storageStatus = /** - * Export status including the export identifier and the last exported sequence number for that export task + * Stream status including oldest/newest sequence number and total bytes. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ - class _exportStatuses { - #__exportConfigIdentifier = null; - #__lastExportedSequenceNumber = null; - #__lastExportTime = null; - #__errorMessage = null; + class _storageStatus { + #__oldestSequenceNumber = null; + #__newestSequenceNumber = null; + #__totalBytes = null; /** - * @param exportConfigIdentifier {String} The unique export identifier. - * @param lastExportedSequenceNumber {Number} The sequence number of the last message which was successfully exported. - * @param lastExportTime {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. - * @param errorMessage {String} Error message from the last export attempt if it failed. + * @param oldestSequenceNumber {Number} The sequence number of the first message which is still accessible in the stream. + * @param newestSequenceNumber {Number} The sequence number of the last appended message. + * @param totalBytes {Number} The current total size of the stream in bytes. */ constructor( - exportConfigIdentifier = null, - lastExportedSequenceNumber = null, - lastExportTime = null, - errorMessage = null, + oldestSequenceNumber = null, + newestSequenceNumber = null, + totalBytes = null, ) { - if (exportConfigIdentifier !== null && !(typeof exportConfigIdentifier === "string")) { - throw new Error("exportConfigIdentifier must be String"); - } - - if (lastExportedSequenceNumber !== null && !(typeof lastExportedSequenceNumber === "number")) { - throw new Error("lastExportedSequenceNumber must be Number"); - } - - if (lastExportTime !== null && !(typeof lastExportTime === "number")) { - throw new Error("lastExportTime must be Number"); + if (oldestSequenceNumber !== null && !(typeof oldestSequenceNumber === "number")) { + throw new Error("oldestSequenceNumber must be Number"); } - if (errorMessage !== null && !(typeof errorMessage === "string")) { - throw new Error("errorMessage must be String"); + if (newestSequenceNumber !== null && !(typeof newestSequenceNumber === "number")) { + throw new Error("newestSequenceNumber must be Number"); } - this.#__exportConfigIdentifier = exportConfigIdentifier; - this.#__lastExportedSequenceNumber = lastExportedSequenceNumber; - this.#__lastExportTime = lastExportTime; - this.#__errorMessage = errorMessage; - } - - /** - * The unique export identifier. - * @returns {String} - - */ - get exportConfigIdentifier() { - return this.#__exportConfigIdentifier; - } - /** - * @param value {String} The unique export identifier. - */ - set exportConfigIdentifier(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("exportConfigIdentifier must be String"); + if (totalBytes !== null && !(typeof totalBytes === "number")) { + throw new Error("totalBytes must be Number"); } - this.#__exportConfigIdentifier = value; - } - /** - * @param value {String} The unique export identifier. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} - */ - withExportConfigIdentifier(value) { - this.exportConfigIdentifier = value; - return this; + this.#__oldestSequenceNumber = oldestSequenceNumber; + this.#__newestSequenceNumber = newestSequenceNumber; + this.#__totalBytes = totalBytes; } /** - * The sequence number of the last message which was successfully exported. + * The sequence number of the first message which is still accessible in the stream. * @returns {Number} */ - get lastExportedSequenceNumber() { - return this.#__lastExportedSequenceNumber; + get oldestSequenceNumber() { + return this.#__oldestSequenceNumber; } /** - * @param value {Number} The sequence number of the last message which was successfully exported. + * @param value {Number} The sequence number of the first message which is still accessible in the stream. */ - set lastExportedSequenceNumber(value) { + set oldestSequenceNumber(value) { if (value !== null && !(typeof value === "number")) { - throw new Error("lastExportedSequenceNumber must be Number"); + throw new Error("oldestSequenceNumber must be Number"); } - this.#__lastExportedSequenceNumber = value; + this.#__oldestSequenceNumber = value; } /** - * @param value {Number} The sequence number of the last message which was successfully exported. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + * @param value {Number} The sequence number of the first message which is still accessible in the stream. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} */ - withLastExportedSequenceNumber(value) { - this.lastExportedSequenceNumber = value; + withOldestSequenceNumber(value) { + this.oldestSequenceNumber = value; return this; } /** - * The last time an export was attempted. Data is Unix epoch time in milliseconds. + * The sequence number of the last appended message. * @returns {Number} */ - get lastExportTime() { - return this.#__lastExportTime; + get newestSequenceNumber() { + return this.#__newestSequenceNumber; } /** - * @param value {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. + * @param value {Number} The sequence number of the last appended message. */ - set lastExportTime(value) { + set newestSequenceNumber(value) { if (value !== null && !(typeof value === "number")) { - throw new Error("lastExportTime must be Number"); + throw new Error("newestSequenceNumber must be Number"); } - this.#__lastExportTime = value; + this.#__newestSequenceNumber = value; } /** - * @param value {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + * @param value {Number} The sequence number of the last appended message. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} */ - withLastExportTime(value) { - this.lastExportTime = value; + withNewestSequenceNumber(value) { + this.newestSequenceNumber = value; return this; } /** - * Error message from the last export attempt if it failed. - * @returns {String} + * The current total size of the stream in bytes. + * @returns {Number} */ - get errorMessage() { - return this.#__errorMessage; + get totalBytes() { + return this.#__totalBytes; } /** - * @param value {String} Error message from the last export attempt if it failed. + * @param value {Number} The current total size of the stream in bytes. */ - set errorMessage(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("errorMessage must be String"); + set totalBytes(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("totalBytes must be Number"); } - this.#__errorMessage = value; + this.#__totalBytes = value; } /** - * @param value {String} Error message from the last export attempt if it failed. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + * @param value {Number} The current total size of the stream in bytes. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} */ - withErrorMessage(value) { - this.errorMessage = value; + withTotalBytes(value) { + this.totalBytes = value; return this; } static fromMap(d) { - const ret = new MessageStreamInfo._exportStatuses(); - if ("exportConfigIdentifier" in d) { - ret.exportConfigIdentifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["exportConfigIdentifier"]) : d["exportConfigIdentifier"]; - } - if ("lastExportedSequenceNumber" in d) { - ret.lastExportedSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["lastExportedSequenceNumber"]) : d["lastExportedSequenceNumber"]; + const ret = new MessageStreamInfo._storageStatus(); + if ("oldestSequenceNumber" in d) { + ret.oldestSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["oldestSequenceNumber"]) : d["oldestSequenceNumber"]; } - if ("lastExportTime" in d) { - ret.lastExportTime = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["lastExportTime"]) : d["lastExportTime"]; + if ("newestSequenceNumber" in d) { + ret.newestSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["newestSequenceNumber"]) : d["newestSequenceNumber"]; } - if ("errorMessage" in d) { - ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + if ("totalBytes" in d) { + ret.totalBytes = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["totalBytes"]) : d["totalBytes"]; } return ret; } asMap() { const d = {}; - if (this.exportConfigIdentifier !== null) { - d["exportConfigIdentifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportConfigIdentifier), "asMap") ? this.exportConfigIdentifier.asMap() : this.exportConfigIdentifier; - } - if (this.lastExportedSequenceNumber !== null) { - d["lastExportedSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.lastExportedSequenceNumber), "asMap") ? this.lastExportedSequenceNumber.asMap() : this.lastExportedSequenceNumber; + if (this.oldestSequenceNumber !== null) { + d["oldestSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.oldestSequenceNumber), "asMap") ? this.oldestSequenceNumber.asMap() : this.oldestSequenceNumber; } - if (this.lastExportTime !== null) { - d["lastExportTime"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.lastExportTime), "asMap") ? this.lastExportTime.asMap() : this.lastExportTime; + if (this.newestSequenceNumber !== null) { + d["newestSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.newestSequenceNumber), "asMap") ? this.newestSequenceNumber.asMap() : this.newestSequenceNumber; } - if (this.errorMessage !== null) { - d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + if (this.totalBytes !== null) { + d["totalBytes"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.totalBytes), "asMap") ? this.totalBytes.asMap() : this.totalBytes; } return d; } }; -Object.defineProperty(MessageStreamInfo._exportStatuses, "typesMap", { +Object.defineProperty(MessageStreamInfo._storageStatus, "typesMap", { value: { - exportConfigIdentifier: { - 'type': String, - 'subtype': null - }, - lastExportedSequenceNumber: { + oldestSequenceNumber: { 'type': Number, 'subtype': null }, - lastExportTime: { + newestSequenceNumber: { 'type': Number, 'subtype': null }, - errorMessage: { - 'type': String, - 'subtype': null - }, - } -}); -Object.defineProperty(MessageStreamInfo._exportStatuses, "formatsMap", { - value: {} -}); -Object.defineProperty(MessageStreamInfo._exportStatuses, "validationsMap", { - value: { - 'exportConfigIdentifier': { - 'required': false, - }, - 'lastExportedSequenceNumber': { - 'required': true, - }, - 'lastExportTime': { - 'required': false, - }, - 'errorMessage': { - 'required': false, - }, - } -}); - -Object.defineProperty(MessageStreamInfo, "typesMap", { - value: { - definition: { - 'type': MessageStreamDefinition, - 'subtype': null - }, - storageStatus: { - 'type': MessageStreamInfo._storageStatus, + totalBytes: { + 'type': Number, 'subtype': null }, - exportStatuses: { - 'type': Array, - 'subtype': MessageStreamInfo._exportStatuses - }, } }); -Object.defineProperty(MessageStreamInfo, "formatsMap", { +Object.defineProperty(MessageStreamInfo._storageStatus, "formatsMap", { value: {} }); -Object.defineProperty(MessageStreamInfo, "validationsMap", { +Object.defineProperty(MessageStreamInfo._storageStatus, "validationsMap", { value: { - 'definition': { - 'required': true, + 'oldestSequenceNumber': { + 'required': false, }, - 'storageStatus': { - 'required': true, + 'newestSequenceNumber': { + 'required': false, }, - 'exportStatuses': { + 'totalBytes': { 'required': false, }, } }); -/** - * Message object containing metadata and the user's payload - * - * @class - * @memberOf aws-greengrass-core-sdk.StreamManager - */ -class Message { - #__streamName = null; - #__sequenceNumber = null; - #__ingestTime = null; - #__payload = null; - +MessageStreamInfo._exportStatuses = /** - * @param streamName {String} The name of the stream which this message is in. - * @param sequenceNumber {Number} The sequence number of this message within the stream. - * @param ingestTime {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. - * @param payload {Buffer} The binary message data. + * Export status including the export identifier and the last exported sequence number for that export task. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager */ - constructor( - streamName = null, - sequenceNumber = null, - ingestTime = null, - payload = null, - ) { - if (streamName !== null && !(typeof streamName === "string")) { - throw new Error("streamName must be String"); - } + class _exportStatuses { + #__exportConfigIdentifier = null; + #__lastExportedSequenceNumber = null; + #__lastExportTime = null; + #__errorMessage = null; + #__exportedBytesFromStream = null; + #__exportedMessagesCount = null; - if (sequenceNumber !== null && !(typeof sequenceNumber === "number")) { - throw new Error("sequenceNumber must be Number"); - } + /** + * @param exportConfigIdentifier {String} The unique export identifier. + * @param lastExportedSequenceNumber {Number} The sequence number of the last message which was successfully exported. + * @param lastExportTime {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. + * @param errorMessage {String} Error message from the last export attempt if it failed. + * @param exportedBytesFromStream {Number} Total bytes exported from the stream for this Export Config. It does not include the failed export attempts or messages which are skipped because of some non-retryable error. + * @param exportedMessagesCount {Number} Total messages exported/processed. + */ + constructor( + exportConfigIdentifier = null, + lastExportedSequenceNumber = null, + lastExportTime = null, + errorMessage = null, + exportedBytesFromStream = null, + exportedMessagesCount = null, + ) { + if (exportConfigIdentifier !== null && !(typeof exportConfigIdentifier === "string")) { + throw new Error("exportConfigIdentifier must be String"); + } - if (ingestTime !== null && !(typeof ingestTime === "number")) { - throw new Error("ingestTime must be Number"); - } + if (lastExportedSequenceNumber !== null && !(typeof lastExportedSequenceNumber === "number")) { + throw new Error("lastExportedSequenceNumber must be Number"); + } - if (payload !== null && !(payload instanceof Buffer)) { - throw new Error("payload must be Buffer"); - } + if (lastExportTime !== null && !(typeof lastExportTime === "number")) { + throw new Error("lastExportTime must be Number"); + } - this.#__streamName = streamName; - this.#__sequenceNumber = sequenceNumber; - this.#__ingestTime = ingestTime; - this.#__payload = payload; - } + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); + } - /** - * The name of the stream which this message is in. - * @returns {String} - - */ - get streamName() { - return this.#__streamName; - } - /** - * @param value {String} The name of the stream which this message is in. - */ - set streamName(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("streamName must be String"); + if (exportedBytesFromStream !== null && !(typeof exportedBytesFromStream === "number")) { + throw new Error("exportedBytesFromStream must be Number"); + } + + if (exportedMessagesCount !== null && !(typeof exportedMessagesCount === "number")) { + throw new Error("exportedMessagesCount must be Number"); + } + + this.#__exportConfigIdentifier = exportConfigIdentifier; + this.#__lastExportedSequenceNumber = lastExportedSequenceNumber; + this.#__lastExportTime = lastExportTime; + this.#__errorMessage = errorMessage; + this.#__exportedBytesFromStream = exportedBytesFromStream; + this.#__exportedMessagesCount = exportedMessagesCount; } - this.#__streamName = value; - } - /** - * @param value {String} The name of the stream which this message is in. - * @returns {aws-greengrass-core-sdk.StreamManager.Message} - */ - withStreamName(value) { - this.streamName = value; - return this; - } + /** + * The unique export identifier. + * @returns {String} + + */ + get exportConfigIdentifier() { + return this.#__exportConfigIdentifier; + } + /** + * @param value {String} The unique export identifier. + */ + set exportConfigIdentifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("exportConfigIdentifier must be String"); + } - /** - * The sequence number of this message within the stream. - * @returns {Number} - - */ - get sequenceNumber() { - return this.#__sequenceNumber; - } - /** - * @param value {Number} The sequence number of this message within the stream. - */ - set sequenceNumber(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("sequenceNumber must be Number"); + this.#__exportConfigIdentifier = value; + } + /** + * @param value {String} The unique export identifier. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withExportConfigIdentifier(value) { + this.exportConfigIdentifier = value; + return this; } - this.#__sequenceNumber = value; - } - /** - * @param value {Number} The sequence number of this message within the stream. - * @returns {aws-greengrass-core-sdk.StreamManager.Message} - */ - withSequenceNumber(value) { - this.sequenceNumber = value; - return this; - } + /** + * The sequence number of the last message which was successfully exported. + * @returns {Number} + + */ + get lastExportedSequenceNumber() { + return this.#__lastExportedSequenceNumber; + } + /** + * @param value {Number} The sequence number of the last message which was successfully exported. + */ + set lastExportedSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("lastExportedSequenceNumber must be Number"); + } - /** - * The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. - * @returns {Number} - - */ - get ingestTime() { - return this.#__ingestTime; - } - /** - * @param value {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. - */ - set ingestTime(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("ingestTime must be Number"); + this.#__lastExportedSequenceNumber = value; + } + /** + * @param value {Number} The sequence number of the last message which was successfully exported. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withLastExportedSequenceNumber(value) { + this.lastExportedSequenceNumber = value; + return this; } - this.#__ingestTime = value; - } - /** - * @param value {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.Message} - */ - withIngestTime(value) { - this.ingestTime = value; - return this; - } + /** + * The last time an export was attempted. Data is Unix epoch time in milliseconds. + * @returns {Number} + + */ + get lastExportTime() { + return this.#__lastExportTime; + } + /** + * @param value {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. + */ + set lastExportTime(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("lastExportTime must be Number"); + } - /** - * The binary message data. - * @returns {Buffer} - - */ - get payload() { - return this.#__payload; - } - /** - * @param value {Buffer} The binary message data. - */ - set payload(value) { - if (value !== null && !(value instanceof Buffer)) { - throw new Error("payload must be Buffer"); + this.#__lastExportTime = value; + } + /** + * @param value {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withLastExportTime(value) { + this.lastExportTime = value; + return this; + } + + /** + * Error message from the last export attempt if it failed. + * @returns {String} + + */ + get errorMessage() { + return this.#__errorMessage; } + /** + * @param value {String} Error message from the last export attempt if it failed. + */ + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); + } - this.#__payload = value; - } - /** - * @param value {Buffer} The binary message data. - * @returns {aws-greengrass-core-sdk.StreamManager.Message} - */ - withPayload(value) { - this.payload = value; - return this; - } + this.#__errorMessage = value; + } + /** + * @param value {String} Error message from the last export attempt if it failed. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withErrorMessage(value) { + this.errorMessage = value; + return this; + } - static fromMap(d) { - const ret = new Message(); - if ("streamName" in d) { - ret.streamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["streamName"]) : d["streamName"]; + /** + * Total bytes exported from the stream for this Export Config. It does not include the failed export attempts or messages which are skipped because of some non-retryable error. + * @returns {Number} + + */ + get exportedBytesFromStream() { + return this.#__exportedBytesFromStream; } - if ("sequenceNumber" in d) { - ret.sequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sequenceNumber"]) : d["sequenceNumber"]; + /** + * @param value {Number} Total bytes exported from the stream for this Export Config. It does not include the failed export attempts or messages which are skipped because of some non-retryable error. + */ + set exportedBytesFromStream(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("exportedBytesFromStream must be Number"); + } + + this.#__exportedBytesFromStream = value; } - if ("ingestTime" in d) { - ret.ingestTime = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["ingestTime"]) : d["ingestTime"]; + /** + * @param value {Number} Total bytes exported from the stream for this Export Config. It does not include the failed export attempts or messages which are skipped because of some non-retryable error. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withExportedBytesFromStream(value) { + this.exportedBytesFromStream = value; + return this; } - if ("payload" in d) { - ret.payload = Object.prototype.hasOwnProperty.call(Buffer, "fromMap") ? Buffer.fromMap(d["payload"]) : d["payload"]; + + /** + * Total messages exported/processed. + * @returns {Number} + + */ + get exportedMessagesCount() { + return this.#__exportedMessagesCount; } - return ret; - } + /** + * @param value {Number} Total messages exported/processed. + */ + set exportedMessagesCount(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("exportedMessagesCount must be Number"); + } - asMap() { - const d = {}; - if (this.streamName !== null) { - d["streamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamName), "asMap") ? this.streamName.asMap() : this.streamName; + this.#__exportedMessagesCount = value; } - if (this.sequenceNumber !== null) { - d["sequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sequenceNumber), "asMap") ? this.sequenceNumber.asMap() : this.sequenceNumber; + /** + * @param value {Number} Total messages exported/processed. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withExportedMessagesCount(value) { + this.exportedMessagesCount = value; + return this; } - if (this.ingestTime !== null) { - d["ingestTime"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.ingestTime), "asMap") ? this.ingestTime.asMap() : this.ingestTime; + + static fromMap(d) { + const ret = new MessageStreamInfo._exportStatuses(); + if ("exportConfigIdentifier" in d) { + ret.exportConfigIdentifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["exportConfigIdentifier"]) : d["exportConfigIdentifier"]; + } + if ("lastExportedSequenceNumber" in d) { + ret.lastExportedSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["lastExportedSequenceNumber"]) : d["lastExportedSequenceNumber"]; + } + if ("lastExportTime" in d) { + ret.lastExportTime = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["lastExportTime"]) : d["lastExportTime"]; + } + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + } + if ("exportedBytesFromStream" in d) { + ret.exportedBytesFromStream = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["exportedBytesFromStream"]) : d["exportedBytesFromStream"]; + } + if ("exportedMessagesCount" in d) { + ret.exportedMessagesCount = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["exportedMessagesCount"]) : d["exportedMessagesCount"]; + } + return ret; } - if (this.payload !== null) { - d["payload"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.payload), "asMap") ? this.payload.asMap() : this.payload; + + asMap() { + const d = {}; + if (this.exportConfigIdentifier !== null) { + d["exportConfigIdentifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportConfigIdentifier), "asMap") ? this.exportConfigIdentifier.asMap() : this.exportConfigIdentifier; + } + if (this.lastExportedSequenceNumber !== null) { + d["lastExportedSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.lastExportedSequenceNumber), "asMap") ? this.lastExportedSequenceNumber.asMap() : this.lastExportedSequenceNumber; + } + if (this.lastExportTime !== null) { + d["lastExportTime"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.lastExportTime), "asMap") ? this.lastExportTime.asMap() : this.lastExportTime; + } + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + } + if (this.exportedBytesFromStream !== null) { + d["exportedBytesFromStream"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportedBytesFromStream), "asMap") ? this.exportedBytesFromStream.asMap() : this.exportedBytesFromStream; + } + if (this.exportedMessagesCount !== null) { + d["exportedMessagesCount"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportedMessagesCount), "asMap") ? this.exportedMessagesCount.asMap() : this.exportedMessagesCount; + } + return d; } - return d; - } -}; + }; -Object.defineProperty(Message, "typesMap", { +Object.defineProperty(MessageStreamInfo._exportStatuses, "typesMap", { value: { - streamName: { + exportConfigIdentifier: { 'type': String, 'subtype': null }, - sequenceNumber: { + lastExportedSequenceNumber: { 'type': Number, 'subtype': null }, - ingestTime: { + lastExportTime: { 'type': Number, 'subtype': null }, - payload: { - 'type': Buffer, + errorMessage: { + 'type': String, + 'subtype': null + }, + exportedBytesFromStream: { + 'type': Number, + 'subtype': null + }, + exportedMessagesCount: { + 'type': Number, 'subtype': null }, } }); -Object.defineProperty(Message, "formatsMap", { +Object.defineProperty(MessageStreamInfo._exportStatuses, "formatsMap", { value: {} }); -Object.defineProperty(Message, "validationsMap", { +Object.defineProperty(MessageStreamInfo._exportStatuses, "validationsMap", { value: { - 'streamName': { + 'exportConfigIdentifier': { + 'required': false, + }, + 'lastExportedSequenceNumber': { 'required': true, }, - 'sequenceNumber': { + 'lastExportTime': { 'required': false, }, - 'ingestTime': { + 'errorMessage': { 'required': false, }, - 'payload': { + 'exportedBytesFromStream': { + 'required': false, + }, + 'exportedMessagesCount': { + 'required': false, + }, + } +}); + +Object.defineProperty(MessageStreamInfo, "typesMap", { + value: { + definition: { + 'type': MessageStreamDefinition, + 'subtype': null + }, + storageStatus: { + 'type': MessageStreamInfo._storageStatus, + 'subtype': null + }, + exportStatuses: { + 'type': Array, + 'subtype': MessageStreamInfo._exportStatuses + }, + } +}); +Object.defineProperty(MessageStreamInfo, "formatsMap", { + value: {} +}); +Object.defineProperty(MessageStreamInfo, "validationsMap", { + value: { + 'definition': { + 'required': true, + }, + 'storageStatus': { 'required': true, }, + 'exportStatuses': { + 'required': false, + }, } }); /** - * Options for the ReadMessages API. All fields are optional. + * (Internal Only) Response object for describing a message stream. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class ReadMessagesOptions { - #__desiredStartSequenceNumber = null; - #__minMessageCount = null; - #__maxMessageCount = null; - #__readTimeoutMillis = null; +class DescribeMessageStreamResponse { + #__requestId = null; + #__status = null; + #__errorMessage = null; + #__messageStreamInfo = null; /** - * @param desiredStartSequenceNumber {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. - * @param minMessageCount {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. - The minimum values is 1 and the maximum value is 2147483647. - * @param maxMessageCount {Number} The maximum number of messages that will be returned. - The minimum values is the value of the minimum message count and the maximum value is 2147483647. - * @param readTimeoutMillis {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. - If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. - If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. - The maximum value is the value of the client timeout. + * @param requestId {String} + * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param errorMessage {String} + * @param messageStreamInfo {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} */ constructor( - desiredStartSequenceNumber = null, - minMessageCount = 1, - maxMessageCount = null, - readTimeoutMillis = 0, + requestId = null, + status = null, + errorMessage = null, + messageStreamInfo = null, ) { - if (desiredStartSequenceNumber !== null && !(typeof desiredStartSequenceNumber === "number")) { - throw new Error("desiredStartSequenceNumber must be Number"); + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); } - if (minMessageCount !== null && !(typeof minMessageCount === "number")) { - throw new Error("minMessageCount must be Number"); + if (status !== null && !(status instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); } - if (maxMessageCount !== null && !(typeof maxMessageCount === "number")) { - throw new Error("maxMessageCount must be Number"); + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); } - if (readTimeoutMillis !== null && !(typeof readTimeoutMillis === "number")) { - throw new Error("readTimeoutMillis must be Number"); + if (messageStreamInfo !== null && !(messageStreamInfo instanceof MessageStreamInfo)) { + throw new Error("messageStreamInfo must be MessageStreamInfo"); } - this.#__desiredStartSequenceNumber = desiredStartSequenceNumber; - this.#__minMessageCount = minMessageCount; - this.#__maxMessageCount = maxMessageCount; - this.#__readTimeoutMillis = readTimeoutMillis; + this.#__requestId = requestId; + this.#__status = status; + this.#__errorMessage = errorMessage; + this.#__messageStreamInfo = messageStreamInfo; } /** - * The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. - * @returns {Number} + * @returns {String} */ - get desiredStartSequenceNumber() { - return this.#__desiredStartSequenceNumber; + get requestId() { + return this.#__requestId; } /** - * @param value {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. + * @param value {String} */ - set desiredStartSequenceNumber(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("desiredStartSequenceNumber must be Number"); + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); } - this.#__desiredStartSequenceNumber = value; + this.#__requestId = value; } /** - * @param value {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} */ - withDesiredStartSequenceNumber(value) { - this.desiredStartSequenceNumber = value; + withRequestId(value) { + this.requestId = value; return this; } /** - * The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. - The minimum values is 1 and the maximum value is 2147483647. - * @returns {Number} - + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + */ - get minMessageCount() { - return this.#__minMessageCount; + get status() { + return this.#__status; } /** - * @param value {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. - The minimum values is 1 and the maximum value is 2147483647. + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} */ - set minMessageCount(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("minMessageCount must be Number"); + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); } - this.#__minMessageCount = value; + this.#__status = value; } /** - * @param value {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. - The minimum values is 1 and the maximum value is 2147483647. - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} */ - withMinMessageCount(value) { - this.minMessageCount = value; + withStatus(value) { + this.status = value; return this; } /** - * The maximum number of messages that will be returned. - The minimum values is the value of the minimum message count and the maximum value is 2147483647. - * @returns {Number} - + * @returns {String} + */ - get maxMessageCount() { - return this.#__maxMessageCount; + get errorMessage() { + return this.#__errorMessage; } /** - * @param value {Number} The maximum number of messages that will be returned. - The minimum values is the value of the minimum message count and the maximum value is 2147483647. + * @param value {String} */ - set maxMessageCount(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("maxMessageCount must be Number"); + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); } - this.#__maxMessageCount = value; + this.#__errorMessage = value; } /** - * @param value {Number} The maximum number of messages that will be returned. - The minimum values is the value of the minimum message count and the maximum value is 2147483647. - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} */ - withMaxMessageCount(value) { - this.maxMessageCount = value; + withErrorMessage(value) { + this.errorMessage = value; return this; } /** - * The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. - If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. - If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. - The maximum value is the value of the client timeout. - * @returns {Number} - + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + */ - get readTimeoutMillis() { - return this.#__readTimeoutMillis; + get messageStreamInfo() { + return this.#__messageStreamInfo; } /** - * @param value {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. - If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. - If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. - The maximum value is the value of the client timeout. + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} */ - set readTimeoutMillis(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("readTimeoutMillis must be Number"); + set messageStreamInfo(value) { + if (value !== null && !(value instanceof MessageStreamInfo)) { + throw new Error("messageStreamInfo must be MessageStreamInfo"); } - this.#__readTimeoutMillis = value; + this.#__messageStreamInfo = value; } /** - * @param value {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. - If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. - If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. - The maximum value is the value of the client timeout. - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} */ - withReadTimeoutMillis(value) { - this.readTimeoutMillis = value; + withMessageStreamInfo(value) { + this.messageStreamInfo = value; return this; } static fromMap(d) { - const ret = new ReadMessagesOptions(); - if ("desiredStartSequenceNumber" in d) { - ret.desiredStartSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["desiredStartSequenceNumber"]) : d["desiredStartSequenceNumber"]; + const ret = new DescribeMessageStreamResponse(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - if ("minMessageCount" in d) { - ret.minMessageCount = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["minMessageCount"]) : d["minMessageCount"]; + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; } - if ("maxMessageCount" in d) { - ret.maxMessageCount = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["maxMessageCount"]) : d["maxMessageCount"]; + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; } - if ("readTimeoutMillis" in d) { - ret.readTimeoutMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["readTimeoutMillis"]) : d["readTimeoutMillis"]; + if ("messageStreamInfo" in d) { + ret.messageStreamInfo = Object.prototype.hasOwnProperty.call(MessageStreamInfo, "fromMap") ? MessageStreamInfo.fromMap(d["messageStreamInfo"]) : d["messageStreamInfo"]; } return ret; } asMap() { const d = {}; - if (this.desiredStartSequenceNumber !== null) { - d["desiredStartSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.desiredStartSequenceNumber), "asMap") ? this.desiredStartSequenceNumber.asMap() : this.desiredStartSequenceNumber; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } - if (this.minMessageCount !== null) { - d["minMessageCount"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.minMessageCount), "asMap") ? this.minMessageCount.asMap() : this.minMessageCount; + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; } - if (this.maxMessageCount !== null) { - d["maxMessageCount"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.maxMessageCount), "asMap") ? this.maxMessageCount.asMap() : this.maxMessageCount; + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; } - if (this.readTimeoutMillis !== null) { - d["readTimeoutMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.readTimeoutMillis), "asMap") ? this.readTimeoutMillis.asMap() : this.readTimeoutMillis; + if (this.messageStreamInfo !== null) { + d["messageStreamInfo"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.messageStreamInfo), "asMap") ? this.messageStreamInfo.asMap() : this.messageStreamInfo; } return d; } }; -Object.defineProperty(ReadMessagesOptions, "typesMap", { +Object.defineProperty(DescribeMessageStreamResponse, "typesMap", { value: { - desiredStartSequenceNumber: { - 'type': Number, + requestId: { + 'type': String, 'subtype': null }, - minMessageCount: { - 'type': Number, + status: { + 'type': ResponseStatusCode, 'subtype': null }, - maxMessageCount: { - 'type': Number, + errorMessage: { + 'type': String, 'subtype': null }, - readTimeoutMillis: { - 'type': Number, + messageStreamInfo: { + 'type': MessageStreamInfo, 'subtype': null }, } }); -Object.defineProperty(ReadMessagesOptions, "formatsMap", { +Object.defineProperty(DescribeMessageStreamResponse, "formatsMap", { value: {} }); -Object.defineProperty(ReadMessagesOptions, "validationsMap", { +Object.defineProperty(DescribeMessageStreamResponse, "validationsMap", { value: { - 'desiredStartSequenceNumber': { - 'required': false, - 'maximum': 9223372036854775807, - 'minimum': 0, + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, }, - 'minMessageCount': { - 'required': false, - 'maximum': 2147483647, - 'minimum': 1, + 'status': { + 'required': true, }, - 'maxMessageCount': { + 'errorMessage': { 'required': false, - 'maximum': 2147483647, - 'minimum': 1, }, - 'readTimeoutMillis': { + 'messageStreamInfo': { 'required': false, - 'maximum': 9223372036854, - 'minimum': 0, }, } }); /** - * (Internal Only) Request object for creating a message stream + * (Internal Only) Request object for appending to a message stream. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class CreateMessageStreamRequest { +class AppendMessageRequest { #__requestId = null; - #__definition = null; + #__name = null; + #__payload = null; /** * @param requestId {String} - * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param name {String} + * @param payload {Buffer} */ constructor( requestId = null, - definition = null, + name = null, + payload = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); } - if (definition !== null && !(definition instanceof MessageStreamDefinition)) { - throw new Error("definition must be MessageStreamDefinition"); + if (name !== null && !(typeof name === "string")) { + throw new Error("name must be String"); + } + + if (payload !== null && !(payload instanceof Buffer)) { + throw new Error("payload must be Buffer"); } this.#__requestId = requestId; - this.#__definition = definition; + this.#__name = name; + this.#__payload = payload; } /** @@ -4031,7 +7692,7 @@ class CreateMessageStreamRequest { } /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} */ withRequestId(value) { this.requestId = value; @@ -4039,38 +7700,67 @@ class CreateMessageStreamRequest { } /** - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @returns {String} */ - get definition() { - return this.#__definition; + get name() { + return this.#__name; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param value {String} */ - set definition(value) { - if (value !== null && !(value instanceof MessageStreamDefinition)) { - throw new Error("definition must be MessageStreamDefinition"); + set name(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("name must be String"); } - this.#__definition = value; + this.#__name = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} */ - withDefinition(value) { - this.definition = value; + withName(value) { + this.name = value; + return this; + } + + /** + * @returns {Buffer} + + */ + get payload() { + return this.#__payload; + } + /** + * @param value {Buffer} + */ + set payload(value) { + if (value !== null && !(value instanceof Buffer)) { + throw new Error("payload must be Buffer"); + } + + this.#__payload = value; + } + /** + * @param value {Buffer} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} + */ + withPayload(value) { + this.payload = value; return this; } static fromMap(d) { - const ret = new CreateMessageStreamRequest(); + const ret = new AppendMessageRequest(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - if ("definition" in d) { - ret.definition = Object.prototype.hasOwnProperty.call(MessageStreamDefinition, "fromMap") ? MessageStreamDefinition.fromMap(d["definition"]) : d["definition"]; + if ("name" in d) { + ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + } + if ("payload" in d) { + ret.payload = Object.prototype.hasOwnProperty.call(Buffer, "fromMap") ? Buffer.fromMap(d["payload"]) : d["payload"]; } return ret; } @@ -4080,61 +7770,78 @@ class CreateMessageStreamRequest { if (this.requestId !== null) { d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } - if (this.definition !== null) { - d["definition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.definition), "asMap") ? this.definition.asMap() : this.definition; + if (this.name !== null) { + d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + } + if (this.payload !== null) { + d["payload"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.payload), "asMap") ? this.payload.asMap() : this.payload; } return d; } }; -Object.defineProperty(CreateMessageStreamRequest, "typesMap", { +Object.defineProperty(AppendMessageRequest, "typesMap", { value: { requestId: { 'type': String, 'subtype': null }, - definition: { - 'type': MessageStreamDefinition, + name: { + 'type': String, + 'subtype': null + }, + payload: { + 'type': Buffer, 'subtype': null }, } }); -Object.defineProperty(CreateMessageStreamRequest, "formatsMap", { +Object.defineProperty(AppendMessageRequest, "formatsMap", { value: {} }); -Object.defineProperty(CreateMessageStreamRequest, "validationsMap", { +Object.defineProperty(AppendMessageRequest, "validationsMap", { value: { 'requestId': { 'required': true, 'minLength': 1, 'pattern': /^[\w ,.\-_]*$/, }, - 'definition': { + 'name': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'payload': { 'required': true, + 'minLength': 1, }, } }); /** - * Internal Only + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class CreateMessageStreamResponse { +class AppendMessageResponse { #__requestId = null; #__status = null; #__errorMessage = null; + #__sequenceNumber = null; /** * @param requestId {String} * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} * @param errorMessage {String} + * @param sequenceNumber {Number} */ constructor( requestId = null, status = null, errorMessage = null, + sequenceNumber = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); @@ -4148,9 +7855,14 @@ class CreateMessageStreamResponse { throw new Error("errorMessage must be String"); } + if (sequenceNumber !== null && !(typeof sequenceNumber === "number")) { + throw new Error("sequenceNumber must be Number"); + } + this.#__requestId = requestId; this.#__status = status; this.#__errorMessage = errorMessage; + this.#__sequenceNumber = sequenceNumber; } /** @@ -4172,7 +7884,7 @@ class CreateMessageStreamResponse { } /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} */ withRequestId(value) { this.requestId = value; @@ -4198,7 +7910,7 @@ class CreateMessageStreamResponse { } /** * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} */ withStatus(value) { this.status = value; @@ -4224,15 +7936,41 @@ class CreateMessageStreamResponse { } /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} */ withErrorMessage(value) { this.errorMessage = value; return this; } + /** + * @returns {Number} + + */ + get sequenceNumber() { + return this.#__sequenceNumber; + } + /** + * @param value {Number} + */ + set sequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("sequenceNumber must be Number"); + } + + this.#__sequenceNumber = value; + } + /** + * @param value {Number} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} + */ + withSequenceNumber(value) { + this.sequenceNumber = value; + return this; + } + static fromMap(d) { - const ret = new CreateMessageStreamResponse(); + const ret = new AppendMessageResponse(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } @@ -4242,6 +7980,9 @@ class CreateMessageStreamResponse { if ("errorMessage" in d) { ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; } + if ("sequenceNumber" in d) { + ret.sequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sequenceNumber"]) : d["sequenceNumber"]; + } return ret; } @@ -4256,11 +7997,14 @@ class CreateMessageStreamResponse { if (this.errorMessage !== null) { d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; } + if (this.sequenceNumber !== null) { + d["sequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sequenceNumber), "asMap") ? this.sequenceNumber.asMap() : this.sequenceNumber; + } return d; } }; -Object.defineProperty(CreateMessageStreamResponse, "typesMap", { +Object.defineProperty(AppendMessageResponse, "typesMap", { value: { requestId: { 'type': String, @@ -4274,12 +8018,16 @@ Object.defineProperty(CreateMessageStreamResponse, "typesMap", { 'type': String, 'subtype': null }, + sequenceNumber: { + 'type': Number, + 'subtype': null + }, } }); -Object.defineProperty(CreateMessageStreamResponse, "formatsMap", { +Object.defineProperty(AppendMessageResponse, "formatsMap", { value: {} }); -Object.defineProperty(CreateMessageStreamResponse, "validationsMap", { +Object.defineProperty(AppendMessageResponse, "validationsMap", { value: { 'requestId': { 'required': true, @@ -4292,181 +8040,305 @@ Object.defineProperty(CreateMessageStreamResponse, "validationsMap", { 'errorMessage': { 'required': false, }, + 'sequenceNumber': { + 'required': false, + }, } }); /** - * (Internal Only) Request object for deleting a message stream + * Options for the ReadMessages API. All fields are optional. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class DeleteMessageStreamRequest { - #__requestId = null; - #__name = null; +class ReadMessagesOptions { + #__desiredStartSequenceNumber = null; + #__minMessageCount = null; + #__maxMessageCount = null; + #__readTimeoutMillis = null; /** - * @param requestId {String} - * @param name {String} + * @param desiredStartSequenceNumber {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. + * @param minMessageCount {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. + The minimum values is 1 and the maximum value is 2147483647. + * @param maxMessageCount {Number} The maximum number of messages that will be returned. + The minimum values is the value of the minimum message count and the maximum value is 2147483647. + * @param readTimeoutMillis {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. + If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. + If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. + The maximum value is the value of the client timeout. */ constructor( - requestId = null, - name = null, + desiredStartSequenceNumber = null, + minMessageCount = 1, + maxMessageCount = null, + readTimeoutMillis = 0, ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); + if (desiredStartSequenceNumber !== null && !(typeof desiredStartSequenceNumber === "number")) { + throw new Error("desiredStartSequenceNumber must be Number"); } - if (name !== null && !(typeof name === "string")) { - throw new Error("name must be String"); + if (minMessageCount !== null && !(typeof minMessageCount === "number")) { + throw new Error("minMessageCount must be Number"); } - this.#__requestId = requestId; - this.#__name = name; + if (maxMessageCount !== null && !(typeof maxMessageCount === "number")) { + throw new Error("maxMessageCount must be Number"); + } + + if (readTimeoutMillis !== null && !(typeof readTimeoutMillis === "number")) { + throw new Error("readTimeoutMillis must be Number"); + } + + this.#__desiredStartSequenceNumber = desiredStartSequenceNumber; + this.#__minMessageCount = minMessageCount; + this.#__maxMessageCount = maxMessageCount; + this.#__readTimeoutMillis = readTimeoutMillis; } /** - * @returns {String} + * The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. + * @returns {Number} */ - get requestId() { - return this.#__requestId; + get desiredStartSequenceNumber() { + return this.#__desiredStartSequenceNumber; } /** - * @param value {String} + * @param value {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. */ - set requestId(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + set desiredStartSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("desiredStartSequenceNumber must be Number"); } - this.#__requestId = value; + this.#__desiredStartSequenceNumber = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest} + * @param value {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} */ - withRequestId(value) { - this.requestId = value; + withDesiredStartSequenceNumber(value) { + this.desiredStartSequenceNumber = value; return this; } /** - * @returns {String} - + * The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. + The minimum values is 1 and the maximum value is 2147483647. + * @returns {Number} + */ - get name() { - return this.#__name; + get minMessageCount() { + return this.#__minMessageCount; } /** - * @param value {String} + * @param value {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. + The minimum values is 1 and the maximum value is 2147483647. */ - set name(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("name must be String"); + set minMessageCount(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("minMessageCount must be Number"); + } + + this.#__minMessageCount = value; + } + /** + * @param value {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. + The minimum values is 1 and the maximum value is 2147483647. + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + */ + withMinMessageCount(value) { + this.minMessageCount = value; + return this; + } + + /** + * The maximum number of messages that will be returned. + The minimum values is the value of the minimum message count and the maximum value is 2147483647. + * @returns {Number} + + */ + get maxMessageCount() { + return this.#__maxMessageCount; + } + /** + * @param value {Number} The maximum number of messages that will be returned. + The minimum values is the value of the minimum message count and the maximum value is 2147483647. + */ + set maxMessageCount(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("maxMessageCount must be Number"); + } + + this.#__maxMessageCount = value; + } + /** + * @param value {Number} The maximum number of messages that will be returned. + The minimum values is the value of the minimum message count and the maximum value is 2147483647. + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + */ + withMaxMessageCount(value) { + this.maxMessageCount = value; + return this; + } + + /** + * The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. + If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. + If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. + The maximum value is the value of the client timeout. + * @returns {Number} + + */ + get readTimeoutMillis() { + return this.#__readTimeoutMillis; + } + /** + * @param value {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. + If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. + If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. + The maximum value is the value of the client timeout. + */ + set readTimeoutMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("readTimeoutMillis must be Number"); } - this.#__name = value; + this.#__readTimeoutMillis = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest} + * @param value {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. + If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. + If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. + The maximum value is the value of the client timeout. + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} */ - withName(value) { - this.name = value; + withReadTimeoutMillis(value) { + this.readTimeoutMillis = value; return this; } static fromMap(d) { - const ret = new DeleteMessageStreamRequest(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + const ret = new ReadMessagesOptions(); + if ("desiredStartSequenceNumber" in d) { + ret.desiredStartSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["desiredStartSequenceNumber"]) : d["desiredStartSequenceNumber"]; } - if ("name" in d) { - ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + if ("minMessageCount" in d) { + ret.minMessageCount = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["minMessageCount"]) : d["minMessageCount"]; + } + if ("maxMessageCount" in d) { + ret.maxMessageCount = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["maxMessageCount"]) : d["maxMessageCount"]; + } + if ("readTimeoutMillis" in d) { + ret.readTimeoutMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["readTimeoutMillis"]) : d["readTimeoutMillis"]; } return ret; } asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + if (this.desiredStartSequenceNumber !== null) { + d["desiredStartSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.desiredStartSequenceNumber), "asMap") ? this.desiredStartSequenceNumber.asMap() : this.desiredStartSequenceNumber; } - if (this.name !== null) { - d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + if (this.minMessageCount !== null) { + d["minMessageCount"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.minMessageCount), "asMap") ? this.minMessageCount.asMap() : this.minMessageCount; + } + if (this.maxMessageCount !== null) { + d["maxMessageCount"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.maxMessageCount), "asMap") ? this.maxMessageCount.asMap() : this.maxMessageCount; + } + if (this.readTimeoutMillis !== null) { + d["readTimeoutMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.readTimeoutMillis), "asMap") ? this.readTimeoutMillis.asMap() : this.readTimeoutMillis; } return d; } }; -Object.defineProperty(DeleteMessageStreamRequest, "typesMap", { +Object.defineProperty(ReadMessagesOptions, "typesMap", { value: { - requestId: { - 'type': String, + desiredStartSequenceNumber: { + 'type': Number, 'subtype': null }, - name: { - 'type': String, + minMessageCount: { + 'type': Number, + 'subtype': null + }, + maxMessageCount: { + 'type': Number, + 'subtype': null + }, + readTimeoutMillis: { + 'type': Number, 'subtype': null }, } }); -Object.defineProperty(DeleteMessageStreamRequest, "formatsMap", { +Object.defineProperty(ReadMessagesOptions, "formatsMap", { value: {} }); -Object.defineProperty(DeleteMessageStreamRequest, "validationsMap", { +Object.defineProperty(ReadMessagesOptions, "validationsMap", { value: { - 'requestId': { - 'required': true, - 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, + 'desiredStartSequenceNumber': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 0, }, - 'name': { - 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, + 'minMessageCount': { + 'required': false, + 'maximum': 2147483647, + 'minimum': 1, + }, + 'maxMessageCount': { + 'required': false, + 'maximum': 2147483647, + 'minimum': 1, + }, + 'readTimeoutMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 0, }, } }); /** - * Internal Only + * (Internal Only) Request object for reading from a message stream. readMessagesOptions is optional. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class DeleteMessageStreamResponse { +class ReadMessagesRequest { #__requestId = null; - #__status = null; - #__errorMessage = null; + #__streamName = null; + #__readMessagesOptions = null; /** * @param requestId {String} - * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @param errorMessage {String} + * @param streamName {String} + * @param readMessagesOptions {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} */ constructor( requestId = null, - status = null, - errorMessage = null, + streamName = null, + readMessagesOptions = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); } - if (status !== null && !(status instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + if (streamName !== null && !(typeof streamName === "string")) { + throw new Error("streamName must be String"); } - if (errorMessage !== null && !(typeof errorMessage === "string")) { - throw new Error("errorMessage must be String"); + if (readMessagesOptions !== null && !(readMessagesOptions instanceof ReadMessagesOptions)) { + throw new Error("readMessagesOptions must be ReadMessagesOptions"); } this.#__requestId = requestId; - this.#__status = status; - this.#__errorMessage = errorMessage; + this.#__streamName = streamName; + this.#__readMessagesOptions = readMessagesOptions; } /** @@ -4488,7 +8360,7 @@ class DeleteMessageStreamResponse { } /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} */ withRequestId(value) { this.requestId = value; @@ -4496,67 +8368,67 @@ class DeleteMessageStreamResponse { } /** - * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {String} */ - get status() { - return this.#__status; + get streamName() { + return this.#__streamName; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param value {String} */ - set status(value) { - if (value !== null && !(value instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + set streamName(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("streamName must be String"); } - this.#__status = value; + this.#__streamName = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} */ - withStatus(value) { - this.status = value; + withStreamName(value) { + this.streamName = value; return this; } /** - * @returns {String} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} */ - get errorMessage() { - return this.#__errorMessage; + get readMessagesOptions() { + return this.#__readMessagesOptions; } /** - * @param value {String} + * @param value {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} */ - set errorMessage(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("errorMessage must be String"); + set readMessagesOptions(value) { + if (value !== null && !(value instanceof ReadMessagesOptions)) { + throw new Error("readMessagesOptions must be ReadMessagesOptions"); } - this.#__errorMessage = value; + this.#__readMessagesOptions = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + * @param value {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} */ - withErrorMessage(value) { - this.errorMessage = value; + withReadMessagesOptions(value) { + this.readMessagesOptions = value; return this; } static fromMap(d) { - const ret = new DeleteMessageStreamResponse(); + const ret = new ReadMessagesRequest(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - if ("status" in d) { - ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + if ("streamName" in d) { + ret.streamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["streamName"]) : d["streamName"]; } - if ("errorMessage" in d) { - ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + if ("readMessagesOptions" in d) { + ret.readMessagesOptions = Object.prototype.hasOwnProperty.call(ReadMessagesOptions, "fromMap") ? ReadMessagesOptions.fromMap(d["readMessagesOptions"]) : d["readMessagesOptions"]; } return ret; } @@ -4566,215 +8438,318 @@ class DeleteMessageStreamResponse { if (this.requestId !== null) { d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } - if (this.status !== null) { - d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + if (this.streamName !== null) { + d["streamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamName), "asMap") ? this.streamName.asMap() : this.streamName; } - if (this.errorMessage !== null) { - d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + if (this.readMessagesOptions !== null) { + d["readMessagesOptions"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.readMessagesOptions), "asMap") ? this.readMessagesOptions.asMap() : this.readMessagesOptions; } return d; } }; -Object.defineProperty(DeleteMessageStreamResponse, "typesMap", { +Object.defineProperty(ReadMessagesRequest, "typesMap", { value: { requestId: { 'type': String, 'subtype': null }, - status: { - 'type': ResponseStatusCode, + streamName: { + 'type': String, 'subtype': null }, - errorMessage: { - 'type': String, + readMessagesOptions: { + 'type': ReadMessagesOptions, 'subtype': null }, } }); -Object.defineProperty(DeleteMessageStreamResponse, "formatsMap", { +Object.defineProperty(ReadMessagesRequest, "formatsMap", { value: {} }); -Object.defineProperty(DeleteMessageStreamResponse, "validationsMap", { +Object.defineProperty(ReadMessagesRequest, "validationsMap", { value: { 'requestId': { 'required': true, 'minLength': 1, 'pattern': /^[\w ,.\-_]*$/, }, - 'status': { + 'streamName': { 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, }, - 'errorMessage': { + 'readMessagesOptions': { 'required': false, }, } }); /** - * (Internal Only) Request object for describing a message stream + * Message object containing metadata and the user's payload. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class DescribeMessageStreamRequest { - #__requestId = null; - #__name = null; +class Message { + #__streamName = null; + #__sequenceNumber = null; + #__ingestTime = null; + #__payload = null; + + /** + * @param streamName {String} The name of the stream which this message is in. + * @param sequenceNumber {Number} The sequence number of this message within the stream. + * @param ingestTime {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. + * @param payload {Buffer} The binary message data. + */ + constructor( + streamName = null, + sequenceNumber = null, + ingestTime = null, + payload = null, + ) { + if (streamName !== null && !(typeof streamName === "string")) { + throw new Error("streamName must be String"); + } + + if (sequenceNumber !== null && !(typeof sequenceNumber === "number")) { + throw new Error("sequenceNumber must be Number"); + } + if (ingestTime !== null && !(typeof ingestTime === "number")) { + throw new Error("ingestTime must be Number"); + } + + if (payload !== null && !(payload instanceof Buffer)) { + throw new Error("payload must be Buffer"); + } + + this.#__streamName = streamName; + this.#__sequenceNumber = sequenceNumber; + this.#__ingestTime = ingestTime; + this.#__payload = payload; + } + + /** + * The name of the stream which this message is in. + * @returns {String} + + */ + get streamName() { + return this.#__streamName; + } /** - * @param requestId {String} - * @param name {String} + * @param value {String} The name of the stream which this message is in. */ - constructor( - requestId = null, - name = null, - ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); + set streamName(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("streamName must be String"); } - if (name !== null && !(typeof name === "string")) { - throw new Error("name must be String"); + this.#__streamName = value; + } + /** + * @param value {String} The name of the stream which this message is in. + * @returns {aws-greengrass-core-sdk.StreamManager.Message} + */ + withStreamName(value) { + this.streamName = value; + return this; + } + + /** + * The sequence number of this message within the stream. + * @returns {Number} + + */ + get sequenceNumber() { + return this.#__sequenceNumber; + } + /** + * @param value {Number} The sequence number of this message within the stream. + */ + set sequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("sequenceNumber must be Number"); } - this.#__requestId = requestId; - this.#__name = name; + this.#__sequenceNumber = value; + } + /** + * @param value {Number} The sequence number of this message within the stream. + * @returns {aws-greengrass-core-sdk.StreamManager.Message} + */ + withSequenceNumber(value) { + this.sequenceNumber = value; + return this; } /** - * @returns {String} + * The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. + * @returns {Number} */ - get requestId() { - return this.#__requestId; + get ingestTime() { + return this.#__ingestTime; } /** - * @param value {String} + * @param value {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. */ - set requestId(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + set ingestTime(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("ingestTime must be Number"); } - this.#__requestId = value; + this.#__ingestTime = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest} + * @param value {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.Message} */ - withRequestId(value) { - this.requestId = value; + withIngestTime(value) { + this.ingestTime = value; return this; } /** - * @returns {String} + * The binary message data. + * @returns {Buffer} */ - get name() { - return this.#__name; + get payload() { + return this.#__payload; } /** - * @param value {String} + * @param value {Buffer} The binary message data. */ - set name(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("name must be String"); + set payload(value) { + if (value !== null && !(value instanceof Buffer)) { + throw new Error("payload must be Buffer"); } - this.#__name = value; + this.#__payload = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest} + * @param value {Buffer} The binary message data. + * @returns {aws-greengrass-core-sdk.StreamManager.Message} */ - withName(value) { - this.name = value; + withPayload(value) { + this.payload = value; return this; } static fromMap(d) { - const ret = new DescribeMessageStreamRequest(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + const ret = new Message(); + if ("streamName" in d) { + ret.streamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["streamName"]) : d["streamName"]; } - if ("name" in d) { - ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + if ("sequenceNumber" in d) { + ret.sequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sequenceNumber"]) : d["sequenceNumber"]; + } + if ("ingestTime" in d) { + ret.ingestTime = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["ingestTime"]) : d["ingestTime"]; + } + if ("payload" in d) { + ret.payload = Object.prototype.hasOwnProperty.call(Buffer, "fromMap") ? Buffer.fromMap(d["payload"]) : d["payload"]; } return ret; } asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + if (this.streamName !== null) { + d["streamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamName), "asMap") ? this.streamName.asMap() : this.streamName; } - if (this.name !== null) { - d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + if (this.sequenceNumber !== null) { + d["sequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sequenceNumber), "asMap") ? this.sequenceNumber.asMap() : this.sequenceNumber; + } + if (this.ingestTime !== null) { + d["ingestTime"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.ingestTime), "asMap") ? this.ingestTime.asMap() : this.ingestTime; + } + if (this.payload !== null) { + d["payload"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.payload), "asMap") ? this.payload.asMap() : this.payload; } return d; } }; -Object.defineProperty(DescribeMessageStreamRequest, "typesMap", { +Object.defineProperty(Message, "typesMap", { value: { - requestId: { + streamName: { 'type': String, 'subtype': null }, - name: { - 'type': String, + sequenceNumber: { + 'type': Number, + 'subtype': null + }, + ingestTime: { + 'type': Number, + 'subtype': null + }, + payload: { + 'type': Buffer, 'subtype': null }, } }); -Object.defineProperty(DescribeMessageStreamRequest, "formatsMap", { +Object.defineProperty(Message, "formatsMap", { value: {} }); -Object.defineProperty(DescribeMessageStreamRequest, "validationsMap", { +Object.defineProperty(Message, "validationsMap", { value: { - 'requestId': { + 'streamName': { 'required': true, - 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, }, - 'name': { + 'sequenceNumber': { + 'required': false, + }, + 'ingestTime': { + 'required': false, + }, + 'payload': { 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, }, } }); /** - * (Internal Only) Response object for describing a message stream + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class DescribeMessageStreamResponse { +class ReadMessagesResponse { #__requestId = null; + #__messages = null; #__status = null; #__errorMessage = null; - #__messageStreamInfo = null; /** * @param requestId {String} + * @param messages {aws-greengrass-core-sdk.StreamManager.Message[]} * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} * @param errorMessage {String} - * @param messageStreamInfo {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} */ constructor( requestId = null, + messages = null, status = null, errorMessage = null, - messageStreamInfo = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); } + if (messages !== null && !(messages instanceof Array)) { + throw new Error("messages must be Array"); + } + if (messages !== null && !messages.every((v) => v instanceof Message)) { + throw new Error("messages array values must be Message"); + } + if (status !== null && !(status instanceof ResponseStatusCode)) { throw new Error("status must be ResponseStatusCode"); } @@ -4783,14 +8758,10 @@ class DescribeMessageStreamResponse { throw new Error("errorMessage must be String"); } - if (messageStreamInfo !== null && !(messageStreamInfo instanceof MessageStreamInfo)) { - throw new Error("messageStreamInfo must be MessageStreamInfo"); - } - this.#__requestId = requestId; + this.#__messages = messages; this.#__status = status; this.#__errorMessage = errorMessage; - this.#__messageStreamInfo = messageStreamInfo; } /** @@ -4812,7 +8783,7 @@ class DescribeMessageStreamResponse { } /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} */ withRequestId(value) { this.requestId = value; @@ -4820,97 +8791,103 @@ class DescribeMessageStreamResponse { } /** - * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.Message[]} */ - get status() { - return this.#__status; + get messages() { + return this.#__messages; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param value {aws-greengrass-core-sdk.StreamManager.Message[]} */ - set status(value) { - if (value !== null && !(value instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + set messages(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("messages must be Array"); + } + if (value !== null && !value.every((v) => v instanceof Message)) { + throw new Error("messages array values must be Message"); } - this.#__status = value; + this.#__messages = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} + * @param value {aws-greengrass-core-sdk.StreamManager.Message[]} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} */ - withStatus(value) { - this.status = value; + withMessages(value) { + this.messages = value; return this; } /** - * @returns {String} + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} */ - get errorMessage() { - return this.#__errorMessage; + get status() { + return this.#__status; } /** - * @param value {String} + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} */ - set errorMessage(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("errorMessage must be String"); + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); } - this.#__errorMessage = value; + this.#__status = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} */ - withErrorMessage(value) { - this.errorMessage = value; + withStatus(value) { + this.status = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + * @returns {String} */ - get messageStreamInfo() { - return this.#__messageStreamInfo; + get errorMessage() { + return this.#__errorMessage; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} - */ - set messageStreamInfo(value) { - if (value !== null && !(value instanceof MessageStreamInfo)) { - throw new Error("messageStreamInfo must be MessageStreamInfo"); + * @param value {String} + */ + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); } - this.#__messageStreamInfo = value; + this.#__errorMessage = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} */ - withMessageStreamInfo(value) { - this.messageStreamInfo = value; + withErrorMessage(value) { + this.errorMessage = value; return this; } static fromMap(d) { - const ret = new DescribeMessageStreamResponse(); + const ret = new ReadMessagesResponse(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } + if ("messages" in d) { + ret.messages = d["messages"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Message, "fromMap") ? Message.fromMap(v) : v); + return acc; + }, []); + } if ("status" in d) { ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; } if ("errorMessage" in d) { ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; } - if ("messageStreamInfo" in d) { - ret.messageStreamInfo = Object.prototype.hasOwnProperty.call(MessageStreamInfo, "fromMap") ? MessageStreamInfo.fromMap(d["messageStreamInfo"]) : d["messageStreamInfo"]; - } return ret; } @@ -4919,25 +8896,32 @@ class DescribeMessageStreamResponse { if (this.requestId !== null) { d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } + if (this.messages !== null) { + d["messages"] = this.messages.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } if (this.status !== null) { d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; } if (this.errorMessage !== null) { d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; } - if (this.messageStreamInfo !== null) { - d["messageStreamInfo"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.messageStreamInfo), "asMap") ? this.messageStreamInfo.asMap() : this.messageStreamInfo; - } return d; } }; -Object.defineProperty(DescribeMessageStreamResponse, "typesMap", { +Object.defineProperty(ReadMessagesResponse, "typesMap", { value: { requestId: { 'type': String, 'subtype': null }, + messages: { + 'type': Array, + 'subtype': Message + }, status: { 'type': ResponseStatusCode, 'subtype': null @@ -4946,70 +8930,50 @@ Object.defineProperty(DescribeMessageStreamResponse, "typesMap", { 'type': String, 'subtype': null }, - messageStreamInfo: { - 'type': MessageStreamInfo, - 'subtype': null - }, } }); -Object.defineProperty(DescribeMessageStreamResponse, "formatsMap", { +Object.defineProperty(ReadMessagesResponse, "formatsMap", { value: {} }); -Object.defineProperty(DescribeMessageStreamResponse, "validationsMap", { +Object.defineProperty(ReadMessagesResponse, "validationsMap", { value: { 'requestId': { - 'required': true, + 'required': false, 'minLength': 1, 'pattern': /^[\w ,.\-_]*$/, }, - 'status': { - 'required': true, + 'messages': { + 'required': false, }, - 'errorMessage': { + 'status': { 'required': false, }, - 'messageStreamInfo': { + 'errorMessage': { 'required': false, }, } }); /** - * (Intenral Only) Request object for appending to a message stream + * (Internal Only) Request object to list all available streams. There are no options. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class AppendMessageRequest { +class ListStreamsRequest { #__requestId = null; - #__name = null; - #__payload = null; /** * @param requestId {String} - * @param name {String} - * @param payload {Buffer} */ constructor( requestId = null, - name = null, - payload = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); } - if (name !== null && !(typeof name === "string")) { - throw new Error("name must be String"); - } - - if (payload !== null && !(payload instanceof Buffer)) { - throw new Error("payload must be Buffer"); - } - this.#__requestId = requestId; - this.#__name = name; - this.#__payload = payload; } /** @@ -5031,76 +8995,18 @@ class AppendMessageRequest { } /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} + * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsRequest} */ withRequestId(value) { this.requestId = value; return this; } - /** - * @returns {String} - - */ - get name() { - return this.#__name; - } - /** - * @param value {String} - */ - set name(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("name must be String"); - } - - this.#__name = value; - } - /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} - */ - withName(value) { - this.name = value; - return this; - } - - /** - * @returns {Buffer} - - */ - get payload() { - return this.#__payload; - } - /** - * @param value {Buffer} - */ - set payload(value) { - if (value !== null && !(value instanceof Buffer)) { - throw new Error("payload must be Buffer"); - } - - this.#__payload = value; - } - /** - * @param value {Buffer} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} - */ - withPayload(value) { - this.payload = value; - return this; - } - static fromMap(d) { - const ret = new AppendMessageRequest(); + const ret = new ListStreamsRequest(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - if ("name" in d) { - ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; - } - if ("payload" in d) { - ret.payload = Object.prototype.hasOwnProperty.call(Buffer, "fromMap") ? Buffer.fromMap(d["payload"]) : d["payload"]; - } return ret; } @@ -5109,78 +9015,54 @@ class AppendMessageRequest { if (this.requestId !== null) { d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } - if (this.name !== null) { - d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; - } - if (this.payload !== null) { - d["payload"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.payload), "asMap") ? this.payload.asMap() : this.payload; - } return d; } }; -Object.defineProperty(AppendMessageRequest, "typesMap", { +Object.defineProperty(ListStreamsRequest, "typesMap", { value: { requestId: { 'type': String, 'subtype': null }, - name: { - 'type': String, - 'subtype': null - }, - payload: { - 'type': Buffer, - 'subtype': null - }, } }); -Object.defineProperty(AppendMessageRequest, "formatsMap", { +Object.defineProperty(ListStreamsRequest, "formatsMap", { value: {} }); -Object.defineProperty(AppendMessageRequest, "validationsMap", { +Object.defineProperty(ListStreamsRequest, "validationsMap", { value: { 'requestId': { 'required': true, 'minLength': 1, 'pattern': /^[\w ,.\-_]*$/, }, - 'name': { - 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, - }, - 'payload': { - 'required': true, - 'minLength': 1, - }, } }); /** - * Internal Only + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class AppendMessageResponse { +class ListStreamsResponse { #__requestId = null; #__status = null; #__errorMessage = null; - #__sequenceNumber = null; + #__streams = null; /** * @param requestId {String} * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} * @param errorMessage {String} - * @param sequenceNumber {Number} + * @param streams {String[]} */ constructor( requestId = null, status = null, errorMessage = null, - sequenceNumber = null, + streams = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); @@ -5194,14 +9076,17 @@ class AppendMessageResponse { throw new Error("errorMessage must be String"); } - if (sequenceNumber !== null && !(typeof sequenceNumber === "number")) { - throw new Error("sequenceNumber must be Number"); + if (streams !== null && !(streams instanceof Array)) { + throw new Error("streams must be Array"); + } + if (streams !== null && !streams.every((v) => typeof v === "string")) { + throw new Error("streams array values must be String"); } this.#__requestId = requestId; this.#__status = status; this.#__errorMessage = errorMessage; - this.#__sequenceNumber = sequenceNumber; + this.#__streams = streams; } /** @@ -5223,7 +9108,7 @@ class AppendMessageResponse { } /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} */ withRequestId(value) { this.requestId = value; @@ -5249,7 +9134,7 @@ class AppendMessageResponse { } /** * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} */ withStatus(value) { this.status = value; @@ -5275,7 +9160,7 @@ class AppendMessageResponse { } /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} */ withErrorMessage(value) { this.errorMessage = value; @@ -5283,33 +9168,36 @@ class AppendMessageResponse { } /** - * @returns {Number} + * @returns {String[]} */ - get sequenceNumber() { - return this.#__sequenceNumber; + get streams() { + return this.#__streams; } /** - * @param value {Number} + * @param value {String[]} */ - set sequenceNumber(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("sequenceNumber must be Number"); + set streams(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("streams must be Array"); + } + if (value !== null && !value.every((v) => typeof v === "string")) { + throw new Error("streams array values must be String"); } - this.#__sequenceNumber = value; + this.#__streams = value; } /** - * @param value {Number} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} + * @param value {String[]} + * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} */ - withSequenceNumber(value) { - this.sequenceNumber = value; + withStreams(value) { + this.streams = value; return this; } static fromMap(d) { - const ret = new AppendMessageResponse(); + const ret = new ListStreamsResponse(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } @@ -5319,8 +9207,11 @@ class AppendMessageResponse { if ("errorMessage" in d) { ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; } - if ("sequenceNumber" in d) { - ret.sequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sequenceNumber"]) : d["sequenceNumber"]; + if ("streams" in d) { + ret.streams = d["streams"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(v) : v); + return acc; + }, []); } return ret; } @@ -5336,14 +9227,17 @@ class AppendMessageResponse { if (this.errorMessage !== null) { d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; } - if (this.sequenceNumber !== null) { - d["sequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sequenceNumber), "asMap") ? this.sequenceNumber.asMap() : this.sequenceNumber; + if (this.streams !== null) { + d["streams"] = this.streams.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); } return d; } }; -Object.defineProperty(AppendMessageResponse, "typesMap", { +Object.defineProperty(ListStreamsResponse, "typesMap", { value: { requestId: { 'type': String, @@ -5357,16 +9251,16 @@ Object.defineProperty(AppendMessageResponse, "typesMap", { 'type': String, 'subtype': null }, - sequenceNumber: { - 'type': Number, - 'subtype': null + streams: { + 'type': Array, + 'subtype': String }, } }); -Object.defineProperty(AppendMessageResponse, "formatsMap", { +Object.defineProperty(ListStreamsResponse, "formatsMap", { value: {} }); -Object.defineProperty(AppendMessageResponse, "validationsMap", { +Object.defineProperty(ListStreamsResponse, "validationsMap", { value: { 'requestId': { 'required': true, @@ -5379,690 +9273,840 @@ Object.defineProperty(AppendMessageResponse, "validationsMap", { 'errorMessage': { 'required': false, }, - 'sequenceNumber': { + 'streams': { 'required': false, }, } }); /** - * (Internal Only) Request object for reading from a message stream. readMessagesOptions is optional. + * Contains a timestamp with optional nanosecond granularity. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager - */ -class ReadMessagesRequest { - #__requestId = null; - #__streamName = null; - #__readMessagesOptions = null; + */ +class TimeInNanos { + #__timeInSeconds = null; + #__offsetInNanos = null; /** - * @param requestId {String} - * @param streamName {String} - * @param readMessagesOptions {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param timeInSeconds {Number} The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by offsetInNanos. + * @param offsetInNanos {Number} The nanosecond offset from timeInSeconds. */ constructor( - requestId = null, - streamName = null, - readMessagesOptions = null, + timeInSeconds = null, + offsetInNanos = null, ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); - } - - if (streamName !== null && !(typeof streamName === "string")) { - throw new Error("streamName must be String"); - } - - if (readMessagesOptions !== null && !(readMessagesOptions instanceof ReadMessagesOptions)) { - throw new Error("readMessagesOptions must be ReadMessagesOptions"); + if (timeInSeconds !== null && !(typeof timeInSeconds === "number")) { + throw new Error("timeInSeconds must be Number"); } - this.#__requestId = requestId; - this.#__streamName = streamName; - this.#__readMessagesOptions = readMessagesOptions; - } - - /** - * @returns {String} - - */ - get requestId() { - return this.#__requestId; - } - /** - * @param value {String} - */ - set requestId(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + if (offsetInNanos !== null && !(typeof offsetInNanos === "number")) { + throw new Error("offsetInNanos must be Number"); } - this.#__requestId = value; - } - /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} - */ - withRequestId(value) { - this.requestId = value; - return this; + this.#__timeInSeconds = timeInSeconds; + this.#__offsetInNanos = offsetInNanos; } /** - * @returns {String} + * The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by offsetInNanos. + * @returns {Number} */ - get streamName() { - return this.#__streamName; + get timeInSeconds() { + return this.#__timeInSeconds; } /** - * @param value {String} + * @param value {Number} The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by offsetInNanos. */ - set streamName(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("streamName must be String"); + set timeInSeconds(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("timeInSeconds must be Number"); } - this.#__streamName = value; + this.#__timeInSeconds = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} + * @param value {Number} The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by offsetInNanos. + * @returns {aws-greengrass-core-sdk.StreamManager.TimeInNanos} */ - withStreamName(value) { - this.streamName = value; + withTimeInSeconds(value) { + this.timeInSeconds = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * The nanosecond offset from timeInSeconds. + * @returns {Number} */ - get readMessagesOptions() { - return this.#__readMessagesOptions; + get offsetInNanos() { + return this.#__offsetInNanos; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param value {Number} The nanosecond offset from timeInSeconds. */ - set readMessagesOptions(value) { - if (value !== null && !(value instanceof ReadMessagesOptions)) { - throw new Error("readMessagesOptions must be ReadMessagesOptions"); + set offsetInNanos(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("offsetInNanos must be Number"); } - this.#__readMessagesOptions = value; + this.#__offsetInNanos = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} + * @param value {Number} The nanosecond offset from timeInSeconds. + * @returns {aws-greengrass-core-sdk.StreamManager.TimeInNanos} */ - withReadMessagesOptions(value) { - this.readMessagesOptions = value; + withOffsetInNanos(value) { + this.offsetInNanos = value; return this; } static fromMap(d) { - const ret = new ReadMessagesRequest(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; - } - if ("streamName" in d) { - ret.streamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["streamName"]) : d["streamName"]; + const ret = new TimeInNanos(); + if ("timeInSeconds" in d) { + ret.timeInSeconds = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["timeInSeconds"]) : d["timeInSeconds"]; } - if ("readMessagesOptions" in d) { - ret.readMessagesOptions = Object.prototype.hasOwnProperty.call(ReadMessagesOptions, "fromMap") ? ReadMessagesOptions.fromMap(d["readMessagesOptions"]) : d["readMessagesOptions"]; + if ("offsetInNanos" in d) { + ret.offsetInNanos = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["offsetInNanos"]) : d["offsetInNanos"]; } return ret; } asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; - } - if (this.streamName !== null) { - d["streamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamName), "asMap") ? this.streamName.asMap() : this.streamName; + if (this.timeInSeconds !== null) { + d["timeInSeconds"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.timeInSeconds), "asMap") ? this.timeInSeconds.asMap() : this.timeInSeconds; } - if (this.readMessagesOptions !== null) { - d["readMessagesOptions"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.readMessagesOptions), "asMap") ? this.readMessagesOptions.asMap() : this.readMessagesOptions; + if (this.offsetInNanos !== null) { + d["offsetInNanos"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.offsetInNanos), "asMap") ? this.offsetInNanos.asMap() : this.offsetInNanos; } return d; } }; -Object.defineProperty(ReadMessagesRequest, "typesMap", { +Object.defineProperty(TimeInNanos, "typesMap", { value: { - requestId: { - 'type': String, - 'subtype': null - }, - streamName: { - 'type': String, + timeInSeconds: { + 'type': Number, 'subtype': null }, - readMessagesOptions: { - 'type': ReadMessagesOptions, + offsetInNanos: { + 'type': Number, 'subtype': null }, } }); -Object.defineProperty(ReadMessagesRequest, "formatsMap", { +Object.defineProperty(TimeInNanos, "formatsMap", { value: {} }); -Object.defineProperty(ReadMessagesRequest, "validationsMap", { +Object.defineProperty(TimeInNanos, "validationsMap", { value: { - 'requestId': { - 'required': true, - 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, - }, - 'streamName': { + 'timeInSeconds': { 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, + 'maximum': 31556889864403199, + 'minimum': 1, }, - 'readMessagesOptions': { + 'offsetInNanos': { 'required': false, + 'maximum': 999999999, + 'minimum': 0, }, } }); /** - * Internal Only + * Contains an asset property value (of a single type only). * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class ReadMessagesResponse { - #__requestId = null; - #__messages = null; - #__status = null; - #__errorMessage = null; +class Variant { + #__stringValue = null; + #__integerValue = null; + #__doubleValue = null; + #__booleanValue = null; /** - * @param requestId {String} - * @param messages {aws-greengrass-core-sdk.StreamManager.Message[]} - * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @param errorMessage {String} + * @param stringValue {String} Asset property data of type string (sequence of characters). + * @param integerValue {Number} Asset property data of type integer (whole number). + * @param doubleValue {Number} Asset property data of type double (floating point number). + * @param booleanValue {Boolean} Asset property data of type Boolean (true or false). */ constructor( - requestId = null, - messages = null, - status = null, - errorMessage = null, + stringValue = null, + integerValue = null, + doubleValue = null, + booleanValue = null, ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); + if (stringValue !== null && !(typeof stringValue === "string")) { + throw new Error("stringValue must be String"); } - if (messages !== null && !(messages instanceof Array)) { - throw new Error("messages must be Array"); - } - if (messages !== null && !messages.every((v) => v instanceof Message)) { - throw new Error("messages array values must be Message"); + if (integerValue !== null && !(typeof integerValue === "number")) { + throw new Error("integerValue must be Number"); } - if (status !== null && !(status instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + if (doubleValue !== null && !(typeof doubleValue === "number")) { + throw new Error("doubleValue must be Number"); } - if (errorMessage !== null && !(typeof errorMessage === "string")) { - throw new Error("errorMessage must be String"); + if (booleanValue !== null && !(typeof booleanValue === "boolean")) { + throw new Error("booleanValue must be Boolean"); } - this.#__requestId = requestId; - this.#__messages = messages; - this.#__status = status; - this.#__errorMessage = errorMessage; + this.#__stringValue = stringValue; + this.#__integerValue = integerValue; + this.#__doubleValue = doubleValue; + this.#__booleanValue = booleanValue; } /** + * Asset property data of type string (sequence of characters). * @returns {String} */ - get requestId() { - return this.#__requestId; + get stringValue() { + return this.#__stringValue; } /** - * @param value {String} + * @param value {String} Asset property data of type string (sequence of characters). */ - set requestId(value) { + set stringValue(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + throw new Error("stringValue must be String"); } - this.#__requestId = value; + this.#__stringValue = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} + * @param value {String} Asset property data of type string (sequence of characters). + * @returns {aws-greengrass-core-sdk.StreamManager.Variant} */ - withRequestId(value) { - this.requestId = value; + withStringValue(value) { + this.stringValue = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.Message[]} + * Asset property data of type integer (whole number). + * @returns {Number} */ - get messages() { - return this.#__messages; + get integerValue() { + return this.#__integerValue; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.Message[]} + * @param value {Number} Asset property data of type integer (whole number). */ - set messages(value) { - if (value !== null && !(value instanceof Array)) { - throw new Error("messages must be Array"); - } - if (value !== null && !value.every((v) => v instanceof Message)) { - throw new Error("messages array values must be Message"); + set integerValue(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("integerValue must be Number"); } - this.#__messages = value; + this.#__integerValue = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.Message[]} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} + * @param value {Number} Asset property data of type integer (whole number). + * @returns {aws-greengrass-core-sdk.StreamManager.Variant} */ - withMessages(value) { - this.messages = value; + withIntegerValue(value) { + this.integerValue = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * Asset property data of type double (floating point number). + * @returns {Number} */ - get status() { - return this.#__status; + get doubleValue() { + return this.#__doubleValue; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param value {Number} Asset property data of type double (floating point number). */ - set status(value) { - if (value !== null && !(value instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + set doubleValue(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("doubleValue must be Number"); } - this.#__status = value; + this.#__doubleValue = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} + * @param value {Number} Asset property data of type double (floating point number). + * @returns {aws-greengrass-core-sdk.StreamManager.Variant} */ - withStatus(value) { - this.status = value; + withDoubleValue(value) { + this.doubleValue = value; return this; } /** - * @returns {String} + * Asset property data of type Boolean (true or false). + * @returns {Boolean} */ - get errorMessage() { - return this.#__errorMessage; + get booleanValue() { + return this.#__booleanValue; } /** - * @param value {String} + * @param value {Boolean} Asset property data of type Boolean (true or false). */ - set errorMessage(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("errorMessage must be String"); + set booleanValue(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("booleanValue must be Boolean"); } - this.#__errorMessage = value; + this.#__booleanValue = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} + * @param value {Boolean} Asset property data of type Boolean (true or false). + * @returns {aws-greengrass-core-sdk.StreamManager.Variant} */ - withErrorMessage(value) { - this.errorMessage = value; + withBooleanValue(value) { + this.booleanValue = value; return this; } static fromMap(d) { - const ret = new ReadMessagesResponse(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + const ret = new Variant(); + if ("stringValue" in d) { + ret.stringValue = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["stringValue"]) : d["stringValue"]; } - if ("messages" in d) { - ret.messages = d["messages"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Message, "fromMap") ? Message.fromMap(v) : v); - return acc; - }, []); + if ("integerValue" in d) { + ret.integerValue = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["integerValue"]) : d["integerValue"]; } - if ("status" in d) { - ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + if ("doubleValue" in d) { + ret.doubleValue = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["doubleValue"]) : d["doubleValue"]; } - if ("errorMessage" in d) { - ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + if ("booleanValue" in d) { + ret.booleanValue = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["booleanValue"]) : d["booleanValue"]; } return ret; } asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + if (this.stringValue !== null) { + d["stringValue"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.stringValue), "asMap") ? this.stringValue.asMap() : this.stringValue; } - if (this.messages !== null) { - d["messages"] = this.messages.reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); - return acc; - }, []); + if (this.integerValue !== null) { + d["integerValue"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.integerValue), "asMap") ? this.integerValue.asMap() : this.integerValue; } - if (this.status !== null) { - d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + if (this.doubleValue !== null) { + d["doubleValue"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.doubleValue), "asMap") ? this.doubleValue.asMap() : this.doubleValue; } - if (this.errorMessage !== null) { - d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + if (this.booleanValue !== null) { + d["booleanValue"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.booleanValue), "asMap") ? this.booleanValue.asMap() : this.booleanValue; } return d; } }; -Object.defineProperty(ReadMessagesResponse, "typesMap", { +Object.defineProperty(Variant, "typesMap", { value: { - requestId: { + stringValue: { 'type': String, 'subtype': null }, - messages: { - 'type': Array, - 'subtype': Message + integerValue: { + 'type': Number, + 'subtype': null }, - status: { - 'type': ResponseStatusCode, + doubleValue: { + 'type': Number, 'subtype': null }, - errorMessage: { - 'type': String, + booleanValue: { + 'type': Boolean, 'subtype': null }, } }); -Object.defineProperty(ReadMessagesResponse, "formatsMap", { +Object.defineProperty(Variant, "formatsMap", { value: {} }); -Object.defineProperty(ReadMessagesResponse, "validationsMap", { +Object.defineProperty(Variant, "validationsMap", { value: { - 'requestId': { + 'stringValue': { 'required': false, 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, + 'maxLength': 1024, + 'pattern': /[^\u0000-\u001F\u007F]+/, }, - 'messages': { + 'integerValue': { 'required': false, + 'maximum': 2147483647, + 'minimum': 0, }, - 'status': { + 'doubleValue': { 'required': false, }, - 'errorMessage': { + 'booleanValue': { 'required': false, }, } }); /** - * (Internal Only) Request object to list all available streams. There are no options. + * + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class Quality { + + #value = null; + constructor(value = null) { + if (!Object.values(Quality.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; + } + + static fromMap(d) { + return Quality[Quality.optionsFlipped[d]]; + } + + asMap() { + return this.#value; + } +}; +Object.defineProperty(Quality, "options", { + value: { + GOOD: "GOOD", + BAD: "BAD", + UNCERTAIN: "UNCERTAIN", + } +}); +Object.defineProperty(Quality, "optionsFlipped", { + value: { + "GOOD": "GOOD", + "BAD": "BAD", + "UNCERTAIN": "UNCERTAIN", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.Quality} GOOD + * @memberOf aws-greengrass-core-sdk.StreamManager.Quality# + * @readonly + */ +Object.defineProperty(Quality, "GOOD", { + value: new Quality("GOOD") +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Quality} BAD + * @memberOf aws-greengrass-core-sdk.StreamManager.Quality# + * @readonly + */ +Object.defineProperty(Quality, "BAD", { + value: new Quality("BAD") +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Quality} UNCERTAIN + * @memberOf aws-greengrass-core-sdk.StreamManager.Quality# + * @readonly + */ +Object.defineProperty(Quality, "UNCERTAIN", { + value: new Quality("UNCERTAIN") +}); + +/** + * Contains asset property value information. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class ListStreamsRequest { - #__requestId = null; +class AssetPropertyValue { + #__value = null; + #__timestamp = null; + #__quality = null; /** - * @param requestId {String} + * @param value {aws-greengrass-core-sdk.StreamManager.Variant} The value of the asset property. + * @param timestamp {aws-greengrass-core-sdk.StreamManager.TimeInNanos} The timestamp of the asset property value. + * @param quality {aws-greengrass-core-sdk.StreamManager.Quality} The quality of the asset property value. */ constructor( - requestId = null, + value = null, + timestamp = null, + quality = null, ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); + if (value !== null && !(value instanceof Variant)) { + throw new Error("value must be Variant"); } - this.#__requestId = requestId; + if (timestamp !== null && !(timestamp instanceof TimeInNanos)) { + throw new Error("timestamp must be TimeInNanos"); + } + + if (quality !== null && !(quality instanceof Quality)) { + throw new Error("quality must be Quality"); + } + + this.#__value = value; + this.#__timestamp = timestamp; + this.#__quality = quality; } /** - * @returns {String} + * The value of the asset property. + * @returns {aws-greengrass-core-sdk.StreamManager.Variant} */ - get requestId() { - return this.#__requestId; + get value() { + return this.#__value; } /** - * @param value {String} + * @param value {aws-greengrass-core-sdk.StreamManager.Variant} The value of the asset property. */ - set requestId(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + set value(value) { + if (value !== null && !(value instanceof Variant)) { + throw new Error("value must be Variant"); } - this.#__requestId = value; + this.#__value = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsRequest} + * @param value {aws-greengrass-core-sdk.StreamManager.Variant} The value of the asset property. + * @returns {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue} */ - withRequestId(value) { - this.requestId = value; + withValue(value) { + this.value = value; + return this; + } + + /** + * The timestamp of the asset property value. + * @returns {aws-greengrass-core-sdk.StreamManager.TimeInNanos} + + */ + get timestamp() { + return this.#__timestamp; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.TimeInNanos} The timestamp of the asset property value. + */ + set timestamp(value) { + if (value !== null && !(value instanceof TimeInNanos)) { + throw new Error("timestamp must be TimeInNanos"); + } + + this.#__timestamp = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.TimeInNanos} The timestamp of the asset property value. + * @returns {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue} + */ + withTimestamp(value) { + this.timestamp = value; + return this; + } + + /** + * The quality of the asset property value. + * @returns {aws-greengrass-core-sdk.StreamManager.Quality} + + */ + get quality() { + return this.#__quality; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.Quality} The quality of the asset property value. + */ + set quality(value) { + if (value !== null && !(value instanceof Quality)) { + throw new Error("quality must be Quality"); + } + + this.#__quality = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.Quality} The quality of the asset property value. + * @returns {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue} + */ + withQuality(value) { + this.quality = value; return this; } static fromMap(d) { - const ret = new ListStreamsRequest(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + const ret = new AssetPropertyValue(); + if ("value" in d) { + ret.value = Object.prototype.hasOwnProperty.call(Variant, "fromMap") ? Variant.fromMap(d["value"]) : d["value"]; + } + if ("timestamp" in d) { + ret.timestamp = Object.prototype.hasOwnProperty.call(TimeInNanos, "fromMap") ? TimeInNanos.fromMap(d["timestamp"]) : d["timestamp"]; + } + if ("quality" in d) { + ret.quality = Object.prototype.hasOwnProperty.call(Quality, "fromMap") ? Quality.fromMap(d["quality"]) : d["quality"]; } return ret; } asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + if (this.value !== null) { + d["value"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.value), "asMap") ? this.value.asMap() : this.value; + } + if (this.timestamp !== null) { + d["timestamp"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.timestamp), "asMap") ? this.timestamp.asMap() : this.timestamp; + } + if (this.quality !== null) { + d["quality"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.quality), "asMap") ? this.quality.asMap() : this.quality; } return d; } }; -Object.defineProperty(ListStreamsRequest, "typesMap", { +Object.defineProperty(AssetPropertyValue, "typesMap", { value: { - requestId: { - 'type': String, + value: { + 'type': Variant, + 'subtype': null + }, + timestamp: { + 'type': TimeInNanos, + 'subtype': null + }, + quality: { + 'type': Quality, 'subtype': null }, } }); -Object.defineProperty(ListStreamsRequest, "formatsMap", { +Object.defineProperty(AssetPropertyValue, "formatsMap", { value: {} }); -Object.defineProperty(ListStreamsRequest, "validationsMap", { +Object.defineProperty(AssetPropertyValue, "validationsMap", { value: { - 'requestId': { + 'value': { 'required': true, - 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, + }, + 'timestamp': { + 'required': true, + }, + 'quality': { + 'required': false, }, } }); /** - * Internal Only + * Contains a list of value updates for a IoTSiteWise asset property in the list of asset entries consumed by the BatchPutAssetPropertyValue API. See https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchPutAssetPropertyValue.html. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class ListStreamsResponse { - #__requestId = null; - #__status = null; - #__errorMessage = null; - #__streams = null; +class PutAssetPropertyValueEntry { + #__entryId = null; + #__assetId = null; + #__propertyId = null; + #__propertyAlias = null; + #__propertyValues = null; /** - * @param requestId {String} - * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @param errorMessage {String} - * @param streams {String[]} + * @param entryId {String} The user specified ID for the entry. You can use this ID to identify which entries failed. + * @param assetId {String} The ID of the asset to update. + * @param propertyId {String} The ID of the asset property for this entry. + * @param propertyAlias {String} The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html. + * @param propertyValues {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue[]} The list of property values to upload. You can specify up to 10 values. */ constructor( - requestId = null, - status = null, - errorMessage = null, - streams = null, + entryId = null, + assetId = null, + propertyId = null, + propertyAlias = null, + propertyValues = null, ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); + if (entryId !== null && !(typeof entryId === "string")) { + throw new Error("entryId must be String"); } - if (status !== null && !(status instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + if (assetId !== null && !(typeof assetId === "string")) { + throw new Error("assetId must be String"); } - if (errorMessage !== null && !(typeof errorMessage === "string")) { - throw new Error("errorMessage must be String"); + if (propertyId !== null && !(typeof propertyId === "string")) { + throw new Error("propertyId must be String"); } - if (streams !== null && !(streams instanceof Array)) { - throw new Error("streams must be Array"); + if (propertyAlias !== null && !(typeof propertyAlias === "string")) { + throw new Error("propertyAlias must be String"); } - if (streams !== null && !streams.every((v) => typeof v === "string")) { - throw new Error("streams array values must be String"); + + if (propertyValues !== null && !(propertyValues instanceof Array)) { + throw new Error("propertyValues must be Array"); + } + if (propertyValues !== null && !propertyValues.every((v) => v instanceof AssetPropertyValue)) { + throw new Error("propertyValues array values must be AssetPropertyValue"); } - this.#__requestId = requestId; - this.#__status = status; - this.#__errorMessage = errorMessage; - this.#__streams = streams; + this.#__entryId = entryId; + this.#__assetId = assetId; + this.#__propertyId = propertyId; + this.#__propertyAlias = propertyAlias; + this.#__propertyValues = propertyValues; } /** + * The user specified ID for the entry. You can use this ID to identify which entries failed. * @returns {String} */ - get requestId() { - return this.#__requestId; + get entryId() { + return this.#__entryId; } /** - * @param value {String} + * @param value {String} The user specified ID for the entry. You can use this ID to identify which entries failed. */ - set requestId(value) { + set entryId(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + throw new Error("entryId must be String"); } - this.#__requestId = value; + this.#__entryId = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} + * @param value {String} The user specified ID for the entry. You can use this ID to identify which entries failed. + * @returns {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry} */ - withRequestId(value) { - this.requestId = value; + withEntryId(value) { + this.entryId = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * The ID of the asset to update. + * @returns {String} */ - get status() { - return this.#__status; + get assetId() { + return this.#__assetId; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param value {String} The ID of the asset to update. */ - set status(value) { - if (value !== null && !(value instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + set assetId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("assetId must be String"); } - this.#__status = value; + this.#__assetId = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} + * @param value {String} The ID of the asset to update. + * @returns {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry} */ - withStatus(value) { - this.status = value; + withAssetId(value) { + this.assetId = value; return this; } /** + * The ID of the asset property for this entry. * @returns {String} */ - get errorMessage() { - return this.#__errorMessage; + get propertyId() { + return this.#__propertyId; } /** - * @param value {String} + * @param value {String} The ID of the asset property for this entry. */ - set errorMessage(value) { + set propertyId(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("errorMessage must be String"); + throw new Error("propertyId must be String"); } - this.#__errorMessage = value; + this.#__propertyId = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} + * @param value {String} The ID of the asset property for this entry. + * @returns {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry} */ - withErrorMessage(value) { - this.errorMessage = value; + withPropertyId(value) { + this.propertyId = value; return this; } /** - * @returns {String[]} + * The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html. + * @returns {String} */ - get streams() { - return this.#__streams; + get propertyAlias() { + return this.#__propertyAlias; } /** - * @param value {String[]} + * @param value {String} The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html. */ - set streams(value) { + set propertyAlias(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("propertyAlias must be String"); + } + + this.#__propertyAlias = value; + } + /** + * @param value {String} The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html. + * @returns {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry} + */ + withPropertyAlias(value) { + this.propertyAlias = value; + return this; + } + + /** + * The list of property values to upload. You can specify up to 10 values. + * @returns {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue[]} + + */ + get propertyValues() { + return this.#__propertyValues; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue[]} The list of property values to upload. You can specify up to 10 values. + */ + set propertyValues(value) { if (value !== null && !(value instanceof Array)) { - throw new Error("streams must be Array"); + throw new Error("propertyValues must be Array"); } - if (value !== null && !value.every((v) => typeof v === "string")) { - throw new Error("streams array values must be String"); + if (value !== null && !value.every((v) => v instanceof AssetPropertyValue)) { + throw new Error("propertyValues array values must be AssetPropertyValue"); } - this.#__streams = value; + this.#__propertyValues = value; } /** - * @param value {String[]} - * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} + * @param value {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue[]} The list of property values to upload. You can specify up to 10 values. + * @returns {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry} */ - withStreams(value) { - this.streams = value; + withPropertyValues(value) { + this.propertyValues = value; return this; } static fromMap(d) { - const ret = new ListStreamsResponse(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + const ret = new PutAssetPropertyValueEntry(); + if ("entryId" in d) { + ret.entryId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["entryId"]) : d["entryId"]; } - if ("status" in d) { - ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + if ("assetId" in d) { + ret.assetId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["assetId"]) : d["assetId"]; } - if ("errorMessage" in d) { - ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + if ("propertyId" in d) { + ret.propertyId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["propertyId"]) : d["propertyId"]; } - if ("streams" in d) { - ret.streams = d["streams"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(v) : v); + if ("propertyAlias" in d) { + ret.propertyAlias = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["propertyAlias"]) : d["propertyAlias"]; + } + if ("propertyValues" in d) { + ret.propertyValues = d["propertyValues"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(AssetPropertyValue, "fromMap") ? AssetPropertyValue.fromMap(v) : v); return acc; }, []); } @@ -6071,17 +10115,20 @@ class ListStreamsResponse { asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + if (this.entryId !== null) { + d["entryId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.entryId), "asMap") ? this.entryId.asMap() : this.entryId; } - if (this.status !== null) { - d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + if (this.assetId !== null) { + d["assetId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.assetId), "asMap") ? this.assetId.asMap() : this.assetId; } - if (this.errorMessage !== null) { - d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + if (this.propertyId !== null) { + d["propertyId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.propertyId), "asMap") ? this.propertyId.asMap() : this.propertyId; } - if (this.streams !== null) { - d["streams"] = this.streams.reduce((acc, v) => { + if (this.propertyAlias !== null) { + d["propertyAlias"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.propertyAlias), "asMap") ? this.propertyAlias.asMap() : this.propertyAlias; + } + if (this.propertyValues !== null) { + d["propertyValues"] = this.propertyValues.reduce((acc, v) => { acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); return acc; }, []); @@ -6090,105 +10137,158 @@ class ListStreamsResponse { } }; -Object.defineProperty(ListStreamsResponse, "typesMap", { +Object.defineProperty(PutAssetPropertyValueEntry, "typesMap", { value: { - requestId: { + entryId: { 'type': String, 'subtype': null }, - status: { - 'type': ResponseStatusCode, + assetId: { + 'type': String, 'subtype': null }, - errorMessage: { + propertyId: { 'type': String, 'subtype': null }, - streams: { + propertyAlias: { + 'type': String, + 'subtype': null + }, + propertyValues: { 'type': Array, - 'subtype': String + 'subtype': AssetPropertyValue }, } }); -Object.defineProperty(ListStreamsResponse, "formatsMap", { +Object.defineProperty(PutAssetPropertyValueEntry, "formatsMap", { value: {} }); -Object.defineProperty(ListStreamsResponse, "validationsMap", { +Object.defineProperty(PutAssetPropertyValueEntry, "validationsMap", { value: { - 'requestId': { + 'entryId': { 'required': true, 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, + 'maxLength': 64, + 'pattern': /^[a-zA-Z0-9_-]+$/, }, - 'status': { - 'required': true, + 'assetId': { + 'required': false, }, - 'errorMessage': { + 'propertyId': { 'required': false, }, - 'streams': { + 'propertyAlias': { 'required': false, + 'minLength': 1, + 'maxLength': 2048, + 'pattern': /[^\u0000-\u001F\u007F]+/, + }, + 'propertyValues': { + 'required': true, + 'maxItems': 10, + 'minItems': 1, }, } }); /** * @type {{ -StrategyOnFull: StrategyOnFull, -Persistence: Persistence, +VersionInfo: VersionInfo, ConnectRequest: ConnectRequest, ResponseStatusCode: ResponseStatusCode, ConnectResponse: ConnectResponse, Operation: Operation, MessageFrame: MessageFrame, +EventType: EventType, +Status: Status, +StatusLevel: StatusLevel, +S3ExportTaskDefinition: S3ExportTaskDefinition, +StatusContext: StatusContext, +StatusMessage: StatusMessage, +TraceableRequest: TraceableRequest, +UnknownOperationError: UnknownOperationError, +Persistence: Persistence, +ExportFormat: ExportFormat, HTTPConfig: HTTPConfig, IoTAnalyticsConfig: IoTAnalyticsConfig, KinesisConfig: KinesisConfig, +IoTSiteWiseConfig: IoTSiteWiseConfig, +StatusConfig: StatusConfig, +S3ExportTaskExecutorConfig: S3ExportTaskExecutorConfig, ExportDefinition: ExportDefinition, +StrategyOnFull: StrategyOnFull, MessageStreamDefinition: MessageStreamDefinition, -MessageStreamInfo: MessageStreamInfo, -Message: Message, -ReadMessagesOptions: ReadMessagesOptions, CreateMessageStreamRequest: CreateMessageStreamRequest, CreateMessageStreamResponse: CreateMessageStreamResponse, +UpdateMessageStreamRequest: UpdateMessageStreamRequest, +UpdateMessageStreamResponse: UpdateMessageStreamResponse, DeleteMessageStreamRequest: DeleteMessageStreamRequest, DeleteMessageStreamResponse: DeleteMessageStreamResponse, DescribeMessageStreamRequest: DescribeMessageStreamRequest, +MessageStreamInfo: MessageStreamInfo, DescribeMessageStreamResponse: DescribeMessageStreamResponse, AppendMessageRequest: AppendMessageRequest, AppendMessageResponse: AppendMessageResponse, +ReadMessagesOptions: ReadMessagesOptions, ReadMessagesRequest: ReadMessagesRequest, +Message: Message, ReadMessagesResponse: ReadMessagesResponse, ListStreamsRequest: ListStreamsRequest, -ListStreamsResponse: ListStreamsResponse +ListStreamsResponse: ListStreamsResponse, +TimeInNanos: TimeInNanos, +Variant: Variant, +Quality: Quality, +AssetPropertyValue: AssetPropertyValue, +PutAssetPropertyValueEntry: PutAssetPropertyValueEntry }} */ module.exports = { - StrategyOnFull, - Persistence, + VersionInfo, ConnectRequest, ResponseStatusCode, ConnectResponse, Operation, MessageFrame, + EventType, + Status, + StatusLevel, + S3ExportTaskDefinition, + StatusContext, + StatusMessage, + TraceableRequest, + UnknownOperationError, + Persistence, + ExportFormat, HTTPConfig, IoTAnalyticsConfig, KinesisConfig, + IoTSiteWiseConfig, + StatusConfig, + S3ExportTaskExecutorConfig, ExportDefinition, + StrategyOnFull, MessageStreamDefinition, - MessageStreamInfo, - Message, - ReadMessagesOptions, CreateMessageStreamRequest, CreateMessageStreamResponse, + UpdateMessageStreamRequest, + UpdateMessageStreamResponse, DeleteMessageStreamRequest, DeleteMessageStreamResponse, DescribeMessageStreamRequest, + MessageStreamInfo, DescribeMessageStreamResponse, AppendMessageRequest, AppendMessageResponse, + ReadMessagesOptions, ReadMessagesRequest, + Message, ReadMessagesResponse, ListStreamsRequest, ListStreamsResponse, + TimeInNanos, + Variant, + Quality, + AssetPropertyValue, + PutAssetPropertyValueEntry, }; \ No newline at end of file diff --git a/aws-greengrass-core-sdk/stream-manager/exceptions.js b/aws-greengrass-core-sdk/stream-manager/exceptions.js index d1b4377..89ddf00 100644 --- a/aws-greengrass-core-sdk/stream-manager/exceptions.js +++ b/aws-greengrass-core-sdk/stream-manager/exceptions.js @@ -23,6 +23,9 @@ class ServerOutOfMemoryException extends StreamManagerException {} class ServerTimeoutException extends StreamManagerException {} class UnauthorizedException extends StreamManagerException {} class UnknownFailureException extends StreamManagerException {} +class UpdateFailedException extends StreamManagerException {} +class UnknownOperationException extends StreamManagerException {} +class UpdateNotAllowedException extends InvalidRequestException {} class ValidationException extends ClientException {} module.exports = { @@ -40,4 +43,7 @@ module.exports = { UnauthorizedException, UnknownFailureException, ValidationException, + UpdateFailedException, + UpdateNotAllowedException, + UnknownOperationException, }; diff --git a/aws-greengrass-core-sdk/stream-manager/util.js b/aws-greengrass-core-sdk/stream-manager/util.js index 1ed8a3f..9cbe226 100644 --- a/aws-greengrass-core-sdk/stream-manager/util.js +++ b/aws-greengrass-core-sdk/stream-manager/util.js @@ -3,186 +3,33 @@ * Copyright (c) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. */ -const smData = require('aws-greengrass-core-sdk/stream-manager/data'); const exceptions = require('./exceptions'); - -// eslint-disable-next-line no-bitwise -const MAX_PACKET_SIZE = 1 << 30; -const LENGTH_FIELD_SIZE_BYTES = 4; -const OP_FIELD_SIZE_BYTES = 1; -const HEADER_SIZE_BYTES = LENGTH_FIELD_SIZE_BYTES + OP_FIELD_SIZE_BYTES; - -const intToBuffer = (i, length = 4) => { - const buf = Buffer.alloc(length); - if (length === 4) { - buf.writeInt32BE(i, 0); - } else if (length === 1) { - buf.writeInt8(i, 0); - } else { - throw new Error('Illegal value specified for intToBuffer length. Must be 1 or 4.'); - } - return buf; -}; - -const intFromBuffer = (b) => { - if (b.length >= 4) { - return b.readInt32BE(0); - } else { - return b.readInt8(0); - } -}; - -const encodeFrame = (frame) => { - if (frame.payload.length + 1 > MAX_PACKET_SIZE) { - throw new exceptions.RequestPayloadTooLargeException(); - } - - const buf = Buffer.alloc(HEADER_SIZE_BYTES); - buf.writeInt32BE(frame.payload.length + 1, 0); - buf.writeInt8(frame.operation.asMap(), LENGTH_FIELD_SIZE_BYTES); - return { header: buf, payload: frame.payload }; -}; +const utilInternal = require('./utilInternal'); /** - * From https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript - * @ignore - * @returns {string} + * Validate And Serialize an instance of class to Json bytes + * @param o a instance object + * @return byte array + * @exception throws ValidationException */ -const uuidv4 = () => 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { - // eslint-disable-next-line no-bitwise - const r = Math.random() * 16 | 0; - const - // eslint-disable-next-line no-bitwise,no-mixed-operators - v = c === 'x' ? r : (r & 0x3 | 0x8); - return v.toString(16); -}); - -const isInvalid = (o) => { - if (o === null || typeof o === 'undefined') { - return false; +const validateAndSerializeToJsonBytes = (o) => { + const validation = utilInternal.isInvalid(o); + if (validation) { + throw new exceptions.ValidationException(validation); } - if (!Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(o).constructor, 'validationsMap')) { - return false; - } - - for (const [propName, validations] of Object.entries(Object.getPrototypeOf(o).constructor.validationsMap)) { - if (!(propName in o)) { - return `Object is malformed, missing property: ${propName}`; - } - - // Validate all properties on arrays - if (o[propName] instanceof Array) { - for (const [i, v] of o[propName].entries()) { - const result = isInvalid(v); - if (result) { - return `Property ${propName}[${i}] is invalid because ${result}`; - } - } - } - - // Validate the property - if ('required' in validations && validations.required && o[propName] === null) { - return `Property ${propName} is required, but was null`; - } - if ( - 'minLength' in validations - && o[propName] !== null - && o[propName].length < validations.minLength - ) { - return `Property ${propName} must have a minimum length of ${validations.minLength}, but found length of ${o[propName].length}`; - } - if ( - 'maxLength' in validations - && o[propName] !== null - && o[propName].length > validations.maxLength - ) { - return `Property ${propName} must have a maximum length of ${validations.maxLength}, but found length of ${o[propName].length}`; - } - if ( - 'minItems' in validations - && o[propName] !== null - && o[propName].length < validations.minItems - ) { - return `Property ${propName} must have at least ${validations.minItems} items, but found ${o[propName].length}`; - } - if ( - 'maxItems' in validations - && o[propName] !== null - && o[propName].length > validations.maxItems - ) { - return `Property ${propName} must have at most ${validations.maxItems} items, but found ${o[propName].length}`; - } - if ( - 'maximum' in validations - && o[propName] !== null - && o[propName] > validations.maximum - ) { - return `Property ${propName} must be at most ${validations.maximum}`; - } - if ( - 'minimum' in validations - && o[propName] !== null - && o[propName] < validations.minimum - ) { - return `Property ${propName} must be at least ${validations.minimum}`; - } - if ( - 'pattern' in validations - && o[propName] !== null - && o[propName].match(validations.pattern) === null - ) { - return `Property ${propName} must match regex ${validations.pattern}`; - } - } - - // Recurse down to check validity of objects within objects - for (const propName of Object.keys(Object.getPrototypeOf(o).constructor.validationsMap)) { - const result = isInvalid(o[propName]); - if (result) { - return `Property ${propName} is invalid because ${result}`; - } - } - - return false; + return utilInternal.serializeToJsonWithEmptyArrayAsNull(o.asMap()); }; -const throwOnErrorResponse = (response) => { - // eslint-disable-next-line no-empty - if (response.status === smData.ResponseStatusCode.Success) { - } else if (response.status === smData.ResponseStatusCode.InvalidRequest) { - throw new exceptions.InvalidRequestException(response.errorMessage, response.status, response.requestId); - } else if (response.status === smData.ResponseStatusCode.RequestPayloadTooLarge) { - throw new exceptions.RequestPayloadTooLargeException(response.errorMessage, response.status, response.requestId); - } else if (response.status === smData.ResponseStatusCode.ResourceNotFound) { - throw new exceptions.ResourceNotFoundException(response.errorMessage, response.status, response.requestId); - } else if (response.status === smData.ResponseStatusCode.ResponsePayloadTooLarge) { - throw new exceptions.ResponsePayloadTooLargeException(response.errorMessage, response.status, response.requestId); - } else if (response.status === smData.ResponseStatusCode.ServerTimeout) { - throw new exceptions.ServerTimeoutException(response.errorMessage, response.status, response.requestId); - } else if (response.status === smData.ResponseStatusCode.Unauthorized) { - throw new exceptions.UnauthorizedException(response.errorMessage, response.status, response.requestId); - } else if (response.status === smData.ResponseStatusCode.UnknownFailure) { - throw new exceptions.UnknownFailureException(response.errorMessage, response.status, response.requestId); - } else if (response.status === smData.ResponseStatusCode.NotEnoughMessages) { - throw new exceptions.NotEnoughMessagesException(response.errorMessage, response.status, response.requestId); - } else if (response.status === smData.ResponseStatusCode.MessageStoreReadError) { - throw new exceptions.MessageStoreReadErrorException(response.errorMessage, response.status, response.requestId); - } else if (response.status === smData.ResponseStatusCode.OutOfMemoryError) { - throw new exceptions.ServerOutOfMemoryException(response.errorMessage, response.status, response.requestId); - } else { - throw new exceptions.StreamManagerException( - 'Client is not able to understand this server response status code', 'Unrecognized', response.requestId, - ); - } -}; +/** + * Deserialize the json byte array to an instance of class + * @param bytes a bytes array + * @param type instance type + * @return object + */ +const deserializeJsonBytesToObj = (bytes, type) => type.fromMap(JSON.parse(bytes.toString('utf-8'))); module.exports = { - intToBuffer, - intFromBuffer, - encodeFrame, - uuidv4, - isInvalid, - throwOnErrorResponse, - MAX_PACKET_SIZE, + validateAndSerializeToJsonBytes, + deserializeJsonBytesToObj, }; diff --git a/aws-greengrass-core-sdk/stream-manager/utilInternal.js b/aws-greengrass-core-sdk/stream-manager/utilInternal.js new file mode 100644 index 0000000..2261f87 --- /dev/null +++ b/aws-greengrass-core-sdk/stream-manager/utilInternal.js @@ -0,0 +1,207 @@ +/* eslint-disable no-restricted-syntax */ +/* + * Copyright (c) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + */ + +const smData = require('aws-greengrass-core-sdk/stream-manager/data'); +const exceptions = require('./exceptions'); + +// eslint-disable-next-line no-bitwise +const MAX_PACKET_SIZE = 1 << 30; +const LENGTH_FIELD_SIZE_BYTES = 4; +const OP_FIELD_SIZE_BYTES = 1; +const HEADER_SIZE_BYTES = LENGTH_FIELD_SIZE_BYTES + OP_FIELD_SIZE_BYTES; + +const intToBuffer = (i, length = 4) => { + const buf = Buffer.alloc(length); + if (length === 4) { + buf.writeInt32BE(i, 0); + } else if (length === 2) { + buf.writeInt16BE(i, 0); + } else if (length === 1) { + buf.writeInt8(i, 0); + } else { + throw new Error('Illegal value specified for intToBuffer length. Must be 1, 2 or 4.'); + } + return buf; +}; + +const intFromBuffer = (b) => { + if (b.length >= 4) { + return b.readInt32BE(0); + } else { + return b.readInt8(0); + } +}; + +const encodeFrame = (frame) => { + if (frame.payload.length + 1 > MAX_PACKET_SIZE) { + throw new exceptions.RequestPayloadTooLargeException(); + } + + const buf = Buffer.alloc(HEADER_SIZE_BYTES); + buf.writeInt32BE(frame.payload.length + 1, 0); + buf.writeInt8(frame.operation.asMap(), LENGTH_FIELD_SIZE_BYTES); + return { header: buf, payload: frame.payload }; +}; + +/** + * From https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript + * @ignore + * @returns {string} + */ +const uuidv4 = () => 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { + // eslint-disable-next-line no-bitwise + const r = Math.random() * 16 | 0; + const + // eslint-disable-next-line no-bitwise,no-mixed-operators + v = c === 'x' ? r : (r & 0x3 | 0x8); + return v.toString(16); +}); + +const isInvalid = (o) => { + if (o === null || typeof o === 'undefined') { + return false; + } + if (!Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(o).constructor, 'validationsMap')) { + return false; + } + + for (const [propName, validations] of Object.entries(Object.getPrototypeOf(o).constructor.validationsMap)) { + if (!(propName in o)) { + return `Object is malformed, missing property: ${propName}`; + } + + // Validate all properties on arrays + if (o[propName] instanceof Array) { + for (const [i, v] of o[propName].entries()) { + const result = isInvalid(v); + if (result) { + return `Property ${propName}[${i}] is invalid because ${result}`; + } + } + } + + // Validate the property + if ('required' in validations && validations.required && o[propName] === null) { + return `Property ${propName} is required, but was null`; + } + if ( + 'minLength' in validations + && o[propName] !== null + && o[propName].length < validations.minLength + ) { + return `Property ${propName} must have a minimum length of ${validations.minLength}, but found length of ${o[propName].length}`; + } + if ( + 'maxLength' in validations + && o[propName] !== null + && o[propName].length > validations.maxLength + ) { + return `Property ${propName} must have a maximum length of ${validations.maxLength}, but found length of ${o[propName].length}`; + } + if ( + 'minItems' in validations + && o[propName] !== null + && o[propName].length < validations.minItems + ) { + return `Property ${propName} must have at least ${validations.minItems} items, but found ${o[propName].length}`; + } + if ( + 'maxItems' in validations + && o[propName] !== null + && o[propName].length > validations.maxItems + ) { + return `Property ${propName} must have at most ${validations.maxItems} items, but found ${o[propName].length}`; + } + if ( + 'maximum' in validations + && o[propName] !== null + && o[propName] > validations.maximum + ) { + return `Property ${propName} must be at most ${validations.maximum}`; + } + if ( + 'minimum' in validations + && o[propName] !== null + && o[propName] < validations.minimum + ) { + return `Property ${propName} must be at least ${validations.minimum}`; + } + if ( + 'pattern' in validations + && o[propName] !== null + && o[propName].match(validations.pattern) === null + ) { + return `Property ${propName} must match regex ${validations.pattern}`; + } + } + + // Recurse down to check validity of objects within objects + for (const propName of Object.keys(Object.getPrototypeOf(o).constructor.validationsMap)) { + const result = isInvalid(o[propName]); + if (result) { + return `Property ${propName} is invalid because ${result}`; + } + } + + return false; +}; + +const removeEmptyArray = (nam, val) => { + if (val && val.length === 0) { + return undefined; // remove from result + } else { + return val; // return as is + } +}; + +const serializeToJsonWithEmptyArrayAsNull = (o) => Buffer.from(JSON.stringify(o, removeEmptyArray)); + +const throwOnErrorResponse = (response) => { + // eslint-disable-next-line no-empty + if (response.status === smData.ResponseStatusCode.Success) { + + } else if (response.status === smData.ResponseStatusCode.InvalidRequest) { + throw new exceptions.InvalidRequestException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.RequestPayloadTooLarge) { + throw new exceptions.RequestPayloadTooLargeException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.ResourceNotFound) { + throw new exceptions.ResourceNotFoundException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.ResponsePayloadTooLarge) { + throw new exceptions.ResponsePayloadTooLargeException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.ServerTimeout) { + throw new exceptions.ServerTimeoutException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.Unauthorized) { + throw new exceptions.UnauthorizedException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.UnknownFailure) { + throw new exceptions.UnknownFailureException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.NotEnoughMessages) { + throw new exceptions.NotEnoughMessagesException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.MessageStoreReadError) { + throw new exceptions.MessageStoreReadErrorException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.OutOfMemoryError) { + throw new exceptions.ServerOutOfMemoryException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.UpdateFailed) { + throw new exceptions.UpdateFailedException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.UpdateNotAllowed) { + throw new exceptions.UpdateNotAllowedException(response.errorMessage, response.status, response.requestId); + } else if (response.status === smData.ResponseStatusCode.UnknownOperation) { + throw new exceptions.UnknownOperationException(response.errorMessage, response.status, response.requestId); + } else { + throw new exceptions.StreamManagerException( + 'Client is not able to understand this server response status code', 'Unrecognized', response.requestId, + ); + } +}; + +module.exports = { + intToBuffer, + intFromBuffer, + encodeFrame, + uuidv4, + isInvalid, + throwOnErrorResponse, + serializeToJsonWithEmptyArrayAsNull, + MAX_PACKET_SIZE, +}; diff --git a/docs/aws-greengrass-core-sdk.IotData.html b/docs/aws-greengrass-core-sdk.IotData.html index 5c10304..b2316b3 100644 --- a/docs/aws-greengrass-core-sdk.IotData.html +++ b/docs/aws-greengrass-core-sdk.IotData.html @@ -1130,13 +1130,13 @@
Example

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.Lambda.html b/docs/aws-greengrass-core-sdk.Lambda.html index 30f7e11..bec9c56 100644 --- a/docs/aws-greengrass-core-sdk.Lambda.html +++ b/docs/aws-greengrass-core-sdk.Lambda.html @@ -570,13 +570,13 @@
Examples

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.SecretsManager.html b/docs/aws-greengrass-core-sdk.SecretsManager.html index 164db76..cb91f4c 100644 --- a/docs/aws-greengrass-core-sdk.SecretsManager.html +++ b/docs/aws-greengrass-core-sdk.SecretsManager.html @@ -98,7 +98,7 @@

new Sec
Source:
@@ -291,6 +291,29 @@

Properties
+ + + + DeStringifyResultFlag + + + + + +boolean + + + + + + + + + + Optional Flag to decide the return type from getSecretValue. If set, it returns de-serialized data object, otherwise it returns stringified response. + + + @@ -358,7 +381,7 @@
Properties
Source:
@@ -420,13 +443,13 @@
Example

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.AppendMessageRequest.html b/docs/aws-greengrass-core-sdk.StreamManager.AppendMessageRequest.html index eed079b..4ef1a9b 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.AppendMessageRequest.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.AppendMessageRequest.html @@ -31,7 +31,7 @@

Class: AppendMessageRequest

aws-greengrass-core-sdk.StreamManager~AppendMessageRequest(requestId, name, payload)

-
(Intenral Only) Request object for appending to a message stream
+
(Internal Only) Request object for appending to a message stream.
@@ -209,7 +209,7 @@
Parameters:
Source:
@@ -299,7 +299,7 @@

nameSource:
@@ -357,7 +357,7 @@

nameSource:
@@ -415,7 +415,7 @@

payloadSource:
@@ -473,7 +473,7 @@

payloadSource:
@@ -531,7 +531,7 @@

requestIdSource:
@@ -589,7 +589,7 @@

requestIdSource:
@@ -714,7 +714,7 @@
Parameters:
Source:
@@ -865,7 +865,7 @@
Parameters:
Source:
@@ -1016,7 +1016,7 @@
Parameters:
Source:
@@ -1080,13 +1080,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.AppendMessageResponse.html b/docs/aws-greengrass-core-sdk.StreamManager.AppendMessageResponse.html index 358a712..82e7f32 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.AppendMessageResponse.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.AppendMessageResponse.html @@ -31,7 +31,7 @@

Class: AppendMessageResponse

aws-greengrass-core-sdk.StreamManager~AppendMessageResponse(requestId, status, errorMessage, sequenceNumber)

-
Internal Only
+
Internal Only.
@@ -238,7 +238,7 @@
Parameters:
Source:
@@ -328,7 +328,7 @@

errorMess
Source:
@@ -386,7 +386,7 @@

errorMess
Source:
@@ -444,7 +444,7 @@

requestIdSource:
@@ -502,7 +502,7 @@

requestIdSource:
@@ -560,7 +560,7 @@

sequenc
Source:
@@ -618,7 +618,7 @@

sequenc
Source:
@@ -676,7 +676,7 @@

statusSource:
@@ -734,7 +734,7 @@

statusSource:
@@ -859,7 +859,7 @@
Parameters:
Source:
@@ -1010,7 +1010,7 @@
Parameters:
Source:
@@ -1161,7 +1161,7 @@
Parameters:
Source:
@@ -1312,7 +1312,7 @@
Parameters:
Source:
@@ -1376,13 +1376,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.AssetPropertyValue.html b/docs/aws-greengrass-core-sdk.StreamManager.AssetPropertyValue.html new file mode 100644 index 0000000..1ec37b8 --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.AssetPropertyValue.html @@ -0,0 +1,1107 @@ + + + + + JSDoc: Class: AssetPropertyValue + + + + + + + + + + +
+ +

Class: AssetPropertyValue

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~AssetPropertyValue(value, timestamp, quality)

+ +
Contains asset property value information.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new AssetPropertyValue(value, timestamp, quality)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
value + + +aws-greengrass-core-sdk.StreamManager.Variant + + + + + + null + + The value of the asset property.
timestamp + + +aws-greengrass-core-sdk.StreamManager.TimeInNanos + + + + + + null + + The timestamp of the asset property value.
quality + + +aws-greengrass-core-sdk.StreamManager.Quality + + + + + + null + + The quality of the asset property value.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

quality

+ + + + +
+ The quality of the asset property value. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

quality

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

timestamp

+ + + + +
+ The timestamp of the asset property value. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

timestamp

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

value

+ + + + +
+ The value of the asset property. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

value

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withQuality(value) → {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.Quality + + + + The quality of the asset property value.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.AssetPropertyValue + + +
+
+ + + + + + + + + + + + + +

withTimestamp(value) → {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.TimeInNanos + + + + The timestamp of the asset property value.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.AssetPropertyValue + + +
+
+ + + + + + + + + + + + + +

withValue(value) → {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.Variant + + + + The value of the asset property.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.AssetPropertyValue + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.ConnectRequest.html b/docs/aws-greengrass-core-sdk.StreamManager.ConnectRequest.html index cee7e37..698f21f 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.ConnectRequest.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.ConnectRequest.html @@ -29,9 +29,9 @@

Class: ConnectRequest

- aws-greengrass-core-sdk.StreamManager~ConnectRequest(requestId, protocolVersion, sdkVersion, authToken)

+ aws-greengrass-core-sdk.StreamManager~ConnectRequest(requestId, protocolVersion, otherSupportedProtocolVersions, sdkVersion, authToken)

-
(Internal Only) Request object to connect to the service
+
(Internal Only) Request object to connect to the service.
@@ -46,7 +46,7 @@

Constructor

-

new ConnectRequest(requestId, protocolVersion, sdkVersion, authToken)

+

new ConnectRequest(requestId, protocolVersion, otherSupportedProtocolVersions, sdkVersion, authToken)

@@ -144,6 +144,35 @@
Parameters:
+ + + otherSupportedProtocolVersions + + + + + +Array.<String> + + + + + + + + + + + null + + + + + + + + + sdkVersion @@ -238,7 +267,7 @@
Parameters:
Source:
@@ -328,7 +357,7 @@

authTokenSource:
@@ -386,7 +415,123 @@

authTokenSource:
+ + + + + + + + + + + + + + + + +

otherSupportedProtocolVersions

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

otherSupportedProtocolVersions

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -444,7 +589,7 @@

protoc
Source:
@@ -502,7 +647,7 @@

protoc
Source:
@@ -560,7 +705,7 @@

requestIdSource:
@@ -618,7 +763,7 @@

requestIdSource:
@@ -676,7 +821,7 @@

sdkVersion<
Source:
@@ -734,7 +879,7 @@

sdkVersion<
Source:
@@ -859,7 +1004,158 @@

Parameters:
Source:
+ + + + + + + +

+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.ConnectRequest + + +
+
+ + + + + + + + + + + + + +

withOtherSupportedProtocolVersions(value) → {aws-greengrass-core-sdk.StreamManager.ConnectRequest}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Array.<String> + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -1010,7 +1306,7 @@
Parameters:
Source:
@@ -1161,7 +1457,7 @@
Parameters:
Source:
@@ -1312,7 +1608,7 @@
Parameters:
Source:
@@ -1376,13 +1672,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.ConnectResponse.html b/docs/aws-greengrass-core-sdk.StreamManager.ConnectResponse.html index 24d576b..30ae848 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.ConnectResponse.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.ConnectResponse.html @@ -31,7 +31,7 @@

Class: ConnectResponse

aws-greengrass-core-sdk.StreamManager~ConnectResponse(requestId, status, errorMessage, protocolVersion, supportedProtocolVersions, serverVersion, clientIdentifier)

-
Internal Only
+
Internal Only.
@@ -325,7 +325,7 @@
Parameters:
Source:
@@ -415,7 +415,7 @@

clien
Source:
@@ -473,7 +473,7 @@

clien
Source:
@@ -531,7 +531,7 @@

errorMess
Source:
@@ -589,7 +589,7 @@

errorMess
Source:
@@ -647,7 +647,7 @@

protoc
Source:
@@ -705,7 +705,7 @@

protoc
Source:
@@ -763,7 +763,7 @@

requestIdSource:
@@ -821,7 +821,7 @@

requestIdSource:
@@ -879,7 +879,7 @@

serverVe
Source:
@@ -937,7 +937,7 @@

serverVe
Source:
@@ -995,7 +995,7 @@

statusSource:
@@ -1053,7 +1053,7 @@

statusSource:
@@ -1111,7 +1111,7 @@

Source:
@@ -1169,7 +1169,7 @@

Source:
@@ -1294,7 +1294,7 @@
Parameters:
Source:
@@ -1445,7 +1445,7 @@
Parameters:
Source:
@@ -1596,7 +1596,7 @@
Parameters:
Source:
@@ -1747,7 +1747,7 @@
Parameters:
Source:
@@ -1898,7 +1898,7 @@
Parameters:
Source:
@@ -2049,7 +2049,7 @@
Parameters:
Source:
@@ -2200,7 +2200,7 @@
Parameters:
Source:
@@ -2264,13 +2264,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest.html b/docs/aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest.html index 7c634c7..0b08754 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest.html @@ -31,7 +31,7 @@

Class: CreateMessageStreamRequest

aws-greengrass-core-sdk.StreamManager~CreateMessageStreamRequest(requestId, definition)

-
(Internal Only) Request object for creating a message stream
+
(Internal Only) Request object for creating a message stream.
@@ -180,7 +180,7 @@
Parameters:
Source:
@@ -270,7 +270,7 @@

definition<
Source:
@@ -328,7 +328,7 @@

definition<
Source:
@@ -386,7 +386,7 @@

requestIdSource:
@@ -444,7 +444,7 @@

requestIdSource:
@@ -569,7 +569,7 @@
Parameters:
Source:
@@ -720,7 +720,7 @@
Parameters:
Source:
@@ -784,13 +784,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse.html b/docs/aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse.html index 9b3ffb6..43528df 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse.html @@ -31,7 +31,7 @@

Class: CreateMessageStreamResponse

aws-greengrass-core-sdk.StreamManager~CreateMessageStreamResponse(requestId, status, errorMessage)

-
Internal Only
+
Internal Only.
@@ -209,7 +209,7 @@
Parameters:
Source:
@@ -299,7 +299,7 @@

errorMess
Source:
@@ -357,7 +357,7 @@

errorMess
Source:
@@ -415,7 +415,7 @@

requestIdSource:
@@ -473,7 +473,7 @@

requestIdSource:
@@ -531,7 +531,7 @@

statusSource:
@@ -589,7 +589,7 @@

statusSource:
@@ -714,7 +714,7 @@
Parameters:
Source:
@@ -865,7 +865,7 @@
Parameters:
Source:
@@ -1016,7 +1016,7 @@
Parameters:
Source:
@@ -1080,13 +1080,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest.html b/docs/aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest.html index 0f49f05..c438499 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest.html @@ -31,7 +31,7 @@

Class: DeleteMessageStreamRequest

aws-greengrass-core-sdk.StreamManager~DeleteMessageStreamRequest(requestId, name)

-
(Internal Only) Request object for deleting a message stream
+
(Internal Only) Request object for deleting a message stream.
@@ -180,7 +180,7 @@
Parameters:
Source:
@@ -270,7 +270,7 @@

nameSource:
@@ -328,7 +328,7 @@

nameSource:
@@ -386,7 +386,7 @@

requestIdSource:
@@ -444,7 +444,7 @@

requestIdSource:
@@ -569,7 +569,7 @@
Parameters:
Source:
@@ -720,7 +720,7 @@
Parameters:
Source:
@@ -784,13 +784,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse.html b/docs/aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse.html index 233858c..9456e69 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse.html @@ -31,7 +31,7 @@

Class: DeleteMessageStreamResponse

aws-greengrass-core-sdk.StreamManager~DeleteMessageStreamResponse(requestId, status, errorMessage)

-
Internal Only
+
Internal Only.
@@ -209,7 +209,7 @@
Parameters:
Source:
@@ -299,7 +299,7 @@

errorMess
Source:
@@ -357,7 +357,7 @@

errorMess
Source:
@@ -415,7 +415,7 @@

requestIdSource:
@@ -473,7 +473,7 @@

requestIdSource:
@@ -531,7 +531,7 @@

statusSource:
@@ -589,7 +589,7 @@

statusSource:
@@ -714,7 +714,7 @@
Parameters:
Source:
@@ -865,7 +865,7 @@
Parameters:
Source:
@@ -1016,7 +1016,7 @@
Parameters:
Source:
@@ -1080,13 +1080,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest.html b/docs/aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest.html index c4a0447..7d5dc67 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest.html @@ -31,7 +31,7 @@

Class: DescribeMessageStreamRequest

aws-greengrass-core-sdk.StreamManager~DescribeMessageStreamRequest(requestId, name)

-
(Internal Only) Request object for describing a message stream
+
(Internal Only) Request object for describing a message stream.
@@ -180,7 +180,7 @@
Parameters:
Source:
@@ -270,7 +270,7 @@

nameSource:
@@ -328,7 +328,7 @@

nameSource:
@@ -386,7 +386,7 @@

requestIdSource:
@@ -444,7 +444,7 @@

requestIdSource:
@@ -569,7 +569,7 @@
Parameters:
Source:
@@ -720,7 +720,7 @@
Parameters:
Source:
@@ -784,13 +784,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse.html b/docs/aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse.html index 716401a..8f25417 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse.html @@ -31,7 +31,7 @@

Class: DescribeMessageStreamResponse

aws-greengrass-core-sdk.StreamManager~DescribeMessageStreamResponse(requestId, status, errorMessage, messageStreamInfo)

-
(Internal Only) Response object for describing a message stream
+
(Internal Only) Response object for describing a message stream.
@@ -238,7 +238,7 @@
Parameters:
Source:
@@ -328,7 +328,7 @@

errorMess
Source:
@@ -386,7 +386,7 @@

errorMess
Source:
@@ -444,7 +444,7 @@

mess
Source:
@@ -502,7 +502,7 @@

mess
Source:
@@ -560,7 +560,7 @@

requestIdSource:
@@ -618,7 +618,7 @@

requestIdSource:
@@ -676,7 +676,7 @@

statusSource:
@@ -734,7 +734,7 @@

statusSource:
@@ -859,7 +859,7 @@
Parameters:
Source:
@@ -1010,7 +1010,7 @@
Parameters:
Source:
@@ -1161,7 +1161,7 @@
Parameters:
Source:
@@ -1312,7 +1312,7 @@
Parameters:
Source:
@@ -1376,13 +1376,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.EventType.html b/docs/aws-greengrass-core-sdk.StreamManager.EventType.html new file mode 100644 index 0000000..486de3e --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.EventType.html @@ -0,0 +1,243 @@ + + + + + JSDoc: Class: EventType + + + + + + + + + + +
+ +

Class: EventType

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~EventType()

+ +
The type of event, which determines how to interpret the status payload.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new EventType()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

(readonly) S3Task :aws-greengrass-core-sdk.StreamManager.EventType

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.ExportDefinition.html b/docs/aws-greengrass-core-sdk.StreamManager.ExportDefinition.html index a12ef9e..f9c5469 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.ExportDefinition.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.ExportDefinition.html @@ -29,9 +29,9 @@

Class: ExportDefinition

- aws-greengrass-core-sdk.StreamManager~ExportDefinition(http, iotAnalytics, kinesis)

+ aws-greengrass-core-sdk.StreamManager~ExportDefinition(http, iotAnalytics, kinesis, IotSitewise, s3TaskExecutor)

-
Defines how and where the stream is uploaded
+
Defines how and where the stream is uploaded.
@@ -46,7 +46,7 @@

Constructor

-

new ExportDefinition(http, iotAnalytics, kinesis)

+

new ExportDefinition(http, iotAnalytics, kinesis, IotSitewise, s3TaskExecutor)

@@ -110,7 +110,7 @@
Parameters:
- Defines how the stream is uploaded to an HTTP endpoint + Defines how the stream is uploaded to an HTTP endpoint. @@ -139,7 +139,7 @@
Parameters:
- Defines how the stream is uploaded to IoT Analytics + Defines how the stream is uploaded to IoT Analytics. @@ -168,7 +168,65 @@
Parameters:
- Defines how the stream is uploaded to Kinesis + Defines how the stream is uploaded to Kinesis. + + + + + + + IotSitewise + + + + + +Array.<aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig> + + + + + + + + + + + null + + + + + Defines how the stream is uploaded to IoT SiteWise. + + + + + + + s3TaskExecutor + + + + + +Array.<aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig> + + + + + + + + + + + null + + + + + Defines the list of configs for S3 task executors. @@ -209,7 +267,341 @@
Parameters:
Source:
+ + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Members

+ + + +

http

+ + + + +
+ Defines how the stream is uploaded to an HTTP endpoint. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

http

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

iotAnalytics

+ + + + +
+ Defines how the stream is uploaded to IoT Analytics. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

iotAnalytics

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

IotSitewise

+ + + + +
+ Defines how the stream is uploaded to IoT SiteWise. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -225,6 +617,10 @@
Parameters:
+ + +

IotSitewise

+ @@ -234,13 +630,17 @@
Parameters:
+
+ + + + - @@ -255,17 +655,35 @@
Parameters:
-

Members

+ + +
Source:
+
+ + + + + + + +
+ + + + + -

http

+

kinesis

- Defines how the stream is uploaded to an HTTP endpoint + Defines how the stream is uploaded to Kinesis.
@@ -303,7 +721,7 @@

httpSource:
@@ -321,7 +739,7 @@

httphttp

+

kinesis

@@ -361,7 +779,7 @@

httpSource:
@@ -379,13 +797,13 @@

httpiotAnalytics

+

s3TaskExecutor

- Defines how the stream is uploaded to IoT Analytics + Defines the list of configs for S3 task executors.
@@ -423,7 +841,7 @@

iotAnalyt
Source:
@@ -441,7 +859,7 @@

iotAnalyt -

iotAnalytics

+

s3TaskExecutor

@@ -481,7 +899,7 @@

iotAnalyt
Source:
@@ -498,15 +916,24 @@

iotAnalyt + + + +

Methods

+ + -

kinesis

+ + + +

withHttp(value) → {aws-greengrass-core-sdk.StreamManager.ExportDefinition}

+ + + -
- Defines how the stream is uploaded to Kinesis -
@@ -514,6 +941,60 @@

kinesisParameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Array.<aws-greengrass-core-sdk.StreamManager.HTTPConfig> + + + + Defines how the stream is uploaded to an HTTP endpoint.
+ + + + + +
@@ -543,7 +1024,7 @@

kinesisSource:
@@ -559,13 +1040,106 @@

kinesisReturns:

+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.ExportDefinition + + +
+
+ + + + + + + -

kinesis

+ + + + +

withIotAnalytics(value) → {aws-greengrass-core-sdk.StreamManager.ExportDefinition}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Array.<aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig> + + Defines how the stream is uploaded to IoT Analytics.
@@ -601,7 +1175,7 @@

kinesisSource:
@@ -617,11 +1191,37 @@

kinesisReturns:

+ - + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.ExportDefinition + + +
+
-

Methods

+ + + + @@ -629,7 +1229,7 @@

Methods

-

withHttp(value) → {aws-greengrass-core-sdk.StreamManager.ExportDefinition}

+

withIotSitewise(value) → {aws-greengrass-core-sdk.StreamManager.ExportDefinition}

@@ -675,7 +1275,7 @@
Parameters:
-Array.<aws-greengrass-core-sdk.StreamManager.HTTPConfig> +Array.<aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig> @@ -685,7 +1285,7 @@
Parameters:
- Defines how the stream is uploaded to an HTTP endpoint + Defines how the stream is uploaded to IoT SiteWise. @@ -726,7 +1326,7 @@
Parameters:
Source:
@@ -780,7 +1380,7 @@
Returns:
-

withIotAnalytics(value) → {aws-greengrass-core-sdk.StreamManager.ExportDefinition}

+

withKinesis(value) → {aws-greengrass-core-sdk.StreamManager.ExportDefinition}

@@ -826,7 +1426,7 @@
Parameters:
-Array.<aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig> +Array.<aws-greengrass-core-sdk.StreamManager.KinesisConfig> @@ -836,7 +1436,7 @@
Parameters:
- Defines how the stream is uploaded to IoT Analytics + Defines how the stream is uploaded to Kinesis. @@ -877,7 +1477,7 @@
Parameters:
Source:
@@ -931,7 +1531,7 @@
Returns:
-

withKinesis(value) → {aws-greengrass-core-sdk.StreamManager.ExportDefinition}

+

withS3TaskExecutor(value) → {aws-greengrass-core-sdk.StreamManager.ExportDefinition}

@@ -977,7 +1577,7 @@
Parameters:
-Array.<aws-greengrass-core-sdk.StreamManager.KinesisConfig> +Array.<aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig> @@ -987,7 +1587,7 @@
Parameters:
- Defines how the stream is uploaded to Kinesis + Defines the list of configs for S3 task executors. @@ -1028,7 +1628,7 @@
Parameters:
Source:
@@ -1092,13 +1692,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.ExportFormat.html b/docs/aws-greengrass-core-sdk.StreamManager.ExportFormat.html new file mode 100644 index 0000000..7d1cb54 --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.ExportFormat.html @@ -0,0 +1,313 @@ + + + + + JSDoc: Class: ExportFormat + + + + + + + + + + +
+ +

Class: ExportFormat

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~ExportFormat()

+ +
ExportFormat is used to define how messages are batched and formatted in the export payload. + RAW_NOT_BATCHED: Each message in a batch will be sent as an individual HTTP POST with the payload as the body (even if batchSize is set). + JSON_BATCHED: Each batch of messages will be sent as a JSON list of Message objects as the body.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new ExportFormat()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

(readonly) JSON_BATCHED :aws-greengrass-core-sdk.StreamManager.ExportFormat

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) RAW_NOT_BATCHED :aws-greengrass-core-sdk.StreamManager.ExportFormat

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.HTTPConfig.html b/docs/aws-greengrass-core-sdk.StreamManager.HTTPConfig.html index 151c278..2111e8a 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.HTTPConfig.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.HTTPConfig.html @@ -29,7 +29,7 @@

Class: HTTPConfig

- aws-greengrass-core-sdk.StreamManager~HTTPConfig(identifier, uri, batchSize, batchIntervalMillis, priority)

+ aws-greengrass-core-sdk.StreamManager~HTTPConfig(identifier, uri, batchSize, batchIntervalMillis, priority, startSequenceNumber, disabled, exportFormat)

This export destination is not supported! The interface may change at any time without notice and should not be relied on for any production use. There are no guarantees around its correctness. @@ -48,7 +48,7 @@

Constructor

-

new HTTPConfig(identifier, uri, batchSize, batchIntervalMillis, priority)

+

new HTTPConfig(identifier, uri, batchSize, batchIntervalMillis, priority, startSequenceNumber, disabled, exportFormat)

@@ -171,7 +171,7 @@
Parameters:
- The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. + The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. The minimum batch size is 1 and the maximum is 500. @@ -237,6 +237,93 @@
Parameters:
+ + + + startSequenceNumber + + + + + +Number + + + + + + + + + + + null + + + + + The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + + + + + + + disabled + + + + + +Boolean + + + + + + + + + + + null + + + + + Enable or disable this export. Default is false. + + + + + + + exportFormat + + + + + +aws-greengrass-core-sdk.StreamManager.ExportFormat + + + + + + + + + + + null + + + + + Defines how messages are batched and formatted in the export payload. + + + @@ -274,7 +361,7 @@
Parameters:
Source:
@@ -370,7 +457,7 @@

ba
Source:
@@ -428,7 +515,7 @@

ba
Source:
@@ -452,7 +539,7 @@

batchSize - The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. + The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. The minimum batch size is 1 and the maximum is 500.

@@ -492,7 +579,7 @@

batchSizeSource:
@@ -550,7 +637,7 @@

batchSizeSource:
@@ -568,14 +655,13 @@

batchSizeidentifier

+

disabled

- A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + Enable or disable this export. Default is false.
@@ -613,7 +699,7 @@

identifier<
Source:
@@ -631,7 +717,7 @@

identifier< -

identifier

+

disabled

@@ -671,7 +757,7 @@

identifier<
Source:
@@ -689,13 +775,13 @@

identifier< -

priority

+

exportFormat

- Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + Defines how messages are batched and formatted in the export payload.
@@ -733,7 +819,7 @@

prioritySource:
@@ -751,7 +837,7 @@

prioritypriority

+

exportFormat

@@ -791,7 +877,7 @@

prioritySource:
@@ -809,13 +895,14 @@

priorityuri

+

identifier

- URL for HTTP endpoint which should receive the POST requests for export. + A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255.
@@ -853,7 +940,7 @@

uriSource:
@@ -871,7 +958,7 @@

uriuri

+

identifier

@@ -911,7 +998,7 @@

uriSource:
@@ -928,81 +1015,74 @@

uripriority

- -

Methods

- - - - -

withBatchIntervalMillis(value) → {aws-greengrass-core-sdk.StreamManager.HTTPConfig}

- +
+ Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. +
- +
+ + + + -
Parameters:
- - - - - - + - + - + - + - - - + - - - - - + - - + + + +

priority

+ + - - - - -
NameTypeDescription
value - - -Number + +
Source:
+
+ + + + + + + + - -
The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds.
@@ -1038,7 +1118,7 @@
Parameters:
Source:
@@ -1054,108 +1134,75 @@
Parameters:
+ + +

startSequenceNumber

+
+ The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. +
-
Returns:
- - - - -
-
- Type -
-
- -aws-greengrass-core-sdk.StreamManager.HTTPConfig -
-
+
- - - - - - - -

withBatchSize(value) → {aws-greengrass-core-sdk.StreamManager.HTTPConfig}

- + + + + + + + - - - -
Parameters:
- - - - - - + +
Source:
+
+ - + - + - + + - - - - - - - - - - +

startSequenceNumber

- - - - - - -
NameTypeDescription
value - - -Number + - The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum batch size is 1 and the maximum is 500.
@@ -1191,7 +1238,7 @@
Parameters:
Source:
@@ -1207,16 +1254,718 @@
Parameters:
+ + +

uri

+
+ URL for HTTP endpoint which should receive the POST requests for export. +
-
Returns:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

uri

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withBatchIntervalMillis(value) → {aws-greengrass-core-sdk.StreamManager.HTTPConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.HTTPConfig + + +
+
+ + + + + + + + + + + + + +

withBatchSize(value) → {aws-greengrass-core-sdk.StreamManager.HTTPConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 500.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.HTTPConfig + + +
+
+ + + + + + + + + + + + + +

withDisabled(value) → {aws-greengrass-core-sdk.StreamManager.HTTPConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Boolean + + + + Enable or disable this export. Default is false.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.HTTPConfig + + +
+
+ + + + + + + + + + + + + +

withExportFormat(value) → {aws-greengrass-core-sdk.StreamManager.HTTPConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.ExportFormat + + + + Defines how messages are batched and formatted in the export payload.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
@@ -1343,7 +2092,7 @@
Parameters:
Source:
@@ -1494,7 +2243,158 @@
Parameters:
Source:
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.HTTPConfig + + +
+
+ + + + + + + + + + + + + +

withStartSequenceNumber(value) → {aws-greengrass-core-sdk.StreamManager.HTTPConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -1645,7 +2545,7 @@
Parameters:
Source:
@@ -1709,13 +2609,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig.html b/docs/aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig.html index d05b730..c1febea 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig.html @@ -29,7 +29,7 @@

Class: IoTAnalyticsConfig

- aws-greengrass-core-sdk.StreamManager~IoTAnalyticsConfig(identifier, iotChannel, iotMsgIdPrefix, batchSize, batchIntervalMillis, priority)

+ aws-greengrass-core-sdk.StreamManager~IoTAnalyticsConfig(identifier, iotChannel, iotMsgIdPrefix, batchSize, batchIntervalMillis, priority, startSequenceNumber, disabled)

Configuration object for IoT Analytics export destination.
@@ -46,7 +46,7 @@

Constructor

-

new IoTAnalyticsConfig(identifier, iotChannel, iotMsgIdPrefix, batchSize, batchIntervalMillis, priority)

+

new IoTAnalyticsConfig(identifier, iotChannel, iotMsgIdPrefix, batchSize, batchIntervalMillis, priority, startSequenceNumber, disabled)

@@ -140,7 +140,7 @@
Parameters:
- The name of the IoT Analytics Channel that this exporter should upload to + The name of the IoT Analytics Channel that this exporter should upload to. @@ -199,7 +199,7 @@
Parameters:
- The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. + The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 100. If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. The batch size must be between 1 and 100. @@ -265,6 +265,64 @@
Parameters:
+ + + + startSequenceNumber + + + + + +Number + + + + + + + + + + + null + + + + + The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + + + + + + + disabled + + + + + +Boolean + + + + + + + + + + + null + + + + + Enable or disable this export. Default is false. + + + @@ -302,7 +360,7 @@
Parameters:
Source:
@@ -398,7 +456,370 @@

ba
Source:
+ + + + + + + +

+ + + + + + + + +

batchIntervalMillis

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

batchSize

+ + + + +
+ The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 100. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 100. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

batchSize

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

disabled

+ + + + +
+ Enable or disable this export. Default is false. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

disabled

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

identifier

+ + + + +
+ A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -416,7 +837,7 @@

ba -

batchIntervalMillis

+

identifier

@@ -456,7 +877,7 @@

ba
Source:
@@ -474,15 +895,13 @@

ba -

batchSize

+

iotChannel

- The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 100. + The name of the IoT Analytics Channel that this exporter should upload to.
@@ -520,7 +939,7 @@

batchSizeSource:
@@ -538,7 +957,7 @@

batchSizebatchSize

+

iotChannel

@@ -578,7 +997,7 @@

batchSizeSource:
@@ -596,14 +1015,14 @@

batchSizeidentifier

+

iotMsgIdPrefix

- A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. + This prefix must be less than 32 characters.
@@ -641,7 +1060,7 @@

identifier<
Source:
@@ -659,7 +1078,7 @@

identifier< -

identifier

+

iotMsgIdPrefix

@@ -699,7 +1118,7 @@

identifier<
Source:
@@ -717,13 +1136,13 @@

identifier< -

iotChannel

+

priority

- The name of the IoT Analytics Channel that this exporter should upload to + Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority.
@@ -761,7 +1180,7 @@

iotChannel<
Source:
@@ -779,7 +1198,7 @@

iotChannel< -

iotChannel

+

priority

@@ -819,7 +1238,7 @@

iotChannel<
Source:
@@ -837,14 +1256,13 @@

iotChannel< -

iotMsgIdPrefix

+

startSequenceNumber

- A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. - This prefix must be less than 32 characters. + The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object.
@@ -882,7 +1300,7 @@

iotMsgI
Source:
@@ -900,7 +1318,7 @@

iotMsgI -

iotMsgIdPrefix

+

startSequenceNumber

@@ -940,7 +1358,7 @@

iotMsgI
Source:
@@ -957,15 +1375,22 @@

iotMsgI + + + +

Methods

+ + -

priority

+ + +

withBatchIntervalMillis(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

+ + -
- Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. -
@@ -973,6 +1398,64 @@

priorityParameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds.
+ + + + + +
@@ -1002,7 +1485,7 @@

prioritySource:
@@ -1018,13 +1501,108 @@

priorityReturns:

+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig + + +
+
+ + + + + + + -

priority

+ + + + +

withBatchSize(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 100. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 100.
@@ -1060,7 +1638,7 @@

prioritySource:
@@ -1076,11 +1654,37 @@

priorityReturns:

+ - + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig + + +
+
-

Methods

+ + + + @@ -1088,7 +1692,7 @@

Methods

-

withBatchIntervalMillis(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

+

withDisabled(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

@@ -1134,7 +1738,7 @@
Parameters:
-Number +Boolean @@ -1144,9 +1748,7 @@
Parameters:
- The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + Enable or disable this export. Default is false. @@ -1187,7 +1789,7 @@
Parameters:
Source:
@@ -1241,7 +1843,7 @@
Returns:
-

withBatchSize(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

+

withIdentifier(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

@@ -1287,7 +1889,7 @@
Parameters:
-Number +String @@ -1297,9 +1899,8 @@
Parameters:
- The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 100. + A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. @@ -1340,7 +1941,7 @@
Parameters:
Source:
@@ -1394,7 +1995,7 @@
Returns:
-

withIdentifier(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

+

withIotChannel(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

@@ -1450,8 +2051,7 @@
Parameters:
- A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + The name of the IoT Analytics Channel that this exporter should upload to. @@ -1492,7 +2092,7 @@
Parameters:
Source:
@@ -1546,7 +2146,7 @@
Returns:
-

withIotChannel(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

+

withIotMsgIdPrefix(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

@@ -1602,7 +2202,8 @@
Parameters:
- The name of the IoT Analytics Channel that this exporter should upload to + A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. + This prefix must be less than 32 characters. @@ -1643,7 +2244,7 @@
Parameters:
Source:
@@ -1697,7 +2298,7 @@
Returns:
-

withIotMsgIdPrefix(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

+

withPriority(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

@@ -1743,7 +2344,7 @@
Parameters:
-String +Number @@ -1753,8 +2354,7 @@
Parameters:
- A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. - This prefix must be less than 32 characters. + Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. @@ -1795,7 +2395,7 @@
Parameters:
Source:
@@ -1849,7 +2449,7 @@
Returns:
-

withPriority(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

+

withStartSequenceNumber(value) → {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig}

@@ -1905,7 +2505,7 @@
Parameters:
- Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. @@ -1946,7 +2546,7 @@
Parameters:
Source:
@@ -2010,13 +2610,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig.html b/docs/aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig.html new file mode 100644 index 0000000..ec3deb1 --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig.html @@ -0,0 +1,2022 @@ + + + + + JSDoc: Class: IoTSiteWiseConfig + + + + + + + + + + +
+ +

Class: IoTSiteWiseConfig

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~IoTSiteWiseConfig(identifier, batchSize, batchIntervalMillis, priority, startSequenceNumber, disabled)

+ +
Configuration object for IotSiteWise data streams export destination. Minimum version requirements: StreamManager server version 1.1 (or AWS IoT Greengrass Core 1.11.0)
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new IoTSiteWiseConfig(identifier, batchSize, batchIntervalMillis, priority, startSequenceNumber, disabled)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
identifier + + +String + + + + + + null + + A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255.
batchSize + + +Number + + + + + + null + + The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 10. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 10.
batchIntervalMillis + + +Number + + + + + + null + + The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds.
priority + + +Number + + + + + + null + + Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority.
startSequenceNumber + + +Number + + + + + + null + + The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object.
disabled + + +Boolean + + + + + + null + + Enable or disable this export. Default is false.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

batchIntervalMillis

+ + + + +
+ The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

batchIntervalMillis

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

batchSize

+ + + + +
+ The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 10. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 10. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

batchSize

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

disabled

+ + + + +
+ Enable or disable this export. Default is false. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

disabled

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

identifier

+ + + + +
+ A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

identifier

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

priority

+ + + + +
+ Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

priority

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

startSequenceNumber

+ + + + +
+ The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

startSequenceNumber

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withBatchIntervalMillis(value) → {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig + + +
+
+ + + + + + + + + + + + + +

withBatchSize(value) → {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 10. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 10.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig + + +
+
+ + + + + + + + + + + + + +

withDisabled(value) → {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Boolean + + + + Enable or disable this export. Default is false.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig + + +
+
+ + + + + + + + + + + + + +

withIdentifier(value) → {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig + + +
+
+ + + + + + + + + + + + + +

withPriority(value) → {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig + + +
+
+ + + + + + + + + + + + + +

withStartSequenceNumber(value) → {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.KinesisConfig.html b/docs/aws-greengrass-core-sdk.StreamManager.KinesisConfig.html index eae8445..c806794 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.KinesisConfig.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.KinesisConfig.html @@ -29,7 +29,7 @@

Class: KinesisConfig

- aws-greengrass-core-sdk.StreamManager~KinesisConfig(identifier, kinesisStreamName, batchSize, batchIntervalMillis, priority)

+ aws-greengrass-core-sdk.StreamManager~KinesisConfig(identifier, kinesisStreamName, batchSize, batchIntervalMillis, priority, startSequenceNumber, disabled)

Configuration object for Kinesis data streams export destination.
@@ -46,7 +46,7 @@

Constructor

-

new KinesisConfig(identifier, kinesisStreamName, batchSize, batchIntervalMillis, priority)

+

new KinesisConfig(identifier, kinesisStreamName, batchSize, batchIntervalMillis, priority, startSequenceNumber, disabled)

@@ -140,7 +140,7 @@
Parameters:
- The name of the Kinesis data stream that this exporter should upload to + The name of the Kinesis data stream that this exporter should upload to. @@ -169,7 +169,7 @@
Parameters:
- The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. + The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. The batch size must be between 1 and 500. @@ -235,6 +235,64 @@
Parameters:
+ + + + startSequenceNumber + + + + + +Number + + + + + + + + + + + null + + + + + The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + + + + + + + disabled + + + + + +Boolean + + + + + + + + + + + null + + + + + Enable or disable this export. Default is false. + + + @@ -272,7 +330,161 @@
Parameters:
Source:
+ + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Members

+ + + +

batchIntervalMillis

+ + + + +
+ The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

batchIntervalMillis

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -288,49 +500,258 @@
Parameters:
+ + +

batchSize

+ + + + +
+ The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 500. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + +

batchSize

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +

disabled

+ + + + +
+ Enable or disable this export. Default is false. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

disabled

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
- +
+ - - - - -

Members

-

batchIntervalMillis

+

identifier

- The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255.
@@ -368,7 +789,7 @@

ba
Source:
@@ -386,7 +807,7 @@

ba -

batchIntervalMillis

+

identifier

@@ -426,7 +847,7 @@

ba
Source:
@@ -444,15 +865,13 @@

ba -

batchSize

+

kinesisStreamName

- The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 500. + The name of the Kinesis data stream that this exporter should upload to.
@@ -490,7 +909,7 @@

batchSizeSource:
@@ -508,7 +927,7 @@

batchSizebatchSize

+

kinesisStreamName

@@ -548,7 +967,7 @@

batchSizeSource:
@@ -566,14 +985,13 @@

batchSizeidentifier

+

priority

- A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority.
@@ -611,7 +1029,7 @@

identifier<
Source:
@@ -629,7 +1047,7 @@

identifier< -

identifier

+

priority

@@ -669,7 +1087,7 @@

identifier<
Source:
@@ -687,13 +1105,13 @@

identifier< -

kinesisStreamName

+

startSequenceNumber

- The name of the Kinesis data stream that this exporter should upload to + The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object.
@@ -731,7 +1149,7 @@

kine
Source:
@@ -749,7 +1167,7 @@

kine -

kinesisStreamName

+

startSequenceNumber

@@ -789,7 +1207,7 @@

kine
Source:
@@ -806,15 +1224,22 @@

kine + + + +

Methods

+ + -

priority

+ + +

withBatchIntervalMillis(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

+ + -
- Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. -
@@ -822,6 +1247,64 @@

priorityParameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds.
+ + + + + +
@@ -851,7 +1334,7 @@

prioritySource:
@@ -867,13 +1350,108 @@

priorityReturns:

+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.KinesisConfig + + +
+
+ + + + + + + -

priority

+ + + +

withBatchSize(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 500.
@@ -909,7 +1487,7 @@

prioritySource:
@@ -925,11 +1503,37 @@

priorityReturns:

+ - + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.KinesisConfig + + +
+
-

Methods

+ + + + @@ -937,7 +1541,7 @@

Methods

-

withBatchIntervalMillis(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

+

withDisabled(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

@@ -983,7 +1587,7 @@
Parameters:
-Number +Boolean @@ -993,9 +1597,7 @@
Parameters:
- The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + Enable or disable this export. Default is false. @@ -1036,7 +1638,7 @@
Parameters:
Source:
@@ -1090,7 +1692,7 @@
Returns:
-

withBatchSize(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

+

withIdentifier(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

@@ -1136,7 +1738,7 @@
Parameters:
-Number +String @@ -1146,9 +1748,8 @@
Parameters:
- The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 500. + A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. @@ -1189,7 +1790,7 @@
Parameters:
Source:
@@ -1243,7 +1844,7 @@
Returns:
-

withIdentifier(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

+

withKinesisStreamName(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

@@ -1299,8 +1900,7 @@
Parameters:
- A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + The name of the Kinesis data stream that this exporter should upload to. @@ -1341,7 +1941,7 @@
Parameters:
Source:
@@ -1395,7 +1995,7 @@
Returns:
-

withKinesisStreamName(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

+

withPriority(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

@@ -1441,7 +2041,7 @@
Parameters:
-String +Number @@ -1451,7 +2051,7 @@
Parameters:
- The name of the Kinesis data stream that this exporter should upload to + Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. @@ -1492,7 +2092,7 @@
Parameters:
Source:
@@ -1546,7 +2146,7 @@
Returns:
-

withPriority(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

+

withStartSequenceNumber(value) → {aws-greengrass-core-sdk.StreamManager.KinesisConfig}

@@ -1602,7 +2202,7 @@
Parameters:
- Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. @@ -1643,7 +2243,7 @@
Parameters:
Source:
@@ -1707,13 +2307,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.ListStreamsRequest.html b/docs/aws-greengrass-core-sdk.StreamManager.ListStreamsRequest.html index 49eddf8..1244d9b 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.ListStreamsRequest.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.ListStreamsRequest.html @@ -151,7 +151,7 @@
Parameters:
Source:
@@ -241,7 +241,7 @@

requestIdSource:
@@ -299,7 +299,7 @@

requestIdSource:
@@ -424,7 +424,7 @@
Parameters:
Source:
@@ -488,13 +488,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.ListStreamsResponse.html b/docs/aws-greengrass-core-sdk.StreamManager.ListStreamsResponse.html index 1d65e7d..33dab9a 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.ListStreamsResponse.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.ListStreamsResponse.html @@ -31,7 +31,7 @@

Class: ListStreamsResponse

aws-greengrass-core-sdk.StreamManager~ListStreamsResponse(requestId, status, errorMessage, streams)

-
Internal Only
+
Internal Only.
@@ -238,7 +238,7 @@
Parameters:
Source:
@@ -328,7 +328,7 @@

errorMess
Source:
@@ -386,7 +386,7 @@

errorMess
Source:
@@ -444,7 +444,7 @@

requestIdSource:
@@ -502,7 +502,7 @@

requestIdSource:
@@ -560,7 +560,7 @@

statusSource:
@@ -618,7 +618,7 @@

statusSource:
@@ -676,7 +676,7 @@

streamsSource:
@@ -734,7 +734,7 @@

streamsSource:
@@ -859,7 +859,7 @@
Parameters:
Source:
@@ -1010,7 +1010,7 @@
Parameters:
Source:
@@ -1161,7 +1161,7 @@
Parameters:
Source:
@@ -1312,7 +1312,7 @@
Parameters:
Source:
@@ -1376,13 +1376,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.Message.html b/docs/aws-greengrass-core-sdk.StreamManager.Message.html index c83911e..a6ae166 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.Message.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.Message.html @@ -31,7 +31,7 @@

Class: Message

aws-greengrass-core-sdk.StreamManager~Message(streamName, sequenceNumber, ingestTime, payload)

-
Message object containing metadata and the user's payload
+
Message object containing metadata and the user's payload.
@@ -238,7 +238,7 @@
Parameters:
Source:
@@ -332,7 +332,7 @@

ingestTime<
Source:
@@ -390,7 +390,7 @@

ingestTime<
Source:
@@ -452,7 +452,7 @@

payloadSource:
@@ -510,7 +510,7 @@

payloadSource:
@@ -572,7 +572,7 @@

sequenc
Source:
@@ -630,7 +630,7 @@

sequenc
Source:
@@ -692,7 +692,7 @@

streamName<
Source:
@@ -750,7 +750,7 @@

streamName<
Source:
@@ -875,7 +875,7 @@

Parameters:
Source:
@@ -1026,7 +1026,7 @@
Parameters:
Source:
@@ -1177,7 +1177,7 @@
Parameters:
Source:
@@ -1328,7 +1328,7 @@
Parameters:
Source:
@@ -1392,13 +1392,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.MessageFrame.html b/docs/aws-greengrass-core-sdk.StreamManager.MessageFrame.html index b800b91..54dc066 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.MessageFrame.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.MessageFrame.html @@ -31,7 +31,7 @@

Class: MessageFrame

aws-greengrass-core-sdk.StreamManager~MessageFrame(operation, payload)

-
Internal Only
+
Internal Only.
@@ -180,7 +180,7 @@
Parameters:
Source:
@@ -270,7 +270,7 @@

operationSource:
@@ -328,7 +328,7 @@

operationSource:
@@ -386,7 +386,7 @@

payloadSource:
@@ -444,7 +444,7 @@

payloadSource:
@@ -569,7 +569,7 @@
Parameters:
Source:
@@ -720,7 +720,7 @@
Parameters:
Source:
@@ -784,13 +784,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition.html b/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition.html index 048f24c..cae48cf 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition.html @@ -31,7 +31,7 @@

Class: MessageStreamDefinition

aws-greengrass-core-sdk.StreamManager~MessageStreamDefinition(name, maxSize, streamSegmentSize, timeToLiveMillis, strategyOnFull, persistence, flushOnWrite, exportDefinition)

-
Object defining a message stream used in the CreateMessageStream API.
+
Object defining a message stream used in the CreateMessageStream and UpdateMessageStream API.
@@ -361,7 +361,7 @@
Parameters:
Source:
@@ -455,7 +455,7 @@

expor
Source:
@@ -513,7 +513,7 @@

expor
Source:
@@ -576,7 +576,7 @@

flushOnWr
Source:
@@ -634,7 +634,7 @@

flushOnWr
Source:
@@ -696,7 +696,7 @@

maxSizeSource:
@@ -754,7 +754,7 @@

maxSizeSource:
@@ -817,7 +817,7 @@

nameSource:
@@ -875,7 +875,7 @@

nameSource:
@@ -938,7 +938,7 @@

persistenc
Source:
@@ -996,7 +996,7 @@

persistenc
Source:
@@ -1060,7 +1060,7 @@

strateg
Source:
@@ -1118,7 +1118,7 @@

strateg
Source:
@@ -1181,7 +1181,7 @@

stre
Source:
@@ -1239,7 +1239,7 @@

stre
Source:
@@ -1302,7 +1302,7 @@

timeT
Source:
@@ -1360,7 +1360,7 @@

timeT
Source:
@@ -1485,7 +1485,7 @@

Parameters:
Source:
@@ -1637,7 +1637,7 @@
Parameters:
Source:
@@ -1788,7 +1788,7 @@
Parameters:
Source:
@@ -1940,7 +1940,7 @@
Parameters:
Source:
@@ -2092,7 +2092,7 @@
Parameters:
Source:
@@ -2245,7 +2245,7 @@
Parameters:
Source:
@@ -2397,7 +2397,7 @@
Parameters:
Source:
@@ -2549,7 +2549,7 @@
Parameters:
Source:
@@ -2613,13 +2613,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo-MessageStreamInfo._exportStatuses.html b/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo-MessageStreamInfo._exportStatuses.html index a34be0c..5098a50 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo-MessageStreamInfo._exportStatuses.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo-MessageStreamInfo._exportStatuses.html @@ -28,7 +28,7 @@

Class: _exportStatuses

-

_exportStatuses(exportConfigIdentifier, lastExportedSequenceNumber, lastExportTime, errorMessage)

+

_exportStatuses(exportConfigIdentifier, lastExportedSequenceNumber, lastExportTime, errorMessage, exportedBytesFromStream, exportedMessagesCount)

@@ -41,7 +41,7 @@

_exportStat -

new _exportStatuses(exportConfigIdentifier, lastExportedSequenceNumber, lastExportTime, errorMessage)

+

new _exportStatuses(exportConfigIdentifier, lastExportedSequenceNumber, lastExportTime, errorMessage, exportedBytesFromStream, exportedMessagesCount)

@@ -196,6 +196,64 @@
Parameters:
+ + + + exportedBytesFromStream + + + + + +Number + + + + + + + + + + + null + + + + + Total bytes exported from the stream for this Export Config. It does not include the failed export attempts or messages which are skipped because of some non-retryable error. + + + + + + + exportedMessagesCount + + + + + +Number + + + + + + + + + + + null + + + + + Total messages exported/processed. + + + @@ -233,7 +291,7 @@
Parameters:
Source:
@@ -295,13 +353,13 @@
Parameters:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo-MessageStreamInfo._storageStatus.html b/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo-MessageStreamInfo._storageStatus.html index 86261d3..b975ced 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo-MessageStreamInfo._storageStatus.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo-MessageStreamInfo._storageStatus.html @@ -204,7 +204,7 @@
Parameters:
Source:
@@ -266,13 +266,13 @@
Parameters:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo.html b/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo.html index e882166..eba4c38 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.MessageStreamInfo.html @@ -31,7 +31,7 @@

Class: MessageStreamInfo

aws-greengrass-core-sdk.StreamManager~MessageStreamInfo(definition, storageStatus, exportStatuses)

-
Message stream information including its definition, storage status and export status
+
Message stream information including its definition, storage status and export status.
@@ -139,7 +139,7 @@
Parameters:
- Stream status including oldest/newest sequence number and total bytes + Stream status including oldest/newest sequence number and total bytes. @@ -209,7 +209,7 @@
Parameters:
Source:
@@ -303,7 +303,7 @@

(static)
Source:
@@ -361,7 +361,7 @@

(static)
Source:
@@ -423,7 +423,7 @@

(stati
Source:
@@ -481,7 +481,247 @@

(stati
Source:
+ + + + + + + +

+ + + + + + + + +

(static) _exportStatuses#exportedBytesFromStream

+ + + + +
+ Total bytes exported from the stream for this Export Config. It does not include the failed export attempts or messages which are skipped because of some non-retryable error. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) _exportStatuses#exportedBytesFromStream

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) _exportStatuses#exportedMessagesCount

+ + + + +
+ Total messages exported/processed. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) _exportStatuses#exportedMessagesCount

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -543,7 +783,7 @@

(s
Source:
@@ -601,7 +841,7 @@

(s
Source:
@@ -663,7 +903,7 @@

(static) Source:
@@ -721,7 +961,7 @@

(static) Source:
@@ -783,7 +1023,7 @@

(static)
Source:
@@ -841,7 +1081,7 @@

(static)
Source:
@@ -903,7 +1143,7 @@

(static)
Source:
@@ -961,7 +1201,7 @@

(static)
Source:
@@ -1023,7 +1263,7 @@

(static) _s
Source:
@@ -1081,7 +1321,7 @@

(static) _s
Source:
@@ -1139,7 +1379,7 @@

definition<
Source:
@@ -1197,7 +1437,7 @@

definition<
Source:
@@ -1255,7 +1495,7 @@

exportS
Source:
@@ -1313,7 +1553,7 @@

exportS
Source:
@@ -1337,7 +1577,7 @@

storageS
- Stream status including oldest/newest sequence number and total bytes + Stream status including oldest/newest sequence number and total bytes.
@@ -1375,7 +1615,7 @@

storageS
Source:
@@ -1433,7 +1673,7 @@

storageS
Source:
@@ -1558,7 +1798,7 @@

Parameters:
Source:
@@ -1709,7 +1949,309 @@
Parameters:
Source:
+ + + + + + + +

+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses + + +
+
+ + + + + + + + + + + + + +

(static) _exportStatuses#withExportedBytesFromStream(value) → {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + Total bytes exported from the stream for this Export Config. It does not include the failed export attempts or messages which are skipped because of some non-retryable error.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses + + +
+
+ + + + + + + + + + + + + +

(static) _exportStatuses#withExportedMessagesCount(value) → {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + Total messages exported/processed.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -1860,7 +2402,7 @@
Parameters:
Source:
@@ -2011,7 +2553,7 @@
Parameters:
Source:
@@ -2162,7 +2704,7 @@
Parameters:
Source:
@@ -2313,7 +2855,7 @@
Parameters:
Source:
@@ -2464,7 +3006,7 @@
Parameters:
Source:
@@ -2615,7 +3157,7 @@
Parameters:
Source:
@@ -2766,7 +3308,7 @@
Parameters:
Source:
@@ -2876,7 +3418,7 @@
Parameters:
- Stream status including oldest/newest sequence number and total bytes + Stream status including oldest/newest sequence number and total bytes. @@ -2917,7 +3459,7 @@
Parameters:
Source:
@@ -2981,13 +3523,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.Operation.html b/docs/aws-greengrass-core-sdk.StreamManager.Operation.html index 07483b9..8bfaa32 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.Operation.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.Operation.html @@ -31,7 +31,7 @@

Class: Operation

aws-greengrass-core-sdk.StreamManager~Operation()

-
Internal Only
+
Internal Only.
@@ -94,7 +94,7 @@

new Operatio
Source:
@@ -194,7 +194,7 @@

Type:
Source:
@@ -262,7 +262,7 @@
Type:
Source:
@@ -330,7 +330,7 @@
Type:
Source:
@@ -398,7 +398,7 @@
Type:
Source:
@@ -466,7 +466,7 @@
Type:
Source:
@@ -534,7 +534,7 @@
Type:
Source:
@@ -602,7 +602,7 @@
Type:
Source:
@@ -670,7 +670,7 @@
Type:
Source:
@@ -738,7 +738,7 @@
Type:
Source:
@@ -806,7 +806,7 @@
Type:
Source:
@@ -874,7 +874,7 @@
Type:
Source:
@@ -942,7 +942,7 @@
Type:
Source:
@@ -1010,7 +1010,7 @@
Type:
Source:
@@ -1078,7 +1078,7 @@
Type:
Source:
@@ -1146,7 +1146,211 @@
Type:
Source:
+ + + + + + + +
+ + + + + + + + +

(readonly) UnknownOperationError :aws-greengrass-core-sdk.StreamManager.Operation

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) UpdateMessageStream :aws-greengrass-core-sdk.StreamManager.Operation

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) UpdateMessageStreamResponse :aws-greengrass-core-sdk.StreamManager.Operation

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -1180,13 +1384,13 @@
Type:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.Persistence.html b/docs/aws-greengrass-core-sdk.StreamManager.Persistence.html index ba44bb4..cad3568 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.Persistence.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.Persistence.html @@ -95,7 +95,7 @@

new Persis
Source:
@@ -195,7 +195,7 @@

Type:
Source:
@@ -263,7 +263,7 @@
Type:
Source:
@@ -297,13 +297,13 @@
Type:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry.html b/docs/aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry.html new file mode 100644 index 0000000..4f052ce --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry.html @@ -0,0 +1,1707 @@ + + + + + JSDoc: Class: PutAssetPropertyValueEntry + + + + + + + + + + +
+ +

Class: PutAssetPropertyValueEntry

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~PutAssetPropertyValueEntry(entryId, assetId, propertyId, propertyAlias, propertyValues)

+ +
Contains a list of value updates for a IoTSiteWise asset property in the list of asset entries consumed by the BatchPutAssetPropertyValue API. See https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchPutAssetPropertyValue.html.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new PutAssetPropertyValueEntry(entryId, assetId, propertyId, propertyAlias, propertyValues)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
entryId + + +String + + + + + + null + + The user specified ID for the entry. You can use this ID to identify which entries failed.
assetId + + +String + + + + + + null + + The ID of the asset to update.
propertyId + + +String + + + + + + null + + The ID of the asset property for this entry.
propertyAlias + + +String + + + + + + null + + The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html.
propertyValues + + +Array.<aws-greengrass-core-sdk.StreamManager.AssetPropertyValue> + + + + + + null + + The list of property values to upload. You can specify up to 10 values.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

assetId

+ + + + +
+ The ID of the asset to update. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

assetId

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

entryId

+ + + + +
+ The user specified ID for the entry. You can use this ID to identify which entries failed. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

entryId

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

propertyAlias

+ + + + +
+ The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

propertyAlias

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

propertyId

+ + + + +
+ The ID of the asset property for this entry. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

propertyId

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

propertyValues

+ + + + +
+ The list of property values to upload. You can specify up to 10 values. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

propertyValues

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withAssetId(value) → {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + The ID of the asset to update.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry + + +
+
+ + + + + + + + + + + + + +

withEntryId(value) → {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + The user specified ID for the entry. You can use this ID to identify which entries failed.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry + + +
+
+ + + + + + + + + + + + + +

withPropertyAlias(value) → {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry + + +
+
+ + + + + + + + + + + + + +

withPropertyId(value) → {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + The ID of the asset property for this entry.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry + + +
+
+ + + + + + + + + + + + + +

withPropertyValues(value) → {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Array.<aws-greengrass-core-sdk.StreamManager.AssetPropertyValue> + + + + The list of property values to upload. You can specify up to 10 values.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.Quality.html b/docs/aws-greengrass-core-sdk.StreamManager.Quality.html new file mode 100644 index 0000000..76a373a --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.Quality.html @@ -0,0 +1,375 @@ + + + + + JSDoc: Class: Quality + + + + + + + + + + +
+ +

Class: Quality

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~Quality()

+ + +
+ +
+
+ + + + + + +

new Quality()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

(readonly) BAD :aws-greengrass-core-sdk.StreamManager.Quality

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) GOOD :aws-greengrass-core-sdk.StreamManager.Quality

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) UNCERTAIN :aws-greengrass-core-sdk.StreamManager.Quality

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions.html b/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions.html index 56bbf11..840c138 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions.html @@ -243,7 +243,7 @@
Parameters:
Source:
@@ -337,7 +337,7 @@

Source:
@@ -395,7 +395,7 @@

Source:
@@ -458,7 +458,7 @@

maxMes
Source:
@@ -516,7 +516,7 @@

maxMes
Source:
@@ -579,7 +579,7 @@

minMes
Source:
@@ -637,7 +637,7 @@

minMes
Source:
@@ -702,7 +702,7 @@

read
Source:
@@ -760,7 +760,7 @@

read
Source:
@@ -885,7 +885,7 @@

Parameters:
Source:
@@ -1037,7 +1037,7 @@
Parameters:
Source:
@@ -1189,7 +1189,7 @@
Parameters:
Source:
@@ -1343,7 +1343,7 @@
Parameters:
Source:
@@ -1407,13 +1407,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest.html b/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest.html index 5886e10..5c11179 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest.html @@ -209,7 +209,7 @@
Parameters:
Source:
@@ -299,7 +299,7 @@

re
Source:
@@ -357,7 +357,7 @@

re
Source:
@@ -415,7 +415,7 @@

requestIdSource:
@@ -473,7 +473,7 @@

requestIdSource:
@@ -531,7 +531,7 @@

streamName<
Source:
@@ -589,7 +589,7 @@

streamName<
Source:
@@ -714,7 +714,7 @@

Parameters:
Source:
@@ -865,7 +865,7 @@
Parameters:
Source:
@@ -1016,7 +1016,7 @@
Parameters:
Source:
@@ -1080,13 +1080,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse.html b/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse.html index 613f92d..3545e86 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse.html @@ -31,7 +31,7 @@

Class: ReadMessagesResponse

aws-greengrass-core-sdk.StreamManager~ReadMessagesResponse(requestId, messages, status, errorMessage)

-
Internal Only
+
Internal Only.
@@ -238,7 +238,7 @@
Parameters:
Source:
@@ -328,7 +328,7 @@

errorMess
Source:
@@ -386,7 +386,7 @@

errorMess
Source:
@@ -444,7 +444,7 @@

messagesSource:
@@ -502,7 +502,7 @@

messagesSource:
@@ -560,7 +560,7 @@

requestIdSource:
@@ -618,7 +618,7 @@

requestIdSource:
@@ -676,7 +676,7 @@

statusSource:
@@ -734,7 +734,7 @@

statusSource:
@@ -859,7 +859,7 @@
Parameters:
Source:
@@ -1010,7 +1010,7 @@
Parameters:
Source:
@@ -1161,7 +1161,7 @@
Parameters:
Source:
@@ -1312,7 +1312,7 @@
Parameters:
Source:
@@ -1376,13 +1376,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.ResponseStatusCode.html b/docs/aws-greengrass-core-sdk.StreamManager.ResponseStatusCode.html index 6ade219..f27ab74 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.ResponseStatusCode.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.ResponseStatusCode.html @@ -47,7 +47,10 @@

FailedToConnect: Client failed to connect to the Server. NotEnoughMessages: There is not enough messages to return. MessageStoreReadError: Read messages encountered an error. - OutOfMemoryError: Server ran out of memory. + OutOfMemoryError: Server ran out of memory. + UpdateFailed: Update operation failed. + UpdateNotAllowed: One or more fields are not allowed to be updated. + UnknownOperation: Client request is not recognized by the server. @@ -110,7 +113,7 @@

new
Source:
@@ -1112,6 +1115,74 @@

Type:
+

(readonly) UnknownOperation :aws-greengrass-core-sdk.StreamManager.ResponseStatusCode

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +

(readonly) UnsupportedConnectVersion :aws-greengrass-core-sdk.StreamManager.ResponseStatusCode

@@ -1247,6 +1318,142 @@
Type:
+ +

(readonly) UpdateFailed :aws-greengrass-core-sdk.StreamManager.ResponseStatusCode

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) UpdateNotAllowed :aws-greengrass-core-sdk.StreamManager.ResponseStatusCode

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + @@ -1264,13 +1471,13 @@
Type:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition.html b/docs/aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition.html new file mode 100644 index 0000000..17ebe2e --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition.html @@ -0,0 +1,1413 @@ + + + + + JSDoc: Class: S3ExportTaskDefinition + + + + + + + + + + +
+ +

Class: S3ExportTaskDefinition

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~S3ExportTaskDefinition(inputUrl, bucket, key, userMetadata)

+ +
S3 Task definition containing all the information necessary to export the data to S3. This will contain the S3 bucket and key as well as the file's URL where the data is stored.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new S3ExportTaskDefinition(inputUrl, bucket, key, userMetadata)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
inputUrl + + +String + + + + + + null + + The URL of the file that contains the data to upload. The file should be local on the disk.
bucket + + +String + + + + + + null + + The name of the S3 bucket that this file should be uploaded to.
key + + +String + + + + + + null + + The key for the S3 object that this file should be uploaded to. + The string can have placeholder expressions which are resolved at upload time. Valid expressions are strings that are valid Java DateTimeFormatter strings. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html + Example: myKeyNamePrefix/!{timestamp:yyyy/MM/dd}/myKeyNameSuffix.
userMetadata + + +Object + + + + + + null + + User metadata. For key of a user metadata, callers should not include the internal "x-amz-meta-" prefix. Keys are case insensitive and will appear as lowercase strings on S3, even if they were originally specified with uppercase strings. Reserved key names start with "$aws-gg-" prefix.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

bucket

+ + + + +
+ The name of the S3 bucket that this file should be uploaded to. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

bucket

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

inputUrl

+ + + + +
+ The URL of the file that contains the data to upload. The file should be local on the disk. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

inputUrl

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

key

+ + + + +
+ The key for the S3 object that this file should be uploaded to. + The string can have placeholder expressions which are resolved at upload time. Valid expressions are strings that are valid Java DateTimeFormatter strings. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html + Example: myKeyNamePrefix/!{timestamp:yyyy/MM/dd}/myKeyNameSuffix. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

key

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

userMetadata

+ + + + +
+ User metadata. For key of a user metadata, callers should not include the internal "x-amz-meta-" prefix. Keys are case insensitive and will appear as lowercase strings on S3, even if they were originally specified with uppercase strings. Reserved key names start with "$aws-gg-" prefix. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

userMetadata

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withBucket(value) → {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + The name of the S3 bucket that this file should be uploaded to.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition + + +
+
+ + + + + + + + + + + + + +

withInputUrl(value) → {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + The URL of the file that contains the data to upload. The file should be local on the disk.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition + + +
+
+ + + + + + + + + + + + + +

withKey(value) → {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + The key for the S3 object that this file should be uploaded to. + The string can have placeholder expressions which are resolved at upload time. Valid expressions are strings that are valid Java DateTimeFormatter strings. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html + Example: myKeyNamePrefix/!{timestamp:yyyy/MM/dd}/myKeyNameSuffix.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition + + +
+
+ + + + + + + + + + + + + +

withUserMetadata(value) → {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Object + + + + User metadata. For key of a user metadata, callers should not include the internal "x-amz-meta-" prefix. Keys are case insensitive and will appear as lowercase strings on S3, even if they were originally specified with uppercase strings. Reserved key names start with "$aws-gg-" prefix.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig.html b/docs/aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig.html new file mode 100644 index 0000000..4d3d37a --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig.html @@ -0,0 +1,1710 @@ + + + + + JSDoc: Class: S3ExportTaskExecutorConfig + + + + + + + + + + +
+ +

Class: S3ExportTaskExecutorConfig

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~S3ExportTaskExecutorConfig(identifier, sizeThresholdForMultipartUploadBytes, priority, disabled, statusConfig)

+ +
Configuration object for S3 export tasks executor. Minimum version requirements: StreamManager server version 1.1 (or AWS IoT Greengrass Core 1.11.0)
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new S3ExportTaskExecutorConfig(identifier, sizeThresholdForMultipartUploadBytes, priority, disabled, statusConfig)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
identifier + + +String + + + + + + null + + A unique identifier to identify this individual upload task. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255.
sizeThresholdForMultipartUploadBytes + + +Number + + + + + + null + + The size threshold in bytes for when to use multipart uploads. Uploads over this size will automatically use a multipart upload strategy, while uploads equal or smaller than this threshold will use a single connection to upload the whole object.
priority + + +Number + + + + + + null + + Priority for this upload task. Lower values are higher priority. If not specified it will have the lowest priority.
disabled + + +Boolean + + + + + + null + + Enable or disable this export. Default is false.
statusConfig + + +aws-greengrass-core-sdk.StreamManager.StatusConfig + + + + + + null + + Event status configuration that specifies the target status stream and verbosity.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

disabled

+ + + + +
+ Enable or disable this export. Default is false. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

disabled

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

identifier

+ + + + +
+ A unique identifier to identify this individual upload task. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

identifier

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

priority

+ + + + +
+ Priority for this upload task. Lower values are higher priority. If not specified it will have the lowest priority. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

priority

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

sizeThresholdForMultipartUploadBytes

+ + + + +
+ The size threshold in bytes for when to use multipart uploads. Uploads over this size will automatically use a multipart upload strategy, while uploads equal or smaller than this threshold will use a single connection to upload the whole object. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

sizeThresholdForMultipartUploadBytes

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

statusConfig

+ + + + +
+ Event status configuration that specifies the target status stream and verbosity. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

statusConfig

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withDisabled(value) → {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Boolean + + + + Enable or disable this export. Default is false.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig + + +
+
+ + + + + + + + + + + + + +

withIdentifier(value) → {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + A unique identifier to identify this individual upload task. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig + + +
+
+ + + + + + + + + + + + + +

withPriority(value) → {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + Priority for this upload task. Lower values are higher priority. If not specified it will have the lowest priority.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig + + +
+
+ + + + + + + + + + + + + +

withSizeThresholdForMultipartUploadBytes(value) → {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The size threshold in bytes for when to use multipart uploads. Uploads over this size will automatically use a multipart upload strategy, while uploads equal or smaller than this threshold will use a single connection to upload the whole object.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig + + +
+
+ + + + + + + + + + + + + +

withStatusConfig(value) → {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.StatusConfig + + + + Event status configuration that specifies the target status stream and verbosity.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.Status.html b/docs/aws-greengrass-core-sdk.StreamManager.Status.html new file mode 100644 index 0000000..5e0bc4b --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.Status.html @@ -0,0 +1,515 @@ + + + + + JSDoc: Class: Status + + + + + + + + + + +
+ +

Class: Status

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~Status()

+ +
The status of the event.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Status()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

(readonly) Canceled :aws-greengrass-core-sdk.StreamManager.Status

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) Failure :aws-greengrass-core-sdk.StreamManager.Status

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) InProgress :aws-greengrass-core-sdk.StreamManager.Status

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) Success :aws-greengrass-core-sdk.StreamManager.Status

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) Warning :aws-greengrass-core-sdk.StreamManager.Status

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.StatusConfig.html b/docs/aws-greengrass-core-sdk.StreamManager.StatusConfig.html new file mode 100644 index 0000000..4482548 --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.StatusConfig.html @@ -0,0 +1,810 @@ + + + + + JSDoc: Class: StatusConfig + + + + + + + + + + +
+ +

Class: StatusConfig

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~StatusConfig(statusLevel, statusStreamName)

+ +
Configuration for status in a status-stream.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new StatusConfig(statusLevel, statusStreamName)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
statusLevel + + +aws-greengrass-core-sdk.StreamManager.StatusLevel + + + + + + null + + Defines the verbosity of status messages in a status-stream.
statusStreamName + + +String + + + + + + null + + The name of the stream to which status messages are appended. + The status-stream should be created before associating it with another stream.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

statusLevel

+ + + + +
+ Defines the verbosity of status messages in a status-stream. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

statusLevel

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

statusStreamName

+ + + + +
+ The name of the stream to which status messages are appended. + The status-stream should be created before associating it with another stream. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

statusStreamName

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withStatusLevel(value) → {aws-greengrass-core-sdk.StreamManager.StatusConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.StatusLevel + + + + Defines the verbosity of status messages in a status-stream.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusConfig + + +
+
+ + + + + + + + + + + + + +

withStatusStreamName(value) → {aws-greengrass-core-sdk.StreamManager.StatusConfig}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + The name of the stream to which status messages are appended. + The status-stream should be created before associating it with another stream.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusConfig + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.StatusContext.html b/docs/aws-greengrass-core-sdk.StreamManager.StatusContext.html new file mode 100644 index 0000000..60edd50 --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.StatusContext.html @@ -0,0 +1,1407 @@ + + + + + JSDoc: Class: StatusContext + + + + + + + + + + +
+ +

Class: StatusContext

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~StatusContext(s3ExportTaskDefinition, exportIdentifier, streamName, sequenceNumber)

+ +
Context associated with a status message. Describes which stream, export config, message, the status is associated with.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new StatusContext(s3ExportTaskDefinition, exportIdentifier, streamName, sequenceNumber)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
s3ExportTaskDefinition + + +aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition + + + + + + null + + The task definition of an S3 upload task if the status is associated with it, ie, if the eventType = S3Task.
exportIdentifier + + +String + + + + + + null + + The export identifier the status is associated with.
streamName + + +String + + + + + + null + + The name of the stream the status is associated with.
sequenceNumber + + +Number + + + + + + null + + The sequence number of the message the status is associated with.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

exportIdentifier

+ + + + +
+ The export identifier the status is associated with. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

exportIdentifier

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

s3ExportTaskDefinition

+ + + + +
+ The task definition of an S3 upload task if the status is associated with it, ie, if the eventType = S3Task. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

s3ExportTaskDefinition

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

sequenceNumber

+ + + + +
+ The sequence number of the message the status is associated with. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

sequenceNumber

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

streamName

+ + + + +
+ The name of the stream the status is associated with. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

streamName

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withExportIdentifier(value) → {aws-greengrass-core-sdk.StreamManager.StatusContext}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + The export identifier the status is associated with.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusContext + + +
+
+ + + + + + + + + + + + + +

withS3ExportTaskDefinition(value) → {aws-greengrass-core-sdk.StreamManager.StatusContext}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition + + + + The task definition of an S3 upload task if the status is associated with it, ie, if the eventType = S3Task.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusContext + + +
+
+ + + + + + + + + + + + + +

withSequenceNumber(value) → {aws-greengrass-core-sdk.StreamManager.StatusContext}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The sequence number of the message the status is associated with.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusContext + + +
+
+ + + + + + + + + + + + + +

withStreamName(value) → {aws-greengrass-core-sdk.StreamManager.StatusContext}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + The name of the stream the status is associated with.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusContext + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.StatusLevel.html b/docs/aws-greengrass-core-sdk.StreamManager.StatusLevel.html new file mode 100644 index 0000000..4abbd42 --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.StatusLevel.html @@ -0,0 +1,515 @@ + + + + + JSDoc: Class: StatusLevel + + + + + + + + + + +
+ +

Class: StatusLevel

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~StatusLevel()

+ +
Defines the verbosity of status messages in a status-stream.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new StatusLevel()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

(readonly) DEBUG :aws-greengrass-core-sdk.StreamManager.StatusLevel

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) ERROR :aws-greengrass-core-sdk.StreamManager.StatusLevel

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) INFO :aws-greengrass-core-sdk.StreamManager.StatusLevel

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) TRACE :aws-greengrass-core-sdk.StreamManager.StatusLevel

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(readonly) WARN :aws-greengrass-core-sdk.StreamManager.StatusLevel

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.StatusMessage.html b/docs/aws-greengrass-core-sdk.StreamManager.StatusMessage.html new file mode 100644 index 0000000..9b06620 --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.StatusMessage.html @@ -0,0 +1,1991 @@ + + + + + JSDoc: Class: StatusMessage + + + + + + + + + + +
+ +

Class: StatusMessage

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~StatusMessage(eventType, statusLevel, status, statusContext, message, timestampEpochMs)

+ +
Status object appended to a status-stream.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new StatusMessage(eventType, statusLevel, status, statusContext, message, timestampEpochMs)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
eventType + + +aws-greengrass-core-sdk.StreamManager.EventType + + + + + + null + +
statusLevel + + +aws-greengrass-core-sdk.StreamManager.StatusLevel + + + + + + null + +
status + + +aws-greengrass-core-sdk.StreamManager.Status + + + + + + null + +
statusContext + + +aws-greengrass-core-sdk.StreamManager.StatusContext + + + + + + null + +
message + + +String + + + + + + null + + String describing the status message.
timestampEpochMs + + +Number + + + + + + null + + The time this status was added to the status-stream (in milliseconds since epoch).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

eventType

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

eventType

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

message

+ + + + +
+ String describing the status message. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

message

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

status

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

status

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

statusContext

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

statusContext

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

statusLevel

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

statusLevel

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

timestampEpochMs

+ + + + +
+ The time this status was added to the status-stream (in milliseconds since epoch). +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

timestampEpochMs

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withEventType(value) → {aws-greengrass-core-sdk.StreamManager.StatusMessage}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.EventType + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusMessage + + +
+
+ + + + + + + + + + + + + +

withMessage(value) → {aws-greengrass-core-sdk.StreamManager.StatusMessage}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + String describing the status message.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusMessage + + +
+
+ + + + + + + + + + + + + +

withStatus(value) → {aws-greengrass-core-sdk.StreamManager.StatusMessage}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.Status + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusMessage + + +
+
+ + + + + + + + + + + + + +

withStatusContext(value) → {aws-greengrass-core-sdk.StreamManager.StatusMessage}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.StatusContext + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusMessage + + +
+
+ + + + + + + + + + + + + +

withStatusLevel(value) → {aws-greengrass-core-sdk.StreamManager.StatusMessage}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.StatusLevel + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusMessage + + +
+
+ + + + + + + + + + + + + +

withTimestampEpochMs(value) → {aws-greengrass-core-sdk.StreamManager.StatusMessage}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The time this status was added to the status-stream (in milliseconds since epoch).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.StatusMessage + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.StrategyOnFull.html b/docs/aws-greengrass-core-sdk.StreamManager.StrategyOnFull.html index 6201247..9772d5f 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.StrategyOnFull.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.StrategyOnFull.html @@ -97,7 +97,7 @@

new Str
Source:
@@ -197,7 +197,7 @@

Type:
Source:
@@ -265,7 +265,7 @@
Type:
Source:
@@ -299,13 +299,13 @@
Type:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.StreamManagerClient.html b/docs/aws-greengrass-core-sdk.StreamManager.StreamManagerClient.html index a073f35..2d6e1a9 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.StreamManagerClient.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.StreamManagerClient.html @@ -349,7 +349,7 @@
Properties
Source:
@@ -541,7 +541,7 @@
Parameters:
Source:
@@ -647,7 +647,7 @@

closeSource:
@@ -784,7 +784,7 @@
Parameters:
Source:
@@ -940,7 +940,7 @@
Parameters:
Source:
@@ -1096,7 +1096,7 @@
Parameters:
Source:
@@ -1202,7 +1202,7 @@

(async) li
Source:
@@ -1357,7 +1357,7 @@

Parameters:
Source:
@@ -1494,7 +1494,7 @@
Parameters:
Source:
@@ -1700,7 +1700,7 @@
Parameters:
Source:
@@ -1753,6 +1753,162 @@
Returns:
+ + + + + +

(async) updateMessageStream(definition) → {Promise.<void>}

+ + + + + + +
+ Updates a message stream with the new definition. +Minimum version requirements: StreamManager server version 1.1 (or AWS IoT Greengrass Core 1.11.0) +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
definition + + +aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<void> + + +
+
+ + + + + + + + @@ -1768,13 +1924,13 @@
Returns:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.StreamManager.TimeInNanos.html b/docs/aws-greengrass-core-sdk.StreamManager.TimeInNanos.html new file mode 100644 index 0000000..a21958c --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.TimeInNanos.html @@ -0,0 +1,807 @@ + + + + + JSDoc: Class: TimeInNanos + + + + + + + + + + +
+ +

Class: TimeInNanos

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~TimeInNanos(timeInSeconds, offsetInNanos)

+ +
Contains a timestamp with optional nanosecond granularity.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new TimeInNanos(timeInSeconds, offsetInNanos)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
timeInSeconds + + +Number + + + + + + null + + The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by offsetInNanos.
offsetInNanos + + +Number + + + + + + null + + The nanosecond offset from timeInSeconds.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

offsetInNanos

+ + + + +
+ The nanosecond offset from timeInSeconds. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

offsetInNanos

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

timeInSeconds

+ + + + +
+ The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by offsetInNanos. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

timeInSeconds

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withOffsetInNanos(value) → {aws-greengrass-core-sdk.StreamManager.TimeInNanos}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The nanosecond offset from timeInSeconds.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.TimeInNanos + + +
+
+ + + + + + + + + + + + + +

withTimeInSeconds(value) → {aws-greengrass-core-sdk.StreamManager.TimeInNanos}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by offsetInNanos.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.TimeInNanos + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.TraceableRequest.html b/docs/aws-greengrass-core-sdk.StreamManager.TraceableRequest.html new file mode 100644 index 0000000..9de8589 --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.TraceableRequest.html @@ -0,0 +1,503 @@ + + + + + JSDoc: Class: TraceableRequest + + + + + + + + + + +
+ +

Class: TraceableRequest

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~TraceableRequest(requestId)

+ +
(Internal Only) TraceableRequest that contains only requestId.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new TraceableRequest(requestId)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
requestId + + +String + + + + + + null + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

requestId

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

requestId

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withRequestId(value) → {aws-greengrass-core-sdk.StreamManager.TraceableRequest}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.TraceableRequest + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.UnknownOperationError.html b/docs/aws-greengrass-core-sdk.StreamManager.UnknownOperationError.html new file mode 100644 index 0000000..62d3c61 --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.UnknownOperationError.html @@ -0,0 +1,1095 @@ + + + + + JSDoc: Class: UnknownOperationError + + + + + + + + + + +
+ +

Class: UnknownOperationError

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~UnknownOperationError(requestId, status, errorMessage)

+ +
(Internal Only) Response for UnknownOperationError.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new UnknownOperationError(requestId, status, errorMessage)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
requestId + + +String + + + + + + null + +
status + + +aws-greengrass-core-sdk.StreamManager.ResponseStatusCode + + + + + + null + +
errorMessage + + +String + + + + + + null + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

errorMessage

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

errorMessage

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

requestId

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

requestId

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

status

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

status

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withErrorMessage(value) → {aws-greengrass-core-sdk.StreamManager.UnknownOperationError}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.UnknownOperationError + + +
+
+ + + + + + + + + + + + + +

withRequestId(value) → {aws-greengrass-core-sdk.StreamManager.UnknownOperationError}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.UnknownOperationError + + +
+
+ + + + + + + + + + + + + +

withStatus(value) → {aws-greengrass-core-sdk.StreamManager.UnknownOperationError}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.ResponseStatusCode + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.UnknownOperationError + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest.html b/docs/aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest.html new file mode 100644 index 0000000..f09966c --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest.html @@ -0,0 +1,799 @@ + + + + + JSDoc: Class: UpdateMessageStreamRequest + + + + + + + + + + +
+ +

Class: UpdateMessageStreamRequest

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~UpdateMessageStreamRequest(requestId, definition)

+ +
(Internal Only) Request object for updating a message stream.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new UpdateMessageStreamRequest(requestId, definition)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
requestId + + +String + + + + + + null + +
definition + + +aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition + + + + + + null + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

definition

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

definition

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

requestId

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

requestId

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withDefinition(value) → {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest + + +
+
+ + + + + + + + + + + + + +

withRequestId(value) → {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse.html b/docs/aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse.html new file mode 100644 index 0000000..971614c --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse.html @@ -0,0 +1,1095 @@ + + + + + JSDoc: Class: UpdateMessageStreamResponse + + + + + + + + + + +
+ +

Class: UpdateMessageStreamResponse

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~UpdateMessageStreamResponse(requestId, status, errorMessage)

+ +
(Internal Only) Response for UpdateMessageStreamRequest.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new UpdateMessageStreamResponse(requestId, status, errorMessage)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
requestId + + +String + + + + + + null + +
status + + +aws-greengrass-core-sdk.StreamManager.ResponseStatusCode + + + + + + null + +
errorMessage + + +String + + + + + + null + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

errorMessage

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

errorMessage

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

requestId

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

requestId

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

status

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

status

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withErrorMessage(value) → {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse + + +
+
+ + + + + + + + + + + + + +

withRequestId(value) → {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse + + +
+
+ + + + + + + + + + + + + +

withStatus(value) → {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +aws-greengrass-core-sdk.StreamManager.ResponseStatusCode + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.Variant.html b/docs/aws-greengrass-core-sdk.StreamManager.Variant.html new file mode 100644 index 0000000..39cee62 --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.Variant.html @@ -0,0 +1,1407 @@ + + + + + JSDoc: Class: Variant + + + + + + + + + + +
+ +

Class: Variant

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~Variant(stringValue, integerValue, doubleValue, booleanValue)

+ +
Contains an asset property value (of a single type only).
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Variant(stringValue, integerValue, doubleValue, booleanValue)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
stringValue + + +String + + + + + + null + + Asset property data of type string (sequence of characters).
integerValue + + +Number + + + + + + null + + Asset property data of type integer (whole number).
doubleValue + + +Number + + + + + + null + + Asset property data of type double (floating point number).
booleanValue + + +Boolean + + + + + + null + + Asset property data of type Boolean (true or false).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

booleanValue

+ + + + +
+ Asset property data of type Boolean (true or false). +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

booleanValue

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

doubleValue

+ + + + +
+ Asset property data of type double (floating point number). +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

doubleValue

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

integerValue

+ + + + +
+ Asset property data of type integer (whole number). +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

integerValue

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

stringValue

+ + + + +
+ Asset property data of type string (sequence of characters). +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

stringValue

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

withBooleanValue(value) → {aws-greengrass-core-sdk.StreamManager.Variant}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Boolean + + + + Asset property data of type Boolean (true or false).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.Variant + + +
+
+ + + + + + + + + + + + + +

withDoubleValue(value) → {aws-greengrass-core-sdk.StreamManager.Variant}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + Asset property data of type double (floating point number).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.Variant + + +
+
+ + + + + + + + + + + + + +

withIntegerValue(value) → {aws-greengrass-core-sdk.StreamManager.Variant}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +Number + + + + Asset property data of type integer (whole number).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.Variant + + +
+
+ + + + + + + + + + + + + +

withStringValue(value) → {aws-greengrass-core-sdk.StreamManager.Variant}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + Asset property data of type string (sequence of characters).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +aws-greengrass-core-sdk.StreamManager.Variant + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.VersionInfo.html b/docs/aws-greengrass-core-sdk.StreamManager.VersionInfo.html new file mode 100644 index 0000000..4a156e1 --- /dev/null +++ b/docs/aws-greengrass-core-sdk.StreamManager.VersionInfo.html @@ -0,0 +1,243 @@ + + + + + JSDoc: Class: VersionInfo + + + + + + + + + + +
+ +

Class: VersionInfo

+ + + + + + +
+ +
+ +

+ aws-greengrass-core-sdk.StreamManager~VersionInfo()

+ +
(Internal Only) Version information.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new VersionInfo()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

(readonly) PROTOCOL_VERSION :aws-greengrass-core-sdk.StreamManager.VersionInfo

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + \ No newline at end of file diff --git a/docs/aws-greengrass-core-sdk.StreamManager.html b/docs/aws-greengrass-core-sdk.StreamManager.html index db61aaa..0158da9 100644 --- a/docs/aws-greengrass-core-sdk.StreamManager.html +++ b/docs/aws-greengrass-core-sdk.StreamManager.html @@ -101,6 +101,9 @@

Classes

AppendMessageResponse
+
AssetPropertyValue
+
+
ConnectRequest
@@ -125,15 +128,24 @@

Classes

DescribeMessageStreamResponse
+
EventType
+
+
ExportDefinition
+
ExportFormat
+
+
HTTPConfig
IoTAnalyticsConfig
+
IoTSiteWiseConfig
+
+
KinesisConfig
@@ -161,6 +173,12 @@

Classes

Persistence
+
PutAssetPropertyValueEntry
+
+ +
Quality
+
+
ReadMessagesOptions
@@ -173,11 +191,53 @@

Classes

ResponseStatusCode
+
S3ExportTaskDefinition
+
+ +
S3ExportTaskExecutorConfig
+
+ +
Status
+
+ +
StatusConfig
+
+ +
StatusContext
+
+ +
StatusLevel
+
+ +
StatusMessage
+
+
StrategyOnFull
StreamManagerClient
+ +
TimeInNanos
+
+ +
TraceableRequest
+
+ +
UnknownOperationError
+
+ +
UpdateMessageStreamRequest
+
+ +
UpdateMessageStreamResponse
+
+ +
Variant
+
+ +
VersionInfo
+

@@ -204,13 +264,13 @@

Classes


- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/aws-greengrass-core-sdk.html b/docs/aws-greengrass-core-sdk.html index c99bbdf..6171f66 100644 --- a/docs/aws-greengrass-core-sdk.html +++ b/docs/aws-greengrass-core-sdk.html @@ -135,13 +135,13 @@

Namespaces


- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/global.html b/docs/global.html index 3ed1f12..ae4bcee 100644 --- a/docs/global.html +++ b/docs/global.html @@ -96,6 +96,324 @@

+

Methods

+ + + + + + + +

deserializeJsonBytesToObj(bytes, type)

+ + + + + + +
+ Deserialize the json byte array to an instance of class +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + a bytes array
type + + instance type
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ object +
+ + + + + + + + + + + + + + + +

validateAndSerializeToJsonBytes(o)

+ + + + + + +
+ Validate And Serialize an instance of class to Json bytes +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
o + + a instance object
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+ + throws ValidationException + +
+ + + + + +
Returns:
+ + +
+ byte array +
+ + + + + + + + + + +

Type Definitions

@@ -737,7 +1055,7 @@
Properties:
Source:
@@ -832,6 +1150,9 @@
Parameters:
+Object +| + String @@ -842,14 +1163,174 @@
Parameters:
- The json-serialized data returned from the request. Set to null if a request error occurs. This string can be parsed to get the Object with the following info: -data.ARN {String} The ARN of the secret. -data.Name {String} The friendly name of the secret. -data.VersionId {String} The unique identifier of this version of the secret. -data.SecretBinary {Buffer|TypedArray|Blob|String} The decrypted part of the protected secret information that was originally provided as binary data in the form of a byte array. -The response parameter represents the binary data as a base64-encoded string. -data.SecretString {String} The decrypted part of the protected secret information that was originally provided as a string. -data.VersionStages {String[]} Specifies the secret version that you want to retrieve by the staging label attached to the version. + data returned from the request. Return type is decided on DeStringifyResultFlag flag in request. Set to null if a request error occurs. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -857,6 +1338,13 @@
Parameters:
NameTypeDescription
ARN + + +String + + + + The ARN of the secret.
Name + + +String + + + + The friendly name of the secret.
VersionId + + +String + + + + The unique identifier of this version of the secret.
SecretBinary + + +Buffer +| + +TypedArray +| + +Blob +| + +String + + + + The decrypted part of the protected secret information that was originally provided as binary data in the form of a byte array. +The response parameter represents the binary data as a base64-encoded string.
SecretString + + +String + + + + The decrypted part of the protected secret information that was originally provided as a string.
VersionStages + + +Array.<String> + + + + Specifies the secret version that you want to retrieve by the staging label attached to the version.
Staging labels are used to keep track of different versions during the rotation process.
+ + + + + + + @@ -891,7 +1379,7 @@
Parameters:
Source:
@@ -935,13 +1423,13 @@
Parameters:

- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/index.html b/docs/index.html index 3b9ebb9..c626fa2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -114,9 +114,17 @@

Compatibility¶< 1.10.x 1.0.x-1.6.x + +1.11.x +1.0.x-1.7.x + +
+

1.7.0 Updates

+

Stream manager supports automatic data export to AWS S3 and AWS IoT SiteWise, provides new API method to update existing streams, and pause or resume exporting.

+

1.6.0 Updates

Added support for StreamManager, see AWS Docs @@ -189,13 +197,13 @@

License


- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/index.js.html b/docs/index.js.html index 51e571d..21dce66 100644 --- a/docs/index.js.html +++ b/docs/index.js.html @@ -69,13 +69,13 @@

Source: index.js


- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/iotdata.js.html b/docs/iotdata.js.html index 3e11e37..de6d779 100644 --- a/docs/iotdata.js.html +++ b/docs/iotdata.js.html @@ -268,13 +268,13 @@

Source: iotdata.js


- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/lambda.js.html b/docs/lambda.js.html index 1012078..b4a3ce5 100644 --- a/docs/lambda.js.html +++ b/docs/lambda.js.html @@ -227,13 +227,13 @@

Source: lambda.js


- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/secretsmanager.js.html b/docs/secretsmanager.js.html index f71aec8..9fbacbb 100644 --- a/docs/secretsmanager.js.html +++ b/docs/secretsmanager.js.html @@ -41,6 +41,7 @@

Source: secretsmanager.js

const KEY_SECRET_ARN = 'ARN'; const KEY_SECRET_NAME = 'Name'; const KEY_CREATED_DATE = 'CreatedDate'; +const KEY_JSON_RESULT_FLAG = 'DeStringifyResultFlag'; const { envVars } = GreengrassCommon; const { SECRETS_MANAGER_FUNCTION_ARN } = envVars; @@ -66,14 +67,14 @@

Source: secretsmanager.js

* * @callback secretsManagerCallback * @param err {Error} The error object returned from the request. Set to <tt>null</tt> if the request is successful. - * @param data {String} The json-serialized data returned from the request. Set to <tt>null</tt> if a request error occurs. This string can be parsed to get the Object with the following info: - * data.ARN {String} The ARN of the secret. - * data.Name {String} The friendly name of the secret. - * data.VersionId {String} The unique identifier of this version of the secret. - * data.SecretBinary {Buffer|TypedArray|Blob|String} The decrypted part of the protected secret information that was originally provided as binary data in the form of a byte array. + * @param data {Object|String} data returned from the request. Return type is decided on DeStringifyResultFlag flag in request. Set to <tt>null</tt> if a request error occurs. + * @param data.ARN {String} The ARN of the secret. + * @param data.Name {String} The friendly name of the secret. + * @param data.VersionId {String} The unique identifier of this version of the secret. + * @param data.SecretBinary {Buffer|TypedArray|Blob|String} The decrypted part of the protected secret information that was originally provided as binary data in the form of a byte array. * The response parameter represents the binary data as a base64-encoded string. - * data.SecretString {String} The decrypted part of the protected secret information that was originally provided as a string. - * data.VersionStages {String[]} Specifies the secret version that you want to retrieve by the staging label attached to the version. + * @param data.SecretString {String} The decrypted part of the protected secret information that was originally provided as a string. + * @param data.VersionStages {String[]} Specifies the secret version that you want to retrieve by the staging label attached to the version. * <br/>Staging labels are used to keep track of different versions during the rotation process. */ @@ -84,6 +85,7 @@

Source: secretsmanager.js

* @param params.SecretId {String} Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret. * @param params.VersionStage {String} Specifies the secret version that you want to retrieve by the staging label attached to the version. * <br/>Staging labels are used to keep track of different versions during the rotation process. + * @param params.DeStringifyResultFlag {boolean} Optional Flag to decide the return type from getSecretValue. If set, it returns de-serialized data object, otherwise it returns stringified response. * @param callback {secretsManagerCallback} The callback. * * @example <caption>Retrieving a local secret value</caption> @@ -102,6 +104,7 @@

Source: secretsmanager.js

const secretId = Util.getParameter(params, KEY_SECRET_ID); const versionId = Util.getParameter(params, KEY_VERSION_ID); const versionStage = Util.getParameter(params, KEY_VERSION_STAGE); + const isJSONResultFlagSet = Util.getParameter(params, KEY_JSON_RESULT_FLAG); if (secretId === undefined) { callback(new Error(`"${KEY_SECRET_ID}" is a required parameter`), null); @@ -130,7 +133,11 @@

Source: secretsmanager.js

if (err) { callback(err, null); // an error occurred } else if (SecretsManager._is200Response(data.Payload)) { - callback(null, data.Payload); // successful response + // successful response + if (isJSONResultFlagSet) { + callback(null, JSON.parse(data.Payload)); + } + callback(null, data.Payload); } else { callback(new Error(JSON.stringify(data.Payload)), null); // error response } @@ -178,13 +185,13 @@

Source: secretsmanager.js


- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/stream-manager_client.js.html b/docs/stream-manager_client.js.html index 2389ab4..2fd4911 100644 --- a/docs/stream-manager_client.js.html +++ b/docs/stream-manager_client.js.html @@ -37,11 +37,20 @@

Source: stream-manager/client.js

const net = require('net'); const smData = require('aws-greengrass-core-sdk/stream-manager/data'); const exceptions = require('./exceptions'); +const utilInternal = require('./utilInternal'); const util = require('./util'); // Consts -const PROTOCOL_VERSION = '1.0.0'; -const SDK_VERSION = '1.0.0'; + +// Version of the Java SDK. +// NOTE: When you bump this version, +// consider adding the old version to olderSupportedProtocolVersions list (if you intend to support it) +const SDK_VERSION = '1.1.0'; + +// List of supported protocol protocol. +// These are meant to be used for graceful degradation if the server does not support the current SDK version. +const OLD_SUPPORTED_PROTOCOL_VERSIONS = ['1.0.0']; + const CONNECT_VERSION = 1; const removeFromArray = (arr, f) => { @@ -101,6 +110,7 @@

Source: stream-manager/client.js

error: console.error, debug: console.debug, info: console.info, + warn: console.warn, }, }; @@ -160,7 +170,7 @@

Source: stream-manager/client.js

// Set high water mark so that we can read 1 full packet (1GB) at a time instead of needing to // try to read multiple times and combine the results. The HWM adjusts how much the socket will // buffer when reading. - readableHighWaterMark: util.MAX_PACKET_SIZE, + readableHighWaterMark: utilInternal.MAX_PACKET_SIZE, }, async () => { try { // Connection started @@ -168,17 +178,18 @@

Source: stream-manager/client.js

this.#connected = false; const request = new smData.ConnectRequest() - .withProtocolVersion(PROTOCOL_VERSION) + .withProtocolVersion(smData.VersionInfo.PROTOCOL_VERSION.asMap()) .withSdkVersion(SDK_VERSION) .withAuthToken(this.#authToken) - .withRequestId(util.uuidv4()); + .withOtherSupportedProtocolVersions(OLD_SUPPORTED_PROTOCOL_VERSIONS) + .withRequestId(utilInternal.uuidv4()); // Write the connect version - newSock.write(util.intToBuffer(CONNECT_VERSION, 1)); + newSock.write(utilInternal.intToBuffer(CONNECT_VERSION, 1)); // Write request to socket const frame = new smData.MessageFrame(smData.Operation.Connect, cbor.encode(request.asMap())); - const byteFrame = util.encodeFrame(frame); + const byteFrame = utilInternal.encodeFrame(frame); newSock.write(byteFrame.header); newSock.write(byteFrame.payload); @@ -261,7 +272,7 @@

Source: stream-manager/client.js

this.__handleReadResponse(cbor.decodeFirstSync(frame.payload), frame); } else { // Read connect version - const connectResponseVersion = util.intFromBuffer(await this.__readSocket(1, socket)); + const connectResponseVersion = utilInternal.intFromBuffer(await this.__readSocket(1, socket)); if (connectResponseVersion !== CONNECT_VERSION) { this.#logger.error('Unexpected response from the server, Connect version:', connectResponseVersion); throw new exceptions.ConnectFailedException('Failed to establish connection with the server'); @@ -283,6 +294,14 @@

Source: stream-manager/client.js

this.#logger.error('Received ConnectResponse with unexpected status', response.status); throw new exceptions.ConnectFailedException('Failed to establish connection with the server'); } + + if (response.protocolVersion !== smData.VersionInfo.PROTOCOL_VERSION.asMap()) { + this.#logger.warn('SDK with version %s using Protocol version %s is not fully compatible with ' + + 'Server with version %s. ' + + 'Client has connected in a compatibility mode using protocol version %s. ' + + 'Some features will not work as expected', SDK_VERSION, smData.VersionInfo.PROTOCOL_VERSION.asMap(), + response.serverVersion, response.protocolVersion); + } } // Put ourselves back in the event loop to handle the next messages @@ -299,8 +318,8 @@

Source: stream-manager/client.js

} async __readMessageFrame(socket) { - const length = util.intFromBuffer(await this.__readSocket(4, socket)); - const operation = util.intFromBuffer(await this.__readSocket(1, socket)); + const length = utilInternal.intFromBuffer(await this.__readSocket(4, socket)); + const operation = utilInternal.intFromBuffer(await this.__readSocket(1, socket)); let op = smData.Operation.fromMap(operation); if (typeof op === 'undefined') { @@ -320,6 +339,10 @@

Source: stream-manager/client.js

const response = smData.CreateMessageStreamResponse.fromMap(data); this.#logger.debug('Received CreateMessageStreamResponse from server', frame); this.#requestMap[response.requestId](response); + } else if (frame.operation === smData.Operation.UpdateMessageStreamResponse) { + const response = smData.UpdateMessageStreamResponse.fromMap(data); + this.#logger.debug('Received UpdateMessageStreamResponse from server', frame); + this.#requestMap[response.requestId](response); } else if (frame.operation === smData.Operation.DeleteMessageStreamResponse) { const response = smData.DeleteMessageStreamResponse.fromMap(data); this.#logger.debug('Received DeleteMessageStreamResponse from server', frame); @@ -336,6 +359,10 @@

Source: stream-manager/client.js

const response = smData.DescribeMessageStreamResponse.fromMap(data); this.#logger.debug('Received DescribeMessageStreamResponse from server', frame); this.#requestMap[response.requestId](response); + } else if (frame.operation === smData.Operation.UnknownOperationError) { + this.#logger.error('Received response with UnknownOperation Error from server. You should update your server version'); + const response = smData.UnknownOperationError.fromMap(data); + this.#requestMap[response.requestId](response); } else if (frame.operation === smData.Operation.Unknown) { this.#logger.error('Received response with unknown operation from server', frame); try { @@ -358,10 +385,10 @@

Source: stream-manager/client.js

if (data.requestId === null) { // eslint-disable-next-line no-param-reassign - data.requestId = util.uuidv4(); + data.requestId = utilInternal.uuidv4(); } - const validation = util.isInvalid(data); + const validation = utilInternal.isInvalid(data); if (validation) { throw new exceptions.ValidationException(validation); } @@ -385,7 +412,7 @@

Source: stream-manager/client.js

// Write request to socket const frame = new smData.MessageFrame(operation, cbor.encode(data.asMap())); - const byteFrame = util.encodeFrame(frame); + const byteFrame = utilInternal.encodeFrame(frame); this.#socket.write(byteFrame.header); this.#socket.write(byteFrame.payload); @@ -397,7 +424,7 @@

Source: stream-manager/client.js

if (!(options instanceof smData.ReadMessagesOptions)) { throw new exceptions.ValidationException('options argument to read_messages must be a ReadMessageOptions object'); } - const validation = util.isInvalid(options); + const validation = utilInternal.isInvalid(options); if (validation) { throw new exceptions.ValidationException(validation); } @@ -423,7 +450,7 @@

Source: stream-manager/client.js

async appendMessage(streamName, data) { const request = new smData.AppendMessageRequest().withName(streamName).withPayload(data); const result = await this._sendAndReceive(smData.Operation.AppendMessage, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); return result.sequenceNumber; } @@ -439,7 +466,23 @@

Source: stream-manager/client.js

} const request = new smData.CreateMessageStreamRequest().withDefinition(definition); const result = await this._sendAndReceive(smData.Operation.CreateMessageStream, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); + } + + /** + * Updates a message stream with the new definition. + * Minimum version requirements: StreamManager server version 1.1 (or AWS IoT Greengrass Core 1.11.0) + * + * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @returns {Promise<void>} + */ + async updateMessageStream(definition) { + if (!(definition instanceof smData.MessageStreamDefinition)) { + throw new exceptions.ValidationException('definition argument to update_stream must be a MessageStreamDefinition object'); + } + const request = new smData.UpdateMessageStreamRequest().withDefinition(definition); + const result = await this._sendAndReceive(smData.Operation.UpdateMessageStream, request); + utilInternal.throwOnErrorResponse(result); } /** @@ -452,7 +495,7 @@

Source: stream-manager/client.js

async deleteMessageStream(streamName) { const request = new smData.DeleteMessageStreamRequest().withName(streamName); const result = await this._sendAndReceive(smData.Operation.DeleteMessageStream, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); } /** @@ -480,7 +523,7 @@

Source: stream-manager/client.js

StreamManagerClient.__validateReadMessagesOptions(options); const request = new smData.ReadMessagesRequest().withStreamName(streamName).withReadMessagesOptions(options); const result = await this._sendAndReceive(smData.Operation.ReadMessages, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); return result.messages; } @@ -492,7 +535,7 @@

Source: stream-manager/client.js

async listStreams() { const request = new smData.ListStreamsRequest(); const result = await this._sendAndReceive(smData.Operation.ListStreams, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); return result.streams; } @@ -506,7 +549,7 @@

Source: stream-manager/client.js

async describeMessageStream(streamName) { const request = new smData.DescribeMessageStreamRequest().withName(streamName); const result = await this._sendAndReceive(smData.Operation.DescribeMessageStream, request); - util.throwOnErrorResponse(result); + utilInternal.throwOnErrorResponse(result); return result.messageStreamInfo; } @@ -545,6 +588,7 @@

Source: stream-manager/client.js

...smData, StreamManagerClient: StreamManagerClient, ...exceptions, + util, }; @@ -556,13 +600,13 @@

Source: stream-manager/client.js


- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/stream-manager_data_index.js.html b/docs/stream-manager_data_index.js.html index df51ad8..f583f05 100644 --- a/docs/stream-manager_data_index.js.html +++ b/docs/stream-manager_data_index.js.html @@ -27,119 +27,51 @@

Source: stream-manager/data/index.js

/**
- * StrategyOnFull is used in the MessageStreamDefinition when creating a stream.
-   It defines the behavior when the stream has reached the maximum size.
-   RejectNewData: any append message request after the stream is full will be rejected with an exception.
-   OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message.
- *
- * @class
- * @memberOf aws-greengrass-core-sdk.StreamManager
- */
-class StrategyOnFull {
-
-    #value = null;
-    constructor(value = null) {
-        if (!(value in Object.values(StrategyOnFull.options))) {
-            throw new Error("Value must be one of the enumerated options");
-        }
-        this.#value = value;
-    }
-
-    static fromMap(d) {
-        return StrategyOnFull[StrategyOnFull.optionsFlipped[d]];
-    }
-
-    asMap() {
-        return this.#value;
-    }
-};
-Object.defineProperty(StrategyOnFull, "options", {
-    value: {
-        RejectNewData: 0,
-        OverwriteOldestData: 1,
-    }
-});
-Object.defineProperty(StrategyOnFull, "optionsFlipped", {
-    value: {
-        0: "RejectNewData",
-        1: "OverwriteOldestData",
-    }
-});
-
-/**
- * @member {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} RejectNewData
- * @memberOf aws-greengrass-core-sdk.StreamManager.StrategyOnFull#
- * @readonly
- */
-Object.defineProperty(StrategyOnFull, "RejectNewData", {
-    value: new StrategyOnFull(0)
-});
-/**
- * @member {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} OverwriteOldestData
- * @memberOf aws-greengrass-core-sdk.StreamManager.StrategyOnFull#
- * @readonly
- */
-Object.defineProperty(StrategyOnFull, "OverwriteOldestData", {
-    value: new StrategyOnFull(1)
-});
-
-/**
- * Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts.
-   Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk.
+ * (Internal Only) Version information.
  *
  * @class
  * @memberOf aws-greengrass-core-sdk.StreamManager
  */
-class Persistence {
+class VersionInfo {
 
     #value = null;
     constructor(value = null) {
-        if (!(value in Object.values(Persistence.options))) {
+        if (!Object.values(VersionInfo.options).includes(value)) {
             throw new Error("Value must be one of the enumerated options");
         }
         this.#value = value;
     }
 
     static fromMap(d) {
-        return Persistence[Persistence.optionsFlipped[d]];
+        return VersionInfo[VersionInfo.optionsFlipped[d]];
     }
 
     asMap() {
         return this.#value;
     }
 };
-Object.defineProperty(Persistence, "options", {
+Object.defineProperty(VersionInfo, "options", {
     value: {
-        File: 0,
-        Memory: 1,
+        PROTOCOL_VERSION: "1.1.0",
     }
 });
-Object.defineProperty(Persistence, "optionsFlipped", {
+Object.defineProperty(VersionInfo, "optionsFlipped", {
     value: {
-        0: "File",
-        1: "Memory",
+        "1.1.0": "PROTOCOL_VERSION",
     }
 });
 
 /**
- * @member {aws-greengrass-core-sdk.StreamManager.Persistence} File
- * @memberOf aws-greengrass-core-sdk.StreamManager.Persistence#
- * @readonly
- */
-Object.defineProperty(Persistence, "File", {
-    value: new Persistence(0)
-});
-/**
- * @member {aws-greengrass-core-sdk.StreamManager.Persistence} Memory
- * @memberOf aws-greengrass-core-sdk.StreamManager.Persistence#
+ * @member {aws-greengrass-core-sdk.StreamManager.VersionInfo} PROTOCOL_VERSION
+ * @memberOf aws-greengrass-core-sdk.StreamManager.VersionInfo#
  * @readonly
  */
-Object.defineProperty(Persistence, "Memory", {
-    value: new Persistence(1)
+Object.defineProperty(VersionInfo, "PROTOCOL_VERSION", {
+    value: new VersionInfo("1.1.0")
 });
 
 /**
- * (Internal Only) Request object to connect to the service
+ * (Internal Only) Request object to connect to the service.
  *
  * @class
  * @memberOf aws-greengrass-core-sdk.StreamManager
@@ -147,18 +79,21 @@ 

Source: stream-manager/data/index.js

class ConnectRequest { #__requestId = null; #__protocolVersion = null; + #__otherSupportedProtocolVersions = null; #__sdkVersion = null; #__authToken = null; /** * @param requestId {String} * @param protocolVersion {String} + * @param otherSupportedProtocolVersions {String[]} * @param sdkVersion {String} * @param authToken {String} */ constructor( requestId = null, protocolVersion = null, + otherSupportedProtocolVersions = null, sdkVersion = null, authToken = null, ) { @@ -170,6 +105,13 @@

Source: stream-manager/data/index.js

throw new Error("protocolVersion must be String"); } + if (otherSupportedProtocolVersions !== null && !(otherSupportedProtocolVersions instanceof Array)) { + throw new Error("otherSupportedProtocolVersions must be Array"); + } + if (otherSupportedProtocolVersions !== null && !otherSupportedProtocolVersions.every((v) => typeof v === "string")) { + throw new Error("otherSupportedProtocolVersions array values must be String"); + } + if (sdkVersion !== null && !(typeof sdkVersion === "string")) { throw new Error("sdkVersion must be String"); } @@ -180,6 +122,7 @@

Source: stream-manager/data/index.js

this.#__requestId = requestId; this.#__protocolVersion = protocolVersion; + this.#__otherSupportedProtocolVersions = otherSupportedProtocolVersions; this.#__sdkVersion = sdkVersion; this.#__authToken = authToken; } @@ -236,6 +179,35 @@

Source: stream-manager/data/index.js

return this; } + /** + * @returns {String[]} + + */ + get otherSupportedProtocolVersions() { + return this.#__otherSupportedProtocolVersions; + } + /** + * @param value {String[]} + */ + set otherSupportedProtocolVersions(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("otherSupportedProtocolVersions must be Array"); + } + if (value !== null && !value.every((v) => typeof v === "string")) { + throw new Error("otherSupportedProtocolVersions array values must be String"); + } + + this.#__otherSupportedProtocolVersions = value; + } + /** + * @param value {String[]} + * @returns {aws-greengrass-core-sdk.StreamManager.ConnectRequest} + */ + withOtherSupportedProtocolVersions(value) { + this.otherSupportedProtocolVersions = value; + return this; + } + /** * @returns {String} @@ -296,6 +268,12 @@

Source: stream-manager/data/index.js

if ("protocolVersion" in d) { ret.protocolVersion = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["protocolVersion"]) : d["protocolVersion"]; } + if ("otherSupportedProtocolVersions" in d) { + ret.otherSupportedProtocolVersions = d["otherSupportedProtocolVersions"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(v) : v); + return acc; + }, []); + } if ("sdkVersion" in d) { ret.sdkVersion = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["sdkVersion"]) : d["sdkVersion"]; } @@ -313,6 +291,12 @@

Source: stream-manager/data/index.js

if (this.protocolVersion !== null) { d["protocolVersion"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.protocolVersion), "asMap") ? this.protocolVersion.asMap() : this.protocolVersion; } + if (this.otherSupportedProtocolVersions !== null) { + d["otherSupportedProtocolVersions"] = this.otherSupportedProtocolVersions.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } if (this.sdkVersion !== null) { d["sdkVersion"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sdkVersion), "asMap") ? this.sdkVersion.asMap() : this.sdkVersion; } @@ -333,6 +317,10 @@

Source: stream-manager/data/index.js

'type': String, 'subtype': null }, + otherSupportedProtocolVersions: { + 'type': Array, + 'subtype': String + }, sdkVersion: { 'type': String, 'subtype': null @@ -356,6 +344,9 @@

Source: stream-manager/data/index.js

'protocolVersion': { 'required': true, }, + 'otherSupportedProtocolVersions': { + 'required': false, + }, 'sdkVersion': { 'required': false, }, @@ -383,6 +374,9 @@

Source: stream-manager/data/index.js

NotEnoughMessages: There is not enough messages to return. MessageStoreReadError: Read messages encountered an error. OutOfMemoryError: Server ran out of memory. + UpdateFailed: Update operation failed. + UpdateNotAllowed: One or more fields are not allowed to be updated. + UnknownOperation: Client request is not recognized by the server. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager @@ -391,7 +385,7 @@

Source: stream-manager/data/index.js

#value = null; constructor(value = null) { - if (!(value in Object.values(ResponseStatusCode.options))) { + if (!Object.values(ResponseStatusCode.options).includes(value)) { throw new Error("Value must be one of the enumerated options"); } this.#value = value; @@ -423,6 +417,9 @@

Source: stream-manager/data/index.js

NotEnoughMessages: 13, MessageStoreReadError: 14, OutOfMemoryError: 15, + UpdateFailed: 16, + UpdateNotAllowed: 17, + UnknownOperation: 18, } }); Object.defineProperty(ResponseStatusCode, "optionsFlipped", { @@ -443,6 +440,9 @@

Source: stream-manager/data/index.js

13: "NotEnoughMessages", 14: "MessageStoreReadError", 15: "OutOfMemoryError", + 16: "UpdateFailed", + 17: "UpdateNotAllowed", + 18: "UnknownOperation", } }); @@ -574,9 +574,33 @@

Source: stream-manager/data/index.js

Object.defineProperty(ResponseStatusCode, "OutOfMemoryError", { value: new ResponseStatusCode(15) }); +/** + * @member {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} UpdateFailed + * @memberOf aws-greengrass-core-sdk.StreamManager.ResponseStatusCode# + * @readonly + */ +Object.defineProperty(ResponseStatusCode, "UpdateFailed", { + value: new ResponseStatusCode(16) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} UpdateNotAllowed + * @memberOf aws-greengrass-core-sdk.StreamManager.ResponseStatusCode# + * @readonly + */ +Object.defineProperty(ResponseStatusCode, "UpdateNotAllowed", { + value: new ResponseStatusCode(17) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} UnknownOperation + * @memberOf aws-greengrass-core-sdk.StreamManager.ResponseStatusCode# + * @readonly + */ +Object.defineProperty(ResponseStatusCode, "UnknownOperation", { + value: new ResponseStatusCode(18) +}); /** - * Internal Only + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager @@ -956,7 +980,7 @@

Source: stream-manager/data/index.js

}); /** - * Internal Only + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager @@ -965,7 +989,7 @@

Source: stream-manager/data/index.js

#value = null; constructor(value = null) { - if (!(value in Object.values(Operation.options))) { + if (!Object.values(Operation.options).includes(value)) { throw new Error("Value must be one of the enumerated options"); } this.#value = value; @@ -996,6 +1020,9 @@

Source: stream-manager/data/index.js

ListStreamsResponse: 12, DescribeMessageStream: 13, DescribeMessageStreamResponse: 14, + UpdateMessageStream: 15, + UpdateMessageStreamResponse: 16, + UnknownOperationError: 17, } }); Object.defineProperty(Operation, "optionsFlipped", { @@ -1015,6 +1042,9 @@

Source: stream-manager/data/index.js

12: "ListStreamsResponse", 13: "DescribeMessageStream", 14: "DescribeMessageStreamResponse", + 15: "UpdateMessageStream", + 16: "UpdateMessageStreamResponse", + 17: "UnknownOperationError", } }); @@ -1138,9 +1168,33 @@

Source: stream-manager/data/index.js

Object.defineProperty(Operation, "DescribeMessageStreamResponse", { value: new Operation(14) }); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Operation} UpdateMessageStream + * @memberOf aws-greengrass-core-sdk.StreamManager.Operation# + * @readonly + */ +Object.defineProperty(Operation, "UpdateMessageStream", { + value: new Operation(15) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Operation} UpdateMessageStreamResponse + * @memberOf aws-greengrass-core-sdk.StreamManager.Operation# + * @readonly + */ +Object.defineProperty(Operation, "UpdateMessageStreamResponse", { + value: new Operation(16) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Operation} UnknownOperationError + * @memberOf aws-greengrass-core-sdk.StreamManager.Operation# + * @readonly + */ +Object.defineProperty(Operation, "UnknownOperationError", { + value: new Operation(17) +}); /** - * Internal Only + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager @@ -1271,2773 +1325,6380 @@

Source: stream-manager/data/index.js

}); /** - * This export destination is not supported! The interface may change at any time without notice and should not be relied on for any production use. - There are no guarantees around its correctness. - This configures an HTTP endpoint which sends a POST request to the provided URI. Each request contains a single message in the body of the request. + * The type of event, which determines how to interpret the status payload. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class HTTPConfig { - #__identifier = null; - #__uri = null; - #__batchSize = null; - #__batchIntervalMillis = null; - #__priority = null; +class EventType { - /** - * @param identifier {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @param uri {String} URL for HTTP endpoint which should receive the POST requests for export. - * @param batchSize {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum batch size is 1 and the maximum is 500. - * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. - */ - constructor( - identifier = null, - uri = null, - batchSize = null, - batchIntervalMillis = null, - priority = null, - ) { - if (identifier !== null && !(typeof identifier === "string")) { - throw new Error("identifier must be String"); + #value = null; + constructor(value = null) { + if (!Object.values(EventType.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); } + this.#value = value; + } - if (uri !== null && !(typeof uri === "string")) { - throw new Error("uri must be String"); - } + static fromMap(d) { + return EventType[EventType.optionsFlipped[d]]; + } - if (batchSize !== null && !(typeof batchSize === "number")) { - throw new Error("batchSize must be Number"); - } + asMap() { + return this.#value; + } +}; +Object.defineProperty(EventType, "options", { + value: { + S3Task: 0, + } +}); +Object.defineProperty(EventType, "optionsFlipped", { + value: { + 0: "S3Task", + } +}); - if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { - throw new Error("batchIntervalMillis must be Number"); - } +/** + * @member {aws-greengrass-core-sdk.StreamManager.EventType} S3Task + * @memberOf aws-greengrass-core-sdk.StreamManager.EventType# + * @readonly + */ +Object.defineProperty(EventType, "S3Task", { + value: new EventType(0) +}); - if (priority !== null && !(typeof priority === "number")) { - throw new Error("priority must be Number"); - } +/** + * The status of the event. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class Status { - this.#__identifier = identifier; - this.#__uri = uri; - this.#__batchSize = batchSize; - this.#__batchIntervalMillis = batchIntervalMillis; - this.#__priority = priority; + #value = null; + constructor(value = null) { + if (!Object.values(Status.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; } - /** - * A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {String} - - */ - get identifier() { - return this.#__identifier; + static fromMap(d) { + return Status[Status.optionsFlipped[d]]; } - /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - */ - set identifier(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("identifier must be String"); - } - this.#__identifier = value; + asMap() { + return this.#value; } - /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} - */ - withIdentifier(value) { - this.identifier = value; - return this; +}; +Object.defineProperty(Status, "options", { + value: { + Success: 0, + Failure: 1, + InProgress: 2, + Warning: 3, + Canceled: 4, } - - /** - * URL for HTTP endpoint which should receive the POST requests for export. +}); +Object.defineProperty(Status, "optionsFlipped", { + value: { + 0: "Success", + 1: "Failure", + 2: "InProgress", + 3: "Warning", + 4: "Canceled", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.Status} Success + * @memberOf aws-greengrass-core-sdk.StreamManager.Status# + * @readonly + */ +Object.defineProperty(Status, "Success", { + value: new Status(0) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Status} Failure + * @memberOf aws-greengrass-core-sdk.StreamManager.Status# + * @readonly + */ +Object.defineProperty(Status, "Failure", { + value: new Status(1) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Status} InProgress + * @memberOf aws-greengrass-core-sdk.StreamManager.Status# + * @readonly + */ +Object.defineProperty(Status, "InProgress", { + value: new Status(2) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Status} Warning + * @memberOf aws-greengrass-core-sdk.StreamManager.Status# + * @readonly + */ +Object.defineProperty(Status, "Warning", { + value: new Status(3) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Status} Canceled + * @memberOf aws-greengrass-core-sdk.StreamManager.Status# + * @readonly + */ +Object.defineProperty(Status, "Canceled", { + value: new Status(4) +}); + +/** + * Defines the verbosity of status messages in a status-stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class StatusLevel { + + #value = null; + constructor(value = null) { + if (!Object.values(StatusLevel.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; + } + + static fromMap(d) { + return StatusLevel[StatusLevel.optionsFlipped[d]]; + } + + asMap() { + return this.#value; + } +}; +Object.defineProperty(StatusLevel, "options", { + value: { + ERROR: 0, + WARN: 1, + INFO: 2, + DEBUG: 3, + TRACE: 4, + } +}); +Object.defineProperty(StatusLevel, "optionsFlipped", { + value: { + 0: "ERROR", + 1: "WARN", + 2: "INFO", + 3: "DEBUG", + 4: "TRACE", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.StatusLevel} ERROR + * @memberOf aws-greengrass-core-sdk.StreamManager.StatusLevel# + * @readonly + */ +Object.defineProperty(StatusLevel, "ERROR", { + value: new StatusLevel(0) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.StatusLevel} WARN + * @memberOf aws-greengrass-core-sdk.StreamManager.StatusLevel# + * @readonly + */ +Object.defineProperty(StatusLevel, "WARN", { + value: new StatusLevel(1) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.StatusLevel} INFO + * @memberOf aws-greengrass-core-sdk.StreamManager.StatusLevel# + * @readonly + */ +Object.defineProperty(StatusLevel, "INFO", { + value: new StatusLevel(2) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.StatusLevel} DEBUG + * @memberOf aws-greengrass-core-sdk.StreamManager.StatusLevel# + * @readonly + */ +Object.defineProperty(StatusLevel, "DEBUG", { + value: new StatusLevel(3) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.StatusLevel} TRACE + * @memberOf aws-greengrass-core-sdk.StreamManager.StatusLevel# + * @readonly + */ +Object.defineProperty(StatusLevel, "TRACE", { + value: new StatusLevel(4) +}); + +/** + * S3 Task definition containing all the information necessary to export the data to S3. This will contain the S3 bucket and key as well as the file's URL where the data is stored. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class S3ExportTaskDefinition { + #__inputUrl = null; + #__bucket = null; + #__key = null; + #__userMetadata = null; + + /** + * @param inputUrl {String} The URL of the file that contains the data to upload. The file should be local on the disk. + * @param bucket {String} The name of the S3 bucket that this file should be uploaded to. + * @param key {String} The key for the S3 object that this file should be uploaded to. + The string can have placeholder expressions which are resolved at upload time. Valid expressions are strings that are valid Java DateTimeFormatter strings. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html + Example: myKeyNamePrefix/!{timestamp:yyyy/MM/dd}/myKeyNameSuffix. + * @param userMetadata {Object} User metadata. For key of a user metadata, callers should not include the internal "x-amz-meta-" prefix. Keys are case insensitive and will appear as lowercase strings on S3, even if they were originally specified with uppercase strings. Reserved key names start with "$aws-gg-" prefix. + */ + constructor( + inputUrl = null, + bucket = null, + key = null, + userMetadata = null, + ) { + if (inputUrl !== null && !(typeof inputUrl === "string")) { + throw new Error("inputUrl must be String"); + } + + if (bucket !== null && !(typeof bucket === "string")) { + throw new Error("bucket must be String"); + } + + if (key !== null && !(typeof key === "string")) { + throw new Error("key must be String"); + } + + if (userMetadata !== null && !(userMetadata instanceof Object)) { + throw new Error("userMetadata must be Object"); + } + + this.#__inputUrl = inputUrl; + this.#__bucket = bucket; + this.#__key = key; + this.#__userMetadata = userMetadata; + } + + /** + * The URL of the file that contains the data to upload. The file should be local on the disk. * @returns {String} */ - get uri() { - return this.#__uri; + get inputUrl() { + return this.#__inputUrl; } /** - * @param value {String} URL for HTTP endpoint which should receive the POST requests for export. + * @param value {String} The URL of the file that contains the data to upload. The file should be local on the disk. */ - set uri(value) { + set inputUrl(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("uri must be String"); + throw new Error("inputUrl must be String"); } - this.#__uri = value; + this.#__inputUrl = value; } /** - * @param value {String} URL for HTTP endpoint which should receive the POST requests for export. - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + * @param value {String} The URL of the file that contains the data to upload. The file should be local on the disk. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} */ - withUri(value) { - this.uri = value; + withInputUrl(value) { + this.inputUrl = value; return this; } /** - * The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum batch size is 1 and the maximum is 500. - * @returns {Number} - + * The name of the S3 bucket that this file should be uploaded to. + * @returns {String} + */ - get batchSize() { - return this.#__batchSize; + get bucket() { + return this.#__bucket; } /** - * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum batch size is 1 and the maximum is 500. + * @param value {String} The name of the S3 bucket that this file should be uploaded to. */ - set batchSize(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchSize must be Number"); + set bucket(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("bucket must be String"); } - this.#__batchSize = value; + this.#__bucket = value; } /** - * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum batch size is 1 and the maximum is 500. - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + * @param value {String} The name of the S3 bucket that this file should be uploaded to. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} */ - withBatchSize(value) { - this.batchSize = value; + withBucket(value) { + this.bucket = value; return this; } /** - * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {Number} + * The key for the S3 object that this file should be uploaded to. + The string can have placeholder expressions which are resolved at upload time. Valid expressions are strings that are valid Java DateTimeFormatter strings. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html + Example: myKeyNamePrefix/!{timestamp:yyyy/MM/dd}/myKeyNameSuffix. + * @returns {String} */ - get batchIntervalMillis() { - return this.#__batchIntervalMillis; + get key() { + return this.#__key; } /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param value {String} The key for the S3 object that this file should be uploaded to. + The string can have placeholder expressions which are resolved at upload time. Valid expressions are strings that are valid Java DateTimeFormatter strings. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html + Example: myKeyNamePrefix/!{timestamp:yyyy/MM/dd}/myKeyNameSuffix. */ - set batchIntervalMillis(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchIntervalMillis must be Number"); + set key(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("key must be String"); } - this.#__batchIntervalMillis = value; + this.#__key = value; } /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + * @param value {String} The key for the S3 object that this file should be uploaded to. + The string can have placeholder expressions which are resolved at upload time. Valid expressions are strings that are valid Java DateTimeFormatter strings. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html + Example: myKeyNamePrefix/!{timestamp:yyyy/MM/dd}/myKeyNameSuffix. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} */ - withBatchIntervalMillis(value) { - this.batchIntervalMillis = value; + withKey(value) { + this.key = value; return this; } /** - * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. - * @returns {Number} + * User metadata. For key of a user metadata, callers should not include the internal "x-amz-meta-" prefix. Keys are case insensitive and will appear as lowercase strings on S3, even if they were originally specified with uppercase strings. Reserved key names start with "$aws-gg-" prefix. + * @returns {Object} */ - get priority() { - return this.#__priority; + get userMetadata() { + return this.#__userMetadata; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param value {Object} User metadata. For key of a user metadata, callers should not include the internal "x-amz-meta-" prefix. Keys are case insensitive and will appear as lowercase strings on S3, even if they were originally specified with uppercase strings. Reserved key names start with "$aws-gg-" prefix. */ - set priority(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("priority must be Number"); + set userMetadata(value) { + if (value !== null && !(value instanceof Object)) { + throw new Error("userMetadata must be Object"); } - this.#__priority = value; + this.#__userMetadata = value; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + * @param value {Object} User metadata. For key of a user metadata, callers should not include the internal "x-amz-meta-" prefix. Keys are case insensitive and will appear as lowercase strings on S3, even if they were originally specified with uppercase strings. Reserved key names start with "$aws-gg-" prefix. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} */ - withPriority(value) { - this.priority = value; + withUserMetadata(value) { + this.userMetadata = value; return this; } static fromMap(d) { - const ret = new HTTPConfig(); - if ("identifier" in d) { - ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; - } - if ("uri" in d) { - ret.uri = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["uri"]) : d["uri"]; + const ret = new S3ExportTaskDefinition(); + if ("inputUrl" in d) { + ret.inputUrl = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["inputUrl"]) : d["inputUrl"]; } - if ("batchSize" in d) { - ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + if ("bucket" in d) { + ret.bucket = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["bucket"]) : d["bucket"]; } - if ("batchIntervalMillis" in d) { - ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + if ("key" in d) { + ret.key = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["key"]) : d["key"]; } - if ("priority" in d) { - ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + if ("userMetadata" in d) { + ret.userMetadata = Object.prototype.hasOwnProperty.call(Object, "fromMap") ? Object.fromMap(d["userMetadata"]) : d["userMetadata"]; } return ret; } asMap() { const d = {}; - if (this.identifier !== null) { - d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; - } - if (this.uri !== null) { - d["uri"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.uri), "asMap") ? this.uri.asMap() : this.uri; + if (this.inputUrl !== null) { + d["inputUrl"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.inputUrl), "asMap") ? this.inputUrl.asMap() : this.inputUrl; } - if (this.batchSize !== null) { - d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + if (this.bucket !== null) { + d["bucket"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.bucket), "asMap") ? this.bucket.asMap() : this.bucket; } - if (this.batchIntervalMillis !== null) { - d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + if (this.key !== null) { + d["key"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.key), "asMap") ? this.key.asMap() : this.key; } - if (this.priority !== null) { - d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + if (this.userMetadata !== null) { + d["userMetadata"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.userMetadata), "asMap") ? this.userMetadata.asMap() : this.userMetadata; } return d; } }; -Object.defineProperty(HTTPConfig, "typesMap", { +Object.defineProperty(S3ExportTaskDefinition, "typesMap", { value: { - identifier: { + inputUrl: { 'type': String, 'subtype': null }, - uri: { + bucket: { 'type': String, 'subtype': null }, - batchSize: { - 'type': Number, - 'subtype': null - }, - batchIntervalMillis: { - 'type': Number, + key: { + 'type': String, 'subtype': null }, - priority: { - 'type': Number, + userMetadata: { + 'type': Object, 'subtype': null }, } }); -Object.defineProperty(HTTPConfig, "formatsMap", { +Object.defineProperty(S3ExportTaskDefinition, "formatsMap", { value: {} }); -Object.defineProperty(HTTPConfig, "validationsMap", { +Object.defineProperty(S3ExportTaskDefinition, "validationsMap", { value: { - 'identifier': { + 'inputUrl': { 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, }, - 'uri': { + 'bucket': { 'required': true, - 'minLength': 1, - }, - 'batchSize': { - 'required': false, - 'maximum': 500, - 'minimum': 1, + 'minLength': 3, + 'maxLength': 63, + 'pattern': /(?=^.{3,63}$)(?!^(\d+\.)+\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$)/, }, - 'batchIntervalMillis': { - 'required': false, - 'maximum': 9223372036854, - 'minimum': 60000, + 'key': { + 'required': true, + 'minLength': 1, + 'maxLength': 1024, + 'pattern': /^([^\\\{ \}%\`\[\]\"\'\>\<\~\#\^\?\|]|!\{[a-zA-Z]+:[a-zA-Z\/]+\})*$/, }, - 'priority': { + 'userMetadata': { 'required': false, - 'maximum': 10, - 'minimum': 1, }, } }); /** - * Configuration object for IoT Analytics export destination. + * Context associated with a status message. Describes which stream, export config, message, the status is associated with. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class IoTAnalyticsConfig { - #__identifier = null; - #__iotChannel = null; - #__iotMsgIdPrefix = null; - #__batchSize = null; - #__batchIntervalMillis = null; - #__priority = null; +class StatusContext { + #__s3ExportTaskDefinition = null; + #__exportIdentifier = null; + #__streamName = null; + #__sequenceNumber = null; /** - * @param identifier {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @param iotChannel {String} The name of the IoT Analytics Channel that this exporter should upload to - * @param iotMsgIdPrefix {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. - This prefix must be less than 32 characters. - * @param batchSize {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 100. - * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param s3ExportTaskDefinition {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} The task definition of an S3 upload task if the status is associated with it, ie, if the eventType = S3Task. + * @param exportIdentifier {String} The export identifier the status is associated with. + * @param streamName {String} The name of the stream the status is associated with. + * @param sequenceNumber {Number} The sequence number of the message the status is associated with. */ constructor( - identifier = null, - iotChannel = null, - iotMsgIdPrefix = null, - batchSize = null, - batchIntervalMillis = null, - priority = null, + s3ExportTaskDefinition = null, + exportIdentifier = null, + streamName = null, + sequenceNumber = null, ) { - if (identifier !== null && !(typeof identifier === "string")) { - throw new Error("identifier must be String"); + if (s3ExportTaskDefinition !== null && !(s3ExportTaskDefinition instanceof S3ExportTaskDefinition)) { + throw new Error("s3ExportTaskDefinition must be S3ExportTaskDefinition"); } - if (iotChannel !== null && !(typeof iotChannel === "string")) { - throw new Error("iotChannel must be String"); + if (exportIdentifier !== null && !(typeof exportIdentifier === "string")) { + throw new Error("exportIdentifier must be String"); } - if (iotMsgIdPrefix !== null && !(typeof iotMsgIdPrefix === "string")) { - throw new Error("iotMsgIdPrefix must be String"); + if (streamName !== null && !(typeof streamName === "string")) { + throw new Error("streamName must be String"); } - if (batchSize !== null && !(typeof batchSize === "number")) { - throw new Error("batchSize must be Number"); - } - - if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { - throw new Error("batchIntervalMillis must be Number"); - } - - if (priority !== null && !(typeof priority === "number")) { - throw new Error("priority must be Number"); + if (sequenceNumber !== null && !(typeof sequenceNumber === "number")) { + throw new Error("sequenceNumber must be Number"); } - this.#__identifier = identifier; - this.#__iotChannel = iotChannel; - this.#__iotMsgIdPrefix = iotMsgIdPrefix; - this.#__batchSize = batchSize; - this.#__batchIntervalMillis = batchIntervalMillis; - this.#__priority = priority; + this.#__s3ExportTaskDefinition = s3ExportTaskDefinition; + this.#__exportIdentifier = exportIdentifier; + this.#__streamName = streamName; + this.#__sequenceNumber = sequenceNumber; } /** - * A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {String} - + * The task definition of an S3 upload task if the status is associated with it, ie, if the eventType = S3Task. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} + */ - get identifier() { - return this.#__identifier; + get s3ExportTaskDefinition() { + return this.#__s3ExportTaskDefinition; } /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param value {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} The task definition of an S3 upload task if the status is associated with it, ie, if the eventType = S3Task. */ - set identifier(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("identifier must be String"); + set s3ExportTaskDefinition(value) { + if (value !== null && !(value instanceof S3ExportTaskDefinition)) { + throw new Error("s3ExportTaskDefinition must be S3ExportTaskDefinition"); } - this.#__identifier = value; + this.#__s3ExportTaskDefinition = value; } /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + * @param value {aws-greengrass-core-sdk.StreamManager.S3ExportTaskDefinition} The task definition of an S3 upload task if the status is associated with it, ie, if the eventType = S3Task. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusContext} */ - withIdentifier(value) { - this.identifier = value; + withS3ExportTaskDefinition(value) { + this.s3ExportTaskDefinition = value; return this; } /** - * The name of the IoT Analytics Channel that this exporter should upload to + * The export identifier the status is associated with. * @returns {String} */ - get iotChannel() { - return this.#__iotChannel; + get exportIdentifier() { + return this.#__exportIdentifier; } /** - * @param value {String} The name of the IoT Analytics Channel that this exporter should upload to + * @param value {String} The export identifier the status is associated with. */ - set iotChannel(value) { + set exportIdentifier(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("iotChannel must be String"); + throw new Error("exportIdentifier must be String"); } - this.#__iotChannel = value; + this.#__exportIdentifier = value; } /** - * @param value {String} The name of the IoT Analytics Channel that this exporter should upload to - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + * @param value {String} The export identifier the status is associated with. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusContext} */ - withIotChannel(value) { - this.iotChannel = value; + withExportIdentifier(value) { + this.exportIdentifier = value; return this; } /** - * A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. - This prefix must be less than 32 characters. + * The name of the stream the status is associated with. * @returns {String} - + */ - get iotMsgIdPrefix() { - return this.#__iotMsgIdPrefix; + get streamName() { + return this.#__streamName; } /** - * @param value {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. - This prefix must be less than 32 characters. + * @param value {String} The name of the stream the status is associated with. */ - set iotMsgIdPrefix(value) { + set streamName(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("iotMsgIdPrefix must be String"); - } - - this.#__iotMsgIdPrefix = value; - } - /** - * @param value {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. - This prefix must be less than 32 characters. - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} - */ - withIotMsgIdPrefix(value) { - this.iotMsgIdPrefix = value; - return this; - } - - /** - * The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 100. - * @returns {Number} - - */ - get batchSize() { - return this.#__batchSize; - } - /** - * @param value {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 100. - */ - set batchSize(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchSize must be Number"); - } - - this.#__batchSize = value; - } - /** - * @param value {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 100. - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} - */ - withBatchSize(value) { - this.batchSize = value; - return this; - } - - /** - * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {Number} - - */ - get batchIntervalMillis() { - return this.#__batchIntervalMillis; - } - /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - */ - set batchIntervalMillis(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchIntervalMillis must be Number"); + throw new Error("streamName must be String"); } - this.#__batchIntervalMillis = value; + this.#__streamName = value; } /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + * @param value {String} The name of the stream the status is associated with. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusContext} */ - withBatchIntervalMillis(value) { - this.batchIntervalMillis = value; + withStreamName(value) { + this.streamName = value; return this; } /** - * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * The sequence number of the message the status is associated with. * @returns {Number} */ - get priority() { - return this.#__priority; + get sequenceNumber() { + return this.#__sequenceNumber; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param value {Number} The sequence number of the message the status is associated with. */ - set priority(value) { + set sequenceNumber(value) { if (value !== null && !(typeof value === "number")) { - throw new Error("priority must be Number"); + throw new Error("sequenceNumber must be Number"); } - this.#__priority = value; + this.#__sequenceNumber = value; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + * @param value {Number} The sequence number of the message the status is associated with. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusContext} */ - withPriority(value) { - this.priority = value; + withSequenceNumber(value) { + this.sequenceNumber = value; return this; } static fromMap(d) { - const ret = new IoTAnalyticsConfig(); - if ("identifier" in d) { - ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; - } - if ("iotChannel" in d) { - ret.iotChannel = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["iotChannel"]) : d["iotChannel"]; - } - if ("iotMsgIdPrefix" in d) { - ret.iotMsgIdPrefix = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["iotMsgIdPrefix"]) : d["iotMsgIdPrefix"]; + const ret = new StatusContext(); + if ("s3ExportTaskDefinition" in d) { + ret.s3ExportTaskDefinition = Object.prototype.hasOwnProperty.call(S3ExportTaskDefinition, "fromMap") ? S3ExportTaskDefinition.fromMap(d["s3ExportTaskDefinition"]) : d["s3ExportTaskDefinition"]; } - if ("batchSize" in d) { - ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + if ("exportIdentifier" in d) { + ret.exportIdentifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["exportIdentifier"]) : d["exportIdentifier"]; } - if ("batchIntervalMillis" in d) { - ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + if ("streamName" in d) { + ret.streamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["streamName"]) : d["streamName"]; } - if ("priority" in d) { - ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + if ("sequenceNumber" in d) { + ret.sequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sequenceNumber"]) : d["sequenceNumber"]; } return ret; } asMap() { const d = {}; - if (this.identifier !== null) { - d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + if (this.s3ExportTaskDefinition !== null) { + d["s3ExportTaskDefinition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.s3ExportTaskDefinition), "asMap") ? this.s3ExportTaskDefinition.asMap() : this.s3ExportTaskDefinition; } - if (this.iotChannel !== null) { - d["iotChannel"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.iotChannel), "asMap") ? this.iotChannel.asMap() : this.iotChannel; - } - if (this.iotMsgIdPrefix !== null) { - d["iotMsgIdPrefix"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.iotMsgIdPrefix), "asMap") ? this.iotMsgIdPrefix.asMap() : this.iotMsgIdPrefix; - } - if (this.batchSize !== null) { - d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + if (this.exportIdentifier !== null) { + d["exportIdentifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportIdentifier), "asMap") ? this.exportIdentifier.asMap() : this.exportIdentifier; } - if (this.batchIntervalMillis !== null) { - d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + if (this.streamName !== null) { + d["streamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamName), "asMap") ? this.streamName.asMap() : this.streamName; } - if (this.priority !== null) { - d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + if (this.sequenceNumber !== null) { + d["sequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sequenceNumber), "asMap") ? this.sequenceNumber.asMap() : this.sequenceNumber; } return d; } }; -Object.defineProperty(IoTAnalyticsConfig, "typesMap", { +Object.defineProperty(StatusContext, "typesMap", { value: { - identifier: { - 'type': String, + s3ExportTaskDefinition: { + 'type': S3ExportTaskDefinition, 'subtype': null }, - iotChannel: { + exportIdentifier: { 'type': String, 'subtype': null }, - iotMsgIdPrefix: { + streamName: { 'type': String, 'subtype': null }, - batchSize: { - 'type': Number, - 'subtype': null - }, - batchIntervalMillis: { - 'type': Number, - 'subtype': null - }, - priority: { + sequenceNumber: { 'type': Number, 'subtype': null }, } }); -Object.defineProperty(IoTAnalyticsConfig, "formatsMap", { +Object.defineProperty(StatusContext, "formatsMap", { value: {} }); -Object.defineProperty(IoTAnalyticsConfig, "validationsMap", { +Object.defineProperty(StatusContext, "validationsMap", { value: { - 'identifier': { - 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, - }, - 'iotChannel': { - 'required': true, - 'minLength': 1, - }, - 'iotMsgIdPrefix': { + 's3ExportTaskDefinition': { 'required': false, - 'maxLength': 32, }, - 'batchSize': { + 'exportIdentifier': { 'required': false, - 'maximum': 100, - 'minimum': 1, }, - 'batchIntervalMillis': { + 'streamName': { 'required': false, - 'maximum': 9223372036854, - 'minimum': 60000, }, - 'priority': { + 'sequenceNumber': { 'required': false, - 'maximum': 10, - 'minimum': 1, }, } }); /** - * Configuration object for Kinesis data streams export destination. + * Status object appended to a status-stream. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class KinesisConfig { - #__identifier = null; - #__kinesisStreamName = null; - #__batchSize = null; - #__batchIntervalMillis = null; - #__priority = null; +class StatusMessage { + #__eventType = null; + #__statusLevel = null; + #__status = null; + #__statusContext = null; + #__message = null; + #__timestampEpochMs = null; /** - * @param identifier {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @param kinesisStreamName {String} The name of the Kinesis data stream that this exporter should upload to - * @param batchSize {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 500. - * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param eventType {aws-greengrass-core-sdk.StreamManager.EventType} + * @param statusLevel {aws-greengrass-core-sdk.StreamManager.StatusLevel} + * @param status {aws-greengrass-core-sdk.StreamManager.Status} + * @param statusContext {aws-greengrass-core-sdk.StreamManager.StatusContext} + * @param message {String} String describing the status message. + * @param timestampEpochMs {Number} The time this status was added to the status-stream (in milliseconds since epoch). */ constructor( - identifier = null, - kinesisStreamName = null, - batchSize = null, - batchIntervalMillis = null, - priority = null, + eventType = null, + statusLevel = null, + status = null, + statusContext = null, + message = null, + timestampEpochMs = null, ) { - if (identifier !== null && !(typeof identifier === "string")) { - throw new Error("identifier must be String"); + if (eventType !== null && !(eventType instanceof EventType)) { + throw new Error("eventType must be EventType"); } - if (kinesisStreamName !== null && !(typeof kinesisStreamName === "string")) { - throw new Error("kinesisStreamName must be String"); + if (statusLevel !== null && !(statusLevel instanceof StatusLevel)) { + throw new Error("statusLevel must be StatusLevel"); } - if (batchSize !== null && !(typeof batchSize === "number")) { - throw new Error("batchSize must be Number"); + if (status !== null && !(status instanceof Status)) { + throw new Error("status must be Status"); } - if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { - throw new Error("batchIntervalMillis must be Number"); + if (statusContext !== null && !(statusContext instanceof StatusContext)) { + throw new Error("statusContext must be StatusContext"); } - if (priority !== null && !(typeof priority === "number")) { - throw new Error("priority must be Number"); + if (message !== null && !(typeof message === "string")) { + throw new Error("message must be String"); } - this.#__identifier = identifier; - this.#__kinesisStreamName = kinesisStreamName; - this.#__batchSize = batchSize; - this.#__batchIntervalMillis = batchIntervalMillis; - this.#__priority = priority; + if (timestampEpochMs !== null && !(typeof timestampEpochMs === "number")) { + throw new Error("timestampEpochMs must be Number"); + } + + this.#__eventType = eventType; + this.#__statusLevel = statusLevel; + this.#__status = status; + this.#__statusContext = statusContext; + this.#__message = message; + this.#__timestampEpochMs = timestampEpochMs; } /** - * A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {String} - + * @returns {aws-greengrass-core-sdk.StreamManager.EventType} + */ - get identifier() { - return this.#__identifier; + get eventType() { + return this.#__eventType; } /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param value {aws-greengrass-core-sdk.StreamManager.EventType} */ - set identifier(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("identifier must be String"); + set eventType(value) { + if (value !== null && !(value instanceof EventType)) { + throw new Error("eventType must be EventType"); } - this.#__identifier = value; + this.#__eventType = value; } /** - * @param value {String} A unique identifier to identify this individual upload stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + * @param value {aws-greengrass-core-sdk.StreamManager.EventType} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - withIdentifier(value) { - this.identifier = value; + withEventType(value) { + this.eventType = value; return this; } /** - * The name of the Kinesis data stream that this exporter should upload to - * @returns {String} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusLevel} */ - get kinesisStreamName() { - return this.#__kinesisStreamName; + get statusLevel() { + return this.#__statusLevel; } /** - * @param value {String} The name of the Kinesis data stream that this exporter should upload to + * @param value {aws-greengrass-core-sdk.StreamManager.StatusLevel} */ - set kinesisStreamName(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("kinesisStreamName must be String"); + set statusLevel(value) { + if (value !== null && !(value instanceof StatusLevel)) { + throw new Error("statusLevel must be StatusLevel"); } - this.#__kinesisStreamName = value; + this.#__statusLevel = value; } /** - * @param value {String} The name of the Kinesis data stream that this exporter should upload to - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + * @param value {aws-greengrass-core-sdk.StreamManager.StatusLevel} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - withKinesisStreamName(value) { - this.kinesisStreamName = value; + withStatusLevel(value) { + this.statusLevel = value; return this; } /** - * The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 500. - * @returns {Number} - + * @returns {aws-greengrass-core-sdk.StreamManager.Status} + */ - get batchSize() { - return this.#__batchSize; + get status() { + return this.#__status; } /** - * @param value {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 500. + * @param value {aws-greengrass-core-sdk.StreamManager.Status} */ - set batchSize(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchSize must be Number"); + set status(value) { + if (value !== null && !(value instanceof Status)) { + throw new Error("status must be Status"); } - this.#__batchSize = value; + this.#__status = value; } /** - * @param value {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 1. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The batch size must be between 1 and 500. - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + * @param value {aws-greengrass-core-sdk.StreamManager.Status} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - withBatchSize(value) { - this.batchSize = value; + withStatus(value) { + this.status = value; return this; } /** - * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {Number} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusContext} + + */ + get statusContext() { + return this.#__statusContext; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusContext} + */ + set statusContext(value) { + if (value !== null && !(value instanceof StatusContext)) { + throw new Error("statusContext must be StatusContext"); + } + this.#__statusContext = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusContext} + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - get batchIntervalMillis() { - return this.#__batchIntervalMillis; + withStatusContext(value) { + this.statusContext = value; + return this; } + /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * String describing the status message. + * @returns {String} + */ - set batchIntervalMillis(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("batchIntervalMillis must be Number"); + get message() { + return this.#__message; + } + /** + * @param value {String} String describing the status message. + */ + set message(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("message must be String"); } - this.#__batchIntervalMillis = value; + this.#__message = value; } /** - * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. - If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + * @param value {String} String describing the status message. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - withBatchIntervalMillis(value) { - this.batchIntervalMillis = value; + withMessage(value) { + this.message = value; return this; } /** - * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * The time this status was added to the status-stream (in milliseconds since epoch). * @returns {Number} */ - get priority() { - return this.#__priority; + get timestampEpochMs() { + return this.#__timestampEpochMs; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param value {Number} The time this status was added to the status-stream (in milliseconds since epoch). */ - set priority(value) { + set timestampEpochMs(value) { if (value !== null && !(typeof value === "number")) { - throw new Error("priority must be Number"); + throw new Error("timestampEpochMs must be Number"); } - this.#__priority = value; + this.#__timestampEpochMs = value; } /** - * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + * @param value {Number} The time this status was added to the status-stream (in milliseconds since epoch). + * @returns {aws-greengrass-core-sdk.StreamManager.StatusMessage} */ - withPriority(value) { - this.priority = value; + withTimestampEpochMs(value) { + this.timestampEpochMs = value; return this; } static fromMap(d) { - const ret = new KinesisConfig(); - if ("identifier" in d) { - ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; + const ret = new StatusMessage(); + if ("eventType" in d) { + ret.eventType = Object.prototype.hasOwnProperty.call(EventType, "fromMap") ? EventType.fromMap(d["eventType"]) : d["eventType"]; } - if ("kinesisStreamName" in d) { - ret.kinesisStreamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["kinesisStreamName"]) : d["kinesisStreamName"]; + if ("statusLevel" in d) { + ret.statusLevel = Object.prototype.hasOwnProperty.call(StatusLevel, "fromMap") ? StatusLevel.fromMap(d["statusLevel"]) : d["statusLevel"]; } - if ("batchSize" in d) { - ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(Status, "fromMap") ? Status.fromMap(d["status"]) : d["status"]; } - if ("batchIntervalMillis" in d) { - ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + if ("statusContext" in d) { + ret.statusContext = Object.prototype.hasOwnProperty.call(StatusContext, "fromMap") ? StatusContext.fromMap(d["statusContext"]) : d["statusContext"]; } - if ("priority" in d) { - ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + if ("message" in d) { + ret.message = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["message"]) : d["message"]; + } + if ("timestampEpochMs" in d) { + ret.timestampEpochMs = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["timestampEpochMs"]) : d["timestampEpochMs"]; } return ret; } asMap() { const d = {}; - if (this.identifier !== null) { - d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + if (this.eventType !== null) { + d["eventType"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.eventType), "asMap") ? this.eventType.asMap() : this.eventType; } - if (this.kinesisStreamName !== null) { - d["kinesisStreamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.kinesisStreamName), "asMap") ? this.kinesisStreamName.asMap() : this.kinesisStreamName; + if (this.statusLevel !== null) { + d["statusLevel"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.statusLevel), "asMap") ? this.statusLevel.asMap() : this.statusLevel; } - if (this.batchSize !== null) { - d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; } - if (this.batchIntervalMillis !== null) { - d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + if (this.statusContext !== null) { + d["statusContext"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.statusContext), "asMap") ? this.statusContext.asMap() : this.statusContext; } - if (this.priority !== null) { - d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + if (this.message !== null) { + d["message"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.message), "asMap") ? this.message.asMap() : this.message; + } + if (this.timestampEpochMs !== null) { + d["timestampEpochMs"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.timestampEpochMs), "asMap") ? this.timestampEpochMs.asMap() : this.timestampEpochMs; } return d; } }; -Object.defineProperty(KinesisConfig, "typesMap", { +Object.defineProperty(StatusMessage, "typesMap", { value: { - identifier: { - 'type': String, + eventType: { + 'type': EventType, 'subtype': null }, - kinesisStreamName: { - 'type': String, + statusLevel: { + 'type': StatusLevel, 'subtype': null }, - batchSize: { - 'type': Number, + status: { + 'type': Status, 'subtype': null }, - batchIntervalMillis: { - 'type': Number, + statusContext: { + 'type': StatusContext, 'subtype': null }, - priority: { + message: { + 'type': String, + 'subtype': null + }, + timestampEpochMs: { 'type': Number, 'subtype': null }, } }); -Object.defineProperty(KinesisConfig, "formatsMap", { +Object.defineProperty(StatusMessage, "formatsMap", { value: {} }); -Object.defineProperty(KinesisConfig, "validationsMap", { +Object.defineProperty(StatusMessage, "validationsMap", { value: { - 'identifier': { + 'eventType': { 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, }, - 'kinesisStreamName': { + 'statusLevel': { + 'required': false, + }, + 'status': { 'required': true, - 'minLength': 1, }, - 'batchSize': { + 'statusContext': { 'required': false, - 'maximum': 500, - 'minimum': 1, }, - 'batchIntervalMillis': { + 'message': { 'required': false, - 'maximum': 9223372036854, - 'minimum': 60000, }, - 'priority': { + 'timestampEpochMs': { 'required': false, - 'maximum': 10, - 'minimum': 1, }, } }); /** - * Defines how and where the stream is uploaded + * (Internal Only) TraceableRequest that contains only requestId. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class ExportDefinition { - #__http = null; - #__iotAnalytics = null; - #__kinesis = null; +class TraceableRequest { + #__requestId = null; /** - * @param http {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint - * @param iotAnalytics {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics - * @param kinesis {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis + * @param requestId {String} */ constructor( - http = null, - iotAnalytics = null, - kinesis = null, + requestId = null, ) { - if (http !== null && !(http instanceof Array)) { - throw new Error("http must be Array"); - } - if (http !== null && !http.every((v) => v instanceof HTTPConfig)) { - throw new Error("http array values must be HTTPConfig"); - } - - if (iotAnalytics !== null && !(iotAnalytics instanceof Array)) { - throw new Error("iotAnalytics must be Array"); - } - if (iotAnalytics !== null && !iotAnalytics.every((v) => v instanceof IoTAnalyticsConfig)) { - throw new Error("iotAnalytics array values must be IoTAnalyticsConfig"); - } - - if (kinesis !== null && !(kinesis instanceof Array)) { - throw new Error("kinesis must be Array"); - } - if (kinesis !== null && !kinesis.every((v) => v instanceof KinesisConfig)) { - throw new Error("kinesis array values must be KinesisConfig"); + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); } - this.#__http = http; - this.#__iotAnalytics = iotAnalytics; - this.#__kinesis = kinesis; + this.#__requestId = requestId; } /** - * Defines how the stream is uploaded to an HTTP endpoint - * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} + * @returns {String} */ - get http() { - return this.#__http; + get requestId() { + return this.#__requestId; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint + * @param value {String} */ - set http(value) { - if (value !== null && !(value instanceof Array)) { - throw new Error("http must be Array"); - } - if (value !== null && !value.every((v) => v instanceof HTTPConfig)) { - throw new Error("http array values must be HTTPConfig"); + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); } - this.#__http = value; + this.#__requestId = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint - * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.TraceableRequest} */ - withHttp(value) { - this.http = value; + withRequestId(value) { + this.requestId = value; return this; } - /** - * Defines how the stream is uploaded to IoT Analytics - * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} - - */ - get iotAnalytics() { - return this.#__iotAnalytics; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics - */ - set iotAnalytics(value) { - if (value !== null && !(value instanceof Array)) { - throw new Error("iotAnalytics must be Array"); - } - if (value !== null && !value.every((v) => v instanceof IoTAnalyticsConfig)) { - throw new Error("iotAnalytics array values must be IoTAnalyticsConfig"); + static fromMap(d) { + const ret = new TraceableRequest(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - - this.#__iotAnalytics = value; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics - * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} - */ - withIotAnalytics(value) { - this.iotAnalytics = value; - return this; - } - - /** - * Defines how the stream is uploaded to Kinesis - * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} - - */ - get kinesis() { - return this.#__kinesis; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis - */ - set kinesis(value) { - if (value !== null && !(value instanceof Array)) { - throw new Error("kinesis must be Array"); - } - if (value !== null && !value.every((v) => v instanceof KinesisConfig)) { - throw new Error("kinesis array values must be KinesisConfig"); - } - - this.#__kinesis = value; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis - * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} - */ - withKinesis(value) { - this.kinesis = value; - return this; - } - - static fromMap(d) { - const ret = new ExportDefinition(); - if ("http" in d) { - ret.http = d["http"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(HTTPConfig, "fromMap") ? HTTPConfig.fromMap(v) : v); - return acc; - }, []); - } - if ("iotAnalytics" in d) { - ret.iotAnalytics = d["iotAnalytics"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(IoTAnalyticsConfig, "fromMap") ? IoTAnalyticsConfig.fromMap(v) : v); - return acc; - }, []); - } - if ("kinesis" in d) { - ret.kinesis = d["kinesis"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(KinesisConfig, "fromMap") ? KinesisConfig.fromMap(v) : v); - return acc; - }, []); - } - return ret; + return ret; } asMap() { const d = {}; - if (this.http !== null) { - d["http"] = this.http.reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); - return acc; - }, []); - } - if (this.iotAnalytics !== null) { - d["iotAnalytics"] = this.iotAnalytics.reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); - return acc; - }, []); - } - if (this.kinesis !== null) { - d["kinesis"] = this.kinesis.reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); - return acc; - }, []); + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } return d; } }; -Object.defineProperty(ExportDefinition, "typesMap", { +Object.defineProperty(TraceableRequest, "typesMap", { value: { - http: { - 'type': Array, - 'subtype': HTTPConfig - }, - iotAnalytics: { - 'type': Array, - 'subtype': IoTAnalyticsConfig - }, - kinesis: { - 'type': Array, - 'subtype': KinesisConfig + requestId: { + 'type': String, + 'subtype': null }, } }); -Object.defineProperty(ExportDefinition, "formatsMap", { +Object.defineProperty(TraceableRequest, "formatsMap", { value: {} }); -Object.defineProperty(ExportDefinition, "validationsMap", { +Object.defineProperty(TraceableRequest, "validationsMap", { value: { - 'http': { - 'required': false, - }, - 'iotAnalytics': { - 'required': false, - }, - 'kinesis': { - 'required': false, + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, }, } }); /** - * Object defining a message stream used in the CreateMessageStream API. + * (Internal Only) Response for UnknownOperationError. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class MessageStreamDefinition { - #__name = null; - #__maxSize = null; - #__streamSegmentSize = null; - #__timeToLiveMillis = null; - #__strategyOnFull = null; - #__persistence = null; - #__flushOnWrite = null; - #__exportDefinition = null; +class UnknownOperationError { + #__requestId = null; + #__status = null; + #__errorMessage = null; /** - * @param name {String} The unique name of the stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @param maxSize {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. - * @param streamSegmentSize {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. - Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. - * @param timeToLiveMillis {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @param strategyOnFull {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. - RejectNewData: any append message request after the stream is full will be rejected with an exception. - OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. - * @param persistence {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. - Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. - * @param flushOnWrite {Boolean} This only applies when Persistence is set to File mode. - Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. - * @param exportDefinition {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. + * @param requestId {String} + * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param errorMessage {String} */ constructor( - name = null, - maxSize = 268435456, - streamSegmentSize = 16777216, - timeToLiveMillis = null, - strategyOnFull = null, - persistence = null, - flushOnWrite = null, - exportDefinition = null, + requestId = null, + status = null, + errorMessage = null, ) { - if (name !== null && !(typeof name === "string")) { - throw new Error("name must be String"); - } - - if (maxSize !== null && !(typeof maxSize === "number")) { - throw new Error("maxSize must be Number"); - } - - if (streamSegmentSize !== null && !(typeof streamSegmentSize === "number")) { - throw new Error("streamSegmentSize must be Number"); - } - - if (timeToLiveMillis !== null && !(typeof timeToLiveMillis === "number")) { - throw new Error("timeToLiveMillis must be Number"); - } - - if (strategyOnFull !== null && !(strategyOnFull instanceof StrategyOnFull)) { - throw new Error("strategyOnFull must be StrategyOnFull"); - } - - if (persistence !== null && !(persistence instanceof Persistence)) { - throw new Error("persistence must be Persistence"); + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); } - if (flushOnWrite !== null && !(typeof flushOnWrite === "boolean")) { - throw new Error("flushOnWrite must be Boolean"); + if (status !== null && !(status instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); } - if (exportDefinition !== null && !(exportDefinition instanceof ExportDefinition)) { - throw new Error("exportDefinition must be ExportDefinition"); + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); } - this.#__name = name; - this.#__maxSize = maxSize; - this.#__streamSegmentSize = streamSegmentSize; - this.#__timeToLiveMillis = timeToLiveMillis; - this.#__strategyOnFull = strategyOnFull; - this.#__persistence = persistence; - this.#__flushOnWrite = flushOnWrite; - this.#__exportDefinition = exportDefinition; + this.#__requestId = requestId; + this.#__status = status; + this.#__errorMessage = errorMessage; } /** - * The unique name of the stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. * @returns {String} - + */ - get name() { - return this.#__name; + get requestId() { + return this.#__requestId; } /** - * @param value {String} The unique name of the stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param value {String} */ - set name(value) { + set requestId(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("name must be String"); + throw new Error("requestId must be String"); } - this.#__name = value; + this.#__requestId = value; } /** - * @param value {String} The unique name of the stream. - Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.UnknownOperationError} */ - withName(value) { - this.name = value; + withRequestId(value) { + this.requestId = value; return this; } /** - * The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. - * @returns {Number} + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} */ - get maxSize() { - return this.#__maxSize; + get status() { + return this.#__status; } /** - * @param value {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} */ - set maxSize(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("maxSize must be Number"); + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); } - this.#__maxSize = value; + this.#__status = value; } /** - * @param value {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.UnknownOperationError} */ - withMaxSize(value) { - this.maxSize = value; + withStatus(value) { + this.status = value; return this; } /** - * The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. - Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. - * @returns {Number} - + * @returns {String} + */ - get streamSegmentSize() { - return this.#__streamSegmentSize; + get errorMessage() { + return this.#__errorMessage; } /** - * @param value {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. - Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. + * @param value {String} */ - set streamSegmentSize(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("streamSegmentSize must be Number"); + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); } - this.#__streamSegmentSize = value; + this.#__errorMessage = value; } /** - * @param value {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. - Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.UnknownOperationError} */ - withStreamSegmentSize(value) { - this.streamSegmentSize = value; - return this; - } - - /** - * Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {Number} - - */ - get timeToLiveMillis() { - return this.#__timeToLiveMillis; - } - /** - * @param value {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - */ - set timeToLiveMillis(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("timeToLiveMillis must be Number"); - } - - this.#__timeToLiveMillis = value; - } - /** - * @param value {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. - The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - */ - withTimeToLiveMillis(value) { - this.timeToLiveMillis = value; - return this; - } - - /** - * What to do when the maximum size of the stream is reached. - RejectNewData: any append message request after the stream is full will be rejected with an exception. - OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. - * @returns {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} - - */ - get strategyOnFull() { - return this.#__strategyOnFull; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. - RejectNewData: any append message request after the stream is full will be rejected with an exception. - OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. - */ - set strategyOnFull(value) { - if (value !== null && !(value instanceof StrategyOnFull)) { - throw new Error("strategyOnFull must be StrategyOnFull"); - } - - this.#__strategyOnFull = value; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. - RejectNewData: any append message request after the stream is full will be rejected with an exception. - OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - */ - withStrategyOnFull(value) { - this.strategyOnFull = value; - return this; - } - - /** - * Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. - Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. - * @returns {aws-greengrass-core-sdk.StreamManager.Persistence} - - */ - get persistence() { - return this.#__persistence; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. - Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. - */ - set persistence(value) { - if (value !== null && !(value instanceof Persistence)) { - throw new Error("persistence must be Persistence"); - } - - this.#__persistence = value; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. - Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - */ - withPersistence(value) { - this.persistence = value; - return this; - } - - /** - * This only applies when Persistence is set to File mode. - Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. - * @returns {Boolean} - - */ - get flushOnWrite() { - return this.#__flushOnWrite; - } - /** - * @param value {Boolean} This only applies when Persistence is set to File mode. - Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. - */ - set flushOnWrite(value) { - if (value !== null && !(typeof value === "boolean")) { - throw new Error("flushOnWrite must be Boolean"); - } - - this.#__flushOnWrite = value; - } - /** - * @param value {Boolean} This only applies when Persistence is set to File mode. - Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - */ - withFlushOnWrite(value) { - this.flushOnWrite = value; - return this; - } - - /** - * Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. - * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} - - */ - get exportDefinition() { - return this.#__exportDefinition; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. - */ - set exportDefinition(value) { - if (value !== null && !(value instanceof ExportDefinition)) { - throw new Error("exportDefinition must be ExportDefinition"); - } - - this.#__exportDefinition = value; - } - /** - * @param value {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - */ - withExportDefinition(value) { - this.exportDefinition = value; + withErrorMessage(value) { + this.errorMessage = value; return this; } static fromMap(d) { - const ret = new MessageStreamDefinition(); - if ("name" in d) { - ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; - } - if ("maxSize" in d) { - ret.maxSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["maxSize"]) : d["maxSize"]; - } - if ("streamSegmentSize" in d) { - ret.streamSegmentSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["streamSegmentSize"]) : d["streamSegmentSize"]; - } - if ("timeToLiveMillis" in d) { - ret.timeToLiveMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["timeToLiveMillis"]) : d["timeToLiveMillis"]; - } - if ("strategyOnFull" in d) { - ret.strategyOnFull = Object.prototype.hasOwnProperty.call(StrategyOnFull, "fromMap") ? StrategyOnFull.fromMap(d["strategyOnFull"]) : d["strategyOnFull"]; - } - if ("persistence" in d) { - ret.persistence = Object.prototype.hasOwnProperty.call(Persistence, "fromMap") ? Persistence.fromMap(d["persistence"]) : d["persistence"]; + const ret = new UnknownOperationError(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - if ("flushOnWrite" in d) { - ret.flushOnWrite = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["flushOnWrite"]) : d["flushOnWrite"]; + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; } - if ("exportDefinition" in d) { - ret.exportDefinition = Object.prototype.hasOwnProperty.call(ExportDefinition, "fromMap") ? ExportDefinition.fromMap(d["exportDefinition"]) : d["exportDefinition"]; + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; } return ret; } asMap() { const d = {}; - if (this.name !== null) { - d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; - } - if (this.maxSize !== null) { - d["maxSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.maxSize), "asMap") ? this.maxSize.asMap() : this.maxSize; - } - if (this.streamSegmentSize !== null) { - d["streamSegmentSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamSegmentSize), "asMap") ? this.streamSegmentSize.asMap() : this.streamSegmentSize; - } - if (this.timeToLiveMillis !== null) { - d["timeToLiveMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.timeToLiveMillis), "asMap") ? this.timeToLiveMillis.asMap() : this.timeToLiveMillis; - } - if (this.strategyOnFull !== null) { - d["strategyOnFull"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.strategyOnFull), "asMap") ? this.strategyOnFull.asMap() : this.strategyOnFull; - } - if (this.persistence !== null) { - d["persistence"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.persistence), "asMap") ? this.persistence.asMap() : this.persistence; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } - if (this.flushOnWrite !== null) { - d["flushOnWrite"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.flushOnWrite), "asMap") ? this.flushOnWrite.asMap() : this.flushOnWrite; + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; } - if (this.exportDefinition !== null) { - d["exportDefinition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportDefinition), "asMap") ? this.exportDefinition.asMap() : this.exportDefinition; + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; } return d; } }; -Object.defineProperty(MessageStreamDefinition, "typesMap", { +Object.defineProperty(UnknownOperationError, "typesMap", { value: { - name: { + requestId: { 'type': String, 'subtype': null }, - maxSize: { - 'type': Number, - 'subtype': null - }, - streamSegmentSize: { - 'type': Number, - 'subtype': null - }, - timeToLiveMillis: { - 'type': Number, - 'subtype': null - }, - strategyOnFull: { - 'type': StrategyOnFull, - 'subtype': null - }, - persistence: { - 'type': Persistence, - 'subtype': null - }, - flushOnWrite: { - 'type': Boolean, + status: { + 'type': ResponseStatusCode, 'subtype': null }, - exportDefinition: { - 'type': ExportDefinition, + errorMessage: { + 'type': String, 'subtype': null }, } }); -Object.defineProperty(MessageStreamDefinition, "formatsMap", { +Object.defineProperty(UnknownOperationError, "formatsMap", { value: {} }); -Object.defineProperty(MessageStreamDefinition, "validationsMap", { +Object.defineProperty(UnknownOperationError, "validationsMap", { value: { - 'name': { + 'requestId': { 'required': true, 'minLength': 1, - 'maxLength': 255, 'pattern': /^[\w ,.\-_]*$/, }, - 'maxSize': { - 'required': false, - 'maximum': 9223372036854775807, - 'minimum': 1024, + 'status': { + 'required': true, }, - 'streamSegmentSize': { - 'required': false, - 'maximum': 2147483647, - 'minimum': 1024, - }, - 'timeToLiveMillis': { - 'required': false, - 'maximum': 9223372036854, - 'minimum': 60000, - }, - 'strategyOnFull': { - 'required': true, - }, - 'persistence': { - 'required': false, - }, - 'flushOnWrite': { - 'required': false, - }, - 'exportDefinition': { + 'errorMessage': { 'required': false, }, } }); /** - * Message stream information including its definition, storage status and export status + * Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. + Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class MessageStreamInfo { - #__definition = null; - #__storageStatus = null; - #__exportStatuses = null; +class Persistence { + + #value = null; + constructor(value = null) { + if (!Object.values(Persistence.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; + } + + static fromMap(d) { + return Persistence[Persistence.optionsFlipped[d]]; + } + + asMap() { + return this.#value; + } +}; +Object.defineProperty(Persistence, "options", { + value: { + File: 0, + Memory: 1, + } +}); +Object.defineProperty(Persistence, "optionsFlipped", { + value: { + 0: "File", + 1: "Memory", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.Persistence} File + * @memberOf aws-greengrass-core-sdk.StreamManager.Persistence# + * @readonly + */ +Object.defineProperty(Persistence, "File", { + value: new Persistence(0) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Persistence} Memory + * @memberOf aws-greengrass-core-sdk.StreamManager.Persistence# + * @readonly + */ +Object.defineProperty(Persistence, "Memory", { + value: new Persistence(1) +}); + +/** + * ExportFormat is used to define how messages are batched and formatted in the export payload. + RAW_NOT_BATCHED: Each message in a batch will be sent as an individual HTTP POST with the payload as the body (even if batchSize is set). + JSON_BATCHED: Each batch of messages will be sent as a JSON list of Message objects as the body. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class ExportFormat { + + #value = null; + constructor(value = null) { + if (!Object.values(ExportFormat.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; + } + + static fromMap(d) { + return ExportFormat[ExportFormat.optionsFlipped[d]]; + } + + asMap() { + return this.#value; + } +}; +Object.defineProperty(ExportFormat, "options", { + value: { + RAW_NOT_BATCHED: 0, + JSON_BATCHED: 1, + } +}); +Object.defineProperty(ExportFormat, "optionsFlipped", { + value: { + 0: "RAW_NOT_BATCHED", + 1: "JSON_BATCHED", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.ExportFormat} RAW_NOT_BATCHED + * @memberOf aws-greengrass-core-sdk.StreamManager.ExportFormat# + * @readonly + */ +Object.defineProperty(ExportFormat, "RAW_NOT_BATCHED", { + value: new ExportFormat(0) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.ExportFormat} JSON_BATCHED + * @memberOf aws-greengrass-core-sdk.StreamManager.ExportFormat# + * @readonly + */ +Object.defineProperty(ExportFormat, "JSON_BATCHED", { + value: new ExportFormat(1) +}); + +/** + * This export destination is not supported! The interface may change at any time without notice and should not be relied on for any production use. + There are no guarantees around its correctness. + This configures an HTTP endpoint which sends a POST request to the provided URI. Each request contains a single message in the body of the request. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class HTTPConfig { + #__identifier = null; + #__uri = null; + #__batchSize = null; + #__batchIntervalMillis = null; + #__priority = null; + #__startSequenceNumber = null; + #__disabled = null; + #__exportFormat = null; /** - * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - * @param storageStatus {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes - * @param exportStatuses {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + * @param identifier {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param uri {String} URL for HTTP endpoint which should receive the POST requests for export. + * @param batchSize {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 500. + * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param startSequenceNumber {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @param disabled {Boolean} Enable or disable this export. Default is false. + * @param exportFormat {aws-greengrass-core-sdk.StreamManager.ExportFormat} Defines how messages are batched and formatted in the export payload. */ constructor( - definition = null, - storageStatus = null, - exportStatuses = null, + identifier = null, + uri = null, + batchSize = null, + batchIntervalMillis = null, + priority = null, + startSequenceNumber = null, + disabled = null, + exportFormat = null, ) { - if (definition !== null && !(definition instanceof MessageStreamDefinition)) { - throw new Error("definition must be MessageStreamDefinition"); + if (identifier !== null && !(typeof identifier === "string")) { + throw new Error("identifier must be String"); } - if (storageStatus !== null && !(storageStatus instanceof MessageStreamInfo._storageStatus)) { - throw new Error("storageStatus must be MessageStreamInfo._storageStatus"); + if (uri !== null && !(typeof uri === "string")) { + throw new Error("uri must be String"); } - if (exportStatuses !== null && !(exportStatuses instanceof Array)) { - throw new Error("exportStatuses must be Array"); + if (batchSize !== null && !(typeof batchSize === "number")) { + throw new Error("batchSize must be Number"); } - if (exportStatuses !== null && !exportStatuses.every((v) => v instanceof MessageStreamInfo._exportStatuses)) { - throw new Error("exportStatuses array values must be MessageStreamInfo._exportStatuses"); + + if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { + throw new Error("batchIntervalMillis must be Number"); } - this.#__definition = definition; - this.#__storageStatus = storageStatus; - this.#__exportStatuses = exportStatuses; + if (priority !== null && !(typeof priority === "number")) { + throw new Error("priority must be Number"); + } + + if (startSequenceNumber !== null && !(typeof startSequenceNumber === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + if (disabled !== null && !(typeof disabled === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + if (exportFormat !== null && !(exportFormat instanceof ExportFormat)) { + throw new Error("exportFormat must be ExportFormat"); + } + + this.#__identifier = identifier; + this.#__uri = uri; + this.#__batchSize = batchSize; + this.#__batchIntervalMillis = batchIntervalMillis; + this.#__priority = priority; + this.#__startSequenceNumber = startSequenceNumber; + this.#__disabled = disabled; + this.#__exportFormat = exportFormat; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - + * A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + */ - get definition() { - return this.#__definition; + get identifier() { + return this.#__identifier; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. */ - set definition(value) { - if (value !== null && !(value instanceof MessageStreamDefinition)) { - throw new Error("definition must be MessageStreamDefinition"); + set identifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("identifier must be String"); } - this.#__definition = value; + this.#__identifier = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} */ - withDefinition(value) { - this.definition = value; + withIdentifier(value) { + this.identifier = value; return this; } /** - * Stream status including oldest/newest sequence number and total bytes - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} + * URL for HTTP endpoint which should receive the POST requests for export. + * @returns {String} */ - get storageStatus() { - return this.#__storageStatus; + get uri() { + return this.#__uri; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes + * @param value {String} URL for HTTP endpoint which should receive the POST requests for export. */ - set storageStatus(value) { - if (value !== null && !(value instanceof MessageStreamInfo._storageStatus)) { - throw new Error("storageStatus must be MessageStreamInfo._storageStatus"); + set uri(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("uri must be String"); } - this.#__storageStatus = value; + this.#__uri = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + * @param value {String} URL for HTTP endpoint which should receive the POST requests for export. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} */ - withStorageStatus(value) { - this.storageStatus = value; + withUri(value) { + this.uri = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} - + * The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 500. + * @returns {Number} + */ - get exportStatuses() { - return this.#__exportStatuses; + get batchSize() { + return this.#__batchSize; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 500. */ - set exportStatuses(value) { - if (value !== null && !(value instanceof Array)) { - throw new Error("exportStatuses must be Array"); - } - if (value !== null && !value.every((v) => v instanceof MessageStreamInfo._exportStatuses)) { - throw new Error("exportStatuses array values must be MessageStreamInfo._exportStatuses"); + set batchSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchSize must be Number"); } - this.#__exportStatuses = value; + this.#__batchSize = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 500. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} */ - withExportStatuses(value) { - this.exportStatuses = value; - return this; + withBatchSize(value) { + this.batchSize = value; + return this; } - static fromMap(d) { - const ret = new MessageStreamInfo(); - if ("definition" in d) { - ret.definition = Object.prototype.hasOwnProperty.call(MessageStreamDefinition, "fromMap") ? MessageStreamDefinition.fromMap(d["definition"]) : d["definition"]; - } - if ("storageStatus" in d) { - ret.storageStatus = Object.prototype.hasOwnProperty.call(MessageStreamInfo._storageStatus, "fromMap") ? MessageStreamInfo._storageStatus.fromMap(d["storageStatus"]) : d["storageStatus"]; - } - if ("exportStatuses" in d) { - ret.exportStatuses = d["exportStatuses"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(MessageStreamInfo._exportStatuses, "fromMap") ? MessageStreamInfo._exportStatuses.fromMap(v) : v); - return acc; - }, []); + /** + * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {Number} + + */ + get batchIntervalMillis() { + return this.#__batchIntervalMillis; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + */ + set batchIntervalMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchIntervalMillis must be Number"); } - return ret; + + this.#__batchIntervalMillis = value; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + */ + withBatchIntervalMillis(value) { + this.batchIntervalMillis = value; + return this; } - asMap() { - const d = {}; - if (this.definition !== null) { - d["definition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.definition), "asMap") ? this.definition.asMap() : this.definition; - } - if (this.storageStatus !== null) { - d["storageStatus"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.storageStatus), "asMap") ? this.storageStatus.asMap() : this.storageStatus; - } - if (this.exportStatuses !== null) { - d["exportStatuses"] = this.exportStatuses.reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); - return acc; - }, []); + /** + * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {Number} + + */ + get priority() { + return this.#__priority; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + */ + set priority(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("priority must be Number"); } - return d; + + this.#__priority = value; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + */ + withPriority(value) { + this.priority = value; + return this; } -}; -MessageStreamInfo._storageStatus = /** - * Stream status including oldest/newest sequence number and total bytes - * - * @class - * @memberOf aws-greengrass-core-sdk.StreamManager + * The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {Number} + */ - class _storageStatus { - #__oldestSequenceNumber = null; - #__newestSequenceNumber = null; - #__totalBytes = null; + get startSequenceNumber() { + return this.#__startSequenceNumber; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + */ + set startSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("startSequenceNumber must be Number"); + } - /** - * @param oldestSequenceNumber {Number} The sequence number of the first message which is still accessible in the stream. - * @param newestSequenceNumber {Number} The sequence number of the last appended message. - * @param totalBytes {Number} The current total size of the stream in bytes. - */ - constructor( - oldestSequenceNumber = null, - newestSequenceNumber = null, - totalBytes = null, - ) { - if (oldestSequenceNumber !== null && !(typeof oldestSequenceNumber === "number")) { - throw new Error("oldestSequenceNumber must be Number"); - } + this.#__startSequenceNumber = value; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + */ + withStartSequenceNumber(value) { + this.startSequenceNumber = value; + return this; + } - if (newestSequenceNumber !== null && !(typeof newestSequenceNumber === "number")) { - throw new Error("newestSequenceNumber must be Number"); - } + /** + * Enable or disable this export. Default is false. + * @returns {Boolean} + + */ + get disabled() { + return this.#__disabled; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + */ + set disabled(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("disabled must be Boolean"); + } - if (totalBytes !== null && !(typeof totalBytes === "number")) { - throw new Error("totalBytes must be Number"); - } + this.#__disabled = value; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + */ + withDisabled(value) { + this.disabled = value; + return this; + } - this.#__oldestSequenceNumber = oldestSequenceNumber; - this.#__newestSequenceNumber = newestSequenceNumber; - this.#__totalBytes = totalBytes; + /** + * Defines how messages are batched and formatted in the export payload. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportFormat} + + */ + get exportFormat() { + return this.#__exportFormat; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ExportFormat} Defines how messages are batched and formatted in the export payload. + */ + set exportFormat(value) { + if (value !== null && !(value instanceof ExportFormat)) { + throw new Error("exportFormat must be ExportFormat"); } - /** - * The sequence number of the first message which is still accessible in the stream. - * @returns {Number} - - */ - get oldestSequenceNumber() { - return this.#__oldestSequenceNumber; - } - /** - * @param value {Number} The sequence number of the first message which is still accessible in the stream. - */ - set oldestSequenceNumber(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("oldestSequenceNumber must be Number"); - } + this.#__exportFormat = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ExportFormat} Defines how messages are batched and formatted in the export payload. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig} + */ + withExportFormat(value) { + this.exportFormat = value; + return this; + } - this.#__oldestSequenceNumber = value; - } - /** - * @param value {Number} The sequence number of the first message which is still accessible in the stream. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} - */ - withOldestSequenceNumber(value) { - this.oldestSequenceNumber = value; - return this; + static fromMap(d) { + const ret = new HTTPConfig(); + if ("identifier" in d) { + ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; } - - /** - * The sequence number of the last appended message. - * @returns {Number} - - */ - get newestSequenceNumber() { - return this.#__newestSequenceNumber; + if ("uri" in d) { + ret.uri = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["uri"]) : d["uri"]; } - /** - * @param value {Number} The sequence number of the last appended message. - */ - set newestSequenceNumber(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("newestSequenceNumber must be Number"); - } - - this.#__newestSequenceNumber = value; + if ("batchSize" in d) { + ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; } - /** - * @param value {Number} The sequence number of the last appended message. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} - */ - withNewestSequenceNumber(value) { - this.newestSequenceNumber = value; - return this; + if ("batchIntervalMillis" in d) { + ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; } - - /** - * The current total size of the stream in bytes. - * @returns {Number} - - */ - get totalBytes() { - return this.#__totalBytes; + if ("priority" in d) { + ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; } - /** - * @param value {Number} The current total size of the stream in bytes. - */ - set totalBytes(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("totalBytes must be Number"); - } - - this.#__totalBytes = value; + if ("startSequenceNumber" in d) { + ret.startSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["startSequenceNumber"]) : d["startSequenceNumber"]; } - /** - * @param value {Number} The current total size of the stream in bytes. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} - */ - withTotalBytes(value) { - this.totalBytes = value; - return this; + if ("disabled" in d) { + ret.disabled = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["disabled"]) : d["disabled"]; } - - static fromMap(d) { - const ret = new MessageStreamInfo._storageStatus(); - if ("oldestSequenceNumber" in d) { - ret.oldestSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["oldestSequenceNumber"]) : d["oldestSequenceNumber"]; - } - if ("newestSequenceNumber" in d) { - ret.newestSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["newestSequenceNumber"]) : d["newestSequenceNumber"]; - } - if ("totalBytes" in d) { - ret.totalBytes = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["totalBytes"]) : d["totalBytes"]; - } - return ret; + if ("exportFormat" in d) { + ret.exportFormat = Object.prototype.hasOwnProperty.call(ExportFormat, "fromMap") ? ExportFormat.fromMap(d["exportFormat"]) : d["exportFormat"]; } + return ret; + } - asMap() { - const d = {}; - if (this.oldestSequenceNumber !== null) { - d["oldestSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.oldestSequenceNumber), "asMap") ? this.oldestSequenceNumber.asMap() : this.oldestSequenceNumber; - } - if (this.newestSequenceNumber !== null) { - d["newestSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.newestSequenceNumber), "asMap") ? this.newestSequenceNumber.asMap() : this.newestSequenceNumber; - } - if (this.totalBytes !== null) { - d["totalBytes"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.totalBytes), "asMap") ? this.totalBytes.asMap() : this.totalBytes; - } - return d; + asMap() { + const d = {}; + if (this.identifier !== null) { + d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; } - }; + if (this.uri !== null) { + d["uri"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.uri), "asMap") ? this.uri.asMap() : this.uri; + } + if (this.batchSize !== null) { + d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + } + if (this.batchIntervalMillis !== null) { + d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + } + if (this.priority !== null) { + d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + } + if (this.startSequenceNumber !== null) { + d["startSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.startSequenceNumber), "asMap") ? this.startSequenceNumber.asMap() : this.startSequenceNumber; + } + if (this.disabled !== null) { + d["disabled"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.disabled), "asMap") ? this.disabled.asMap() : this.disabled; + } + if (this.exportFormat !== null) { + d["exportFormat"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportFormat), "asMap") ? this.exportFormat.asMap() : this.exportFormat; + } + return d; + } +}; -Object.defineProperty(MessageStreamInfo._storageStatus, "typesMap", { +Object.defineProperty(HTTPConfig, "typesMap", { value: { - oldestSequenceNumber: { + identifier: { + 'type': String, + 'subtype': null + }, + uri: { + 'type': String, + 'subtype': null + }, + batchSize: { 'type': Number, 'subtype': null }, - newestSequenceNumber: { + batchIntervalMillis: { 'type': Number, 'subtype': null }, - totalBytes: { + priority: { + 'type': Number, + 'subtype': null + }, + startSequenceNumber: { 'type': Number, 'subtype': null }, + disabled: { + 'type': Boolean, + 'subtype': null + }, + exportFormat: { + 'type': ExportFormat, + 'subtype': null + }, } }); -Object.defineProperty(MessageStreamInfo._storageStatus, "formatsMap", { +Object.defineProperty(HTTPConfig, "formatsMap", { value: {} }); -Object.defineProperty(MessageStreamInfo._storageStatus, "validationsMap", { +Object.defineProperty(HTTPConfig, "validationsMap", { value: { - 'oldestSequenceNumber': { + 'identifier': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'uri': { + 'required': true, + 'minLength': 1, + }, + 'batchSize': { 'required': false, + 'maximum': 500, + 'minimum': 1, }, - 'newestSequenceNumber': { + 'batchIntervalMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 60000, + }, + 'priority': { 'required': false, + 'maximum': 10, + 'minimum': 1, }, - 'totalBytes': { + 'startSequenceNumber': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 0, + }, + 'disabled': { + 'required': false, + }, + 'exportFormat': { 'required': false, }, } -}); +}); + +/** + * Configuration object for IoT Analytics export destination. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class IoTAnalyticsConfig { + #__identifier = null; + #__iotChannel = null; + #__iotMsgIdPrefix = null; + #__batchSize = null; + #__batchIntervalMillis = null; + #__priority = null; + #__startSequenceNumber = null; + #__disabled = null; + + /** + * @param identifier {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param iotChannel {String} The name of the IoT Analytics Channel that this exporter should upload to. + * @param iotMsgIdPrefix {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. + This prefix must be less than 32 characters. + * @param batchSize {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 100. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 100. + * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param startSequenceNumber {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @param disabled {Boolean} Enable or disable this export. Default is false. + */ + constructor( + identifier = null, + iotChannel = null, + iotMsgIdPrefix = null, + batchSize = null, + batchIntervalMillis = null, + priority = null, + startSequenceNumber = null, + disabled = null, + ) { + if (identifier !== null && !(typeof identifier === "string")) { + throw new Error("identifier must be String"); + } + + if (iotChannel !== null && !(typeof iotChannel === "string")) { + throw new Error("iotChannel must be String"); + } + + if (iotMsgIdPrefix !== null && !(typeof iotMsgIdPrefix === "string")) { + throw new Error("iotMsgIdPrefix must be String"); + } + + if (batchSize !== null && !(typeof batchSize === "number")) { + throw new Error("batchSize must be Number"); + } + + if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + if (priority !== null && !(typeof priority === "number")) { + throw new Error("priority must be Number"); + } + + if (startSequenceNumber !== null && !(typeof startSequenceNumber === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + if (disabled !== null && !(typeof disabled === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__identifier = identifier; + this.#__iotChannel = iotChannel; + this.#__iotMsgIdPrefix = iotMsgIdPrefix; + this.#__batchSize = batchSize; + this.#__batchIntervalMillis = batchIntervalMillis; + this.#__priority = priority; + this.#__startSequenceNumber = startSequenceNumber; + this.#__disabled = disabled; + } + + /** + * A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + + */ + get identifier() { + return this.#__identifier; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + */ + set identifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("identifier must be String"); + } + + this.#__identifier = value; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withIdentifier(value) { + this.identifier = value; + return this; + } + + /** + * The name of the IoT Analytics Channel that this exporter should upload to. + * @returns {String} + + */ + get iotChannel() { + return this.#__iotChannel; + } + /** + * @param value {String} The name of the IoT Analytics Channel that this exporter should upload to. + */ + set iotChannel(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("iotChannel must be String"); + } + + this.#__iotChannel = value; + } + /** + * @param value {String} The name of the IoT Analytics Channel that this exporter should upload to. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withIotChannel(value) { + this.iotChannel = value; + return this; + } + + /** + * A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. + This prefix must be less than 32 characters. + * @returns {String} + + */ + get iotMsgIdPrefix() { + return this.#__iotMsgIdPrefix; + } + /** + * @param value {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. + This prefix must be less than 32 characters. + */ + set iotMsgIdPrefix(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("iotMsgIdPrefix must be String"); + } + + this.#__iotMsgIdPrefix = value; + } + /** + * @param value {String} A string prefixed to each unique message id. After this prefix, StreamManager may append more data to make the message ID unique. + This prefix must be less than 32 characters. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withIotMsgIdPrefix(value) { + this.iotMsgIdPrefix = value; + return this; + } + + /** + * The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 100. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 100. + * @returns {Number} + + */ + get batchSize() { + return this.#__batchSize; + } + /** + * @param value {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 100. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 100. + */ + set batchSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchSize must be Number"); + } + + this.#__batchSize = value; + } + /** + * @param value {Number} The maximum size of a batch to send to IoT Analytics. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 100. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 100. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withBatchSize(value) { + this.batchSize = value; + return this; + } + + /** + * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {Number} + + */ + get batchIntervalMillis() { + return this.#__batchIntervalMillis; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + */ + set batchIntervalMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + this.#__batchIntervalMillis = value; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withBatchIntervalMillis(value) { + this.batchIntervalMillis = value; + return this; + } + + /** + * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {Number} + + */ + get priority() { + return this.#__priority; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + */ + set priority(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("priority must be Number"); + } + + this.#__priority = value; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withPriority(value) { + this.priority = value; + return this; + } + + /** + * The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {Number} + + */ + get startSequenceNumber() { + return this.#__startSequenceNumber; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + */ + set startSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + this.#__startSequenceNumber = value; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withStartSequenceNumber(value) { + this.startSequenceNumber = value; + return this; + } + + /** + * Enable or disable this export. Default is false. + * @returns {Boolean} + + */ + get disabled() { + return this.#__disabled; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + */ + set disabled(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__disabled = value; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig} + */ + withDisabled(value) { + this.disabled = value; + return this; + } + + static fromMap(d) { + const ret = new IoTAnalyticsConfig(); + if ("identifier" in d) { + ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; + } + if ("iotChannel" in d) { + ret.iotChannel = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["iotChannel"]) : d["iotChannel"]; + } + if ("iotMsgIdPrefix" in d) { + ret.iotMsgIdPrefix = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["iotMsgIdPrefix"]) : d["iotMsgIdPrefix"]; + } + if ("batchSize" in d) { + ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + } + if ("batchIntervalMillis" in d) { + ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + } + if ("priority" in d) { + ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + } + if ("startSequenceNumber" in d) { + ret.startSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["startSequenceNumber"]) : d["startSequenceNumber"]; + } + if ("disabled" in d) { + ret.disabled = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["disabled"]) : d["disabled"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.identifier !== null) { + d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + } + if (this.iotChannel !== null) { + d["iotChannel"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.iotChannel), "asMap") ? this.iotChannel.asMap() : this.iotChannel; + } + if (this.iotMsgIdPrefix !== null) { + d["iotMsgIdPrefix"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.iotMsgIdPrefix), "asMap") ? this.iotMsgIdPrefix.asMap() : this.iotMsgIdPrefix; + } + if (this.batchSize !== null) { + d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + } + if (this.batchIntervalMillis !== null) { + d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + } + if (this.priority !== null) { + d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + } + if (this.startSequenceNumber !== null) { + d["startSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.startSequenceNumber), "asMap") ? this.startSequenceNumber.asMap() : this.startSequenceNumber; + } + if (this.disabled !== null) { + d["disabled"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.disabled), "asMap") ? this.disabled.asMap() : this.disabled; + } + return d; + } +}; + +Object.defineProperty(IoTAnalyticsConfig, "typesMap", { + value: { + identifier: { + 'type': String, + 'subtype': null + }, + iotChannel: { + 'type': String, + 'subtype': null + }, + iotMsgIdPrefix: { + 'type': String, + 'subtype': null + }, + batchSize: { + 'type': Number, + 'subtype': null + }, + batchIntervalMillis: { + 'type': Number, + 'subtype': null + }, + priority: { + 'type': Number, + 'subtype': null + }, + startSequenceNumber: { + 'type': Number, + 'subtype': null + }, + disabled: { + 'type': Boolean, + 'subtype': null + }, + } +}); +Object.defineProperty(IoTAnalyticsConfig, "formatsMap", { + value: {} +}); +Object.defineProperty(IoTAnalyticsConfig, "validationsMap", { + value: { + 'identifier': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'iotChannel': { + 'required': true, + 'minLength': 1, + }, + 'iotMsgIdPrefix': { + 'required': false, + 'maxLength': 32, + }, + 'batchSize': { + 'required': false, + 'maximum': 100, + 'minimum': 1, + }, + 'batchIntervalMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 60000, + }, + 'priority': { + 'required': false, + 'maximum': 10, + 'minimum': 1, + }, + 'startSequenceNumber': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 0, + }, + 'disabled': { + 'required': false, + }, + } +}); + +/** + * Configuration object for Kinesis data streams export destination. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class KinesisConfig { + #__identifier = null; + #__kinesisStreamName = null; + #__batchSize = null; + #__batchIntervalMillis = null; + #__priority = null; + #__startSequenceNumber = null; + #__disabled = null; + + /** + * @param identifier {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param kinesisStreamName {String} The name of the Kinesis data stream that this exporter should upload to. + * @param batchSize {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 500. + * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param startSequenceNumber {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @param disabled {Boolean} Enable or disable this export. Default is false. + */ + constructor( + identifier = null, + kinesisStreamName = null, + batchSize = null, + batchIntervalMillis = null, + priority = null, + startSequenceNumber = null, + disabled = null, + ) { + if (identifier !== null && !(typeof identifier === "string")) { + throw new Error("identifier must be String"); + } + + if (kinesisStreamName !== null && !(typeof kinesisStreamName === "string")) { + throw new Error("kinesisStreamName must be String"); + } + + if (batchSize !== null && !(typeof batchSize === "number")) { + throw new Error("batchSize must be Number"); + } + + if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + if (priority !== null && !(typeof priority === "number")) { + throw new Error("priority must be Number"); + } + + if (startSequenceNumber !== null && !(typeof startSequenceNumber === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + if (disabled !== null && !(typeof disabled === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__identifier = identifier; + this.#__kinesisStreamName = kinesisStreamName; + this.#__batchSize = batchSize; + this.#__batchIntervalMillis = batchIntervalMillis; + this.#__priority = priority; + this.#__startSequenceNumber = startSequenceNumber; + this.#__disabled = disabled; + } + + /** + * A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + + */ + get identifier() { + return this.#__identifier; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + */ + set identifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("identifier must be String"); + } + + this.#__identifier = value; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withIdentifier(value) { + this.identifier = value; + return this; + } + + /** + * The name of the Kinesis data stream that this exporter should upload to. + * @returns {String} + + */ + get kinesisStreamName() { + return this.#__kinesisStreamName; + } + /** + * @param value {String} The name of the Kinesis data stream that this exporter should upload to. + */ + set kinesisStreamName(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("kinesisStreamName must be String"); + } + + this.#__kinesisStreamName = value; + } + /** + * @param value {String} The name of the Kinesis data stream that this exporter should upload to. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withKinesisStreamName(value) { + this.kinesisStreamName = value; + return this; + } + + /** + * The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 500. + * @returns {Number} + + */ + get batchSize() { + return this.#__batchSize; + } + /** + * @param value {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 500. + */ + set batchSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchSize must be Number"); + } + + this.#__batchSize = value; + } + /** + * @param value {Number} The maximum size of a batch to send to Kinesis. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 500. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The batch size must be between 1 and 500. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withBatchSize(value) { + this.batchSize = value; + return this; + } + + /** + * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {Number} + + */ + get batchIntervalMillis() { + return this.#__batchIntervalMillis; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + */ + set batchIntervalMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + this.#__batchIntervalMillis = value; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withBatchIntervalMillis(value) { + this.batchIntervalMillis = value; + return this; + } + + /** + * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {Number} + + */ + get priority() { + return this.#__priority; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + */ + set priority(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("priority must be Number"); + } + + this.#__priority = value; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withPriority(value) { + this.priority = value; + return this; + } + + /** + * The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {Number} + + */ + get startSequenceNumber() { + return this.#__startSequenceNumber; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + */ + set startSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + this.#__startSequenceNumber = value; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withStartSequenceNumber(value) { + this.startSequenceNumber = value; + return this; + } + + /** + * Enable or disable this export. Default is false. + * @returns {Boolean} + + */ + get disabled() { + return this.#__disabled; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + */ + set disabled(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__disabled = value; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig} + */ + withDisabled(value) { + this.disabled = value; + return this; + } + + static fromMap(d) { + const ret = new KinesisConfig(); + if ("identifier" in d) { + ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; + } + if ("kinesisStreamName" in d) { + ret.kinesisStreamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["kinesisStreamName"]) : d["kinesisStreamName"]; + } + if ("batchSize" in d) { + ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + } + if ("batchIntervalMillis" in d) { + ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + } + if ("priority" in d) { + ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + } + if ("startSequenceNumber" in d) { + ret.startSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["startSequenceNumber"]) : d["startSequenceNumber"]; + } + if ("disabled" in d) { + ret.disabled = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["disabled"]) : d["disabled"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.identifier !== null) { + d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + } + if (this.kinesisStreamName !== null) { + d["kinesisStreamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.kinesisStreamName), "asMap") ? this.kinesisStreamName.asMap() : this.kinesisStreamName; + } + if (this.batchSize !== null) { + d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + } + if (this.batchIntervalMillis !== null) { + d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + } + if (this.priority !== null) { + d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + } + if (this.startSequenceNumber !== null) { + d["startSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.startSequenceNumber), "asMap") ? this.startSequenceNumber.asMap() : this.startSequenceNumber; + } + if (this.disabled !== null) { + d["disabled"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.disabled), "asMap") ? this.disabled.asMap() : this.disabled; + } + return d; + } +}; + +Object.defineProperty(KinesisConfig, "typesMap", { + value: { + identifier: { + 'type': String, + 'subtype': null + }, + kinesisStreamName: { + 'type': String, + 'subtype': null + }, + batchSize: { + 'type': Number, + 'subtype': null + }, + batchIntervalMillis: { + 'type': Number, + 'subtype': null + }, + priority: { + 'type': Number, + 'subtype': null + }, + startSequenceNumber: { + 'type': Number, + 'subtype': null + }, + disabled: { + 'type': Boolean, + 'subtype': null + }, + } +}); +Object.defineProperty(KinesisConfig, "formatsMap", { + value: {} +}); +Object.defineProperty(KinesisConfig, "validationsMap", { + value: { + 'identifier': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'kinesisStreamName': { + 'required': true, + 'minLength': 1, + }, + 'batchSize': { + 'required': false, + 'maximum': 500, + 'minimum': 1, + }, + 'batchIntervalMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 60000, + }, + 'priority': { + 'required': false, + 'maximum': 10, + 'minimum': 1, + }, + 'startSequenceNumber': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 0, + }, + 'disabled': { + 'required': false, + }, + } +}); + +/** + * Configuration object for IotSiteWise data streams export destination. Minimum version requirements: StreamManager server version 1.1 (or AWS IoT Greengrass Core 1.11.0) + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class IoTSiteWiseConfig { + #__identifier = null; + #__batchSize = null; + #__batchIntervalMillis = null; + #__priority = null; + #__startSequenceNumber = null; + #__disabled = null; + + /** + * @param identifier {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param batchSize {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 10. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 10. + * @param batchIntervalMillis {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param priority {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @param startSequenceNumber {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @param disabled {Boolean} Enable or disable this export. Default is false. + */ + constructor( + identifier = null, + batchSize = null, + batchIntervalMillis = null, + priority = null, + startSequenceNumber = null, + disabled = null, + ) { + if (identifier !== null && !(typeof identifier === "string")) { + throw new Error("identifier must be String"); + } + + if (batchSize !== null && !(typeof batchSize === "number")) { + throw new Error("batchSize must be Number"); + } + + if (batchIntervalMillis !== null && !(typeof batchIntervalMillis === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + if (priority !== null && !(typeof priority === "number")) { + throw new Error("priority must be Number"); + } + + if (startSequenceNumber !== null && !(typeof startSequenceNumber === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + if (disabled !== null && !(typeof disabled === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__identifier = identifier; + this.#__batchSize = batchSize; + this.#__batchIntervalMillis = batchIntervalMillis; + this.#__priority = priority; + this.#__startSequenceNumber = startSequenceNumber; + this.#__disabled = disabled; + } + + /** + * A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + + */ + get identifier() { + return this.#__identifier; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + */ + set identifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("identifier must be String"); + } + + this.#__identifier = value; + } + /** + * @param value {String} A unique identifier to identify this individual upload stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withIdentifier(value) { + this.identifier = value; + return this; + } + + /** + * The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 10. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 10. + * @returns {Number} + + */ + get batchSize() { + return this.#__batchSize; + } + /** + * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 10. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 10. + */ + set batchSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchSize must be Number"); + } + + this.#__batchSize = value; + } + /** + * @param value {Number} The maximum size of a batch to send to the destination. Messages will be queued until the batch size is reached, after which they will then be uploaded. If unspecified the default will be 10. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum batch size is 1 and the maximum is 10. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withBatchSize(value) { + this.batchSize = value; + return this; + } + + /** + * The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {Number} + + */ + get batchIntervalMillis() { + return this.#__batchIntervalMillis; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + */ + set batchIntervalMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("batchIntervalMillis must be Number"); + } + + this.#__batchIntervalMillis = value; + } + /** + * @param value {Number} The time in milliseconds between the earliest un-uploaded message and the current time. If this time is exceeded, messages will be uploaded in the next batch. If unspecified messages will be eligible for upload immediately. + If both batchSize and batchIntervalMillis are specified, then messages will be eligible for upload when either condition is met. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withBatchIntervalMillis(value) { + this.batchIntervalMillis = value; + return this; + } + + /** + * Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {Number} + + */ + get priority() { + return this.#__priority; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + */ + set priority(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("priority must be Number"); + } + + this.#__priority = value; + } + /** + * @param value {Number} Priority for this upload stream. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withPriority(value) { + this.priority = value; + return this; + } + + /** + * The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {Number} + + */ + get startSequenceNumber() { + return this.#__startSequenceNumber; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + */ + set startSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("startSequenceNumber must be Number"); + } + + this.#__startSequenceNumber = value; + } + /** + * @param value {Number} The sequence number of the message to use as the starting message in the export. Default is 0. The sequence number provided should be less than the newest sequence number in the stream, i.e., sequence number of the last messaged appended. To find the newest sequence number, describe the stream and then check the storage status of the returned MessageStreamInfo object. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withStartSequenceNumber(value) { + this.startSequenceNumber = value; + return this; + } + + /** + * Enable or disable this export. Default is false. + * @returns {Boolean} + + */ + get disabled() { + return this.#__disabled; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + */ + set disabled(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__disabled = value; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig} + */ + withDisabled(value) { + this.disabled = value; + return this; + } + + static fromMap(d) { + const ret = new IoTSiteWiseConfig(); + if ("identifier" in d) { + ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; + } + if ("batchSize" in d) { + ret.batchSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchSize"]) : d["batchSize"]; + } + if ("batchIntervalMillis" in d) { + ret.batchIntervalMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["batchIntervalMillis"]) : d["batchIntervalMillis"]; + } + if ("priority" in d) { + ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + } + if ("startSequenceNumber" in d) { + ret.startSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["startSequenceNumber"]) : d["startSequenceNumber"]; + } + if ("disabled" in d) { + ret.disabled = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["disabled"]) : d["disabled"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.identifier !== null) { + d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + } + if (this.batchSize !== null) { + d["batchSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchSize), "asMap") ? this.batchSize.asMap() : this.batchSize; + } + if (this.batchIntervalMillis !== null) { + d["batchIntervalMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.batchIntervalMillis), "asMap") ? this.batchIntervalMillis.asMap() : this.batchIntervalMillis; + } + if (this.priority !== null) { + d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + } + if (this.startSequenceNumber !== null) { + d["startSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.startSequenceNumber), "asMap") ? this.startSequenceNumber.asMap() : this.startSequenceNumber; + } + if (this.disabled !== null) { + d["disabled"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.disabled), "asMap") ? this.disabled.asMap() : this.disabled; + } + return d; + } +}; + +Object.defineProperty(IoTSiteWiseConfig, "typesMap", { + value: { + identifier: { + 'type': String, + 'subtype': null + }, + batchSize: { + 'type': Number, + 'subtype': null + }, + batchIntervalMillis: { + 'type': Number, + 'subtype': null + }, + priority: { + 'type': Number, + 'subtype': null + }, + startSequenceNumber: { + 'type': Number, + 'subtype': null + }, + disabled: { + 'type': Boolean, + 'subtype': null + }, + } +}); +Object.defineProperty(IoTSiteWiseConfig, "formatsMap", { + value: {} +}); +Object.defineProperty(IoTSiteWiseConfig, "validationsMap", { + value: { + 'identifier': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'batchSize': { + 'required': false, + 'maximum': 10, + 'minimum': 1, + }, + 'batchIntervalMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 60000, + }, + 'priority': { + 'required': false, + 'maximum': 10, + 'minimum': 1, + }, + 'startSequenceNumber': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 0, + }, + 'disabled': { + 'required': false, + }, + } +}); + +/** + * Configuration for status in a status-stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class StatusConfig { + #__statusLevel = null; + #__statusStreamName = null; + + /** + * @param statusLevel {aws-greengrass-core-sdk.StreamManager.StatusLevel} Defines the verbosity of status messages in a status-stream. + * @param statusStreamName {String} The name of the stream to which status messages are appended. + The status-stream should be created before associating it with another stream. + */ + constructor( + statusLevel = null, + statusStreamName = null, + ) { + if (statusLevel !== null && !(statusLevel instanceof StatusLevel)) { + throw new Error("statusLevel must be StatusLevel"); + } + + if (statusStreamName !== null && !(typeof statusStreamName === "string")) { + throw new Error("statusStreamName must be String"); + } + + this.#__statusLevel = statusLevel; + this.#__statusStreamName = statusStreamName; + } + + /** + * Defines the verbosity of status messages in a status-stream. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusLevel} + + */ + get statusLevel() { + return this.#__statusLevel; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusLevel} Defines the verbosity of status messages in a status-stream. + */ + set statusLevel(value) { + if (value !== null && !(value instanceof StatusLevel)) { + throw new Error("statusLevel must be StatusLevel"); + } + + this.#__statusLevel = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusLevel} Defines the verbosity of status messages in a status-stream. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusConfig} + */ + withStatusLevel(value) { + this.statusLevel = value; + return this; + } + + /** + * The name of the stream to which status messages are appended. + The status-stream should be created before associating it with another stream. + * @returns {String} + + */ + get statusStreamName() { + return this.#__statusStreamName; + } + /** + * @param value {String} The name of the stream to which status messages are appended. + The status-stream should be created before associating it with another stream. + */ + set statusStreamName(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("statusStreamName must be String"); + } + + this.#__statusStreamName = value; + } + /** + * @param value {String} The name of the stream to which status messages are appended. + The status-stream should be created before associating it with another stream. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusConfig} + */ + withStatusStreamName(value) { + this.statusStreamName = value; + return this; + } + + static fromMap(d) { + const ret = new StatusConfig(); + if ("statusLevel" in d) { + ret.statusLevel = Object.prototype.hasOwnProperty.call(StatusLevel, "fromMap") ? StatusLevel.fromMap(d["statusLevel"]) : d["statusLevel"]; + } + if ("statusStreamName" in d) { + ret.statusStreamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["statusStreamName"]) : d["statusStreamName"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.statusLevel !== null) { + d["statusLevel"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.statusLevel), "asMap") ? this.statusLevel.asMap() : this.statusLevel; + } + if (this.statusStreamName !== null) { + d["statusStreamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.statusStreamName), "asMap") ? this.statusStreamName.asMap() : this.statusStreamName; + } + return d; + } +}; + +Object.defineProperty(StatusConfig, "typesMap", { + value: { + statusLevel: { + 'type': StatusLevel, + 'subtype': null + }, + statusStreamName: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(StatusConfig, "formatsMap", { + value: {} +}); +Object.defineProperty(StatusConfig, "validationsMap", { + value: { + 'statusLevel': { + 'required': false, + }, + 'statusStreamName': { + 'required': false, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + } +}); + +/** + * Configuration object for S3 export tasks executor. Minimum version requirements: StreamManager server version 1.1 (or AWS IoT Greengrass Core 1.11.0) + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class S3ExportTaskExecutorConfig { + #__identifier = null; + #__sizeThresholdForMultipartUploadBytes = null; + #__priority = null; + #__disabled = null; + #__statusConfig = null; + + /** + * @param identifier {String} A unique identifier to identify this individual upload task. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param sizeThresholdForMultipartUploadBytes {Number} The size threshold in bytes for when to use multipart uploads. Uploads over this size will automatically use a multipart upload strategy, while uploads equal or smaller than this threshold will use a single connection to upload the whole object. + * @param priority {Number} Priority for this upload task. Lower values are higher priority. If not specified it will have the lowest priority. + * @param disabled {Boolean} Enable or disable this export. Default is false. + * @param statusConfig {aws-greengrass-core-sdk.StreamManager.StatusConfig} Event status configuration that specifies the target status stream and verbosity. + */ + constructor( + identifier = null, + sizeThresholdForMultipartUploadBytes = null, + priority = null, + disabled = null, + statusConfig = null, + ) { + if (identifier !== null && !(typeof identifier === "string")) { + throw new Error("identifier must be String"); + } + + if (sizeThresholdForMultipartUploadBytes !== null && !(typeof sizeThresholdForMultipartUploadBytes === "number")) { + throw new Error("sizeThresholdForMultipartUploadBytes must be Number"); + } + + if (priority !== null && !(typeof priority === "number")) { + throw new Error("priority must be Number"); + } + + if (disabled !== null && !(typeof disabled === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + if (statusConfig !== null && !(statusConfig instanceof StatusConfig)) { + throw new Error("statusConfig must be StatusConfig"); + } + + this.#__identifier = identifier; + this.#__sizeThresholdForMultipartUploadBytes = sizeThresholdForMultipartUploadBytes; + this.#__priority = priority; + this.#__disabled = disabled; + this.#__statusConfig = statusConfig; + } + + /** + * A unique identifier to identify this individual upload task. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + + */ + get identifier() { + return this.#__identifier; + } + /** + * @param value {String} A unique identifier to identify this individual upload task. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + */ + set identifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("identifier must be String"); + } + + this.#__identifier = value; + } + /** + * @param value {String} A unique identifier to identify this individual upload task. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig} + */ + withIdentifier(value) { + this.identifier = value; + return this; + } + + /** + * The size threshold in bytes for when to use multipart uploads. Uploads over this size will automatically use a multipart upload strategy, while uploads equal or smaller than this threshold will use a single connection to upload the whole object. + * @returns {Number} + + */ + get sizeThresholdForMultipartUploadBytes() { + return this.#__sizeThresholdForMultipartUploadBytes; + } + /** + * @param value {Number} The size threshold in bytes for when to use multipart uploads. Uploads over this size will automatically use a multipart upload strategy, while uploads equal or smaller than this threshold will use a single connection to upload the whole object. + */ + set sizeThresholdForMultipartUploadBytes(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("sizeThresholdForMultipartUploadBytes must be Number"); + } + + this.#__sizeThresholdForMultipartUploadBytes = value; + } + /** + * @param value {Number} The size threshold in bytes for when to use multipart uploads. Uploads over this size will automatically use a multipart upload strategy, while uploads equal or smaller than this threshold will use a single connection to upload the whole object. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig} + */ + withSizeThresholdForMultipartUploadBytes(value) { + this.sizeThresholdForMultipartUploadBytes = value; + return this; + } + + /** + * Priority for this upload task. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {Number} + + */ + get priority() { + return this.#__priority; + } + /** + * @param value {Number} Priority for this upload task. Lower values are higher priority. If not specified it will have the lowest priority. + */ + set priority(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("priority must be Number"); + } + + this.#__priority = value; + } + /** + * @param value {Number} Priority for this upload task. Lower values are higher priority. If not specified it will have the lowest priority. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig} + */ + withPriority(value) { + this.priority = value; + return this; + } + + /** + * Enable or disable this export. Default is false. + * @returns {Boolean} + + */ + get disabled() { + return this.#__disabled; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + */ + set disabled(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("disabled must be Boolean"); + } + + this.#__disabled = value; + } + /** + * @param value {Boolean} Enable or disable this export. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig} + */ + withDisabled(value) { + this.disabled = value; + return this; + } + + /** + * Event status configuration that specifies the target status stream and verbosity. + * @returns {aws-greengrass-core-sdk.StreamManager.StatusConfig} + + */ + get statusConfig() { + return this.#__statusConfig; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusConfig} Event status configuration that specifies the target status stream and verbosity. + */ + set statusConfig(value) { + if (value !== null && !(value instanceof StatusConfig)) { + throw new Error("statusConfig must be StatusConfig"); + } + + this.#__statusConfig = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StatusConfig} Event status configuration that specifies the target status stream and verbosity. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig} + */ + withStatusConfig(value) { + this.statusConfig = value; + return this; + } + + static fromMap(d) { + const ret = new S3ExportTaskExecutorConfig(); + if ("identifier" in d) { + ret.identifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["identifier"]) : d["identifier"]; + } + if ("sizeThresholdForMultipartUploadBytes" in d) { + ret.sizeThresholdForMultipartUploadBytes = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sizeThresholdForMultipartUploadBytes"]) : d["sizeThresholdForMultipartUploadBytes"]; + } + if ("priority" in d) { + ret.priority = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["priority"]) : d["priority"]; + } + if ("disabled" in d) { + ret.disabled = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["disabled"]) : d["disabled"]; + } + if ("statusConfig" in d) { + ret.statusConfig = Object.prototype.hasOwnProperty.call(StatusConfig, "fromMap") ? StatusConfig.fromMap(d["statusConfig"]) : d["statusConfig"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.identifier !== null) { + d["identifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.identifier), "asMap") ? this.identifier.asMap() : this.identifier; + } + if (this.sizeThresholdForMultipartUploadBytes !== null) { + d["sizeThresholdForMultipartUploadBytes"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sizeThresholdForMultipartUploadBytes), "asMap") ? this.sizeThresholdForMultipartUploadBytes.asMap() : this.sizeThresholdForMultipartUploadBytes; + } + if (this.priority !== null) { + d["priority"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.priority), "asMap") ? this.priority.asMap() : this.priority; + } + if (this.disabled !== null) { + d["disabled"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.disabled), "asMap") ? this.disabled.asMap() : this.disabled; + } + if (this.statusConfig !== null) { + d["statusConfig"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.statusConfig), "asMap") ? this.statusConfig.asMap() : this.statusConfig; + } + return d; + } +}; + +Object.defineProperty(S3ExportTaskExecutorConfig, "typesMap", { + value: { + identifier: { + 'type': String, + 'subtype': null + }, + sizeThresholdForMultipartUploadBytes: { + 'type': Number, + 'subtype': null + }, + priority: { + 'type': Number, + 'subtype': null + }, + disabled: { + 'type': Boolean, + 'subtype': null + }, + statusConfig: { + 'type': StatusConfig, + 'subtype': null + }, + } +}); +Object.defineProperty(S3ExportTaskExecutorConfig, "formatsMap", { + value: {} +}); +Object.defineProperty(S3ExportTaskExecutorConfig, "validationsMap", { + value: { + 'identifier': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'sizeThresholdForMultipartUploadBytes': { + 'required': false, + 'minimum': 5242880, + }, + 'priority': { + 'required': false, + 'maximum': 10, + 'minimum': 1, + }, + 'disabled': { + 'required': false, + }, + 'statusConfig': { + 'required': false, + }, + } +}); + +/** + * Defines how and where the stream is uploaded. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class ExportDefinition { + #__http = null; + #__iotAnalytics = null; + #__kinesis = null; + #__IotSitewise = null; + #__s3TaskExecutor = null; + + /** + * @param http {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint. + * @param iotAnalytics {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics. + * @param kinesis {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis. + * @param IotSitewise {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig[]} Defines how the stream is uploaded to IoT SiteWise. + * @param s3TaskExecutor {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig[]} Defines the list of configs for S3 task executors. + */ + constructor( + http = null, + iotAnalytics = null, + kinesis = null, + IotSitewise = null, + s3TaskExecutor = null, + ) { + if (http !== null && !(http instanceof Array)) { + throw new Error("http must be Array"); + } + if (http !== null && !http.every((v) => v instanceof HTTPConfig)) { + throw new Error("http array values must be HTTPConfig"); + } + + if (iotAnalytics !== null && !(iotAnalytics instanceof Array)) { + throw new Error("iotAnalytics must be Array"); + } + if (iotAnalytics !== null && !iotAnalytics.every((v) => v instanceof IoTAnalyticsConfig)) { + throw new Error("iotAnalytics array values must be IoTAnalyticsConfig"); + } + + if (kinesis !== null && !(kinesis instanceof Array)) { + throw new Error("kinesis must be Array"); + } + if (kinesis !== null && !kinesis.every((v) => v instanceof KinesisConfig)) { + throw new Error("kinesis array values must be KinesisConfig"); + } + + if (IotSitewise !== null && !(IotSitewise instanceof Array)) { + throw new Error("IotSitewise must be Array"); + } + if (IotSitewise !== null && !IotSitewise.every((v) => v instanceof IoTSiteWiseConfig)) { + throw new Error("IotSitewise array values must be IoTSiteWiseConfig"); + } + + if (s3TaskExecutor !== null && !(s3TaskExecutor instanceof Array)) { + throw new Error("s3TaskExecutor must be Array"); + } + if (s3TaskExecutor !== null && !s3TaskExecutor.every((v) => v instanceof S3ExportTaskExecutorConfig)) { + throw new Error("s3TaskExecutor array values must be S3ExportTaskExecutorConfig"); + } + + this.#__http = http; + this.#__iotAnalytics = iotAnalytics; + this.#__kinesis = kinesis; + this.#__IotSitewise = IotSitewise; + this.#__s3TaskExecutor = s3TaskExecutor; + } + + /** + * Defines how the stream is uploaded to an HTTP endpoint. + * @returns {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} + + */ + get http() { + return this.#__http; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint. + */ + set http(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("http must be Array"); + } + if (value !== null && !value.every((v) => v instanceof HTTPConfig)) { + throw new Error("http array values must be HTTPConfig"); + } + + this.#__http = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.HTTPConfig[]} Defines how the stream is uploaded to an HTTP endpoint. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + */ + withHttp(value) { + this.http = value; + return this; + } + + /** + * Defines how the stream is uploaded to IoT Analytics. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} + + */ + get iotAnalytics() { + return this.#__iotAnalytics; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics. + */ + set iotAnalytics(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("iotAnalytics must be Array"); + } + if (value !== null && !value.every((v) => v instanceof IoTAnalyticsConfig)) { + throw new Error("iotAnalytics array values must be IoTAnalyticsConfig"); + } + + this.#__iotAnalytics = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.IoTAnalyticsConfig[]} Defines how the stream is uploaded to IoT Analytics. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + */ + withIotAnalytics(value) { + this.iotAnalytics = value; + return this; + } + + /** + * Defines how the stream is uploaded to Kinesis. + * @returns {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} + + */ + get kinesis() { + return this.#__kinesis; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis. + */ + set kinesis(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("kinesis must be Array"); + } + if (value !== null && !value.every((v) => v instanceof KinesisConfig)) { + throw new Error("kinesis array values must be KinesisConfig"); + } + + this.#__kinesis = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.KinesisConfig[]} Defines how the stream is uploaded to Kinesis. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + */ + withKinesis(value) { + this.kinesis = value; + return this; + } + + /** + * Defines how the stream is uploaded to IoT SiteWise. + * @returns {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig[]} + + */ + get IotSitewise() { + return this.#__IotSitewise; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig[]} Defines how the stream is uploaded to IoT SiteWise. + */ + set IotSitewise(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("IotSitewise must be Array"); + } + if (value !== null && !value.every((v) => v instanceof IoTSiteWiseConfig)) { + throw new Error("IotSitewise array values must be IoTSiteWiseConfig"); + } + + this.#__IotSitewise = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.IoTSiteWiseConfig[]} Defines how the stream is uploaded to IoT SiteWise. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + */ + withIotSitewise(value) { + this.IotSitewise = value; + return this; + } + + /** + * Defines the list of configs for S3 task executors. + * @returns {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig[]} + + */ + get s3TaskExecutor() { + return this.#__s3TaskExecutor; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig[]} Defines the list of configs for S3 task executors. + */ + set s3TaskExecutor(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("s3TaskExecutor must be Array"); + } + if (value !== null && !value.every((v) => v instanceof S3ExportTaskExecutorConfig)) { + throw new Error("s3TaskExecutor array values must be S3ExportTaskExecutorConfig"); + } + + this.#__s3TaskExecutor = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.S3ExportTaskExecutorConfig[]} Defines the list of configs for S3 task executors. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + */ + withS3TaskExecutor(value) { + this.s3TaskExecutor = value; + return this; + } + + static fromMap(d) { + const ret = new ExportDefinition(); + if ("http" in d) { + ret.http = d["http"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(HTTPConfig, "fromMap") ? HTTPConfig.fromMap(v) : v); + return acc; + }, []); + } + if ("iotAnalytics" in d) { + ret.iotAnalytics = d["iotAnalytics"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(IoTAnalyticsConfig, "fromMap") ? IoTAnalyticsConfig.fromMap(v) : v); + return acc; + }, []); + } + if ("kinesis" in d) { + ret.kinesis = d["kinesis"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(KinesisConfig, "fromMap") ? KinesisConfig.fromMap(v) : v); + return acc; + }, []); + } + if ("IotSitewise" in d) { + ret.IotSitewise = d["IotSitewise"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(IoTSiteWiseConfig, "fromMap") ? IoTSiteWiseConfig.fromMap(v) : v); + return acc; + }, []); + } + if ("s3TaskExecutor" in d) { + ret.s3TaskExecutor = d["s3TaskExecutor"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(S3ExportTaskExecutorConfig, "fromMap") ? S3ExportTaskExecutorConfig.fromMap(v) : v); + return acc; + }, []); + } + return ret; + } + + asMap() { + const d = {}; + if (this.http !== null) { + d["http"] = this.http.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + if (this.iotAnalytics !== null) { + d["iotAnalytics"] = this.iotAnalytics.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + if (this.kinesis !== null) { + d["kinesis"] = this.kinesis.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + if (this.IotSitewise !== null) { + d["IotSitewise"] = this.IotSitewise.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + if (this.s3TaskExecutor !== null) { + d["s3TaskExecutor"] = this.s3TaskExecutor.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + return d; + } +}; + +Object.defineProperty(ExportDefinition, "typesMap", { + value: { + http: { + 'type': Array, + 'subtype': HTTPConfig + }, + iotAnalytics: { + 'type': Array, + 'subtype': IoTAnalyticsConfig + }, + kinesis: { + 'type': Array, + 'subtype': KinesisConfig + }, + IotSitewise: { + 'type': Array, + 'subtype': IoTSiteWiseConfig + }, + s3TaskExecutor: { + 'type': Array, + 'subtype': S3ExportTaskExecutorConfig + }, + } +}); +Object.defineProperty(ExportDefinition, "formatsMap", { + value: {} +}); +Object.defineProperty(ExportDefinition, "validationsMap", { + value: { + 'http': { + 'required': false, + }, + 'iotAnalytics': { + 'required': false, + }, + 'kinesis': { + 'required': false, + }, + 'IotSitewise': { + 'required': false, + }, + 's3TaskExecutor': { + 'required': false, + }, + } +}); + +/** + * StrategyOnFull is used in the MessageStreamDefinition when creating a stream. + It defines the behavior when the stream has reached the maximum size. + RejectNewData: any append message request after the stream is full will be rejected with an exception. + OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class StrategyOnFull { + + #value = null; + constructor(value = null) { + if (!Object.values(StrategyOnFull.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; + } + + static fromMap(d) { + return StrategyOnFull[StrategyOnFull.optionsFlipped[d]]; + } + + asMap() { + return this.#value; + } +}; +Object.defineProperty(StrategyOnFull, "options", { + value: { + RejectNewData: 0, + OverwriteOldestData: 1, + } +}); +Object.defineProperty(StrategyOnFull, "optionsFlipped", { + value: { + 0: "RejectNewData", + 1: "OverwriteOldestData", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} RejectNewData + * @memberOf aws-greengrass-core-sdk.StreamManager.StrategyOnFull# + * @readonly + */ +Object.defineProperty(StrategyOnFull, "RejectNewData", { + value: new StrategyOnFull(0) +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} OverwriteOldestData + * @memberOf aws-greengrass-core-sdk.StreamManager.StrategyOnFull# + * @readonly + */ +Object.defineProperty(StrategyOnFull, "OverwriteOldestData", { + value: new StrategyOnFull(1) +}); + +/** + * Object defining a message stream used in the CreateMessageStream and UpdateMessageStream API. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class MessageStreamDefinition { + #__name = null; + #__maxSize = null; + #__streamSegmentSize = null; + #__timeToLiveMillis = null; + #__strategyOnFull = null; + #__persistence = null; + #__flushOnWrite = null; + #__exportDefinition = null; + + /** + * @param name {String} The unique name of the stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @param maxSize {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. + * @param streamSegmentSize {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. + Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. + * @param timeToLiveMillis {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @param strategyOnFull {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. + RejectNewData: any append message request after the stream is full will be rejected with an exception. + OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. + * @param persistence {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. + Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. + * @param flushOnWrite {Boolean} This only applies when Persistence is set to File mode. + Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. + * @param exportDefinition {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. + */ + constructor( + name = null, + maxSize = 268435456, + streamSegmentSize = 16777216, + timeToLiveMillis = null, + strategyOnFull = null, + persistence = null, + flushOnWrite = null, + exportDefinition = null, + ) { + if (name !== null && !(typeof name === "string")) { + throw new Error("name must be String"); + } + + if (maxSize !== null && !(typeof maxSize === "number")) { + throw new Error("maxSize must be Number"); + } + + if (streamSegmentSize !== null && !(typeof streamSegmentSize === "number")) { + throw new Error("streamSegmentSize must be Number"); + } + + if (timeToLiveMillis !== null && !(typeof timeToLiveMillis === "number")) { + throw new Error("timeToLiveMillis must be Number"); + } + + if (strategyOnFull !== null && !(strategyOnFull instanceof StrategyOnFull)) { + throw new Error("strategyOnFull must be StrategyOnFull"); + } + + if (persistence !== null && !(persistence instanceof Persistence)) { + throw new Error("persistence must be Persistence"); + } + + if (flushOnWrite !== null && !(typeof flushOnWrite === "boolean")) { + throw new Error("flushOnWrite must be Boolean"); + } + + if (exportDefinition !== null && !(exportDefinition instanceof ExportDefinition)) { + throw new Error("exportDefinition must be ExportDefinition"); + } + + this.#__name = name; + this.#__maxSize = maxSize; + this.#__streamSegmentSize = streamSegmentSize; + this.#__timeToLiveMillis = timeToLiveMillis; + this.#__strategyOnFull = strategyOnFull; + this.#__persistence = persistence; + this.#__flushOnWrite = flushOnWrite; + this.#__exportDefinition = exportDefinition; + } + + /** + * The unique name of the stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {String} + + */ + get name() { + return this.#__name; + } + /** + * @param value {String} The unique name of the stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + */ + set name(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("name must be String"); + } + + this.#__name = value; + } + /** + * @param value {String} The unique name of the stream. + Must be an alphanumeric string including spaces, commas, periods, hyphens, and underscores with length between 1 and 255. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withName(value) { + this.name = value; + return this; + } + + /** + * The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. + * @returns {Number} + + */ + get maxSize() { + return this.#__maxSize; + } + /** + * @param value {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. + */ + set maxSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("maxSize must be Number"); + } + + this.#__maxSize = value; + } + /** + * @param value {Number} The maximum size in bytes for the entire stream. Set to 256MB by default with a minimum of 1KB and a maximum of 8192PB. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withMaxSize(value) { + this.maxSize = value; + return this; + } + + /** + * The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. + Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. + * @returns {Number} + + */ + get streamSegmentSize() { + return this.#__streamSegmentSize; + } + /** + * @param value {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. + Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. + */ + set streamSegmentSize(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("streamSegmentSize must be Number"); + } + + this.#__streamSegmentSize = value; + } + /** + * @param value {Number} The size of each segment of the stream. Set to 16MB by default with a minimum of 1KB and a maximum of 2GB. + Data is only deleted segment by segment, so the segment size is the smallest amount of data which can be deleted. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withStreamSegmentSize(value) { + this.streamSegmentSize = value; + return this; + } + + /** + * Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {Number} + + */ + get timeToLiveMillis() { + return this.#__timeToLiveMillis; + } + /** + * @param value {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + */ + set timeToLiveMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("timeToLiveMillis must be Number"); + } + + this.#__timeToLiveMillis = value; + } + /** + * @param value {Number} Time to live for each message in milliseconds. Data may be deleted at any time after the TTL expires; deletion is not guaranteed to occur immediately when the TTL expires. + The minimum value is 60000 milliseconds and the maximum is 9223372036854 milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withTimeToLiveMillis(value) { + this.timeToLiveMillis = value; + return this; + } + + /** + * What to do when the maximum size of the stream is reached. + RejectNewData: any append message request after the stream is full will be rejected with an exception. + OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. + * @returns {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} + + */ + get strategyOnFull() { + return this.#__strategyOnFull; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. + RejectNewData: any append message request after the stream is full will be rejected with an exception. + OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. + */ + set strategyOnFull(value) { + if (value !== null && !(value instanceof StrategyOnFull)) { + throw new Error("strategyOnFull must be StrategyOnFull"); + } + + this.#__strategyOnFull = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.StrategyOnFull} What to do when the maximum size of the stream is reached. + RejectNewData: any append message request after the stream is full will be rejected with an exception. + OverwriteOldestData: the oldest stream segments will be deleted until there is room for the new message. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withStrategyOnFull(value) { + this.strategyOnFull = value; + return this; + } + + /** + * Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. + Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. + * @returns {aws-greengrass-core-sdk.StreamManager.Persistence} + + */ + get persistence() { + return this.#__persistence; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. + Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. + */ + set persistence(value) { + if (value !== null && !(value instanceof Persistence)) { + throw new Error("persistence must be Persistence"); + } + + this.#__persistence = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.Persistence} Stream persistence. If set to File, the file system will be used to persist messages long-term and is resilient to restarts. + Memory should be used when performance matters more than durability as it only stores the stream in memory and never writes to the disk. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withPersistence(value) { + this.persistence = value; + return this; + } + + /** + * This only applies when Persistence is set to File mode. + Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. + * @returns {Boolean} + + */ + get flushOnWrite() { + return this.#__flushOnWrite; + } + /** + * @param value {Boolean} This only applies when Persistence is set to File mode. + Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. + */ + set flushOnWrite(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("flushOnWrite must be Boolean"); + } + + this.#__flushOnWrite = value; + } + /** + * @param value {Boolean} This only applies when Persistence is set to File mode. + Waits for the filesystem to complete the write for every message. This is safer, but slower. Default is false. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withFlushOnWrite(value) { + this.flushOnWrite = value; + return this; + } + + /** + * Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. + * @returns {aws-greengrass-core-sdk.StreamManager.ExportDefinition} + + */ + get exportDefinition() { + return this.#__exportDefinition; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. + */ + set exportDefinition(value) { + if (value !== null && !(value instanceof ExportDefinition)) { + throw new Error("exportDefinition must be ExportDefinition"); + } + + this.#__exportDefinition = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ExportDefinition} Defines how and where the stream is uploaded. See the definition of the ExportDefinition object for more detail. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + withExportDefinition(value) { + this.exportDefinition = value; + return this; + } + + static fromMap(d) { + const ret = new MessageStreamDefinition(); + if ("name" in d) { + ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + } + if ("maxSize" in d) { + ret.maxSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["maxSize"]) : d["maxSize"]; + } + if ("streamSegmentSize" in d) { + ret.streamSegmentSize = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["streamSegmentSize"]) : d["streamSegmentSize"]; + } + if ("timeToLiveMillis" in d) { + ret.timeToLiveMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["timeToLiveMillis"]) : d["timeToLiveMillis"]; + } + if ("strategyOnFull" in d) { + ret.strategyOnFull = Object.prototype.hasOwnProperty.call(StrategyOnFull, "fromMap") ? StrategyOnFull.fromMap(d["strategyOnFull"]) : d["strategyOnFull"]; + } + if ("persistence" in d) { + ret.persistence = Object.prototype.hasOwnProperty.call(Persistence, "fromMap") ? Persistence.fromMap(d["persistence"]) : d["persistence"]; + } + if ("flushOnWrite" in d) { + ret.flushOnWrite = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["flushOnWrite"]) : d["flushOnWrite"]; + } + if ("exportDefinition" in d) { + ret.exportDefinition = Object.prototype.hasOwnProperty.call(ExportDefinition, "fromMap") ? ExportDefinition.fromMap(d["exportDefinition"]) : d["exportDefinition"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.name !== null) { + d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + } + if (this.maxSize !== null) { + d["maxSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.maxSize), "asMap") ? this.maxSize.asMap() : this.maxSize; + } + if (this.streamSegmentSize !== null) { + d["streamSegmentSize"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamSegmentSize), "asMap") ? this.streamSegmentSize.asMap() : this.streamSegmentSize; + } + if (this.timeToLiveMillis !== null) { + d["timeToLiveMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.timeToLiveMillis), "asMap") ? this.timeToLiveMillis.asMap() : this.timeToLiveMillis; + } + if (this.strategyOnFull !== null) { + d["strategyOnFull"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.strategyOnFull), "asMap") ? this.strategyOnFull.asMap() : this.strategyOnFull; + } + if (this.persistence !== null) { + d["persistence"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.persistence), "asMap") ? this.persistence.asMap() : this.persistence; + } + if (this.flushOnWrite !== null) { + d["flushOnWrite"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.flushOnWrite), "asMap") ? this.flushOnWrite.asMap() : this.flushOnWrite; + } + if (this.exportDefinition !== null) { + d["exportDefinition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportDefinition), "asMap") ? this.exportDefinition.asMap() : this.exportDefinition; + } + return d; + } +}; + +Object.defineProperty(MessageStreamDefinition, "typesMap", { + value: { + name: { + 'type': String, + 'subtype': null + }, + maxSize: { + 'type': Number, + 'subtype': null + }, + streamSegmentSize: { + 'type': Number, + 'subtype': null + }, + timeToLiveMillis: { + 'type': Number, + 'subtype': null + }, + strategyOnFull: { + 'type': StrategyOnFull, + 'subtype': null + }, + persistence: { + 'type': Persistence, + 'subtype': null + }, + flushOnWrite: { + 'type': Boolean, + 'subtype': null + }, + exportDefinition: { + 'type': ExportDefinition, + 'subtype': null + }, + } +}); +Object.defineProperty(MessageStreamDefinition, "formatsMap", { + value: {} +}); +Object.defineProperty(MessageStreamDefinition, "validationsMap", { + value: { + 'name': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'maxSize': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 1024, + }, + 'streamSegmentSize': { + 'required': false, + 'maximum': 2147483647, + 'minimum': 1024, + }, + 'timeToLiveMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 60000, + }, + 'strategyOnFull': { + 'required': true, + }, + 'persistence': { + 'required': false, + }, + 'flushOnWrite': { + 'required': false, + }, + 'exportDefinition': { + 'required': false, + }, + } +}); + +/** + * (Internal Only) Request object for creating a message stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class CreateMessageStreamRequest { + #__requestId = null; + #__definition = null; + + /** + * @param requestId {String} + * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + constructor( + requestId = null, + definition = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (definition !== null && !(definition instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + this.#__requestId = requestId; + this.#__definition = definition; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + + */ + get definition() { + return this.#__definition; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + set definition(value) { + if (value !== null && !(value instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + this.#__definition = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest} + */ + withDefinition(value) { + this.definition = value; + return this; + } + + static fromMap(d) { + const ret = new CreateMessageStreamRequest(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("definition" in d) { + ret.definition = Object.prototype.hasOwnProperty.call(MessageStreamDefinition, "fromMap") ? MessageStreamDefinition.fromMap(d["definition"]) : d["definition"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.definition !== null) { + d["definition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.definition), "asMap") ? this.definition.asMap() : this.definition; + } + return d; + } +}; + +Object.defineProperty(CreateMessageStreamRequest, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + definition: { + 'type': MessageStreamDefinition, + 'subtype': null + }, + } +}); +Object.defineProperty(CreateMessageStreamRequest, "formatsMap", { + value: {} +}); +Object.defineProperty(CreateMessageStreamRequest, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'definition': { + 'required': true, + }, + } +}); + +/** + * Internal Only. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class CreateMessageStreamResponse { + #__requestId = null; + #__status = null; + #__errorMessage = null; + + /** + * @param requestId {String} + * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param errorMessage {String} + */ + constructor( + requestId = null, + status = null, + errorMessage = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (status !== null && !(status instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__requestId = requestId; + this.#__status = status; + this.#__errorMessage = errorMessage; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + + */ + get status() { + return this.#__status; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + */ + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + this.#__status = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + */ + withStatus(value) { + this.status = value; + return this; + } + + /** + * @returns {String} + + */ + get errorMessage() { + return this.#__errorMessage; + } + /** + * @param value {String} + */ + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__errorMessage = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + */ + withErrorMessage(value) { + this.errorMessage = value; + return this; + } + + static fromMap(d) { + const ret = new CreateMessageStreamResponse(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + } + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + } + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + } + return d; + } +}; + +Object.defineProperty(CreateMessageStreamResponse, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + status: { + 'type': ResponseStatusCode, + 'subtype': null + }, + errorMessage: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(CreateMessageStreamResponse, "formatsMap", { + value: {} +}); +Object.defineProperty(CreateMessageStreamResponse, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'status': { + 'required': true, + }, + 'errorMessage': { + 'required': false, + }, + } +}); + +/** + * (Internal Only) Request object for updating a message stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class UpdateMessageStreamRequest { + #__requestId = null; + #__definition = null; + + /** + * @param requestId {String} + * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + constructor( + requestId = null, + definition = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (definition !== null && !(definition instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + this.#__requestId = requestId; + this.#__definition = definition; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + + */ + get definition() { + return this.#__definition; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + set definition(value) { + if (value !== null && !(value instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + this.#__definition = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @returns {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamRequest} + */ + withDefinition(value) { + this.definition = value; + return this; + } + + static fromMap(d) { + const ret = new UpdateMessageStreamRequest(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("definition" in d) { + ret.definition = Object.prototype.hasOwnProperty.call(MessageStreamDefinition, "fromMap") ? MessageStreamDefinition.fromMap(d["definition"]) : d["definition"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.definition !== null) { + d["definition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.definition), "asMap") ? this.definition.asMap() : this.definition; + } + return d; + } +}; + +Object.defineProperty(UpdateMessageStreamRequest, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + definition: { + 'type': MessageStreamDefinition, + 'subtype': null + }, + } +}); +Object.defineProperty(UpdateMessageStreamRequest, "formatsMap", { + value: {} +}); +Object.defineProperty(UpdateMessageStreamRequest, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'definition': { + 'required': true, + }, + } +}); + +/** + * (Internal Only) Response for UpdateMessageStreamRequest. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class UpdateMessageStreamResponse { + #__requestId = null; + #__status = null; + #__errorMessage = null; + + /** + * @param requestId {String} + * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param errorMessage {String} + */ + constructor( + requestId = null, + status = null, + errorMessage = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (status !== null && !(status instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__requestId = requestId; + this.#__status = status; + this.#__errorMessage = errorMessage; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + + */ + get status() { + return this.#__status; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + */ + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + this.#__status = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse} + */ + withStatus(value) { + this.status = value; + return this; + } + + /** + * @returns {String} + + */ + get errorMessage() { + return this.#__errorMessage; + } + /** + * @param value {String} + */ + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__errorMessage = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.UpdateMessageStreamResponse} + */ + withErrorMessage(value) { + this.errorMessage = value; + return this; + } + + static fromMap(d) { + const ret = new UpdateMessageStreamResponse(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + } + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + } + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + } + return d; + } +}; + +Object.defineProperty(UpdateMessageStreamResponse, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + status: { + 'type': ResponseStatusCode, + 'subtype': null + }, + errorMessage: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(UpdateMessageStreamResponse, "formatsMap", { + value: {} +}); +Object.defineProperty(UpdateMessageStreamResponse, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'status': { + 'required': true, + }, + 'errorMessage': { + 'required': false, + }, + } +}); + +/** + * (Internal Only) Request object for deleting a message stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class DeleteMessageStreamRequest { + #__requestId = null; + #__name = null; + + /** + * @param requestId {String} + * @param name {String} + */ + constructor( + requestId = null, + name = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (name !== null && !(typeof name === "string")) { + throw new Error("name must be String"); + } + + this.#__requestId = requestId; + this.#__name = name; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {String} + + */ + get name() { + return this.#__name; + } + /** + * @param value {String} + */ + set name(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("name must be String"); + } + + this.#__name = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest} + */ + withName(value) { + this.name = value; + return this; + } + + static fromMap(d) { + const ret = new DeleteMessageStreamRequest(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("name" in d) { + ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.name !== null) { + d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + } + return d; + } +}; + +Object.defineProperty(DeleteMessageStreamRequest, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + name: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(DeleteMessageStreamRequest, "formatsMap", { + value: {} +}); +Object.defineProperty(DeleteMessageStreamRequest, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'name': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + } +}); + +/** + * Internal Only. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class DeleteMessageStreamResponse { + #__requestId = null; + #__status = null; + #__errorMessage = null; + + /** + * @param requestId {String} + * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param errorMessage {String} + */ + constructor( + requestId = null, + status = null, + errorMessage = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (status !== null && !(status instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__requestId = requestId; + this.#__status = status; + this.#__errorMessage = errorMessage; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + + */ + get status() { + return this.#__status; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + */ + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); + } + + this.#__status = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + */ + withStatus(value) { + this.status = value; + return this; + } + + /** + * @returns {String} + + */ + get errorMessage() { + return this.#__errorMessage; + } + /** + * @param value {String} + */ + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); + } + + this.#__errorMessage = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + */ + withErrorMessage(value) { + this.errorMessage = value; + return this; + } + + static fromMap(d) { + const ret = new DeleteMessageStreamResponse(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + } + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + } + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + } + return d; + } +}; + +Object.defineProperty(DeleteMessageStreamResponse, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + status: { + 'type': ResponseStatusCode, + 'subtype': null + }, + errorMessage: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(DeleteMessageStreamResponse, "formatsMap", { + value: {} +}); +Object.defineProperty(DeleteMessageStreamResponse, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'status': { + 'required': true, + }, + 'errorMessage': { + 'required': false, + }, + } +}); + +/** + * (Internal Only) Request object for describing a message stream. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class DescribeMessageStreamRequest { + #__requestId = null; + #__name = null; + + /** + * @param requestId {String} + * @param name {String} + */ + constructor( + requestId = null, + name = null, + ) { + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); + } + + if (name !== null && !(typeof name === "string")) { + throw new Error("name must be String"); + } + + this.#__requestId = requestId; + this.#__name = name; + } + + /** + * @returns {String} + + */ + get requestId() { + return this.#__requestId; + } + /** + * @param value {String} + */ + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); + } + + this.#__requestId = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest} + */ + withRequestId(value) { + this.requestId = value; + return this; + } + + /** + * @returns {String} + + */ + get name() { + return this.#__name; + } + /** + * @param value {String} + */ + set name(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("name must be String"); + } + + this.#__name = value; + } + /** + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest} + */ + withName(value) { + this.name = value; + return this; + } + + static fromMap(d) { + const ret = new DescribeMessageStreamRequest(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + } + if ("name" in d) { + ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + } + return ret; + } + + asMap() { + const d = {}; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + } + if (this.name !== null) { + d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + } + return d; + } +}; + +Object.defineProperty(DescribeMessageStreamRequest, "typesMap", { + value: { + requestId: { + 'type': String, + 'subtype': null + }, + name: { + 'type': String, + 'subtype': null + }, + } +}); +Object.defineProperty(DescribeMessageStreamRequest, "formatsMap", { + value: {} +}); +Object.defineProperty(DescribeMessageStreamRequest, "validationsMap", { + value: { + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'name': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + } +}); + +/** + * Message stream information including its definition, storage status and export status. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class MessageStreamInfo { + #__definition = null; + #__storageStatus = null; + #__exportStatuses = null; + + /** + * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param storageStatus {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes. + * @param exportStatuses {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + */ + constructor( + definition = null, + storageStatus = null, + exportStatuses = null, + ) { + if (definition !== null && !(definition instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + if (storageStatus !== null && !(storageStatus instanceof MessageStreamInfo._storageStatus)) { + throw new Error("storageStatus must be MessageStreamInfo._storageStatus"); + } + + if (exportStatuses !== null && !(exportStatuses instanceof Array)) { + throw new Error("exportStatuses must be Array"); + } + if (exportStatuses !== null && !exportStatuses.every((v) => v instanceof MessageStreamInfo._exportStatuses)) { + throw new Error("exportStatuses array values must be MessageStreamInfo._exportStatuses"); + } + + this.#__definition = definition; + this.#__storageStatus = storageStatus; + this.#__exportStatuses = exportStatuses; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + + */ + get definition() { + return this.#__definition; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + */ + set definition(value) { + if (value !== null && !(value instanceof MessageStreamDefinition)) { + throw new Error("definition must be MessageStreamDefinition"); + } + + this.#__definition = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + */ + withDefinition(value) { + this.definition = value; + return this; + } + + /** + * Stream status including oldest/newest sequence number and total bytes. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} + + */ + get storageStatus() { + return this.#__storageStatus; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes. + */ + set storageStatus(value) { + if (value !== null && !(value instanceof MessageStreamInfo._storageStatus)) { + throw new Error("storageStatus must be MessageStreamInfo._storageStatus"); + } + + this.#__storageStatus = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} Stream status including oldest/newest sequence number and total bytes. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + */ + withStorageStatus(value) { + this.storageStatus = value; + return this; + } + + /** + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + + */ + get exportStatuses() { + return this.#__exportStatuses; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + */ + set exportStatuses(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("exportStatuses must be Array"); + } + if (value !== null && !value.every((v) => v instanceof MessageStreamInfo._exportStatuses)) { + throw new Error("exportStatuses array values must be MessageStreamInfo._exportStatuses"); + } + + this.#__exportStatuses = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses[]} + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + */ + withExportStatuses(value) { + this.exportStatuses = value; + return this; + } + + static fromMap(d) { + const ret = new MessageStreamInfo(); + if ("definition" in d) { + ret.definition = Object.prototype.hasOwnProperty.call(MessageStreamDefinition, "fromMap") ? MessageStreamDefinition.fromMap(d["definition"]) : d["definition"]; + } + if ("storageStatus" in d) { + ret.storageStatus = Object.prototype.hasOwnProperty.call(MessageStreamInfo._storageStatus, "fromMap") ? MessageStreamInfo._storageStatus.fromMap(d["storageStatus"]) : d["storageStatus"]; + } + if ("exportStatuses" in d) { + ret.exportStatuses = d["exportStatuses"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(MessageStreamInfo._exportStatuses, "fromMap") ? MessageStreamInfo._exportStatuses.fromMap(v) : v); + return acc; + }, []); + } + return ret; + } -MessageStreamInfo._exportStatuses = + asMap() { + const d = {}; + if (this.definition !== null) { + d["definition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.definition), "asMap") ? this.definition.asMap() : this.definition; + } + if (this.storageStatus !== null) { + d["storageStatus"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.storageStatus), "asMap") ? this.storageStatus.asMap() : this.storageStatus; + } + if (this.exportStatuses !== null) { + d["exportStatuses"] = this.exportStatuses.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } + return d; + } +}; + +MessageStreamInfo._storageStatus = /** - * Export status including the export identifier and the last exported sequence number for that export task + * Stream status including oldest/newest sequence number and total bytes. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ - class _exportStatuses { - #__exportConfigIdentifier = null; - #__lastExportedSequenceNumber = null; - #__lastExportTime = null; - #__errorMessage = null; + class _storageStatus { + #__oldestSequenceNumber = null; + #__newestSequenceNumber = null; + #__totalBytes = null; /** - * @param exportConfigIdentifier {String} The unique export identifier. - * @param lastExportedSequenceNumber {Number} The sequence number of the last message which was successfully exported. - * @param lastExportTime {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. - * @param errorMessage {String} Error message from the last export attempt if it failed. + * @param oldestSequenceNumber {Number} The sequence number of the first message which is still accessible in the stream. + * @param newestSequenceNumber {Number} The sequence number of the last appended message. + * @param totalBytes {Number} The current total size of the stream in bytes. */ constructor( - exportConfigIdentifier = null, - lastExportedSequenceNumber = null, - lastExportTime = null, - errorMessage = null, + oldestSequenceNumber = null, + newestSequenceNumber = null, + totalBytes = null, ) { - if (exportConfigIdentifier !== null && !(typeof exportConfigIdentifier === "string")) { - throw new Error("exportConfigIdentifier must be String"); - } - - if (lastExportedSequenceNumber !== null && !(typeof lastExportedSequenceNumber === "number")) { - throw new Error("lastExportedSequenceNumber must be Number"); - } - - if (lastExportTime !== null && !(typeof lastExportTime === "number")) { - throw new Error("lastExportTime must be Number"); + if (oldestSequenceNumber !== null && !(typeof oldestSequenceNumber === "number")) { + throw new Error("oldestSequenceNumber must be Number"); } - if (errorMessage !== null && !(typeof errorMessage === "string")) { - throw new Error("errorMessage must be String"); + if (newestSequenceNumber !== null && !(typeof newestSequenceNumber === "number")) { + throw new Error("newestSequenceNumber must be Number"); } - this.#__exportConfigIdentifier = exportConfigIdentifier; - this.#__lastExportedSequenceNumber = lastExportedSequenceNumber; - this.#__lastExportTime = lastExportTime; - this.#__errorMessage = errorMessage; - } - - /** - * The unique export identifier. - * @returns {String} - - */ - get exportConfigIdentifier() { - return this.#__exportConfigIdentifier; - } - /** - * @param value {String} The unique export identifier. - */ - set exportConfigIdentifier(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("exportConfigIdentifier must be String"); + if (totalBytes !== null && !(typeof totalBytes === "number")) { + throw new Error("totalBytes must be Number"); } - this.#__exportConfigIdentifier = value; - } - /** - * @param value {String} The unique export identifier. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} - */ - withExportConfigIdentifier(value) { - this.exportConfigIdentifier = value; - return this; + this.#__oldestSequenceNumber = oldestSequenceNumber; + this.#__newestSequenceNumber = newestSequenceNumber; + this.#__totalBytes = totalBytes; } /** - * The sequence number of the last message which was successfully exported. + * The sequence number of the first message which is still accessible in the stream. * @returns {Number} */ - get lastExportedSequenceNumber() { - return this.#__lastExportedSequenceNumber; + get oldestSequenceNumber() { + return this.#__oldestSequenceNumber; } /** - * @param value {Number} The sequence number of the last message which was successfully exported. + * @param value {Number} The sequence number of the first message which is still accessible in the stream. */ - set lastExportedSequenceNumber(value) { + set oldestSequenceNumber(value) { if (value !== null && !(typeof value === "number")) { - throw new Error("lastExportedSequenceNumber must be Number"); + throw new Error("oldestSequenceNumber must be Number"); } - this.#__lastExportedSequenceNumber = value; + this.#__oldestSequenceNumber = value; } /** - * @param value {Number} The sequence number of the last message which was successfully exported. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + * @param value {Number} The sequence number of the first message which is still accessible in the stream. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} */ - withLastExportedSequenceNumber(value) { - this.lastExportedSequenceNumber = value; + withOldestSequenceNumber(value) { + this.oldestSequenceNumber = value; return this; } /** - * The last time an export was attempted. Data is Unix epoch time in milliseconds. + * The sequence number of the last appended message. * @returns {Number} */ - get lastExportTime() { - return this.#__lastExportTime; + get newestSequenceNumber() { + return this.#__newestSequenceNumber; } /** - * @param value {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. + * @param value {Number} The sequence number of the last appended message. */ - set lastExportTime(value) { + set newestSequenceNumber(value) { if (value !== null && !(typeof value === "number")) { - throw new Error("lastExportTime must be Number"); + throw new Error("newestSequenceNumber must be Number"); } - this.#__lastExportTime = value; + this.#__newestSequenceNumber = value; } /** - * @param value {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + * @param value {Number} The sequence number of the last appended message. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} */ - withLastExportTime(value) { - this.lastExportTime = value; + withNewestSequenceNumber(value) { + this.newestSequenceNumber = value; return this; } /** - * Error message from the last export attempt if it failed. - * @returns {String} + * The current total size of the stream in bytes. + * @returns {Number} */ - get errorMessage() { - return this.#__errorMessage; + get totalBytes() { + return this.#__totalBytes; } /** - * @param value {String} Error message from the last export attempt if it failed. + * @param value {Number} The current total size of the stream in bytes. */ - set errorMessage(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("errorMessage must be String"); + set totalBytes(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("totalBytes must be Number"); } - this.#__errorMessage = value; + this.#__totalBytes = value; } /** - * @param value {String} Error message from the last export attempt if it failed. - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + * @param value {Number} The current total size of the stream in bytes. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._storageStatus} */ - withErrorMessage(value) { - this.errorMessage = value; + withTotalBytes(value) { + this.totalBytes = value; return this; } static fromMap(d) { - const ret = new MessageStreamInfo._exportStatuses(); - if ("exportConfigIdentifier" in d) { - ret.exportConfigIdentifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["exportConfigIdentifier"]) : d["exportConfigIdentifier"]; - } - if ("lastExportedSequenceNumber" in d) { - ret.lastExportedSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["lastExportedSequenceNumber"]) : d["lastExportedSequenceNumber"]; + const ret = new MessageStreamInfo._storageStatus(); + if ("oldestSequenceNumber" in d) { + ret.oldestSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["oldestSequenceNumber"]) : d["oldestSequenceNumber"]; } - if ("lastExportTime" in d) { - ret.lastExportTime = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["lastExportTime"]) : d["lastExportTime"]; + if ("newestSequenceNumber" in d) { + ret.newestSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["newestSequenceNumber"]) : d["newestSequenceNumber"]; } - if ("errorMessage" in d) { - ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + if ("totalBytes" in d) { + ret.totalBytes = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["totalBytes"]) : d["totalBytes"]; } return ret; } asMap() { const d = {}; - if (this.exportConfigIdentifier !== null) { - d["exportConfigIdentifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportConfigIdentifier), "asMap") ? this.exportConfigIdentifier.asMap() : this.exportConfigIdentifier; - } - if (this.lastExportedSequenceNumber !== null) { - d["lastExportedSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.lastExportedSequenceNumber), "asMap") ? this.lastExportedSequenceNumber.asMap() : this.lastExportedSequenceNumber; + if (this.oldestSequenceNumber !== null) { + d["oldestSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.oldestSequenceNumber), "asMap") ? this.oldestSequenceNumber.asMap() : this.oldestSequenceNumber; } - if (this.lastExportTime !== null) { - d["lastExportTime"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.lastExportTime), "asMap") ? this.lastExportTime.asMap() : this.lastExportTime; + if (this.newestSequenceNumber !== null) { + d["newestSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.newestSequenceNumber), "asMap") ? this.newestSequenceNumber.asMap() : this.newestSequenceNumber; } - if (this.errorMessage !== null) { - d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + if (this.totalBytes !== null) { + d["totalBytes"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.totalBytes), "asMap") ? this.totalBytes.asMap() : this.totalBytes; } return d; } }; -Object.defineProperty(MessageStreamInfo._exportStatuses, "typesMap", { +Object.defineProperty(MessageStreamInfo._storageStatus, "typesMap", { value: { - exportConfigIdentifier: { - 'type': String, - 'subtype': null - }, - lastExportedSequenceNumber: { + oldestSequenceNumber: { 'type': Number, 'subtype': null }, - lastExportTime: { + newestSequenceNumber: { 'type': Number, 'subtype': null }, - errorMessage: { - 'type': String, - 'subtype': null - }, - } -}); -Object.defineProperty(MessageStreamInfo._exportStatuses, "formatsMap", { - value: {} -}); -Object.defineProperty(MessageStreamInfo._exportStatuses, "validationsMap", { - value: { - 'exportConfigIdentifier': { - 'required': false, - }, - 'lastExportedSequenceNumber': { - 'required': true, - }, - 'lastExportTime': { - 'required': false, - }, - 'errorMessage': { - 'required': false, - }, - } -}); - -Object.defineProperty(MessageStreamInfo, "typesMap", { - value: { - definition: { - 'type': MessageStreamDefinition, - 'subtype': null - }, - storageStatus: { - 'type': MessageStreamInfo._storageStatus, + totalBytes: { + 'type': Number, 'subtype': null }, - exportStatuses: { - 'type': Array, - 'subtype': MessageStreamInfo._exportStatuses - }, } }); -Object.defineProperty(MessageStreamInfo, "formatsMap", { +Object.defineProperty(MessageStreamInfo._storageStatus, "formatsMap", { value: {} }); -Object.defineProperty(MessageStreamInfo, "validationsMap", { +Object.defineProperty(MessageStreamInfo._storageStatus, "validationsMap", { value: { - 'definition': { - 'required': true, + 'oldestSequenceNumber': { + 'required': false, }, - 'storageStatus': { - 'required': true, + 'newestSequenceNumber': { + 'required': false, }, - 'exportStatuses': { + 'totalBytes': { 'required': false, }, } }); -/** - * Message object containing metadata and the user's payload - * - * @class - * @memberOf aws-greengrass-core-sdk.StreamManager - */ -class Message { - #__streamName = null; - #__sequenceNumber = null; - #__ingestTime = null; - #__payload = null; - +MessageStreamInfo._exportStatuses = /** - * @param streamName {String} The name of the stream which this message is in. - * @param sequenceNumber {Number} The sequence number of this message within the stream. - * @param ingestTime {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. - * @param payload {Buffer} The binary message data. + * Export status including the export identifier and the last exported sequence number for that export task. + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager */ - constructor( - streamName = null, - sequenceNumber = null, - ingestTime = null, - payload = null, - ) { - if (streamName !== null && !(typeof streamName === "string")) { - throw new Error("streamName must be String"); - } + class _exportStatuses { + #__exportConfigIdentifier = null; + #__lastExportedSequenceNumber = null; + #__lastExportTime = null; + #__errorMessage = null; + #__exportedBytesFromStream = null; + #__exportedMessagesCount = null; - if (sequenceNumber !== null && !(typeof sequenceNumber === "number")) { - throw new Error("sequenceNumber must be Number"); - } + /** + * @param exportConfigIdentifier {String} The unique export identifier. + * @param lastExportedSequenceNumber {Number} The sequence number of the last message which was successfully exported. + * @param lastExportTime {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. + * @param errorMessage {String} Error message from the last export attempt if it failed. + * @param exportedBytesFromStream {Number} Total bytes exported from the stream for this Export Config. It does not include the failed export attempts or messages which are skipped because of some non-retryable error. + * @param exportedMessagesCount {Number} Total messages exported/processed. + */ + constructor( + exportConfigIdentifier = null, + lastExportedSequenceNumber = null, + lastExportTime = null, + errorMessage = null, + exportedBytesFromStream = null, + exportedMessagesCount = null, + ) { + if (exportConfigIdentifier !== null && !(typeof exportConfigIdentifier === "string")) { + throw new Error("exportConfigIdentifier must be String"); + } - if (ingestTime !== null && !(typeof ingestTime === "number")) { - throw new Error("ingestTime must be Number"); - } + if (lastExportedSequenceNumber !== null && !(typeof lastExportedSequenceNumber === "number")) { + throw new Error("lastExportedSequenceNumber must be Number"); + } - if (payload !== null && !(payload instanceof Buffer)) { - throw new Error("payload must be Buffer"); - } + if (lastExportTime !== null && !(typeof lastExportTime === "number")) { + throw new Error("lastExportTime must be Number"); + } - this.#__streamName = streamName; - this.#__sequenceNumber = sequenceNumber; - this.#__ingestTime = ingestTime; - this.#__payload = payload; - } + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); + } - /** - * The name of the stream which this message is in. - * @returns {String} - - */ - get streamName() { - return this.#__streamName; - } - /** - * @param value {String} The name of the stream which this message is in. - */ - set streamName(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("streamName must be String"); + if (exportedBytesFromStream !== null && !(typeof exportedBytesFromStream === "number")) { + throw new Error("exportedBytesFromStream must be Number"); + } + + if (exportedMessagesCount !== null && !(typeof exportedMessagesCount === "number")) { + throw new Error("exportedMessagesCount must be Number"); + } + + this.#__exportConfigIdentifier = exportConfigIdentifier; + this.#__lastExportedSequenceNumber = lastExportedSequenceNumber; + this.#__lastExportTime = lastExportTime; + this.#__errorMessage = errorMessage; + this.#__exportedBytesFromStream = exportedBytesFromStream; + this.#__exportedMessagesCount = exportedMessagesCount; } - this.#__streamName = value; - } - /** - * @param value {String} The name of the stream which this message is in. - * @returns {aws-greengrass-core-sdk.StreamManager.Message} - */ - withStreamName(value) { - this.streamName = value; - return this; - } + /** + * The unique export identifier. + * @returns {String} + + */ + get exportConfigIdentifier() { + return this.#__exportConfigIdentifier; + } + /** + * @param value {String} The unique export identifier. + */ + set exportConfigIdentifier(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("exportConfigIdentifier must be String"); + } - /** - * The sequence number of this message within the stream. - * @returns {Number} - - */ - get sequenceNumber() { - return this.#__sequenceNumber; - } - /** - * @param value {Number} The sequence number of this message within the stream. - */ - set sequenceNumber(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("sequenceNumber must be Number"); + this.#__exportConfigIdentifier = value; + } + /** + * @param value {String} The unique export identifier. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withExportConfigIdentifier(value) { + this.exportConfigIdentifier = value; + return this; } - this.#__sequenceNumber = value; - } - /** - * @param value {Number} The sequence number of this message within the stream. - * @returns {aws-greengrass-core-sdk.StreamManager.Message} - */ - withSequenceNumber(value) { - this.sequenceNumber = value; - return this; - } + /** + * The sequence number of the last message which was successfully exported. + * @returns {Number} + + */ + get lastExportedSequenceNumber() { + return this.#__lastExportedSequenceNumber; + } + /** + * @param value {Number} The sequence number of the last message which was successfully exported. + */ + set lastExportedSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("lastExportedSequenceNumber must be Number"); + } - /** - * The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. - * @returns {Number} - - */ - get ingestTime() { - return this.#__ingestTime; - } - /** - * @param value {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. - */ - set ingestTime(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("ingestTime must be Number"); + this.#__lastExportedSequenceNumber = value; + } + /** + * @param value {Number} The sequence number of the last message which was successfully exported. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withLastExportedSequenceNumber(value) { + this.lastExportedSequenceNumber = value; + return this; } - this.#__ingestTime = value; - } - /** - * @param value {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. - * @returns {aws-greengrass-core-sdk.StreamManager.Message} - */ - withIngestTime(value) { - this.ingestTime = value; - return this; - } + /** + * The last time an export was attempted. Data is Unix epoch time in milliseconds. + * @returns {Number} + + */ + get lastExportTime() { + return this.#__lastExportTime; + } + /** + * @param value {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. + */ + set lastExportTime(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("lastExportTime must be Number"); + } - /** - * The binary message data. - * @returns {Buffer} - - */ - get payload() { - return this.#__payload; - } - /** - * @param value {Buffer} The binary message data. - */ - set payload(value) { - if (value !== null && !(value instanceof Buffer)) { - throw new Error("payload must be Buffer"); + this.#__lastExportTime = value; + } + /** + * @param value {Number} The last time an export was attempted. Data is Unix epoch time in milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withLastExportTime(value) { + this.lastExportTime = value; + return this; + } + + /** + * Error message from the last export attempt if it failed. + * @returns {String} + + */ + get errorMessage() { + return this.#__errorMessage; } + /** + * @param value {String} Error message from the last export attempt if it failed. + */ + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); + } - this.#__payload = value; - } - /** - * @param value {Buffer} The binary message data. - * @returns {aws-greengrass-core-sdk.StreamManager.Message} - */ - withPayload(value) { - this.payload = value; - return this; - } + this.#__errorMessage = value; + } + /** + * @param value {String} Error message from the last export attempt if it failed. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withErrorMessage(value) { + this.errorMessage = value; + return this; + } - static fromMap(d) { - const ret = new Message(); - if ("streamName" in d) { - ret.streamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["streamName"]) : d["streamName"]; + /** + * Total bytes exported from the stream for this Export Config. It does not include the failed export attempts or messages which are skipped because of some non-retryable error. + * @returns {Number} + + */ + get exportedBytesFromStream() { + return this.#__exportedBytesFromStream; } - if ("sequenceNumber" in d) { - ret.sequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sequenceNumber"]) : d["sequenceNumber"]; + /** + * @param value {Number} Total bytes exported from the stream for this Export Config. It does not include the failed export attempts or messages which are skipped because of some non-retryable error. + */ + set exportedBytesFromStream(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("exportedBytesFromStream must be Number"); + } + + this.#__exportedBytesFromStream = value; } - if ("ingestTime" in d) { - ret.ingestTime = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["ingestTime"]) : d["ingestTime"]; + /** + * @param value {Number} Total bytes exported from the stream for this Export Config. It does not include the failed export attempts or messages which are skipped because of some non-retryable error. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withExportedBytesFromStream(value) { + this.exportedBytesFromStream = value; + return this; } - if ("payload" in d) { - ret.payload = Object.prototype.hasOwnProperty.call(Buffer, "fromMap") ? Buffer.fromMap(d["payload"]) : d["payload"]; + + /** + * Total messages exported/processed. + * @returns {Number} + + */ + get exportedMessagesCount() { + return this.#__exportedMessagesCount; } - return ret; - } + /** + * @param value {Number} Total messages exported/processed. + */ + set exportedMessagesCount(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("exportedMessagesCount must be Number"); + } - asMap() { - const d = {}; - if (this.streamName !== null) { - d["streamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamName), "asMap") ? this.streamName.asMap() : this.streamName; + this.#__exportedMessagesCount = value; } - if (this.sequenceNumber !== null) { - d["sequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sequenceNumber), "asMap") ? this.sequenceNumber.asMap() : this.sequenceNumber; + /** + * @param value {Number} Total messages exported/processed. + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo~MessageStreamInfo._exportStatuses} + */ + withExportedMessagesCount(value) { + this.exportedMessagesCount = value; + return this; } - if (this.ingestTime !== null) { - d["ingestTime"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.ingestTime), "asMap") ? this.ingestTime.asMap() : this.ingestTime; + + static fromMap(d) { + const ret = new MessageStreamInfo._exportStatuses(); + if ("exportConfigIdentifier" in d) { + ret.exportConfigIdentifier = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["exportConfigIdentifier"]) : d["exportConfigIdentifier"]; + } + if ("lastExportedSequenceNumber" in d) { + ret.lastExportedSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["lastExportedSequenceNumber"]) : d["lastExportedSequenceNumber"]; + } + if ("lastExportTime" in d) { + ret.lastExportTime = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["lastExportTime"]) : d["lastExportTime"]; + } + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + } + if ("exportedBytesFromStream" in d) { + ret.exportedBytesFromStream = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["exportedBytesFromStream"]) : d["exportedBytesFromStream"]; + } + if ("exportedMessagesCount" in d) { + ret.exportedMessagesCount = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["exportedMessagesCount"]) : d["exportedMessagesCount"]; + } + return ret; } - if (this.payload !== null) { - d["payload"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.payload), "asMap") ? this.payload.asMap() : this.payload; + + asMap() { + const d = {}; + if (this.exportConfigIdentifier !== null) { + d["exportConfigIdentifier"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportConfigIdentifier), "asMap") ? this.exportConfigIdentifier.asMap() : this.exportConfigIdentifier; + } + if (this.lastExportedSequenceNumber !== null) { + d["lastExportedSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.lastExportedSequenceNumber), "asMap") ? this.lastExportedSequenceNumber.asMap() : this.lastExportedSequenceNumber; + } + if (this.lastExportTime !== null) { + d["lastExportTime"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.lastExportTime), "asMap") ? this.lastExportTime.asMap() : this.lastExportTime; + } + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + } + if (this.exportedBytesFromStream !== null) { + d["exportedBytesFromStream"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportedBytesFromStream), "asMap") ? this.exportedBytesFromStream.asMap() : this.exportedBytesFromStream; + } + if (this.exportedMessagesCount !== null) { + d["exportedMessagesCount"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.exportedMessagesCount), "asMap") ? this.exportedMessagesCount.asMap() : this.exportedMessagesCount; + } + return d; } - return d; - } -}; + }; -Object.defineProperty(Message, "typesMap", { +Object.defineProperty(MessageStreamInfo._exportStatuses, "typesMap", { value: { - streamName: { + exportConfigIdentifier: { 'type': String, 'subtype': null }, - sequenceNumber: { + lastExportedSequenceNumber: { 'type': Number, 'subtype': null }, - ingestTime: { + lastExportTime: { 'type': Number, 'subtype': null }, - payload: { - 'type': Buffer, + errorMessage: { + 'type': String, + 'subtype': null + }, + exportedBytesFromStream: { + 'type': Number, + 'subtype': null + }, + exportedMessagesCount: { + 'type': Number, 'subtype': null }, } }); -Object.defineProperty(Message, "formatsMap", { +Object.defineProperty(MessageStreamInfo._exportStatuses, "formatsMap", { value: {} }); -Object.defineProperty(Message, "validationsMap", { +Object.defineProperty(MessageStreamInfo._exportStatuses, "validationsMap", { value: { - 'streamName': { + 'exportConfigIdentifier': { + 'required': false, + }, + 'lastExportedSequenceNumber': { 'required': true, }, - 'sequenceNumber': { + 'lastExportTime': { 'required': false, }, - 'ingestTime': { + 'errorMessage': { 'required': false, }, - 'payload': { + 'exportedBytesFromStream': { + 'required': false, + }, + 'exportedMessagesCount': { + 'required': false, + }, + } +}); + +Object.defineProperty(MessageStreamInfo, "typesMap", { + value: { + definition: { + 'type': MessageStreamDefinition, + 'subtype': null + }, + storageStatus: { + 'type': MessageStreamInfo._storageStatus, + 'subtype': null + }, + exportStatuses: { + 'type': Array, + 'subtype': MessageStreamInfo._exportStatuses + }, + } +}); +Object.defineProperty(MessageStreamInfo, "formatsMap", { + value: {} +}); +Object.defineProperty(MessageStreamInfo, "validationsMap", { + value: { + 'definition': { + 'required': true, + }, + 'storageStatus': { 'required': true, }, + 'exportStatuses': { + 'required': false, + }, } }); /** - * Options for the ReadMessages API. All fields are optional. + * (Internal Only) Response object for describing a message stream. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class ReadMessagesOptions { - #__desiredStartSequenceNumber = null; - #__minMessageCount = null; - #__maxMessageCount = null; - #__readTimeoutMillis = null; +class DescribeMessageStreamResponse { + #__requestId = null; + #__status = null; + #__errorMessage = null; + #__messageStreamInfo = null; /** - * @param desiredStartSequenceNumber {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. - * @param minMessageCount {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. - The minimum values is 1 and the maximum value is 2147483647. - * @param maxMessageCount {Number} The maximum number of messages that will be returned. - The minimum values is the value of the minimum message count and the maximum value is 2147483647. - * @param readTimeoutMillis {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. - If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. - If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. - The maximum value is the value of the client timeout. + * @param requestId {String} + * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param errorMessage {String} + * @param messageStreamInfo {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} */ constructor( - desiredStartSequenceNumber = null, - minMessageCount = 1, - maxMessageCount = null, - readTimeoutMillis = 0, + requestId = null, + status = null, + errorMessage = null, + messageStreamInfo = null, ) { - if (desiredStartSequenceNumber !== null && !(typeof desiredStartSequenceNumber === "number")) { - throw new Error("desiredStartSequenceNumber must be Number"); + if (requestId !== null && !(typeof requestId === "string")) { + throw new Error("requestId must be String"); } - if (minMessageCount !== null && !(typeof minMessageCount === "number")) { - throw new Error("minMessageCount must be Number"); + if (status !== null && !(status instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); } - if (maxMessageCount !== null && !(typeof maxMessageCount === "number")) { - throw new Error("maxMessageCount must be Number"); + if (errorMessage !== null && !(typeof errorMessage === "string")) { + throw new Error("errorMessage must be String"); } - if (readTimeoutMillis !== null && !(typeof readTimeoutMillis === "number")) { - throw new Error("readTimeoutMillis must be Number"); + if (messageStreamInfo !== null && !(messageStreamInfo instanceof MessageStreamInfo)) { + throw new Error("messageStreamInfo must be MessageStreamInfo"); } - this.#__desiredStartSequenceNumber = desiredStartSequenceNumber; - this.#__minMessageCount = minMessageCount; - this.#__maxMessageCount = maxMessageCount; - this.#__readTimeoutMillis = readTimeoutMillis; + this.#__requestId = requestId; + this.#__status = status; + this.#__errorMessage = errorMessage; + this.#__messageStreamInfo = messageStreamInfo; } /** - * The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. - * @returns {Number} + * @returns {String} */ - get desiredStartSequenceNumber() { - return this.#__desiredStartSequenceNumber; + get requestId() { + return this.#__requestId; } /** - * @param value {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. + * @param value {String} */ - set desiredStartSequenceNumber(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("desiredStartSequenceNumber must be Number"); + set requestId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("requestId must be String"); } - this.#__desiredStartSequenceNumber = value; + this.#__requestId = value; } /** - * @param value {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} */ - withDesiredStartSequenceNumber(value) { - this.desiredStartSequenceNumber = value; + withRequestId(value) { + this.requestId = value; return this; } /** - * The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. - The minimum values is 1 and the maximum value is 2147483647. - * @returns {Number} - + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + */ - get minMessageCount() { - return this.#__minMessageCount; + get status() { + return this.#__status; } /** - * @param value {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. - The minimum values is 1 and the maximum value is 2147483647. + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} */ - set minMessageCount(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("minMessageCount must be Number"); + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); } - this.#__minMessageCount = value; + this.#__status = value; } /** - * @param value {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. - The minimum values is 1 and the maximum value is 2147483647. - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} */ - withMinMessageCount(value) { - this.minMessageCount = value; + withStatus(value) { + this.status = value; return this; } /** - * The maximum number of messages that will be returned. - The minimum values is the value of the minimum message count and the maximum value is 2147483647. - * @returns {Number} - + * @returns {String} + */ - get maxMessageCount() { - return this.#__maxMessageCount; + get errorMessage() { + return this.#__errorMessage; } /** - * @param value {Number} The maximum number of messages that will be returned. - The minimum values is the value of the minimum message count and the maximum value is 2147483647. + * @param value {String} */ - set maxMessageCount(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("maxMessageCount must be Number"); + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); } - this.#__maxMessageCount = value; + this.#__errorMessage = value; } /** - * @param value {Number} The maximum number of messages that will be returned. - The minimum values is the value of the minimum message count and the maximum value is 2147483647. - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} */ - withMaxMessageCount(value) { - this.maxMessageCount = value; + withErrorMessage(value) { + this.errorMessage = value; return this; } /** - * The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. - If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. - If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. - The maximum value is the value of the client timeout. - * @returns {Number} - + * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + */ - get readTimeoutMillis() { - return this.#__readTimeoutMillis; + get messageStreamInfo() { + return this.#__messageStreamInfo; } /** - * @param value {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. - If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. - If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. - The maximum value is the value of the client timeout. + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} */ - set readTimeoutMillis(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("readTimeoutMillis must be Number"); + set messageStreamInfo(value) { + if (value !== null && !(value instanceof MessageStreamInfo)) { + throw new Error("messageStreamInfo must be MessageStreamInfo"); } - this.#__readTimeoutMillis = value; + this.#__messageStreamInfo = value; } /** - * @param value {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. - If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. - If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. - The maximum value is the value of the client timeout. - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} */ - withReadTimeoutMillis(value) { - this.readTimeoutMillis = value; + withMessageStreamInfo(value) { + this.messageStreamInfo = value; return this; } static fromMap(d) { - const ret = new ReadMessagesOptions(); - if ("desiredStartSequenceNumber" in d) { - ret.desiredStartSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["desiredStartSequenceNumber"]) : d["desiredStartSequenceNumber"]; + const ret = new DescribeMessageStreamResponse(); + if ("requestId" in d) { + ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - if ("minMessageCount" in d) { - ret.minMessageCount = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["minMessageCount"]) : d["minMessageCount"]; + if ("status" in d) { + ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; } - if ("maxMessageCount" in d) { - ret.maxMessageCount = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["maxMessageCount"]) : d["maxMessageCount"]; + if ("errorMessage" in d) { + ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; } - if ("readTimeoutMillis" in d) { - ret.readTimeoutMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["readTimeoutMillis"]) : d["readTimeoutMillis"]; + if ("messageStreamInfo" in d) { + ret.messageStreamInfo = Object.prototype.hasOwnProperty.call(MessageStreamInfo, "fromMap") ? MessageStreamInfo.fromMap(d["messageStreamInfo"]) : d["messageStreamInfo"]; } return ret; } asMap() { const d = {}; - if (this.desiredStartSequenceNumber !== null) { - d["desiredStartSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.desiredStartSequenceNumber), "asMap") ? this.desiredStartSequenceNumber.asMap() : this.desiredStartSequenceNumber; + if (this.requestId !== null) { + d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } - if (this.minMessageCount !== null) { - d["minMessageCount"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.minMessageCount), "asMap") ? this.minMessageCount.asMap() : this.minMessageCount; + if (this.status !== null) { + d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; } - if (this.maxMessageCount !== null) { - d["maxMessageCount"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.maxMessageCount), "asMap") ? this.maxMessageCount.asMap() : this.maxMessageCount; + if (this.errorMessage !== null) { + d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; } - if (this.readTimeoutMillis !== null) { - d["readTimeoutMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.readTimeoutMillis), "asMap") ? this.readTimeoutMillis.asMap() : this.readTimeoutMillis; + if (this.messageStreamInfo !== null) { + d["messageStreamInfo"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.messageStreamInfo), "asMap") ? this.messageStreamInfo.asMap() : this.messageStreamInfo; } return d; } }; -Object.defineProperty(ReadMessagesOptions, "typesMap", { +Object.defineProperty(DescribeMessageStreamResponse, "typesMap", { value: { - desiredStartSequenceNumber: { - 'type': Number, + requestId: { + 'type': String, 'subtype': null }, - minMessageCount: { - 'type': Number, + status: { + 'type': ResponseStatusCode, 'subtype': null }, - maxMessageCount: { - 'type': Number, + errorMessage: { + 'type': String, 'subtype': null }, - readTimeoutMillis: { - 'type': Number, + messageStreamInfo: { + 'type': MessageStreamInfo, 'subtype': null }, } }); -Object.defineProperty(ReadMessagesOptions, "formatsMap", { +Object.defineProperty(DescribeMessageStreamResponse, "formatsMap", { value: {} }); -Object.defineProperty(ReadMessagesOptions, "validationsMap", { +Object.defineProperty(DescribeMessageStreamResponse, "validationsMap", { value: { - 'desiredStartSequenceNumber': { - 'required': false, - 'maximum': 9223372036854775807, - 'minimum': 0, + 'requestId': { + 'required': true, + 'minLength': 1, + 'pattern': /^[\w ,.\-_]*$/, }, - 'minMessageCount': { - 'required': false, - 'maximum': 2147483647, - 'minimum': 1, + 'status': { + 'required': true, }, - 'maxMessageCount': { + 'errorMessage': { 'required': false, - 'maximum': 2147483647, - 'minimum': 1, }, - 'readTimeoutMillis': { + 'messageStreamInfo': { 'required': false, - 'maximum': 9223372036854, - 'minimum': 0, }, } }); /** - * (Internal Only) Request object for creating a message stream + * (Internal Only) Request object for appending to a message stream. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class CreateMessageStreamRequest { +class AppendMessageRequest { #__requestId = null; - #__definition = null; + #__name = null; + #__payload = null; /** * @param requestId {String} - * @param definition {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param name {String} + * @param payload {Buffer} */ constructor( requestId = null, - definition = null, + name = null, + payload = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); } - if (definition !== null && !(definition instanceof MessageStreamDefinition)) { - throw new Error("definition must be MessageStreamDefinition"); + if (name !== null && !(typeof name === "string")) { + throw new Error("name must be String"); + } + + if (payload !== null && !(payload instanceof Buffer)) { + throw new Error("payload must be Buffer"); } this.#__requestId = requestId; - this.#__definition = definition; + this.#__name = name; + this.#__payload = payload; } /** @@ -4059,7 +7720,7 @@

Source: stream-manager/data/index.js

} /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} */ withRequestId(value) { this.requestId = value; @@ -4067,38 +7728,67 @@

Source: stream-manager/data/index.js

} /** - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @returns {String} */ - get definition() { - return this.#__definition; + get name() { + return this.#__name; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} + * @param value {String} */ - set definition(value) { - if (value !== null && !(value instanceof MessageStreamDefinition)) { - throw new Error("definition must be MessageStreamDefinition"); + set name(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("name must be String"); } - this.#__definition = value; + this.#__name = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamDefinition} - * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamRequest} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} */ - withDefinition(value) { - this.definition = value; + withName(value) { + this.name = value; + return this; + } + + /** + * @returns {Buffer} + + */ + get payload() { + return this.#__payload; + } + /** + * @param value {Buffer} + */ + set payload(value) { + if (value !== null && !(value instanceof Buffer)) { + throw new Error("payload must be Buffer"); + } + + this.#__payload = value; + } + /** + * @param value {Buffer} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} + */ + withPayload(value) { + this.payload = value; return this; } static fromMap(d) { - const ret = new CreateMessageStreamRequest(); + const ret = new AppendMessageRequest(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - if ("definition" in d) { - ret.definition = Object.prototype.hasOwnProperty.call(MessageStreamDefinition, "fromMap") ? MessageStreamDefinition.fromMap(d["definition"]) : d["definition"]; + if ("name" in d) { + ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + } + if ("payload" in d) { + ret.payload = Object.prototype.hasOwnProperty.call(Buffer, "fromMap") ? Buffer.fromMap(d["payload"]) : d["payload"]; } return ret; } @@ -4108,61 +7798,78 @@

Source: stream-manager/data/index.js

if (this.requestId !== null) { d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } - if (this.definition !== null) { - d["definition"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.definition), "asMap") ? this.definition.asMap() : this.definition; + if (this.name !== null) { + d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + } + if (this.payload !== null) { + d["payload"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.payload), "asMap") ? this.payload.asMap() : this.payload; } return d; } }; -Object.defineProperty(CreateMessageStreamRequest, "typesMap", { +Object.defineProperty(AppendMessageRequest, "typesMap", { value: { requestId: { 'type': String, 'subtype': null }, - definition: { - 'type': MessageStreamDefinition, + name: { + 'type': String, + 'subtype': null + }, + payload: { + 'type': Buffer, 'subtype': null }, } }); -Object.defineProperty(CreateMessageStreamRequest, "formatsMap", { +Object.defineProperty(AppendMessageRequest, "formatsMap", { value: {} }); -Object.defineProperty(CreateMessageStreamRequest, "validationsMap", { +Object.defineProperty(AppendMessageRequest, "validationsMap", { value: { 'requestId': { 'required': true, 'minLength': 1, 'pattern': /^[\w ,.\-_]*$/, }, - 'definition': { + 'name': { + 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, + }, + 'payload': { 'required': true, + 'minLength': 1, }, } }); /** - * Internal Only + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class CreateMessageStreamResponse { +class AppendMessageResponse { #__requestId = null; #__status = null; #__errorMessage = null; + #__sequenceNumber = null; /** * @param requestId {String} * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} * @param errorMessage {String} + * @param sequenceNumber {Number} */ constructor( requestId = null, status = null, errorMessage = null, + sequenceNumber = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); @@ -4176,9 +7883,14 @@

Source: stream-manager/data/index.js

throw new Error("errorMessage must be String"); } + if (sequenceNumber !== null && !(typeof sequenceNumber === "number")) { + throw new Error("sequenceNumber must be Number"); + } + this.#__requestId = requestId; this.#__status = status; this.#__errorMessage = errorMessage; + this.#__sequenceNumber = sequenceNumber; } /** @@ -4200,7 +7912,7 @@

Source: stream-manager/data/index.js

} /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} */ withRequestId(value) { this.requestId = value; @@ -4226,7 +7938,7 @@

Source: stream-manager/data/index.js

} /** * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} */ withStatus(value) { this.status = value; @@ -4252,15 +7964,41 @@

Source: stream-manager/data/index.js

} /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.CreateMessageStreamResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} */ withErrorMessage(value) { this.errorMessage = value; return this; } + /** + * @returns {Number} + + */ + get sequenceNumber() { + return this.#__sequenceNumber; + } + /** + * @param value {Number} + */ + set sequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("sequenceNumber must be Number"); + } + + this.#__sequenceNumber = value; + } + /** + * @param value {Number} + * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} + */ + withSequenceNumber(value) { + this.sequenceNumber = value; + return this; + } + static fromMap(d) { - const ret = new CreateMessageStreamResponse(); + const ret = new AppendMessageResponse(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } @@ -4270,6 +8008,9 @@

Source: stream-manager/data/index.js

if ("errorMessage" in d) { ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; } + if ("sequenceNumber" in d) { + ret.sequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sequenceNumber"]) : d["sequenceNumber"]; + } return ret; } @@ -4284,11 +8025,14 @@

Source: stream-manager/data/index.js

if (this.errorMessage !== null) { d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; } + if (this.sequenceNumber !== null) { + d["sequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sequenceNumber), "asMap") ? this.sequenceNumber.asMap() : this.sequenceNumber; + } return d; } }; -Object.defineProperty(CreateMessageStreamResponse, "typesMap", { +Object.defineProperty(AppendMessageResponse, "typesMap", { value: { requestId: { 'type': String, @@ -4302,12 +8046,16 @@

Source: stream-manager/data/index.js

'type': String, 'subtype': null }, + sequenceNumber: { + 'type': Number, + 'subtype': null + }, } }); -Object.defineProperty(CreateMessageStreamResponse, "formatsMap", { +Object.defineProperty(AppendMessageResponse, "formatsMap", { value: {} }); -Object.defineProperty(CreateMessageStreamResponse, "validationsMap", { +Object.defineProperty(AppendMessageResponse, "validationsMap", { value: { 'requestId': { 'required': true, @@ -4320,181 +8068,305 @@

Source: stream-manager/data/index.js

'errorMessage': { 'required': false, }, + 'sequenceNumber': { + 'required': false, + }, } }); /** - * (Internal Only) Request object for deleting a message stream + * Options for the ReadMessages API. All fields are optional. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class DeleteMessageStreamRequest { - #__requestId = null; - #__name = null; +class ReadMessagesOptions { + #__desiredStartSequenceNumber = null; + #__minMessageCount = null; + #__maxMessageCount = null; + #__readTimeoutMillis = null; /** - * @param requestId {String} - * @param name {String} + * @param desiredStartSequenceNumber {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. + * @param minMessageCount {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. + The minimum values is 1 and the maximum value is 2147483647. + * @param maxMessageCount {Number} The maximum number of messages that will be returned. + The minimum values is the value of the minimum message count and the maximum value is 2147483647. + * @param readTimeoutMillis {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. + If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. + If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. + The maximum value is the value of the client timeout. */ constructor( - requestId = null, - name = null, + desiredStartSequenceNumber = null, + minMessageCount = 1, + maxMessageCount = null, + readTimeoutMillis = 0, ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); + if (desiredStartSequenceNumber !== null && !(typeof desiredStartSequenceNumber === "number")) { + throw new Error("desiredStartSequenceNumber must be Number"); } - if (name !== null && !(typeof name === "string")) { - throw new Error("name must be String"); + if (minMessageCount !== null && !(typeof minMessageCount === "number")) { + throw new Error("minMessageCount must be Number"); } - this.#__requestId = requestId; - this.#__name = name; + if (maxMessageCount !== null && !(typeof maxMessageCount === "number")) { + throw new Error("maxMessageCount must be Number"); + } + + if (readTimeoutMillis !== null && !(typeof readTimeoutMillis === "number")) { + throw new Error("readTimeoutMillis must be Number"); + } + + this.#__desiredStartSequenceNumber = desiredStartSequenceNumber; + this.#__minMessageCount = minMessageCount; + this.#__maxMessageCount = maxMessageCount; + this.#__readTimeoutMillis = readTimeoutMillis; } /** - * @returns {String} + * The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. + * @returns {Number} */ - get requestId() { - return this.#__requestId; + get desiredStartSequenceNumber() { + return this.#__desiredStartSequenceNumber; } /** - * @param value {String} + * @param value {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. */ - set requestId(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + set desiredStartSequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("desiredStartSequenceNumber must be Number"); } - this.#__requestId = value; + this.#__desiredStartSequenceNumber = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest} + * @param value {Number} The desired beginning sequence number to start reading from. If the desired sequence number is less than the current minimum of the stream, then it will instead start reading from the current minimum. + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} */ - withRequestId(value) { - this.requestId = value; + withDesiredStartSequenceNumber(value) { + this.desiredStartSequenceNumber = value; return this; } /** - * @returns {String} - + * The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. + The minimum values is 1 and the maximum value is 2147483647. + * @returns {Number} + */ - get name() { - return this.#__name; + get minMessageCount() { + return this.#__minMessageCount; } /** - * @param value {String} + * @param value {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. + The minimum values is 1 and the maximum value is 2147483647. */ - set name(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("name must be String"); + set minMessageCount(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("minMessageCount must be Number"); + } + + this.#__minMessageCount = value; + } + /** + * @param value {Number} The minimum number of messages that will be returned. If not enough messages are available for reading, then NotEnoughMessages exception will be thrown. + The minimum values is 1 and the maximum value is 2147483647. + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + */ + withMinMessageCount(value) { + this.minMessageCount = value; + return this; + } + + /** + * The maximum number of messages that will be returned. + The minimum values is the value of the minimum message count and the maximum value is 2147483647. + * @returns {Number} + + */ + get maxMessageCount() { + return this.#__maxMessageCount; + } + /** + * @param value {Number} The maximum number of messages that will be returned. + The minimum values is the value of the minimum message count and the maximum value is 2147483647. + */ + set maxMessageCount(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("maxMessageCount must be Number"); + } + + this.#__maxMessageCount = value; + } + /** + * @param value {Number} The maximum number of messages that will be returned. + The minimum values is the value of the minimum message count and the maximum value is 2147483647. + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + */ + withMaxMessageCount(value) { + this.maxMessageCount = value; + return this; + } + + /** + * The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. + If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. + If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. + The maximum value is the value of the client timeout. + * @returns {Number} + + */ + get readTimeoutMillis() { + return this.#__readTimeoutMillis; + } + /** + * @param value {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. + If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. + If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. + The maximum value is the value of the client timeout. + */ + set readTimeoutMillis(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("readTimeoutMillis must be Number"); } - this.#__name = value; + this.#__readTimeoutMillis = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamRequest} + * @param value {Number} The time to wait for messages in milliseconds. Default is 0, meaning that the server will not wait for messages. + If it can fulfill the minimum messages it will return them, but otherwise NotEnoughMessages exception will be thrown. + If the timeout is greater than zero, then the server will wait up to that time for more messages to be appended to the stream, waiting until the minimum number of messages is reached. + The maximum value is the value of the client timeout. + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} */ - withName(value) { - this.name = value; + withReadTimeoutMillis(value) { + this.readTimeoutMillis = value; return this; } static fromMap(d) { - const ret = new DeleteMessageStreamRequest(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + const ret = new ReadMessagesOptions(); + if ("desiredStartSequenceNumber" in d) { + ret.desiredStartSequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["desiredStartSequenceNumber"]) : d["desiredStartSequenceNumber"]; } - if ("name" in d) { - ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + if ("minMessageCount" in d) { + ret.minMessageCount = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["minMessageCount"]) : d["minMessageCount"]; + } + if ("maxMessageCount" in d) { + ret.maxMessageCount = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["maxMessageCount"]) : d["maxMessageCount"]; + } + if ("readTimeoutMillis" in d) { + ret.readTimeoutMillis = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["readTimeoutMillis"]) : d["readTimeoutMillis"]; } return ret; } asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + if (this.desiredStartSequenceNumber !== null) { + d["desiredStartSequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.desiredStartSequenceNumber), "asMap") ? this.desiredStartSequenceNumber.asMap() : this.desiredStartSequenceNumber; } - if (this.name !== null) { - d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + if (this.minMessageCount !== null) { + d["minMessageCount"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.minMessageCount), "asMap") ? this.minMessageCount.asMap() : this.minMessageCount; + } + if (this.maxMessageCount !== null) { + d["maxMessageCount"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.maxMessageCount), "asMap") ? this.maxMessageCount.asMap() : this.maxMessageCount; + } + if (this.readTimeoutMillis !== null) { + d["readTimeoutMillis"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.readTimeoutMillis), "asMap") ? this.readTimeoutMillis.asMap() : this.readTimeoutMillis; } return d; } }; -Object.defineProperty(DeleteMessageStreamRequest, "typesMap", { +Object.defineProperty(ReadMessagesOptions, "typesMap", { value: { - requestId: { - 'type': String, + desiredStartSequenceNumber: { + 'type': Number, 'subtype': null }, - name: { - 'type': String, + minMessageCount: { + 'type': Number, + 'subtype': null + }, + maxMessageCount: { + 'type': Number, + 'subtype': null + }, + readTimeoutMillis: { + 'type': Number, 'subtype': null }, } }); -Object.defineProperty(DeleteMessageStreamRequest, "formatsMap", { +Object.defineProperty(ReadMessagesOptions, "formatsMap", { value: {} }); -Object.defineProperty(DeleteMessageStreamRequest, "validationsMap", { +Object.defineProperty(ReadMessagesOptions, "validationsMap", { value: { - 'requestId': { - 'required': true, - 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, + 'desiredStartSequenceNumber': { + 'required': false, + 'maximum': 9223372036854775807, + 'minimum': 0, }, - 'name': { - 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, + 'minMessageCount': { + 'required': false, + 'maximum': 2147483647, + 'minimum': 1, + }, + 'maxMessageCount': { + 'required': false, + 'maximum': 2147483647, + 'minimum': 1, + }, + 'readTimeoutMillis': { + 'required': false, + 'maximum': 9223372036854, + 'minimum': 0, }, } }); /** - * Internal Only + * (Internal Only) Request object for reading from a message stream. readMessagesOptions is optional. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class DeleteMessageStreamResponse { +class ReadMessagesRequest { #__requestId = null; - #__status = null; - #__errorMessage = null; + #__streamName = null; + #__readMessagesOptions = null; /** * @param requestId {String} - * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @param errorMessage {String} + * @param streamName {String} + * @param readMessagesOptions {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} */ constructor( requestId = null, - status = null, - errorMessage = null, + streamName = null, + readMessagesOptions = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); } - if (status !== null && !(status instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + if (streamName !== null && !(typeof streamName === "string")) { + throw new Error("streamName must be String"); } - if (errorMessage !== null && !(typeof errorMessage === "string")) { - throw new Error("errorMessage must be String"); + if (readMessagesOptions !== null && !(readMessagesOptions instanceof ReadMessagesOptions)) { + throw new Error("readMessagesOptions must be ReadMessagesOptions"); } this.#__requestId = requestId; - this.#__status = status; - this.#__errorMessage = errorMessage; + this.#__streamName = streamName; + this.#__readMessagesOptions = readMessagesOptions; } /** @@ -4516,7 +8388,7 @@

Source: stream-manager/data/index.js

} /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} */ withRequestId(value) { this.requestId = value; @@ -4524,67 +8396,67 @@

Source: stream-manager/data/index.js

} /** - * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {String} */ - get status() { - return this.#__status; + get streamName() { + return this.#__streamName; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param value {String} */ - set status(value) { - if (value !== null && !(value instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + set streamName(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("streamName must be String"); } - this.#__status = value; + this.#__streamName = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} */ - withStatus(value) { - this.status = value; + withStreamName(value) { + this.streamName = value; return this; } /** - * @returns {String} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} */ - get errorMessage() { - return this.#__errorMessage; + get readMessagesOptions() { + return this.#__readMessagesOptions; } /** - * @param value {String} + * @param value {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} */ - set errorMessage(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("errorMessage must be String"); + set readMessagesOptions(value) { + if (value !== null && !(value instanceof ReadMessagesOptions)) { + throw new Error("readMessagesOptions must be ReadMessagesOptions"); } - this.#__errorMessage = value; + this.#__readMessagesOptions = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DeleteMessageStreamResponse} + * @param value {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} */ - withErrorMessage(value) { - this.errorMessage = value; + withReadMessagesOptions(value) { + this.readMessagesOptions = value; return this; } static fromMap(d) { - const ret = new DeleteMessageStreamResponse(); + const ret = new ReadMessagesRequest(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - if ("status" in d) { - ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + if ("streamName" in d) { + ret.streamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["streamName"]) : d["streamName"]; } - if ("errorMessage" in d) { - ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + if ("readMessagesOptions" in d) { + ret.readMessagesOptions = Object.prototype.hasOwnProperty.call(ReadMessagesOptions, "fromMap") ? ReadMessagesOptions.fromMap(d["readMessagesOptions"]) : d["readMessagesOptions"]; } return ret; } @@ -4594,215 +8466,318 @@

Source: stream-manager/data/index.js

if (this.requestId !== null) { d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } - if (this.status !== null) { - d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + if (this.streamName !== null) { + d["streamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamName), "asMap") ? this.streamName.asMap() : this.streamName; } - if (this.errorMessage !== null) { - d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + if (this.readMessagesOptions !== null) { + d["readMessagesOptions"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.readMessagesOptions), "asMap") ? this.readMessagesOptions.asMap() : this.readMessagesOptions; } return d; } }; -Object.defineProperty(DeleteMessageStreamResponse, "typesMap", { +Object.defineProperty(ReadMessagesRequest, "typesMap", { value: { requestId: { 'type': String, 'subtype': null }, - status: { - 'type': ResponseStatusCode, + streamName: { + 'type': String, 'subtype': null }, - errorMessage: { - 'type': String, + readMessagesOptions: { + 'type': ReadMessagesOptions, 'subtype': null }, } }); -Object.defineProperty(DeleteMessageStreamResponse, "formatsMap", { +Object.defineProperty(ReadMessagesRequest, "formatsMap", { value: {} }); -Object.defineProperty(DeleteMessageStreamResponse, "validationsMap", { +Object.defineProperty(ReadMessagesRequest, "validationsMap", { value: { 'requestId': { 'required': true, 'minLength': 1, 'pattern': /^[\w ,.\-_]*$/, }, - 'status': { + 'streamName': { 'required': true, + 'minLength': 1, + 'maxLength': 255, + 'pattern': /^[\w ,.\-_]*$/, }, - 'errorMessage': { + 'readMessagesOptions': { 'required': false, }, } }); /** - * (Internal Only) Request object for describing a message stream + * Message object containing metadata and the user's payload. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class DescribeMessageStreamRequest { - #__requestId = null; - #__name = null; +class Message { + #__streamName = null; + #__sequenceNumber = null; + #__ingestTime = null; + #__payload = null; + + /** + * @param streamName {String} The name of the stream which this message is in. + * @param sequenceNumber {Number} The sequence number of this message within the stream. + * @param ingestTime {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. + * @param payload {Buffer} The binary message data. + */ + constructor( + streamName = null, + sequenceNumber = null, + ingestTime = null, + payload = null, + ) { + if (streamName !== null && !(typeof streamName === "string")) { + throw new Error("streamName must be String"); + } + + if (sequenceNumber !== null && !(typeof sequenceNumber === "number")) { + throw new Error("sequenceNumber must be Number"); + } + if (ingestTime !== null && !(typeof ingestTime === "number")) { + throw new Error("ingestTime must be Number"); + } + + if (payload !== null && !(payload instanceof Buffer)) { + throw new Error("payload must be Buffer"); + } + + this.#__streamName = streamName; + this.#__sequenceNumber = sequenceNumber; + this.#__ingestTime = ingestTime; + this.#__payload = payload; + } + + /** + * The name of the stream which this message is in. + * @returns {String} + + */ + get streamName() { + return this.#__streamName; + } /** - * @param requestId {String} - * @param name {String} + * @param value {String} The name of the stream which this message is in. */ - constructor( - requestId = null, - name = null, - ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); + set streamName(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("streamName must be String"); } - if (name !== null && !(typeof name === "string")) { - throw new Error("name must be String"); + this.#__streamName = value; + } + /** + * @param value {String} The name of the stream which this message is in. + * @returns {aws-greengrass-core-sdk.StreamManager.Message} + */ + withStreamName(value) { + this.streamName = value; + return this; + } + + /** + * The sequence number of this message within the stream. + * @returns {Number} + + */ + get sequenceNumber() { + return this.#__sequenceNumber; + } + /** + * @param value {Number} The sequence number of this message within the stream. + */ + set sequenceNumber(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("sequenceNumber must be Number"); } - this.#__requestId = requestId; - this.#__name = name; + this.#__sequenceNumber = value; + } + /** + * @param value {Number} The sequence number of this message within the stream. + * @returns {aws-greengrass-core-sdk.StreamManager.Message} + */ + withSequenceNumber(value) { + this.sequenceNumber = value; + return this; } /** - * @returns {String} + * The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. + * @returns {Number} */ - get requestId() { - return this.#__requestId; + get ingestTime() { + return this.#__ingestTime; } /** - * @param value {String} + * @param value {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. */ - set requestId(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + set ingestTime(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("ingestTime must be Number"); } - this.#__requestId = value; + this.#__ingestTime = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest} + * @param value {Number} The time that the message was ingested to Stream Manager. Data is Unix epoch time in milliseconds. + * @returns {aws-greengrass-core-sdk.StreamManager.Message} */ - withRequestId(value) { - this.requestId = value; + withIngestTime(value) { + this.ingestTime = value; return this; } /** - * @returns {String} + * The binary message data. + * @returns {Buffer} */ - get name() { - return this.#__name; + get payload() { + return this.#__payload; } /** - * @param value {String} + * @param value {Buffer} The binary message data. */ - set name(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("name must be String"); + set payload(value) { + if (value !== null && !(value instanceof Buffer)) { + throw new Error("payload must be Buffer"); } - this.#__name = value; + this.#__payload = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamRequest} + * @param value {Buffer} The binary message data. + * @returns {aws-greengrass-core-sdk.StreamManager.Message} */ - withName(value) { - this.name = value; + withPayload(value) { + this.payload = value; return this; } static fromMap(d) { - const ret = new DescribeMessageStreamRequest(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + const ret = new Message(); + if ("streamName" in d) { + ret.streamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["streamName"]) : d["streamName"]; } - if ("name" in d) { - ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; + if ("sequenceNumber" in d) { + ret.sequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sequenceNumber"]) : d["sequenceNumber"]; + } + if ("ingestTime" in d) { + ret.ingestTime = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["ingestTime"]) : d["ingestTime"]; + } + if ("payload" in d) { + ret.payload = Object.prototype.hasOwnProperty.call(Buffer, "fromMap") ? Buffer.fromMap(d["payload"]) : d["payload"]; } return ret; } asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + if (this.streamName !== null) { + d["streamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamName), "asMap") ? this.streamName.asMap() : this.streamName; } - if (this.name !== null) { - d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; + if (this.sequenceNumber !== null) { + d["sequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sequenceNumber), "asMap") ? this.sequenceNumber.asMap() : this.sequenceNumber; + } + if (this.ingestTime !== null) { + d["ingestTime"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.ingestTime), "asMap") ? this.ingestTime.asMap() : this.ingestTime; + } + if (this.payload !== null) { + d["payload"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.payload), "asMap") ? this.payload.asMap() : this.payload; } return d; } }; -Object.defineProperty(DescribeMessageStreamRequest, "typesMap", { +Object.defineProperty(Message, "typesMap", { value: { - requestId: { + streamName: { 'type': String, 'subtype': null }, - name: { - 'type': String, + sequenceNumber: { + 'type': Number, + 'subtype': null + }, + ingestTime: { + 'type': Number, + 'subtype': null + }, + payload: { + 'type': Buffer, 'subtype': null }, } }); -Object.defineProperty(DescribeMessageStreamRequest, "formatsMap", { +Object.defineProperty(Message, "formatsMap", { value: {} }); -Object.defineProperty(DescribeMessageStreamRequest, "validationsMap", { +Object.defineProperty(Message, "validationsMap", { value: { - 'requestId': { + 'streamName': { 'required': true, - 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, }, - 'name': { + 'sequenceNumber': { + 'required': false, + }, + 'ingestTime': { + 'required': false, + }, + 'payload': { 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, }, } }); /** - * (Internal Only) Response object for describing a message stream + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class DescribeMessageStreamResponse { +class ReadMessagesResponse { #__requestId = null; + #__messages = null; #__status = null; #__errorMessage = null; - #__messageStreamInfo = null; /** * @param requestId {String} + * @param messages {aws-greengrass-core-sdk.StreamManager.Message[]} * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} * @param errorMessage {String} - * @param messageStreamInfo {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} */ constructor( requestId = null, + messages = null, status = null, errorMessage = null, - messageStreamInfo = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); } + if (messages !== null && !(messages instanceof Array)) { + throw new Error("messages must be Array"); + } + if (messages !== null && !messages.every((v) => v instanceof Message)) { + throw new Error("messages array values must be Message"); + } + if (status !== null && !(status instanceof ResponseStatusCode)) { throw new Error("status must be ResponseStatusCode"); } @@ -4811,14 +8786,10 @@

Source: stream-manager/data/index.js

throw new Error("errorMessage must be String"); } - if (messageStreamInfo !== null && !(messageStreamInfo instanceof MessageStreamInfo)) { - throw new Error("messageStreamInfo must be MessageStreamInfo"); - } - this.#__requestId = requestId; + this.#__messages = messages; this.#__status = status; this.#__errorMessage = errorMessage; - this.#__messageStreamInfo = messageStreamInfo; } /** @@ -4840,7 +8811,7 @@

Source: stream-manager/data/index.js

} /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} */ withRequestId(value) { this.requestId = value; @@ -4848,97 +8819,103 @@

Source: stream-manager/data/index.js

} /** - * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.Message[]} */ - get status() { - return this.#__status; + get messages() { + return this.#__messages; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param value {aws-greengrass-core-sdk.StreamManager.Message[]} */ - set status(value) { - if (value !== null && !(value instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + set messages(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("messages must be Array"); + } + if (value !== null && !value.every((v) => v instanceof Message)) { + throw new Error("messages array values must be Message"); } - this.#__status = value; + this.#__messages = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} + * @param value {aws-greengrass-core-sdk.StreamManager.Message[]} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} */ - withStatus(value) { - this.status = value; + withMessages(value) { + this.messages = value; return this; } /** - * @returns {String} + * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} */ - get errorMessage() { - return this.#__errorMessage; + get status() { + return this.#__status; } /** - * @param value {String} + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} */ - set errorMessage(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("errorMessage must be String"); + set status(value) { + if (value !== null && !(value instanceof ResponseStatusCode)) { + throw new Error("status must be ResponseStatusCode"); } - this.#__errorMessage = value; + this.#__status = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} + * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} */ - withErrorMessage(value) { - this.errorMessage = value; + withStatus(value) { + this.status = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} + * @returns {String} */ - get messageStreamInfo() { - return this.#__messageStreamInfo; + get errorMessage() { + return this.#__errorMessage; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} - */ - set messageStreamInfo(value) { - if (value !== null && !(value instanceof MessageStreamInfo)) { - throw new Error("messageStreamInfo must be MessageStreamInfo"); + * @param value {String} + */ + set errorMessage(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("errorMessage must be String"); } - this.#__messageStreamInfo = value; + this.#__errorMessage = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.MessageStreamInfo} - * @returns {aws-greengrass-core-sdk.StreamManager.DescribeMessageStreamResponse} + * @param value {String} + * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} */ - withMessageStreamInfo(value) { - this.messageStreamInfo = value; + withErrorMessage(value) { + this.errorMessage = value; return this; } static fromMap(d) { - const ret = new DescribeMessageStreamResponse(); + const ret = new ReadMessagesResponse(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } + if ("messages" in d) { + ret.messages = d["messages"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Message, "fromMap") ? Message.fromMap(v) : v); + return acc; + }, []); + } if ("status" in d) { ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; } if ("errorMessage" in d) { ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; } - if ("messageStreamInfo" in d) { - ret.messageStreamInfo = Object.prototype.hasOwnProperty.call(MessageStreamInfo, "fromMap") ? MessageStreamInfo.fromMap(d["messageStreamInfo"]) : d["messageStreamInfo"]; - } return ret; } @@ -4947,25 +8924,32 @@

Source: stream-manager/data/index.js

if (this.requestId !== null) { d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } + if (this.messages !== null) { + d["messages"] = this.messages.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); + } if (this.status !== null) { d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; } if (this.errorMessage !== null) { d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; } - if (this.messageStreamInfo !== null) { - d["messageStreamInfo"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.messageStreamInfo), "asMap") ? this.messageStreamInfo.asMap() : this.messageStreamInfo; - } return d; } }; -Object.defineProperty(DescribeMessageStreamResponse, "typesMap", { +Object.defineProperty(ReadMessagesResponse, "typesMap", { value: { requestId: { 'type': String, 'subtype': null }, + messages: { + 'type': Array, + 'subtype': Message + }, status: { 'type': ResponseStatusCode, 'subtype': null @@ -4974,70 +8958,50 @@

Source: stream-manager/data/index.js

'type': String, 'subtype': null }, - messageStreamInfo: { - 'type': MessageStreamInfo, - 'subtype': null - }, } }); -Object.defineProperty(DescribeMessageStreamResponse, "formatsMap", { +Object.defineProperty(ReadMessagesResponse, "formatsMap", { value: {} }); -Object.defineProperty(DescribeMessageStreamResponse, "validationsMap", { +Object.defineProperty(ReadMessagesResponse, "validationsMap", { value: { 'requestId': { - 'required': true, + 'required': false, 'minLength': 1, 'pattern': /^[\w ,.\-_]*$/, }, - 'status': { - 'required': true, + 'messages': { + 'required': false, }, - 'errorMessage': { + 'status': { 'required': false, }, - 'messageStreamInfo': { + 'errorMessage': { 'required': false, }, } }); /** - * (Intenral Only) Request object for appending to a message stream + * (Internal Only) Request object to list all available streams. There are no options. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class AppendMessageRequest { +class ListStreamsRequest { #__requestId = null; - #__name = null; - #__payload = null; /** * @param requestId {String} - * @param name {String} - * @param payload {Buffer} */ constructor( requestId = null, - name = null, - payload = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); } - if (name !== null && !(typeof name === "string")) { - throw new Error("name must be String"); - } - - if (payload !== null && !(payload instanceof Buffer)) { - throw new Error("payload must be Buffer"); - } - this.#__requestId = requestId; - this.#__name = name; - this.#__payload = payload; } /** @@ -5059,76 +9023,18 @@

Source: stream-manager/data/index.js

} /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} + * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsRequest} */ withRequestId(value) { this.requestId = value; return this; } - /** - * @returns {String} - - */ - get name() { - return this.#__name; - } - /** - * @param value {String} - */ - set name(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("name must be String"); - } - - this.#__name = value; - } - /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} - */ - withName(value) { - this.name = value; - return this; - } - - /** - * @returns {Buffer} - - */ - get payload() { - return this.#__payload; - } - /** - * @param value {Buffer} - */ - set payload(value) { - if (value !== null && !(value instanceof Buffer)) { - throw new Error("payload must be Buffer"); - } - - this.#__payload = value; - } - /** - * @param value {Buffer} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageRequest} - */ - withPayload(value) { - this.payload = value; - return this; - } - static fromMap(d) { - const ret = new AppendMessageRequest(); + const ret = new ListStreamsRequest(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } - if ("name" in d) { - ret.name = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["name"]) : d["name"]; - } - if ("payload" in d) { - ret.payload = Object.prototype.hasOwnProperty.call(Buffer, "fromMap") ? Buffer.fromMap(d["payload"]) : d["payload"]; - } return ret; } @@ -5137,78 +9043,54 @@

Source: stream-manager/data/index.js

if (this.requestId !== null) { d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; } - if (this.name !== null) { - d["name"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.name), "asMap") ? this.name.asMap() : this.name; - } - if (this.payload !== null) { - d["payload"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.payload), "asMap") ? this.payload.asMap() : this.payload; - } return d; } }; -Object.defineProperty(AppendMessageRequest, "typesMap", { +Object.defineProperty(ListStreamsRequest, "typesMap", { value: { requestId: { 'type': String, 'subtype': null }, - name: { - 'type': String, - 'subtype': null - }, - payload: { - 'type': Buffer, - 'subtype': null - }, } }); -Object.defineProperty(AppendMessageRequest, "formatsMap", { +Object.defineProperty(ListStreamsRequest, "formatsMap", { value: {} }); -Object.defineProperty(AppendMessageRequest, "validationsMap", { +Object.defineProperty(ListStreamsRequest, "validationsMap", { value: { 'requestId': { 'required': true, 'minLength': 1, 'pattern': /^[\w ,.\-_]*$/, }, - 'name': { - 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, - }, - 'payload': { - 'required': true, - 'minLength': 1, - }, } }); /** - * Internal Only + * Internal Only. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class AppendMessageResponse { +class ListStreamsResponse { #__requestId = null; #__status = null; #__errorMessage = null; - #__sequenceNumber = null; + #__streams = null; /** * @param requestId {String} * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} * @param errorMessage {String} - * @param sequenceNumber {Number} + * @param streams {String[]} */ constructor( requestId = null, status = null, errorMessage = null, - sequenceNumber = null, + streams = null, ) { if (requestId !== null && !(typeof requestId === "string")) { throw new Error("requestId must be String"); @@ -5222,14 +9104,17 @@

Source: stream-manager/data/index.js

throw new Error("errorMessage must be String"); } - if (sequenceNumber !== null && !(typeof sequenceNumber === "number")) { - throw new Error("sequenceNumber must be Number"); + if (streams !== null && !(streams instanceof Array)) { + throw new Error("streams must be Array"); + } + if (streams !== null && !streams.every((v) => typeof v === "string")) { + throw new Error("streams array values must be String"); } this.#__requestId = requestId; this.#__status = status; this.#__errorMessage = errorMessage; - this.#__sequenceNumber = sequenceNumber; + this.#__streams = streams; } /** @@ -5251,7 +9136,7 @@

Source: stream-manager/data/index.js

} /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} */ withRequestId(value) { this.requestId = value; @@ -5277,7 +9162,7 @@

Source: stream-manager/data/index.js

} /** * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} */ withStatus(value) { this.status = value; @@ -5303,7 +9188,7 @@

Source: stream-manager/data/index.js

} /** * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} + * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} */ withErrorMessage(value) { this.errorMessage = value; @@ -5311,33 +9196,36 @@

Source: stream-manager/data/index.js

} /** - * @returns {Number} + * @returns {String[]} */ - get sequenceNumber() { - return this.#__sequenceNumber; + get streams() { + return this.#__streams; } /** - * @param value {Number} + * @param value {String[]} */ - set sequenceNumber(value) { - if (value !== null && !(typeof value === "number")) { - throw new Error("sequenceNumber must be Number"); + set streams(value) { + if (value !== null && !(value instanceof Array)) { + throw new Error("streams must be Array"); + } + if (value !== null && !value.every((v) => typeof v === "string")) { + throw new Error("streams array values must be String"); } - this.#__sequenceNumber = value; + this.#__streams = value; } /** - * @param value {Number} - * @returns {aws-greengrass-core-sdk.StreamManager.AppendMessageResponse} + * @param value {String[]} + * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} */ - withSequenceNumber(value) { - this.sequenceNumber = value; + withStreams(value) { + this.streams = value; return this; } static fromMap(d) { - const ret = new AppendMessageResponse(); + const ret = new ListStreamsResponse(); if ("requestId" in d) { ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; } @@ -5347,8 +9235,11 @@

Source: stream-manager/data/index.js

if ("errorMessage" in d) { ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; } - if ("sequenceNumber" in d) { - ret.sequenceNumber = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["sequenceNumber"]) : d["sequenceNumber"]; + if ("streams" in d) { + ret.streams = d["streams"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(v) : v); + return acc; + }, []); } return ret; } @@ -5364,14 +9255,17 @@

Source: stream-manager/data/index.js

if (this.errorMessage !== null) { d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; } - if (this.sequenceNumber !== null) { - d["sequenceNumber"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.sequenceNumber), "asMap") ? this.sequenceNumber.asMap() : this.sequenceNumber; + if (this.streams !== null) { + d["streams"] = this.streams.reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); + return acc; + }, []); } return d; } }; -Object.defineProperty(AppendMessageResponse, "typesMap", { +Object.defineProperty(ListStreamsResponse, "typesMap", { value: { requestId: { 'type': String, @@ -5385,16 +9279,16 @@

Source: stream-manager/data/index.js

'type': String, 'subtype': null }, - sequenceNumber: { - 'type': Number, - 'subtype': null + streams: { + 'type': Array, + 'subtype': String }, } }); -Object.defineProperty(AppendMessageResponse, "formatsMap", { +Object.defineProperty(ListStreamsResponse, "formatsMap", { value: {} }); -Object.defineProperty(AppendMessageResponse, "validationsMap", { +Object.defineProperty(ListStreamsResponse, "validationsMap", { value: { 'requestId': { 'required': true, @@ -5407,690 +9301,840 @@

Source: stream-manager/data/index.js

'errorMessage': { 'required': false, }, - 'sequenceNumber': { + 'streams': { 'required': false, }, } }); /** - * (Internal Only) Request object for reading from a message stream. readMessagesOptions is optional. + * Contains a timestamp with optional nanosecond granularity. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager - */ -class ReadMessagesRequest { - #__requestId = null; - #__streamName = null; - #__readMessagesOptions = null; + */ +class TimeInNanos { + #__timeInSeconds = null; + #__offsetInNanos = null; /** - * @param requestId {String} - * @param streamName {String} - * @param readMessagesOptions {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param timeInSeconds {Number} The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by offsetInNanos. + * @param offsetInNanos {Number} The nanosecond offset from timeInSeconds. */ constructor( - requestId = null, - streamName = null, - readMessagesOptions = null, + timeInSeconds = null, + offsetInNanos = null, ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); - } - - if (streamName !== null && !(typeof streamName === "string")) { - throw new Error("streamName must be String"); - } - - if (readMessagesOptions !== null && !(readMessagesOptions instanceof ReadMessagesOptions)) { - throw new Error("readMessagesOptions must be ReadMessagesOptions"); + if (timeInSeconds !== null && !(typeof timeInSeconds === "number")) { + throw new Error("timeInSeconds must be Number"); } - this.#__requestId = requestId; - this.#__streamName = streamName; - this.#__readMessagesOptions = readMessagesOptions; - } - - /** - * @returns {String} - - */ - get requestId() { - return this.#__requestId; - } - /** - * @param value {String} - */ - set requestId(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + if (offsetInNanos !== null && !(typeof offsetInNanos === "number")) { + throw new Error("offsetInNanos must be Number"); } - this.#__requestId = value; - } - /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} - */ - withRequestId(value) { - this.requestId = value; - return this; + this.#__timeInSeconds = timeInSeconds; + this.#__offsetInNanos = offsetInNanos; } /** - * @returns {String} + * The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by offsetInNanos. + * @returns {Number} */ - get streamName() { - return this.#__streamName; + get timeInSeconds() { + return this.#__timeInSeconds; } /** - * @param value {String} + * @param value {Number} The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by offsetInNanos. */ - set streamName(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("streamName must be String"); + set timeInSeconds(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("timeInSeconds must be Number"); } - this.#__streamName = value; + this.#__timeInSeconds = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} + * @param value {Number} The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by offsetInNanos. + * @returns {aws-greengrass-core-sdk.StreamManager.TimeInNanos} */ - withStreamName(value) { - this.streamName = value; + withTimeInSeconds(value) { + this.timeInSeconds = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * The nanosecond offset from timeInSeconds. + * @returns {Number} */ - get readMessagesOptions() { - return this.#__readMessagesOptions; + get offsetInNanos() { + return this.#__offsetInNanos; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} + * @param value {Number} The nanosecond offset from timeInSeconds. */ - set readMessagesOptions(value) { - if (value !== null && !(value instanceof ReadMessagesOptions)) { - throw new Error("readMessagesOptions must be ReadMessagesOptions"); + set offsetInNanos(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("offsetInNanos must be Number"); } - this.#__readMessagesOptions = value; + this.#__offsetInNanos = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ReadMessagesOptions} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesRequest} + * @param value {Number} The nanosecond offset from timeInSeconds. + * @returns {aws-greengrass-core-sdk.StreamManager.TimeInNanos} */ - withReadMessagesOptions(value) { - this.readMessagesOptions = value; + withOffsetInNanos(value) { + this.offsetInNanos = value; return this; } static fromMap(d) { - const ret = new ReadMessagesRequest(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; - } - if ("streamName" in d) { - ret.streamName = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["streamName"]) : d["streamName"]; + const ret = new TimeInNanos(); + if ("timeInSeconds" in d) { + ret.timeInSeconds = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["timeInSeconds"]) : d["timeInSeconds"]; } - if ("readMessagesOptions" in d) { - ret.readMessagesOptions = Object.prototype.hasOwnProperty.call(ReadMessagesOptions, "fromMap") ? ReadMessagesOptions.fromMap(d["readMessagesOptions"]) : d["readMessagesOptions"]; + if ("offsetInNanos" in d) { + ret.offsetInNanos = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["offsetInNanos"]) : d["offsetInNanos"]; } return ret; } asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; - } - if (this.streamName !== null) { - d["streamName"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.streamName), "asMap") ? this.streamName.asMap() : this.streamName; + if (this.timeInSeconds !== null) { + d["timeInSeconds"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.timeInSeconds), "asMap") ? this.timeInSeconds.asMap() : this.timeInSeconds; } - if (this.readMessagesOptions !== null) { - d["readMessagesOptions"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.readMessagesOptions), "asMap") ? this.readMessagesOptions.asMap() : this.readMessagesOptions; + if (this.offsetInNanos !== null) { + d["offsetInNanos"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.offsetInNanos), "asMap") ? this.offsetInNanos.asMap() : this.offsetInNanos; } return d; } }; -Object.defineProperty(ReadMessagesRequest, "typesMap", { +Object.defineProperty(TimeInNanos, "typesMap", { value: { - requestId: { - 'type': String, - 'subtype': null - }, - streamName: { - 'type': String, + timeInSeconds: { + 'type': Number, 'subtype': null }, - readMessagesOptions: { - 'type': ReadMessagesOptions, + offsetInNanos: { + 'type': Number, 'subtype': null }, } }); -Object.defineProperty(ReadMessagesRequest, "formatsMap", { +Object.defineProperty(TimeInNanos, "formatsMap", { value: {} }); -Object.defineProperty(ReadMessagesRequest, "validationsMap", { +Object.defineProperty(TimeInNanos, "validationsMap", { value: { - 'requestId': { - 'required': true, - 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, - }, - 'streamName': { + 'timeInSeconds': { 'required': true, - 'minLength': 1, - 'maxLength': 255, - 'pattern': /^[\w ,.\-_]*$/, + 'maximum': 31556889864403199, + 'minimum': 1, }, - 'readMessagesOptions': { + 'offsetInNanos': { 'required': false, + 'maximum': 999999999, + 'minimum': 0, }, } }); /** - * Internal Only + * Contains an asset property value (of a single type only). * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class ReadMessagesResponse { - #__requestId = null; - #__messages = null; - #__status = null; - #__errorMessage = null; +class Variant { + #__stringValue = null; + #__integerValue = null; + #__doubleValue = null; + #__booleanValue = null; /** - * @param requestId {String} - * @param messages {aws-greengrass-core-sdk.StreamManager.Message[]} - * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @param errorMessage {String} + * @param stringValue {String} Asset property data of type string (sequence of characters). + * @param integerValue {Number} Asset property data of type integer (whole number). + * @param doubleValue {Number} Asset property data of type double (floating point number). + * @param booleanValue {Boolean} Asset property data of type Boolean (true or false). */ constructor( - requestId = null, - messages = null, - status = null, - errorMessage = null, + stringValue = null, + integerValue = null, + doubleValue = null, + booleanValue = null, ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); + if (stringValue !== null && !(typeof stringValue === "string")) { + throw new Error("stringValue must be String"); } - if (messages !== null && !(messages instanceof Array)) { - throw new Error("messages must be Array"); - } - if (messages !== null && !messages.every((v) => v instanceof Message)) { - throw new Error("messages array values must be Message"); + if (integerValue !== null && !(typeof integerValue === "number")) { + throw new Error("integerValue must be Number"); } - if (status !== null && !(status instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + if (doubleValue !== null && !(typeof doubleValue === "number")) { + throw new Error("doubleValue must be Number"); } - if (errorMessage !== null && !(typeof errorMessage === "string")) { - throw new Error("errorMessage must be String"); + if (booleanValue !== null && !(typeof booleanValue === "boolean")) { + throw new Error("booleanValue must be Boolean"); } - this.#__requestId = requestId; - this.#__messages = messages; - this.#__status = status; - this.#__errorMessage = errorMessage; + this.#__stringValue = stringValue; + this.#__integerValue = integerValue; + this.#__doubleValue = doubleValue; + this.#__booleanValue = booleanValue; } /** + * Asset property data of type string (sequence of characters). * @returns {String} */ - get requestId() { - return this.#__requestId; + get stringValue() { + return this.#__stringValue; } /** - * @param value {String} + * @param value {String} Asset property data of type string (sequence of characters). */ - set requestId(value) { + set stringValue(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + throw new Error("stringValue must be String"); } - this.#__requestId = value; + this.#__stringValue = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} + * @param value {String} Asset property data of type string (sequence of characters). + * @returns {aws-greengrass-core-sdk.StreamManager.Variant} */ - withRequestId(value) { - this.requestId = value; + withStringValue(value) { + this.stringValue = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.Message[]} + * Asset property data of type integer (whole number). + * @returns {Number} */ - get messages() { - return this.#__messages; + get integerValue() { + return this.#__integerValue; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.Message[]} + * @param value {Number} Asset property data of type integer (whole number). */ - set messages(value) { - if (value !== null && !(value instanceof Array)) { - throw new Error("messages must be Array"); - } - if (value !== null && !value.every((v) => v instanceof Message)) { - throw new Error("messages array values must be Message"); + set integerValue(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("integerValue must be Number"); } - this.#__messages = value; + this.#__integerValue = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.Message[]} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} + * @param value {Number} Asset property data of type integer (whole number). + * @returns {aws-greengrass-core-sdk.StreamManager.Variant} */ - withMessages(value) { - this.messages = value; + withIntegerValue(value) { + this.integerValue = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * Asset property data of type double (floating point number). + * @returns {Number} */ - get status() { - return this.#__status; + get doubleValue() { + return this.#__doubleValue; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param value {Number} Asset property data of type double (floating point number). */ - set status(value) { - if (value !== null && !(value instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + set doubleValue(value) { + if (value !== null && !(typeof value === "number")) { + throw new Error("doubleValue must be Number"); } - this.#__status = value; + this.#__doubleValue = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} + * @param value {Number} Asset property data of type double (floating point number). + * @returns {aws-greengrass-core-sdk.StreamManager.Variant} */ - withStatus(value) { - this.status = value; + withDoubleValue(value) { + this.doubleValue = value; return this; } /** - * @returns {String} + * Asset property data of type Boolean (true or false). + * @returns {Boolean} */ - get errorMessage() { - return this.#__errorMessage; + get booleanValue() { + return this.#__booleanValue; } /** - * @param value {String} + * @param value {Boolean} Asset property data of type Boolean (true or false). */ - set errorMessage(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("errorMessage must be String"); + set booleanValue(value) { + if (value !== null && !(typeof value === "boolean")) { + throw new Error("booleanValue must be Boolean"); } - this.#__errorMessage = value; + this.#__booleanValue = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ReadMessagesResponse} + * @param value {Boolean} Asset property data of type Boolean (true or false). + * @returns {aws-greengrass-core-sdk.StreamManager.Variant} */ - withErrorMessage(value) { - this.errorMessage = value; + withBooleanValue(value) { + this.booleanValue = value; return this; } static fromMap(d) { - const ret = new ReadMessagesResponse(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + const ret = new Variant(); + if ("stringValue" in d) { + ret.stringValue = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["stringValue"]) : d["stringValue"]; } - if ("messages" in d) { - ret.messages = d["messages"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Message, "fromMap") ? Message.fromMap(v) : v); - return acc; - }, []); + if ("integerValue" in d) { + ret.integerValue = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["integerValue"]) : d["integerValue"]; } - if ("status" in d) { - ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + if ("doubleValue" in d) { + ret.doubleValue = Object.prototype.hasOwnProperty.call(Number, "fromMap") ? Number.fromMap(d["doubleValue"]) : d["doubleValue"]; } - if ("errorMessage" in d) { - ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + if ("booleanValue" in d) { + ret.booleanValue = Object.prototype.hasOwnProperty.call(Boolean, "fromMap") ? Boolean.fromMap(d["booleanValue"]) : d["booleanValue"]; } return ret; } asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + if (this.stringValue !== null) { + d["stringValue"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.stringValue), "asMap") ? this.stringValue.asMap() : this.stringValue; } - if (this.messages !== null) { - d["messages"] = this.messages.reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); - return acc; - }, []); + if (this.integerValue !== null) { + d["integerValue"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.integerValue), "asMap") ? this.integerValue.asMap() : this.integerValue; } - if (this.status !== null) { - d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + if (this.doubleValue !== null) { + d["doubleValue"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.doubleValue), "asMap") ? this.doubleValue.asMap() : this.doubleValue; } - if (this.errorMessage !== null) { - d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + if (this.booleanValue !== null) { + d["booleanValue"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.booleanValue), "asMap") ? this.booleanValue.asMap() : this.booleanValue; } return d; } }; -Object.defineProperty(ReadMessagesResponse, "typesMap", { +Object.defineProperty(Variant, "typesMap", { value: { - requestId: { + stringValue: { 'type': String, 'subtype': null }, - messages: { - 'type': Array, - 'subtype': Message + integerValue: { + 'type': Number, + 'subtype': null }, - status: { - 'type': ResponseStatusCode, + doubleValue: { + 'type': Number, 'subtype': null }, - errorMessage: { - 'type': String, + booleanValue: { + 'type': Boolean, 'subtype': null }, } }); -Object.defineProperty(ReadMessagesResponse, "formatsMap", { +Object.defineProperty(Variant, "formatsMap", { value: {} }); -Object.defineProperty(ReadMessagesResponse, "validationsMap", { +Object.defineProperty(Variant, "validationsMap", { value: { - 'requestId': { + 'stringValue': { 'required': false, 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, + 'maxLength': 1024, + 'pattern': /[^\u0000-\u001F\u007F]+/, }, - 'messages': { + 'integerValue': { 'required': false, + 'maximum': 2147483647, + 'minimum': 0, }, - 'status': { + 'doubleValue': { 'required': false, }, - 'errorMessage': { + 'booleanValue': { 'required': false, }, } }); /** - * (Internal Only) Request object to list all available streams. There are no options. + * + * + * @class + * @memberOf aws-greengrass-core-sdk.StreamManager + */ +class Quality { + + #value = null; + constructor(value = null) { + if (!Object.values(Quality.options).includes(value)) { + throw new Error("Value must be one of the enumerated options"); + } + this.#value = value; + } + + static fromMap(d) { + return Quality[Quality.optionsFlipped[d]]; + } + + asMap() { + return this.#value; + } +}; +Object.defineProperty(Quality, "options", { + value: { + GOOD: "GOOD", + BAD: "BAD", + UNCERTAIN: "UNCERTAIN", + } +}); +Object.defineProperty(Quality, "optionsFlipped", { + value: { + "GOOD": "GOOD", + "BAD": "BAD", + "UNCERTAIN": "UNCERTAIN", + } +}); + +/** + * @member {aws-greengrass-core-sdk.StreamManager.Quality} GOOD + * @memberOf aws-greengrass-core-sdk.StreamManager.Quality# + * @readonly + */ +Object.defineProperty(Quality, "GOOD", { + value: new Quality("GOOD") +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Quality} BAD + * @memberOf aws-greengrass-core-sdk.StreamManager.Quality# + * @readonly + */ +Object.defineProperty(Quality, "BAD", { + value: new Quality("BAD") +}); +/** + * @member {aws-greengrass-core-sdk.StreamManager.Quality} UNCERTAIN + * @memberOf aws-greengrass-core-sdk.StreamManager.Quality# + * @readonly + */ +Object.defineProperty(Quality, "UNCERTAIN", { + value: new Quality("UNCERTAIN") +}); + +/** + * Contains asset property value information. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class ListStreamsRequest { - #__requestId = null; +class AssetPropertyValue { + #__value = null; + #__timestamp = null; + #__quality = null; /** - * @param requestId {String} + * @param value {aws-greengrass-core-sdk.StreamManager.Variant} The value of the asset property. + * @param timestamp {aws-greengrass-core-sdk.StreamManager.TimeInNanos} The timestamp of the asset property value. + * @param quality {aws-greengrass-core-sdk.StreamManager.Quality} The quality of the asset property value. */ constructor( - requestId = null, + value = null, + timestamp = null, + quality = null, ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); + if (value !== null && !(value instanceof Variant)) { + throw new Error("value must be Variant"); } - this.#__requestId = requestId; + if (timestamp !== null && !(timestamp instanceof TimeInNanos)) { + throw new Error("timestamp must be TimeInNanos"); + } + + if (quality !== null && !(quality instanceof Quality)) { + throw new Error("quality must be Quality"); + } + + this.#__value = value; + this.#__timestamp = timestamp; + this.#__quality = quality; } /** - * @returns {String} + * The value of the asset property. + * @returns {aws-greengrass-core-sdk.StreamManager.Variant} */ - get requestId() { - return this.#__requestId; + get value() { + return this.#__value; } /** - * @param value {String} + * @param value {aws-greengrass-core-sdk.StreamManager.Variant} The value of the asset property. */ - set requestId(value) { - if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + set value(value) { + if (value !== null && !(value instanceof Variant)) { + throw new Error("value must be Variant"); } - this.#__requestId = value; + this.#__value = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsRequest} + * @param value {aws-greengrass-core-sdk.StreamManager.Variant} The value of the asset property. + * @returns {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue} */ - withRequestId(value) { - this.requestId = value; + withValue(value) { + this.value = value; + return this; + } + + /** + * The timestamp of the asset property value. + * @returns {aws-greengrass-core-sdk.StreamManager.TimeInNanos} + + */ + get timestamp() { + return this.#__timestamp; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.TimeInNanos} The timestamp of the asset property value. + */ + set timestamp(value) { + if (value !== null && !(value instanceof TimeInNanos)) { + throw new Error("timestamp must be TimeInNanos"); + } + + this.#__timestamp = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.TimeInNanos} The timestamp of the asset property value. + * @returns {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue} + */ + withTimestamp(value) { + this.timestamp = value; + return this; + } + + /** + * The quality of the asset property value. + * @returns {aws-greengrass-core-sdk.StreamManager.Quality} + + */ + get quality() { + return this.#__quality; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.Quality} The quality of the asset property value. + */ + set quality(value) { + if (value !== null && !(value instanceof Quality)) { + throw new Error("quality must be Quality"); + } + + this.#__quality = value; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.Quality} The quality of the asset property value. + * @returns {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue} + */ + withQuality(value) { + this.quality = value; return this; } static fromMap(d) { - const ret = new ListStreamsRequest(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + const ret = new AssetPropertyValue(); + if ("value" in d) { + ret.value = Object.prototype.hasOwnProperty.call(Variant, "fromMap") ? Variant.fromMap(d["value"]) : d["value"]; + } + if ("timestamp" in d) { + ret.timestamp = Object.prototype.hasOwnProperty.call(TimeInNanos, "fromMap") ? TimeInNanos.fromMap(d["timestamp"]) : d["timestamp"]; + } + if ("quality" in d) { + ret.quality = Object.prototype.hasOwnProperty.call(Quality, "fromMap") ? Quality.fromMap(d["quality"]) : d["quality"]; } return ret; } asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + if (this.value !== null) { + d["value"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.value), "asMap") ? this.value.asMap() : this.value; + } + if (this.timestamp !== null) { + d["timestamp"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.timestamp), "asMap") ? this.timestamp.asMap() : this.timestamp; + } + if (this.quality !== null) { + d["quality"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.quality), "asMap") ? this.quality.asMap() : this.quality; } return d; } }; -Object.defineProperty(ListStreamsRequest, "typesMap", { +Object.defineProperty(AssetPropertyValue, "typesMap", { value: { - requestId: { - 'type': String, + value: { + 'type': Variant, + 'subtype': null + }, + timestamp: { + 'type': TimeInNanos, + 'subtype': null + }, + quality: { + 'type': Quality, 'subtype': null }, } }); -Object.defineProperty(ListStreamsRequest, "formatsMap", { +Object.defineProperty(AssetPropertyValue, "formatsMap", { value: {} }); -Object.defineProperty(ListStreamsRequest, "validationsMap", { +Object.defineProperty(AssetPropertyValue, "validationsMap", { value: { - 'requestId': { + 'value': { 'required': true, - 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, + }, + 'timestamp': { + 'required': true, + }, + 'quality': { + 'required': false, }, } }); /** - * Internal Only + * Contains a list of value updates for a IoTSiteWise asset property in the list of asset entries consumed by the BatchPutAssetPropertyValue API. See https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchPutAssetPropertyValue.html. * * @class * @memberOf aws-greengrass-core-sdk.StreamManager */ -class ListStreamsResponse { - #__requestId = null; - #__status = null; - #__errorMessage = null; - #__streams = null; +class PutAssetPropertyValueEntry { + #__entryId = null; + #__assetId = null; + #__propertyId = null; + #__propertyAlias = null; + #__propertyValues = null; /** - * @param requestId {String} - * @param status {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @param errorMessage {String} - * @param streams {String[]} + * @param entryId {String} The user specified ID for the entry. You can use this ID to identify which entries failed. + * @param assetId {String} The ID of the asset to update. + * @param propertyId {String} The ID of the asset property for this entry. + * @param propertyAlias {String} The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html. + * @param propertyValues {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue[]} The list of property values to upload. You can specify up to 10 values. */ constructor( - requestId = null, - status = null, - errorMessage = null, - streams = null, + entryId = null, + assetId = null, + propertyId = null, + propertyAlias = null, + propertyValues = null, ) { - if (requestId !== null && !(typeof requestId === "string")) { - throw new Error("requestId must be String"); + if (entryId !== null && !(typeof entryId === "string")) { + throw new Error("entryId must be String"); } - if (status !== null && !(status instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + if (assetId !== null && !(typeof assetId === "string")) { + throw new Error("assetId must be String"); } - if (errorMessage !== null && !(typeof errorMessage === "string")) { - throw new Error("errorMessage must be String"); + if (propertyId !== null && !(typeof propertyId === "string")) { + throw new Error("propertyId must be String"); } - if (streams !== null && !(streams instanceof Array)) { - throw new Error("streams must be Array"); + if (propertyAlias !== null && !(typeof propertyAlias === "string")) { + throw new Error("propertyAlias must be String"); } - if (streams !== null && !streams.every((v) => typeof v === "string")) { - throw new Error("streams array values must be String"); + + if (propertyValues !== null && !(propertyValues instanceof Array)) { + throw new Error("propertyValues must be Array"); + } + if (propertyValues !== null && !propertyValues.every((v) => v instanceof AssetPropertyValue)) { + throw new Error("propertyValues array values must be AssetPropertyValue"); } - this.#__requestId = requestId; - this.#__status = status; - this.#__errorMessage = errorMessage; - this.#__streams = streams; + this.#__entryId = entryId; + this.#__assetId = assetId; + this.#__propertyId = propertyId; + this.#__propertyAlias = propertyAlias; + this.#__propertyValues = propertyValues; } /** + * The user specified ID for the entry. You can use this ID to identify which entries failed. * @returns {String} */ - get requestId() { - return this.#__requestId; + get entryId() { + return this.#__entryId; } /** - * @param value {String} + * @param value {String} The user specified ID for the entry. You can use this ID to identify which entries failed. */ - set requestId(value) { + set entryId(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("requestId must be String"); + throw new Error("entryId must be String"); } - this.#__requestId = value; + this.#__entryId = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} + * @param value {String} The user specified ID for the entry. You can use this ID to identify which entries failed. + * @returns {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry} */ - withRequestId(value) { - this.requestId = value; + withEntryId(value) { + this.entryId = value; return this; } /** - * @returns {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * The ID of the asset to update. + * @returns {String} */ - get status() { - return this.#__status; + get assetId() { + return this.#__assetId; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} + * @param value {String} The ID of the asset to update. */ - set status(value) { - if (value !== null && !(value instanceof ResponseStatusCode)) { - throw new Error("status must be ResponseStatusCode"); + set assetId(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("assetId must be String"); } - this.#__status = value; + this.#__assetId = value; } /** - * @param value {aws-greengrass-core-sdk.StreamManager.ResponseStatusCode} - * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} + * @param value {String} The ID of the asset to update. + * @returns {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry} */ - withStatus(value) { - this.status = value; + withAssetId(value) { + this.assetId = value; return this; } /** + * The ID of the asset property for this entry. * @returns {String} */ - get errorMessage() { - return this.#__errorMessage; + get propertyId() { + return this.#__propertyId; } /** - * @param value {String} + * @param value {String} The ID of the asset property for this entry. */ - set errorMessage(value) { + set propertyId(value) { if (value !== null && !(typeof value === "string")) { - throw new Error("errorMessage must be String"); + throw new Error("propertyId must be String"); } - this.#__errorMessage = value; + this.#__propertyId = value; } /** - * @param value {String} - * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} + * @param value {String} The ID of the asset property for this entry. + * @returns {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry} */ - withErrorMessage(value) { - this.errorMessage = value; + withPropertyId(value) { + this.propertyId = value; return this; } /** - * @returns {String[]} + * The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html. + * @returns {String} */ - get streams() { - return this.#__streams; + get propertyAlias() { + return this.#__propertyAlias; } /** - * @param value {String[]} + * @param value {String} The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html. */ - set streams(value) { + set propertyAlias(value) { + if (value !== null && !(typeof value === "string")) { + throw new Error("propertyAlias must be String"); + } + + this.#__propertyAlias = value; + } + /** + * @param value {String} The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html. + * @returns {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry} + */ + withPropertyAlias(value) { + this.propertyAlias = value; + return this; + } + + /** + * The list of property values to upload. You can specify up to 10 values. + * @returns {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue[]} + + */ + get propertyValues() { + return this.#__propertyValues; + } + /** + * @param value {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue[]} The list of property values to upload. You can specify up to 10 values. + */ + set propertyValues(value) { if (value !== null && !(value instanceof Array)) { - throw new Error("streams must be Array"); + throw new Error("propertyValues must be Array"); } - if (value !== null && !value.every((v) => typeof v === "string")) { - throw new Error("streams array values must be String"); + if (value !== null && !value.every((v) => v instanceof AssetPropertyValue)) { + throw new Error("propertyValues array values must be AssetPropertyValue"); } - this.#__streams = value; + this.#__propertyValues = value; } /** - * @param value {String[]} - * @returns {aws-greengrass-core-sdk.StreamManager.ListStreamsResponse} + * @param value {aws-greengrass-core-sdk.StreamManager.AssetPropertyValue[]} The list of property values to upload. You can specify up to 10 values. + * @returns {aws-greengrass-core-sdk.StreamManager.PutAssetPropertyValueEntry} */ - withStreams(value) { - this.streams = value; + withPropertyValues(value) { + this.propertyValues = value; return this; } static fromMap(d) { - const ret = new ListStreamsResponse(); - if ("requestId" in d) { - ret.requestId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["requestId"]) : d["requestId"]; + const ret = new PutAssetPropertyValueEntry(); + if ("entryId" in d) { + ret.entryId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["entryId"]) : d["entryId"]; } - if ("status" in d) { - ret.status = Object.prototype.hasOwnProperty.call(ResponseStatusCode, "fromMap") ? ResponseStatusCode.fromMap(d["status"]) : d["status"]; + if ("assetId" in d) { + ret.assetId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["assetId"]) : d["assetId"]; } - if ("errorMessage" in d) { - ret.errorMessage = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["errorMessage"]) : d["errorMessage"]; + if ("propertyId" in d) { + ret.propertyId = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["propertyId"]) : d["propertyId"]; } - if ("streams" in d) { - ret.streams = d["streams"].reduce((acc, v) => { - acc.push(Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(v) : v); + if ("propertyAlias" in d) { + ret.propertyAlias = Object.prototype.hasOwnProperty.call(String, "fromMap") ? String.fromMap(d["propertyAlias"]) : d["propertyAlias"]; + } + if ("propertyValues" in d) { + ret.propertyValues = d["propertyValues"].reduce((acc, v) => { + acc.push(Object.prototype.hasOwnProperty.call(AssetPropertyValue, "fromMap") ? AssetPropertyValue.fromMap(v) : v); return acc; }, []); } @@ -6099,17 +10143,20 @@

Source: stream-manager/data/index.js

asMap() { const d = {}; - if (this.requestId !== null) { - d["requestId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.requestId), "asMap") ? this.requestId.asMap() : this.requestId; + if (this.entryId !== null) { + d["entryId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.entryId), "asMap") ? this.entryId.asMap() : this.entryId; } - if (this.status !== null) { - d["status"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.status), "asMap") ? this.status.asMap() : this.status; + if (this.assetId !== null) { + d["assetId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.assetId), "asMap") ? this.assetId.asMap() : this.assetId; } - if (this.errorMessage !== null) { - d["errorMessage"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.errorMessage), "asMap") ? this.errorMessage.asMap() : this.errorMessage; + if (this.propertyId !== null) { + d["propertyId"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.propertyId), "asMap") ? this.propertyId.asMap() : this.propertyId; } - if (this.streams !== null) { - d["streams"] = this.streams.reduce((acc, v) => { + if (this.propertyAlias !== null) { + d["propertyAlias"] = Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(this.propertyAlias), "asMap") ? this.propertyAlias.asMap() : this.propertyAlias; + } + if (this.propertyValues !== null) { + d["propertyValues"] = this.propertyValues.reduce((acc, v) => { acc.push(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(v), "asMap") ? v.asMap() : v); return acc; }, []); @@ -6118,107 +10165,160 @@

Source: stream-manager/data/index.js

} }; -Object.defineProperty(ListStreamsResponse, "typesMap", { +Object.defineProperty(PutAssetPropertyValueEntry, "typesMap", { value: { - requestId: { + entryId: { 'type': String, 'subtype': null }, - status: { - 'type': ResponseStatusCode, + assetId: { + 'type': String, 'subtype': null }, - errorMessage: { + propertyId: { 'type': String, 'subtype': null }, - streams: { + propertyAlias: { + 'type': String, + 'subtype': null + }, + propertyValues: { 'type': Array, - 'subtype': String + 'subtype': AssetPropertyValue }, } }); -Object.defineProperty(ListStreamsResponse, "formatsMap", { +Object.defineProperty(PutAssetPropertyValueEntry, "formatsMap", { value: {} }); -Object.defineProperty(ListStreamsResponse, "validationsMap", { +Object.defineProperty(PutAssetPropertyValueEntry, "validationsMap", { value: { - 'requestId': { + 'entryId': { 'required': true, 'minLength': 1, - 'pattern': /^[\w ,.\-_]*$/, + 'maxLength': 64, + 'pattern': /^[a-zA-Z0-9_-]+$/, }, - 'status': { - 'required': true, + 'assetId': { + 'required': false, }, - 'errorMessage': { + 'propertyId': { 'required': false, }, - 'streams': { + 'propertyAlias': { 'required': false, + 'minLength': 1, + 'maxLength': 2048, + 'pattern': /[^\u0000-\u001F\u007F]+/, + }, + 'propertyValues': { + 'required': true, + 'maxItems': 10, + 'minItems': 1, }, } }); /** * @type {{ -StrategyOnFull: StrategyOnFull, -Persistence: Persistence, +VersionInfo: VersionInfo, ConnectRequest: ConnectRequest, ResponseStatusCode: ResponseStatusCode, ConnectResponse: ConnectResponse, Operation: Operation, MessageFrame: MessageFrame, +EventType: EventType, +Status: Status, +StatusLevel: StatusLevel, +S3ExportTaskDefinition: S3ExportTaskDefinition, +StatusContext: StatusContext, +StatusMessage: StatusMessage, +TraceableRequest: TraceableRequest, +UnknownOperationError: UnknownOperationError, +Persistence: Persistence, +ExportFormat: ExportFormat, HTTPConfig: HTTPConfig, IoTAnalyticsConfig: IoTAnalyticsConfig, KinesisConfig: KinesisConfig, +IoTSiteWiseConfig: IoTSiteWiseConfig, +StatusConfig: StatusConfig, +S3ExportTaskExecutorConfig: S3ExportTaskExecutorConfig, ExportDefinition: ExportDefinition, +StrategyOnFull: StrategyOnFull, MessageStreamDefinition: MessageStreamDefinition, -MessageStreamInfo: MessageStreamInfo, -Message: Message, -ReadMessagesOptions: ReadMessagesOptions, CreateMessageStreamRequest: CreateMessageStreamRequest, CreateMessageStreamResponse: CreateMessageStreamResponse, +UpdateMessageStreamRequest: UpdateMessageStreamRequest, +UpdateMessageStreamResponse: UpdateMessageStreamResponse, DeleteMessageStreamRequest: DeleteMessageStreamRequest, DeleteMessageStreamResponse: DeleteMessageStreamResponse, DescribeMessageStreamRequest: DescribeMessageStreamRequest, +MessageStreamInfo: MessageStreamInfo, DescribeMessageStreamResponse: DescribeMessageStreamResponse, AppendMessageRequest: AppendMessageRequest, AppendMessageResponse: AppendMessageResponse, +ReadMessagesOptions: ReadMessagesOptions, ReadMessagesRequest: ReadMessagesRequest, +Message: Message, ReadMessagesResponse: ReadMessagesResponse, ListStreamsRequest: ListStreamsRequest, -ListStreamsResponse: ListStreamsResponse +ListStreamsResponse: ListStreamsResponse, +TimeInNanos: TimeInNanos, +Variant: Variant, +Quality: Quality, +AssetPropertyValue: AssetPropertyValue, +PutAssetPropertyValueEntry: PutAssetPropertyValueEntry }} */ module.exports = { - StrategyOnFull, - Persistence, + VersionInfo, ConnectRequest, ResponseStatusCode, ConnectResponse, Operation, MessageFrame, + EventType, + Status, + StatusLevel, + S3ExportTaskDefinition, + StatusContext, + StatusMessage, + TraceableRequest, + UnknownOperationError, + Persistence, + ExportFormat, HTTPConfig, IoTAnalyticsConfig, KinesisConfig, + IoTSiteWiseConfig, + StatusConfig, + S3ExportTaskExecutorConfig, ExportDefinition, + StrategyOnFull, MessageStreamDefinition, - MessageStreamInfo, - Message, - ReadMessagesOptions, CreateMessageStreamRequest, CreateMessageStreamResponse, + UpdateMessageStreamRequest, + UpdateMessageStreamResponse, DeleteMessageStreamRequest, DeleteMessageStreamResponse, DescribeMessageStreamRequest, + MessageStreamInfo, DescribeMessageStreamResponse, AppendMessageRequest, AppendMessageResponse, + ReadMessagesOptions, ReadMessagesRequest, + Message, ReadMessagesResponse, ListStreamsRequest, ListStreamsResponse, + TimeInNanos, + Variant, + Quality, + AssetPropertyValue, + PutAssetPropertyValueEntry, };
@@ -6229,13 +10329,13 @@

Source: stream-manager/data/index.js


- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/stream-manager_index.js.html b/docs/stream-manager_index.js.html index 031c7b2..5346157 100644 --- a/docs/stream-manager_index.js.html +++ b/docs/stream-manager_index.js.html @@ -45,13 +45,13 @@

Source: stream-manager/index.js


- Documentation generated by JSDoc 3.6.3 on Fri May 01 2020 00:24:23 GMT+0000 (Coordinated Universal Time) + Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/stream-manager_util.js.html b/docs/stream-manager_util.js.html new file mode 100644 index 0000000..2d51006 --- /dev/null +++ b/docs/stream-manager_util.js.html @@ -0,0 +1,86 @@ + + + + + JSDoc: Source: stream-manager/util.js + + + + + + + + + + +
+ +

Source: stream-manager/util.js

+ + + + + + +
+
+
/* eslint-disable no-restricted-syntax */
+/*
+ * Copyright (c) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ */
+
+const exceptions = require('./exceptions');
+const utilInternal = require('./utilInternal');
+
+/**
+ * Validate And Serialize an instance of class to Json bytes
+ * @param o a instance object
+ * @return byte array
+ * @exception throws ValidationException
+ */
+const validateAndSerializeToJsonBytes = (o) => {
+    const validation = utilInternal.isInvalid(o);
+    if (validation) {
+        throw new exceptions.ValidationException(validation);
+    }
+    return utilInternal.serializeToJsonWithEmptyArrayAsNull(o.asMap());
+};
+
+
+/**
+ * Deserialize the json byte array to an instance of class
+ * @param bytes a bytes array
+ * @param type instance type
+ * @return object
+ */
+const deserializeJsonBytesToObj = (bytes, type) => type.fromMap(JSON.parse(bytes.toString('utf-8')));
+
+module.exports = {
+    validateAndSerializeToJsonBytes,
+    deserializeJsonBytesToObj,
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.6.3 on Thu Sep 17 2020 01:16:53 GMT+0000 (Coordinated Universal Time) +
+ + + + + diff --git a/greengrassExamples/StreamManagerIoTSiteWise/index.js b/greengrassExamples/StreamManagerIoTSiteWise/index.js new file mode 100644 index 0000000..72b6ddd --- /dev/null +++ b/greengrassExamples/StreamManagerIoTSiteWise/index.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + */ + +/* + * This example will create a Greengrass StreamManager stream called "SomeStream". + * It will then start writing data into that stream and StreamManager will + * automatically export the written data to the customer-created property alias. + * The property alias should be created before running this example. + * This example will run forever, until the program is killed. + + * The size of the StreamManager stream on disk will not exceed the default (which is 256 MB). + * Any data appended after the stream reaches the size limit, will continue to be appended, and + * StreamManager will delete the oldest data until the total stream size is back under 256MB. + */ + +const { + StreamManagerClient, ExportDefinition, + IoTSiteWiseConfig, MessageStreamDefinition, StrategyOnFull, + ResourceNotFoundException, AssetPropertyValue, PutAssetPropertyValueEntry, Quality, TimeInNanos, Variant, + util, +} = require('aws-greengrass-core-sdk').StreamManager; + +const STREAM_NAME = 'SomeStream'; +const PROPERTY_ALIAS = 'SomePropertyAlias'; +const ENTRY_ID_PREFIX = 'SomeEntryId-'; + +const c = new StreamManagerClient(); + +function getRandomPutAssetPropertyValueEntry(i) { + const maxTimeRandomness = 60; + const maxOffsetRandomness = 10000; + const randomValue = Math.random(); + // Note: Inorder to create a new asset property data, you should use the classes defined in the + // aws-greengrass-core-sdk StreamManager module. + const timestamp = new TimeInNanos() + .withTimeInSeconds(Math.round(Date.now() / 1000) - Math.floor(Math.random() - maxTimeRandomness)) + .withOffsetInNanos(Math.floor(Math.random() * maxOffsetRandomness)); + const entry = new AssetPropertyValue() + .withValue(new Variant().withDoubleValue(randomValue)) + .withQuality(Quality.GOOD) + .withTimestamp(timestamp); + + return new PutAssetPropertyValueEntry() + .withEntryId(`${ENTRY_ID_PREFIX}${i}`) + .withPropertyAlias(PROPERTY_ALIAS) + .withPropertyValues([entry]); +} + +c.onConnected(async () => { + // Try deleting the stream (if it exists) so that we have a fresh start + try { + await c.deleteMessageStream(STREAM_NAME); + } catch (e) { + // Rethrow the error if it wasn't the expected error + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } + } + + try { + const exports = new ExportDefinition() + .withIotSitewise([new IoTSiteWiseConfig() + .withIdentifier(`IoTSiteWise-${STREAM_NAME}`) + .withBatchSize(5)]); + + // Then create the stream with the IoTSiteWise export definition. + await c.createMessageStream( + new MessageStreamDefinition() + .withName(STREAM_NAME) + .withStrategyOnFull(StrategyOnFull.OverwriteOldestData) + .withExportDefinition(exports), + ); + + let index = 0; + // Now start putting in random SiteWise entries. + const interval = setInterval(async () => { + try { + console.log('Appending new random SiteWise entries to stream'); + await c.appendMessage(STREAM_NAME, util.validateAndSerializeToJsonBytes(getRandomPutAssetPropertyValueEntry(index++))); + } catch { + clearInterval(interval); + c.close(); + } + }, 1000); + } catch (e) { + console.log(e); + c.close(); + } +}); + +// Dummy handler because this example should run as a long-lived lambda +module.exports.handler = function handler() { + return ''; +}; diff --git a/greengrassExamples/StreamManagerS3/index.js b/greengrassExamples/StreamManagerS3/index.js new file mode 100644 index 0000000..2bc50c9 --- /dev/null +++ b/greengrassExamples/StreamManagerS3/index.js @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + */ + +/* + * This example creates a local stream named 'SomeStream', and a status stream named 'SomeStatusStream. + * It adds 1 S3 Export task into the 'SomeStream' stream and then stream manager automatically exports + * the data to a customer-created S3 bucket named 'SomeBucket'. + * The S3 bucket should be created before running this example. + * This example runs until the customer-created file at URL 'SomeURL' has been uploaded to the S3 bucket. + */ + +const { + StreamManagerClient, ReadMessagesOptions, ExportDefinition, + MessageStreamDefinition, StrategyOnFull, ResourceNotFoundException, + S3ExportTaskDefinition, Status, StatusConfig, StatusLevel, StatusMessage, S3ExportTaskExecutorConfig, + util, +} = require('aws-greengrass-core-sdk').StreamManager; + +const STREAM_NAME = 'SomeStream'; +const STATUS_STREAM_NAME = 'SomeStatusStream'; +const BUCKET = 'SomeBucket'; +const KEY = 'SomeKey'; +const FILE_URL = 'file:/path/to/some/file.someExtension'; + +const c = new StreamManagerClient(); +c.onConnected(async () => { + // Try deleting the stream (if it exists) so that we have a fresh start + try { + await c.deleteMessageStream(STATUS_STREAM_NAME); + } catch (e) { + // Rethrow the error if it wasn't the expected error + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } + } + // Try deleting the stream (if it exists) so that we have a fresh start + try { + await c.deleteMessageStream(STREAM_NAME); + } catch (e) { + // Rethrow the error if it wasn't the expected error + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } + } + + try { + const exports = new ExportDefinition() + .withS3TaskExecutor([new S3ExportTaskExecutorConfig() + .withIdentifier(`S3Export-${STREAM_NAME}`) + .withStatusConfig(new StatusConfig() + .withStatusLevel(StatusLevel.INFO) + .withStatusStreamName(STATUS_STREAM_NAME))]); + + // Create the export status stream first. + await c.createMessageStream( + new MessageStreamDefinition() + .withName(STATUS_STREAM_NAME) + .withStrategyOnFull(StrategyOnFull.OverwriteOldestData), + ); + + // Then create the stream with the S3 Export definition. + await c.createMessageStream( + new MessageStreamDefinition() + .withName(STREAM_NAME) + .withStrategyOnFull(StrategyOnFull.OverwriteOldestData) + .withExportDefinition(exports), + ); + + // Append a S3 export task definition and print the sequence number. + const taskDefinition = new S3ExportTaskDefinition() + .withBucket(BUCKET) + .withKey(KEY) + .withInputUrl(FILE_URL); + + console.log(`Successfully appended message to stream with sequence number + ${await c.appendMessage(STREAM_NAME, util.validateAndSerializeToJsonBytes(taskDefinition))}`); + + console.log('Now going to start reading statuses from the export status stream.'); + let isS3UploadComplete = false; + while (!isS3UploadComplete) { + try { + // Read the statuses from the export status stream + const messages = await c.readMessages(STATUS_STREAM_NAME, + new ReadMessagesOptions() + .withMinMessageCount(1) + .withReadTimeoutMillis(1000)); + + messages.forEach((message) => { + // Deserialize the status message first. + const statusMessage = util.deserializeJsonBytesToObj(message.payload, StatusMessage); + // Check the status of the status message. If the status is 'Success', the file was successfully uploaded to S3. + // If the status was either 'Failure' or 'Cancelled', the server was unable to upload the file to S3. + // We will print the message for why the upload to S3 failed from the status message. + // If the status was "InProgress", the status indicates that the server has started uploading the S3 task. + if (statusMessage.status === Status.Success) { + console.log(`Successfully uploaded file at path ${FILE_URL} to S3.`); + isS3UploadComplete = true; + } else if (statusMessage.status === Status.Failure || statusMessage.status === Status.Canceled) { + console.log(`Unable to upload file at path ${FILE_URL} to S3. Message: ${statusMessage.message}`); + isS3UploadComplete = true; + } + }); + // Sleep for sometime for the S3 upload task to complete before trying to read the status message. + await new Promise((r) => setTimeout(r, 5000)); + } catch (e) { + // Ignored + } + } + } catch (e) { + c.close(); + } +}); + +// Dummy handler because this example should run as a pinned lambda +module.exports.handler = function handler() { + return ''; +}; diff --git a/readme.md b/readme.md index 73d8459..25113c3 100644 --- a/readme.md +++ b/readme.md @@ -105,12 +105,28 @@ As new features are added to AWS IoT Greengrass, newer versions of the AWS IoT G + + +1.11.x + +1.0.x-1.7.x + + + +
+ +## 1.7.0 Updates[¶](#1.7.0updates "Permalink to this headline") + +Stream manager supports automatic data export to AWS S3 and AWS IoT SiteWise, provides new API method to update existing streams, and pause or resume exporting. + +
+
## 1.6.0 Updates[¶](#1.6.0updates "Permalink to this headline")