How to use the @here/olp-sdk-dataservice-api.QueryApi.getPartitionsById function in @here/olp-sdk-dataservice-api

To help you get started, we’ve selected a few @here/olp-sdk-dataservice-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VersionedLayerClient.ts View on Github external
private async getDataHandleByPartitionId(
        partitionId: string,
        version?: number
    ): Promise {
        const queryRequestBilder = await this.getRequestBuilder("query");
        const latestVersion = version || (await this.getLatestVersion());
        const partitions = await QueryApi.getPartitionsById(
            queryRequestBilder,
            {
                version: `${latestVersion}`,
                layerId: this.layerId,
                partition: [partitionId]
            }
        );
        const partition = partitions.partitions.find(element => {
            return element.partition === partitionId;
        });

        return partition && partition.dataHandle
            ? partition.dataHandle
            : Promise.reject(
                  `No partition dataHandle for partition ${partitionId}. HRN: ${this.hrn}`
              );
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VersionedLayerClient.ts View on Github external
private async downloadPartitionData(
        partitionId: string
    ): Promise {
        const queryRequestBilder = await this.getRequestBuilder("query");
        const latestVersion = await this.getLatestVersion();
        return QueryApi.getPartitionsById(queryRequestBilder, {
            version: `${latestVersion}`,
            layerId: this.layerId,
            partition: [partitionId]
        });
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VolatileLayerClient.ts View on Github external
private async downloadPartitionData(
        partitionId: string
    ): Promise {
        const queryRequestBilder = await this.getRequestBuilder("query");
        return QueryApi.getPartitionsById(queryRequestBilder, {
            layerId: this.layerId,
            partition: [partitionId]
        });
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VolatileLayerClient.ts View on Github external
private async getDataHandleByPartitionId(
        partitionId: string
    ): Promise {
        const queryRequestBilder = await this.getRequestBuilder("query");
        const partitions = await QueryApi.getPartitionsById(
            queryRequestBilder,
            {
                layerId: this.layerId,
                partition: [partitionId]
            }
        );
        const partition = partitions.partitions.find(element => {
            return element.partition === partitionId;
        });

        return partition && partition.dataHandle
            ? partition.dataHandle
            : Promise.reject(
                  `No partition dataHandle for partition ${partitionId}. HRN: ${this.hrn}`
              );
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / QueryClient.ts View on Github external
return Promise.reject("Please provide correct partitionIds list");
        }

        const requestBuilder = await RequestFactory.create(
            "query",
            this.apiVersion,
            this.settings,
            hrn,
            abortSignal
        ).catch(error =>
            Promise.reject(
                `Erorr creating request object for query service: ${error}`
            )
        );
        
        return QueryApi.getPartitionsById(
            requestBuilder,
            {
                layerId,
                partition: idsList,
                version: version ? `${version}` : undefined,
            }
        );
    }