UNPKG

@azure/digital-twins-core

Version:
69 lines 2.52 kB
"use strict"; /* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.QueryImpl = void 0; const tslib_1 = require("tslib"); const coreClient = tslib_1.__importStar(require("@azure/core-client")); const Mappers = tslib_1.__importStar(require("../models/mappers.js")); const Parameters = tslib_1.__importStar(require("../models/parameters.js")); /** Class containing Query operations. */ class QueryImpl { /** * Initialize a new instance of the class Query class. * @param client Reference to the service client */ constructor(client) { this.client = client; } /** * Executes a query that allows traversing relationships and filtering by property values. * Status codes: * * 200 OK * * 400 Bad Request * * BadRequest - The continuation token is invalid. * * SqlQueryError - The query contains some errors. * * TimeoutError - The query execution timed out after 60 seconds. Try simplifying the query or * adding conditions to reduce the result size. * * 429 Too Many Requests * * QuotaReachedError - The maximum query rate limit has been reached. * @param querySpecification The query specification to execute. * @param options The options parameters. */ queryTwins(querySpecification, options) { return this.client.sendOperationRequest({ querySpecification, options }, queryTwinsOperationSpec); } } exports.QueryImpl = QueryImpl; // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const queryTwinsOperationSpec = { path: "/query", httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.QueryResult, headersMapper: Mappers.QueryQueryTwinsHeaders, }, default: { bodyMapper: Mappers.ErrorResponse, headersMapper: Mappers.QueryQueryTwinsExceptionHeaders, }, }, requestBody: Parameters.querySpecification, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [ Parameters.contentType, Parameters.accept, Parameters.resultsPerPage, ], mediaType: "json", serializer, }; //# sourceMappingURL=query.js.map