Skip to content

Commit f07f481

Browse files
author
awstools
committed
feat(client-iotsitewise): This release adds 3 new batch data query APIs : BatchGetAssetPropertyValue, BatchGetAssetPropertyValueHistory and BatchGetAssetPropertyAggregates
1 parent 7b8954d commit f07f481

13 files changed

+3390
-302
lines changed

clients/client-iotsitewise/src/IoTSiteWise.ts

+115
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ import {
2020
BatchDisassociateProjectAssetsCommandInput,
2121
BatchDisassociateProjectAssetsCommandOutput,
2222
} from "./commands/BatchDisassociateProjectAssetsCommand";
23+
import {
24+
BatchGetAssetPropertyAggregatesCommand,
25+
BatchGetAssetPropertyAggregatesCommandInput,
26+
BatchGetAssetPropertyAggregatesCommandOutput,
27+
} from "./commands/BatchGetAssetPropertyAggregatesCommand";
28+
import {
29+
BatchGetAssetPropertyValueCommand,
30+
BatchGetAssetPropertyValueCommandInput,
31+
BatchGetAssetPropertyValueCommandOutput,
32+
} from "./commands/BatchGetAssetPropertyValueCommand";
33+
import {
34+
BatchGetAssetPropertyValueHistoryCommand,
35+
BatchGetAssetPropertyValueHistoryCommandInput,
36+
BatchGetAssetPropertyValueHistoryCommandOutput,
37+
} from "./commands/BatchGetAssetPropertyValueHistoryCommand";
2338
import {
2439
BatchPutAssetPropertyValueCommand,
2540
BatchPutAssetPropertyValueCommandInput,
@@ -438,6 +453,106 @@ export class IoTSiteWise extends IoTSiteWiseClient {
438453
}
439454
}
440455

456+
/**
457+
* <p>Gets aggregated values (for example, average, minimum, and maximum) for one or more asset properties.
458+
* For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#aggregates">Querying
459+
* aggregates</a> in the <i>IoT SiteWise User Guide</i>.</p>
460+
*/
461+
public batchGetAssetPropertyAggregates(
462+
args: BatchGetAssetPropertyAggregatesCommandInput,
463+
options?: __HttpHandlerOptions
464+
): Promise<BatchGetAssetPropertyAggregatesCommandOutput>;
465+
public batchGetAssetPropertyAggregates(
466+
args: BatchGetAssetPropertyAggregatesCommandInput,
467+
cb: (err: any, data?: BatchGetAssetPropertyAggregatesCommandOutput) => void
468+
): void;
469+
public batchGetAssetPropertyAggregates(
470+
args: BatchGetAssetPropertyAggregatesCommandInput,
471+
options: __HttpHandlerOptions,
472+
cb: (err: any, data?: BatchGetAssetPropertyAggregatesCommandOutput) => void
473+
): void;
474+
public batchGetAssetPropertyAggregates(
475+
args: BatchGetAssetPropertyAggregatesCommandInput,
476+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: BatchGetAssetPropertyAggregatesCommandOutput) => void),
477+
cb?: (err: any, data?: BatchGetAssetPropertyAggregatesCommandOutput) => void
478+
): Promise<BatchGetAssetPropertyAggregatesCommandOutput> | void {
479+
const command = new BatchGetAssetPropertyAggregatesCommand(args);
480+
if (typeof optionsOrCb === "function") {
481+
this.send(command, optionsOrCb);
482+
} else if (typeof cb === "function") {
483+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
484+
this.send(command, optionsOrCb || {}, cb);
485+
} else {
486+
return this.send(command, optionsOrCb);
487+
}
488+
}
489+
490+
/**
491+
* <p>Gets the current value for one or more asset properties. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#current-values">Querying
492+
* current values</a> in the <i>IoT SiteWise User Guide</i>.</p>
493+
*/
494+
public batchGetAssetPropertyValue(
495+
args: BatchGetAssetPropertyValueCommandInput,
496+
options?: __HttpHandlerOptions
497+
): Promise<BatchGetAssetPropertyValueCommandOutput>;
498+
public batchGetAssetPropertyValue(
499+
args: BatchGetAssetPropertyValueCommandInput,
500+
cb: (err: any, data?: BatchGetAssetPropertyValueCommandOutput) => void
501+
): void;
502+
public batchGetAssetPropertyValue(
503+
args: BatchGetAssetPropertyValueCommandInput,
504+
options: __HttpHandlerOptions,
505+
cb: (err: any, data?: BatchGetAssetPropertyValueCommandOutput) => void
506+
): void;
507+
public batchGetAssetPropertyValue(
508+
args: BatchGetAssetPropertyValueCommandInput,
509+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: BatchGetAssetPropertyValueCommandOutput) => void),
510+
cb?: (err: any, data?: BatchGetAssetPropertyValueCommandOutput) => void
511+
): Promise<BatchGetAssetPropertyValueCommandOutput> | void {
512+
const command = new BatchGetAssetPropertyValueCommand(args);
513+
if (typeof optionsOrCb === "function") {
514+
this.send(command, optionsOrCb);
515+
} else if (typeof cb === "function") {
516+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
517+
this.send(command, optionsOrCb || {}, cb);
518+
} else {
519+
return this.send(command, optionsOrCb);
520+
}
521+
}
522+
523+
/**
524+
* <p>Gets the historical values for one or more asset properties. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#historical-values">Querying
525+
* historical values</a> in the <i>IoT SiteWise User Guide</i>.</p>
526+
*/
527+
public batchGetAssetPropertyValueHistory(
528+
args: BatchGetAssetPropertyValueHistoryCommandInput,
529+
options?: __HttpHandlerOptions
530+
): Promise<BatchGetAssetPropertyValueHistoryCommandOutput>;
531+
public batchGetAssetPropertyValueHistory(
532+
args: BatchGetAssetPropertyValueHistoryCommandInput,
533+
cb: (err: any, data?: BatchGetAssetPropertyValueHistoryCommandOutput) => void
534+
): void;
535+
public batchGetAssetPropertyValueHistory(
536+
args: BatchGetAssetPropertyValueHistoryCommandInput,
537+
options: __HttpHandlerOptions,
538+
cb: (err: any, data?: BatchGetAssetPropertyValueHistoryCommandOutput) => void
539+
): void;
540+
public batchGetAssetPropertyValueHistory(
541+
args: BatchGetAssetPropertyValueHistoryCommandInput,
542+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: BatchGetAssetPropertyValueHistoryCommandOutput) => void),
543+
cb?: (err: any, data?: BatchGetAssetPropertyValueHistoryCommandOutput) => void
544+
): Promise<BatchGetAssetPropertyValueHistoryCommandOutput> | void {
545+
const command = new BatchGetAssetPropertyValueHistoryCommand(args);
546+
if (typeof optionsOrCb === "function") {
547+
this.send(command, optionsOrCb);
548+
} else if (typeof cb === "function") {
549+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
550+
this.send(command, optionsOrCb || {}, cb);
551+
} else {
552+
return this.send(command, optionsOrCb);
553+
}
554+
}
555+
441556
/**
442557
* <p>Sends a list of asset property values to IoT SiteWise. Each value is a timestamp-quality-value
443558
* (TQV) data point. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/ingest-api.html">Ingesting data using the API</a> in the

clients/client-iotsitewise/src/IoTSiteWiseClient.ts

+18
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ import {
6464
BatchDisassociateProjectAssetsCommandInput,
6565
BatchDisassociateProjectAssetsCommandOutput,
6666
} from "./commands/BatchDisassociateProjectAssetsCommand";
67+
import {
68+
BatchGetAssetPropertyAggregatesCommandInput,
69+
BatchGetAssetPropertyAggregatesCommandOutput,
70+
} from "./commands/BatchGetAssetPropertyAggregatesCommand";
71+
import {
72+
BatchGetAssetPropertyValueCommandInput,
73+
BatchGetAssetPropertyValueCommandOutput,
74+
} from "./commands/BatchGetAssetPropertyValueCommand";
75+
import {
76+
BatchGetAssetPropertyValueHistoryCommandInput,
77+
BatchGetAssetPropertyValueHistoryCommandOutput,
78+
} from "./commands/BatchGetAssetPropertyValueHistoryCommand";
6779
import {
6880
BatchPutAssetPropertyValueCommandInput,
6981
BatchPutAssetPropertyValueCommandOutput,
@@ -189,6 +201,9 @@ export type ServiceInputTypes =
189201
| AssociateTimeSeriesToAssetPropertyCommandInput
190202
| BatchAssociateProjectAssetsCommandInput
191203
| BatchDisassociateProjectAssetsCommandInput
204+
| BatchGetAssetPropertyAggregatesCommandInput
205+
| BatchGetAssetPropertyValueCommandInput
206+
| BatchGetAssetPropertyValueHistoryCommandInput
192207
| BatchPutAssetPropertyValueCommandInput
193208
| CreateAccessPolicyCommandInput
194209
| CreateAssetCommandInput
@@ -256,6 +271,9 @@ export type ServiceOutputTypes =
256271
| AssociateTimeSeriesToAssetPropertyCommandOutput
257272
| BatchAssociateProjectAssetsCommandOutput
258273
| BatchDisassociateProjectAssetsCommandOutput
274+
| BatchGetAssetPropertyAggregatesCommandOutput
275+
| BatchGetAssetPropertyValueCommandOutput
276+
| BatchGetAssetPropertyValueHistoryCommandOutput
259277
| BatchPutAssetPropertyValueCommandOutput
260278
| CreateAccessPolicyCommandOutput
261279
| CreateAssetCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
2+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
3+
import { Command as $Command } from "@aws-sdk/smithy-client";
4+
import {
5+
FinalizeHandlerArguments,
6+
Handler,
7+
HandlerExecutionContext,
8+
HttpHandlerOptions as __HttpHandlerOptions,
9+
MetadataBearer as __MetadataBearer,
10+
MiddlewareStack,
11+
SerdeContext as __SerdeContext,
12+
} from "@aws-sdk/types";
13+
14+
import { IoTSiteWiseClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTSiteWiseClient";
15+
import { BatchGetAssetPropertyAggregatesRequest, BatchGetAssetPropertyAggregatesResponse } from "../models/models_0";
16+
import {
17+
deserializeAws_restJson1BatchGetAssetPropertyAggregatesCommand,
18+
serializeAws_restJson1BatchGetAssetPropertyAggregatesCommand,
19+
} from "../protocols/Aws_restJson1";
20+
21+
export interface BatchGetAssetPropertyAggregatesCommandInput extends BatchGetAssetPropertyAggregatesRequest {}
22+
export interface BatchGetAssetPropertyAggregatesCommandOutput
23+
extends BatchGetAssetPropertyAggregatesResponse,
24+
__MetadataBearer {}
25+
26+
/**
27+
* <p>Gets aggregated values (for example, average, minimum, and maximum) for one or more asset properties.
28+
* For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#aggregates">Querying
29+
* aggregates</a> in the <i>IoT SiteWise User Guide</i>.</p>
30+
* @example
31+
* Use a bare-bones client and the command you need to make an API call.
32+
* ```javascript
33+
* import { IoTSiteWiseClient, BatchGetAssetPropertyAggregatesCommand } from "@aws-sdk/client-iotsitewise"; // ES Modules import
34+
* // const { IoTSiteWiseClient, BatchGetAssetPropertyAggregatesCommand } = require("@aws-sdk/client-iotsitewise"); // CommonJS import
35+
* const client = new IoTSiteWiseClient(config);
36+
* const command = new BatchGetAssetPropertyAggregatesCommand(input);
37+
* const response = await client.send(command);
38+
* ```
39+
*
40+
* @see {@link BatchGetAssetPropertyAggregatesCommandInput} for command's `input` shape.
41+
* @see {@link BatchGetAssetPropertyAggregatesCommandOutput} for command's `response` shape.
42+
* @see {@link IoTSiteWiseClientResolvedConfig | config} for IoTSiteWiseClient's `config` shape.
43+
*
44+
*/
45+
export class BatchGetAssetPropertyAggregatesCommand extends $Command<
46+
BatchGetAssetPropertyAggregatesCommandInput,
47+
BatchGetAssetPropertyAggregatesCommandOutput,
48+
IoTSiteWiseClientResolvedConfig
49+
> {
50+
// Start section: command_properties
51+
// End section: command_properties
52+
53+
constructor(readonly input: BatchGetAssetPropertyAggregatesCommandInput) {
54+
// Start section: command_constructor
55+
super();
56+
// End section: command_constructor
57+
}
58+
59+
/**
60+
* @internal
61+
*/
62+
resolveMiddleware(
63+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
64+
configuration: IoTSiteWiseClientResolvedConfig,
65+
options?: __HttpHandlerOptions
66+
): Handler<BatchGetAssetPropertyAggregatesCommandInput, BatchGetAssetPropertyAggregatesCommandOutput> {
67+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
68+
69+
const stack = clientStack.concat(this.middlewareStack);
70+
71+
const { logger } = configuration;
72+
const clientName = "IoTSiteWiseClient";
73+
const commandName = "BatchGetAssetPropertyAggregatesCommand";
74+
const handlerExecutionContext: HandlerExecutionContext = {
75+
logger,
76+
clientName,
77+
commandName,
78+
inputFilterSensitiveLog: BatchGetAssetPropertyAggregatesRequest.filterSensitiveLog,
79+
outputFilterSensitiveLog: BatchGetAssetPropertyAggregatesResponse.filterSensitiveLog,
80+
};
81+
const { requestHandler } = configuration;
82+
return stack.resolve(
83+
(request: FinalizeHandlerArguments<any>) =>
84+
requestHandler.handle(request.request as __HttpRequest, options || {}),
85+
handlerExecutionContext
86+
);
87+
}
88+
89+
private serialize(
90+
input: BatchGetAssetPropertyAggregatesCommandInput,
91+
context: __SerdeContext
92+
): Promise<__HttpRequest> {
93+
return serializeAws_restJson1BatchGetAssetPropertyAggregatesCommand(input, context);
94+
}
95+
96+
private deserialize(
97+
output: __HttpResponse,
98+
context: __SerdeContext
99+
): Promise<BatchGetAssetPropertyAggregatesCommandOutput> {
100+
return deserializeAws_restJson1BatchGetAssetPropertyAggregatesCommand(output, context);
101+
}
102+
103+
// Start section: command_body_extra
104+
// End section: command_body_extra
105+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
2+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
3+
import { Command as $Command } from "@aws-sdk/smithy-client";
4+
import {
5+
FinalizeHandlerArguments,
6+
Handler,
7+
HandlerExecutionContext,
8+
HttpHandlerOptions as __HttpHandlerOptions,
9+
MetadataBearer as __MetadataBearer,
10+
MiddlewareStack,
11+
SerdeContext as __SerdeContext,
12+
} from "@aws-sdk/types";
13+
14+
import { IoTSiteWiseClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTSiteWiseClient";
15+
import { BatchGetAssetPropertyValueRequest, BatchGetAssetPropertyValueResponse } from "../models/models_0";
16+
import {
17+
deserializeAws_restJson1BatchGetAssetPropertyValueCommand,
18+
serializeAws_restJson1BatchGetAssetPropertyValueCommand,
19+
} from "../protocols/Aws_restJson1";
20+
21+
export interface BatchGetAssetPropertyValueCommandInput extends BatchGetAssetPropertyValueRequest {}
22+
export interface BatchGetAssetPropertyValueCommandOutput extends BatchGetAssetPropertyValueResponse, __MetadataBearer {}
23+
24+
/**
25+
* <p>Gets the current value for one or more asset properties. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#current-values">Querying
26+
* current values</a> in the <i>IoT SiteWise User Guide</i>.</p>
27+
* @example
28+
* Use a bare-bones client and the command you need to make an API call.
29+
* ```javascript
30+
* import { IoTSiteWiseClient, BatchGetAssetPropertyValueCommand } from "@aws-sdk/client-iotsitewise"; // ES Modules import
31+
* // const { IoTSiteWiseClient, BatchGetAssetPropertyValueCommand } = require("@aws-sdk/client-iotsitewise"); // CommonJS import
32+
* const client = new IoTSiteWiseClient(config);
33+
* const command = new BatchGetAssetPropertyValueCommand(input);
34+
* const response = await client.send(command);
35+
* ```
36+
*
37+
* @see {@link BatchGetAssetPropertyValueCommandInput} for command's `input` shape.
38+
* @see {@link BatchGetAssetPropertyValueCommandOutput} for command's `response` shape.
39+
* @see {@link IoTSiteWiseClientResolvedConfig | config} for IoTSiteWiseClient's `config` shape.
40+
*
41+
*/
42+
export class BatchGetAssetPropertyValueCommand extends $Command<
43+
BatchGetAssetPropertyValueCommandInput,
44+
BatchGetAssetPropertyValueCommandOutput,
45+
IoTSiteWiseClientResolvedConfig
46+
> {
47+
// Start section: command_properties
48+
// End section: command_properties
49+
50+
constructor(readonly input: BatchGetAssetPropertyValueCommandInput) {
51+
// Start section: command_constructor
52+
super();
53+
// End section: command_constructor
54+
}
55+
56+
/**
57+
* @internal
58+
*/
59+
resolveMiddleware(
60+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
61+
configuration: IoTSiteWiseClientResolvedConfig,
62+
options?: __HttpHandlerOptions
63+
): Handler<BatchGetAssetPropertyValueCommandInput, BatchGetAssetPropertyValueCommandOutput> {
64+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
65+
66+
const stack = clientStack.concat(this.middlewareStack);
67+
68+
const { logger } = configuration;
69+
const clientName = "IoTSiteWiseClient";
70+
const commandName = "BatchGetAssetPropertyValueCommand";
71+
const handlerExecutionContext: HandlerExecutionContext = {
72+
logger,
73+
clientName,
74+
commandName,
75+
inputFilterSensitiveLog: BatchGetAssetPropertyValueRequest.filterSensitiveLog,
76+
outputFilterSensitiveLog: BatchGetAssetPropertyValueResponse.filterSensitiveLog,
77+
};
78+
const { requestHandler } = configuration;
79+
return stack.resolve(
80+
(request: FinalizeHandlerArguments<any>) =>
81+
requestHandler.handle(request.request as __HttpRequest, options || {}),
82+
handlerExecutionContext
83+
);
84+
}
85+
86+
private serialize(input: BatchGetAssetPropertyValueCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
87+
return serializeAws_restJson1BatchGetAssetPropertyValueCommand(input, context);
88+
}
89+
90+
private deserialize(
91+
output: __HttpResponse,
92+
context: __SerdeContext
93+
): Promise<BatchGetAssetPropertyValueCommandOutput> {
94+
return deserializeAws_restJson1BatchGetAssetPropertyValueCommand(output, context);
95+
}
96+
97+
// Start section: command_body_extra
98+
// End section: command_body_extra
99+
}

0 commit comments

Comments
 (0)