et-industry-openapi-20200824/Sources/AlibabacloudEtIndustryOpenapi20200824/Client.swift (433 lines of code) (raw):
import Foundation
import Tea
import TeaUtils
import AlibabacloudOpenApi
import AlibabaCloudOpenApiUtil
import AlibabacloudEndpointUtil
open class Client : AlibabacloudOpenApi.Client {
public override init(_ config: AlibabacloudOpenApi.Config) throws {
try super.init(config)
self._endpointRule = "regional"
self._endpointMap = [
"cn-hangzhou": "et-industry.cn-hangzhou.aliyuncs.com"
]
try checkConfig(config as! AlibabacloudOpenApi.Config)
self._endpoint = try getEndpoint("et-industry-openapi", self._regionId ?? "", self._endpointRule ?? "", self._network ?? "", self._suffix ?? "", self._endpointMap ?? [:], self._endpoint ?? "")
}
public func getEndpoint(_ productId: String, _ regionId: String, _ endpointRule: String, _ network: String, _ suffix: String, _ endpointMap: [String: String], _ endpoint: String) throws -> String {
if (!TeaUtils.Client.empty(endpoint)) {
return endpoint as! String
}
if (!TeaUtils.Client.isUnset(endpointMap) && !TeaUtils.Client.empty(endpointMap[regionId as! String])) {
return endpointMap[regionId as! String] ?? ""
}
return try AlibabacloudEndpointUtil.Client.getEndpointRules(productId, regionId, endpointRule, network, suffix)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getMqttConnectWithOptions(_ request: GetMqttConnectRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetMqttConnectResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.request)) {
body["Request"] = request.request ?? [:];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetMqttConnect",
"version": "2020-08-24",
"protocol": "HTTPS",
"pathname": "/api/igate/collaboration/pop/getmqttconnect",
"method": "POST",
"authType": "AK",
"style": "ROA",
"reqBodyType": "formData",
"bodyType": "json"
])
if (TeaUtils.Client.isUnset(self._signatureVersion) || !TeaUtils.Client.equalString(self._signatureVersion, "v4")) {
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(GetMqttConnectResponse(), tmp)
}
else {
var tmp: [String: Any] = try await execute(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(GetMqttConnectResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getMqttConnect(_ request: GetMqttConnectRequest) async throws -> GetMqttConnectResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getMqttConnectWithOptions(request as! GetMqttConnectRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getNonceWithOptions(_ request: GetNonceRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetNonceResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.request)) {
body["Request"] = request.request ?? [:];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetNonce",
"version": "2020-08-24",
"protocol": "HTTPS",
"pathname": "/api/igate/collaboration/pop/getnonce",
"method": "POST",
"authType": "AK",
"style": "ROA",
"reqBodyType": "formData",
"bodyType": "json"
])
if (TeaUtils.Client.isUnset(self._signatureVersion) || !TeaUtils.Client.equalString(self._signatureVersion, "v4")) {
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(GetNonceResponse(), tmp)
}
else {
var tmp: [String: Any] = try await execute(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(GetNonceResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getNonce(_ request: GetNonceRequest) async throws -> GetNonceResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getNonceWithOptions(request as! GetNonceRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listMeasurePointListByNodeCodePageWithOptions(_ request: ListMeasurePointListByNodeCodePageRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListMeasurePointListByNodeCodePageResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.request)) {
body["Request"] = request.request ?? [:];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListMeasurePointListByNodeCodePage",
"version": "2020-08-24",
"protocol": "HTTPS",
"pathname": "/api/igate/node/pop/measurepointlistbynodecodepage",
"method": "POST",
"authType": "AK",
"style": "ROA",
"reqBodyType": "formData",
"bodyType": "json"
])
if (TeaUtils.Client.isUnset(self._signatureVersion) || !TeaUtils.Client.equalString(self._signatureVersion, "v4")) {
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(ListMeasurePointListByNodeCodePageResponse(), tmp)
}
else {
var tmp: [String: Any] = try await execute(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(ListMeasurePointListByNodeCodePageResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listMeasurePointListByNodeCodePage(_ request: ListMeasurePointListByNodeCodePageRequest) async throws -> ListMeasurePointListByNodeCodePageResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listMeasurePointListByNodeCodePageWithOptions(request as! ListMeasurePointListByNodeCodePageRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func multiFieldBatchUploadWithOptions(_ request: MultiFieldBatchUploadRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> MultiFieldBatchUploadResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.body)) {
body["body"] = request.body ?? [:];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "MultiFieldBatchUpload",
"version": "2020-08-24",
"protocol": "HTTPS",
"pathname": "/api/igate/timeseries/upload/pop/multifieldbatchv2",
"method": "POST",
"authType": "AK",
"style": "ROA",
"reqBodyType": "json",
"bodyType": "json"
])
if (TeaUtils.Client.isUnset(self._signatureVersion) || !TeaUtils.Client.equalString(self._signatureVersion, "v4")) {
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(MultiFieldBatchUploadResponse(), tmp)
}
else {
var tmp: [String: Any] = try await execute(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(MultiFieldBatchUploadResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func multiFieldBatchUpload(_ request: MultiFieldBatchUploadRequest) async throws -> MultiFieldBatchUploadResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await multiFieldBatchUploadWithOptions(request as! MultiFieldBatchUploadRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func multiSourcePointBatchUploadWithOptions(_ request: MultiSourcePointBatchUploadRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> MultiSourcePointBatchUploadResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.body)) {
body["body"] = request.body ?? [:];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "MultiSourcePointBatchUpload",
"version": "2020-08-24",
"protocol": "HTTPS",
"pathname": "/api/igate/timeseries/upload/pop/sourcepointbatchv2",
"method": "POST",
"authType": "AK",
"style": "ROA",
"reqBodyType": "json",
"bodyType": "json"
])
if (TeaUtils.Client.isUnset(self._signatureVersion) || !TeaUtils.Client.equalString(self._signatureVersion, "v4")) {
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(MultiSourcePointBatchUploadResponse(), tmp)
}
else {
var tmp: [String: Any] = try await execute(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(MultiSourcePointBatchUploadResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func multiSourcePointBatchUpload(_ request: MultiSourcePointBatchUploadRequest) async throws -> MultiSourcePointBatchUploadResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await multiSourcePointBatchUploadWithOptions(request as! MultiSourcePointBatchUploadRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func queryFieldLatestBySourcePointWithOptions(_ request: QueryFieldLatestBySourcePointRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> QueryFieldLatestBySourcePointResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.request)) {
body["Request"] = request.request ?? [:];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "QueryFieldLatestBySourcePoint",
"version": "2020-08-24",
"protocol": "HTTPS",
"pathname": "/api/igate/timeseries/query/pop/multifieldlatestbysourcepoint",
"method": "POST",
"authType": "AK",
"style": "ROA",
"reqBodyType": "formData",
"bodyType": "json"
])
if (TeaUtils.Client.isUnset(self._signatureVersion) || !TeaUtils.Client.equalString(self._signatureVersion, "v4")) {
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(QueryFieldLatestBySourcePointResponse(), tmp)
}
else {
var tmp: [String: Any] = try await execute(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(QueryFieldLatestBySourcePointResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func queryFieldLatestBySourcePoint(_ request: QueryFieldLatestBySourcePointRequest) async throws -> QueryFieldLatestBySourcePointResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await queryFieldLatestBySourcePointWithOptions(request as! QueryFieldLatestBySourcePointRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func queryIndustryDeviceDataWithOptions(_ request: QueryIndustryDeviceDataRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> QueryIndustryDeviceDataResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.request)) {
body["Request"] = request.request ?? [:];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "QueryIndustryDeviceData",
"version": "2020-08-24",
"protocol": "HTTPS",
"pathname": "/api/igate/timeseries/query/pop/multifieldlatest",
"method": "POST",
"authType": "AK",
"style": "ROA",
"reqBodyType": "formData",
"bodyType": "json"
])
if (TeaUtils.Client.isUnset(self._signatureVersion) || !TeaUtils.Client.equalString(self._signatureVersion, "v4")) {
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(QueryIndustryDeviceDataResponse(), tmp)
}
else {
var tmp: [String: Any] = try await execute(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(QueryIndustryDeviceDataResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func queryIndustryDeviceData(_ request: QueryIndustryDeviceDataRequest) async throws -> QueryIndustryDeviceDataResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await queryIndustryDeviceDataWithOptions(request as! QueryIndustryDeviceDataRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func queryIndustryDeviceLimitsDataWithOptions(_ request: QueryIndustryDeviceLimitsDataRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> QueryIndustryDeviceLimitsDataResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.request)) {
body["Request"] = request.request ?? [:];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "QueryIndustryDeviceLimitsData",
"version": "2020-08-24",
"protocol": "HTTPS",
"pathname": "/api/igate/timeseries/query/pop/multifieldrange",
"method": "POST",
"authType": "AK",
"style": "ROA",
"reqBodyType": "formData",
"bodyType": "json"
])
if (TeaUtils.Client.isUnset(self._signatureVersion) || !TeaUtils.Client.equalString(self._signatureVersion, "v4")) {
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(QueryIndustryDeviceLimitsDataResponse(), tmp)
}
else {
var tmp: [String: Any] = try await execute(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(QueryIndustryDeviceLimitsDataResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func queryIndustryDeviceLimitsData(_ request: QueryIndustryDeviceLimitsDataRequest) async throws -> QueryIndustryDeviceLimitsDataResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await queryIndustryDeviceLimitsDataWithOptions(request as! QueryIndustryDeviceLimitsDataRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func queryIndustryDeviceStatusDataWithOptions(_ request: QueryIndustryDeviceStatusDataRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> QueryIndustryDeviceStatusDataResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.request)) {
body["Request"] = request.request ?? [:];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "QueryIndustryDeviceStatusData",
"version": "2020-08-24",
"protocol": "HTTPS",
"pathname": "/api/igate/timeseries/query/pop/multifieldrangestatus",
"method": "POST",
"authType": "AK",
"style": "ROA",
"reqBodyType": "formData",
"bodyType": "json"
])
if (TeaUtils.Client.isUnset(self._signatureVersion) || !TeaUtils.Client.equalString(self._signatureVersion, "v4")) {
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(QueryIndustryDeviceStatusDataResponse(), tmp)
}
else {
var tmp: [String: Any] = try await execute(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(QueryIndustryDeviceStatusDataResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func queryIndustryDeviceStatusData(_ request: QueryIndustryDeviceStatusDataRequest) async throws -> QueryIndustryDeviceStatusDataResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await queryIndustryDeviceStatusDataWithOptions(request as! QueryIndustryDeviceStatusDataRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func sourcePointBatchWithOptions(_ request: SourcePointBatchRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> SourcePointBatchResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.request)) {
body["Request"] = request.request ?? [:];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "SourcePointBatch",
"version": "2020-08-24",
"protocol": "HTTPS",
"pathname": "/api/igate/timeseries/upload/pop/sourcepointbatch",
"method": "POST",
"authType": "AK",
"style": "ROA",
"reqBodyType": "formData",
"bodyType": "json"
])
if (TeaUtils.Client.isUnset(self._signatureVersion) || !TeaUtils.Client.equalString(self._signatureVersion, "v4")) {
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(SourcePointBatchResponse(), tmp)
}
else {
var tmp: [String: Any] = try await execute(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(SourcePointBatchResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func sourcePointBatch(_ request: SourcePointBatchRequest) async throws -> SourcePointBatchResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await sourcePointBatchWithOptions(request as! SourcePointBatchRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func uploadIndustryDeviceDataWithOptions(_ request: UploadIndustryDeviceDataRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> UploadIndustryDeviceDataResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.request)) {
body["Request"] = request.request ?? [:];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "UploadIndustryDeviceData",
"version": "2020-08-24",
"protocol": "HTTPS",
"pathname": "/api/igate/timeseries/upload/pop/multifieldbatch",
"method": "POST",
"authType": "AK",
"style": "ROA",
"reqBodyType": "formData",
"bodyType": "json"
])
if (TeaUtils.Client.isUnset(self._signatureVersion) || !TeaUtils.Client.equalString(self._signatureVersion, "v4")) {
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(UploadIndustryDeviceDataResponse(), tmp)
}
else {
var tmp: [String: Any] = try await execute(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
return Tea.TeaConverter.fromMap(UploadIndustryDeviceDataResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func uploadIndustryDeviceData(_ request: UploadIndustryDeviceDataRequest) async throws -> UploadIndustryDeviceDataResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await uploadIndustryDeviceDataWithOptions(request as! UploadIndustryDeviceDataRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
}