rocketmq-20220801/Sources/AlibabacloudRocketMQ20220801/Client.swift (2,626 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 = ""
try checkConfig(config as! AlibabacloudOpenApi.Config)
self._endpoint = try getEndpoint("rocketmq", 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 addDisasterRecoveryItemWithOptions(_ planId: String, _ request: AddDisasterRecoveryItemRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> AddDisasterRecoveryItemResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.topics)) {
body["topics"] = request.topics ?? [];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "AddDisasterRecoveryItem",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)) + "/items",
"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(AddDisasterRecoveryItemResponse(), 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(AddDisasterRecoveryItemResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func addDisasterRecoveryItem(_ planId: String, _ request: AddDisasterRecoveryItemRequest) async throws -> AddDisasterRecoveryItemResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await addDisasterRecoveryItemWithOptions(planId as! String, request as! AddDisasterRecoveryItemRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func changeResourceGroupWithOptions(_ request: ChangeResourceGroupRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ChangeResourceGroupResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.regionId)) {
query["regionId"] = request.regionId ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceGroupId)) {
query["resourceGroupId"] = request.resourceGroupId ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceId)) {
query["resourceId"] = request.resourceId ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceType)) {
query["resourceType"] = request.resourceType ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ChangeResourceGroup",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/resourceGroup/change",
"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(ChangeResourceGroupResponse(), 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(ChangeResourceGroupResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func changeResourceGroup(_ request: ChangeResourceGroupRequest) async throws -> ChangeResourceGroupResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await changeResourceGroupWithOptions(request as! ChangeResourceGroupRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createConsumerGroupWithOptions(_ instanceId: String, _ consumerGroupId: String, _ request: CreateConsumerGroupRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> CreateConsumerGroupResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.consumeRetryPolicy)) {
body["consumeRetryPolicy"] = request.consumeRetryPolicy!;
}
if (!TeaUtils.Client.isUnset(request.deliveryOrderType)) {
body["deliveryOrderType"] = request.deliveryOrderType ?? "";
}
if (!TeaUtils.Client.isUnset(request.maxReceiveTps)) {
body["maxReceiveTps"] = request.maxReceiveTps!;
}
if (!TeaUtils.Client.isUnset(request.remark)) {
body["remark"] = request.remark ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "CreateConsumerGroup",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(consumerGroupId)),
"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(CreateConsumerGroupResponse(), 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(CreateConsumerGroupResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createConsumerGroup(_ instanceId: String, _ consumerGroupId: String, _ request: CreateConsumerGroupRequest) async throws -> CreateConsumerGroupResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await createConsumerGroupWithOptions(instanceId as! String, consumerGroupId as! String, request as! CreateConsumerGroupRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createDisasterRecoveryPlanWithOptions(_ request: CreateDisasterRecoveryPlanRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> CreateDisasterRecoveryPlanResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.autoSyncCheckpoint)) {
body["autoSyncCheckpoint"] = request.autoSyncCheckpoint!;
}
if (!TeaUtils.Client.isUnset(request.instances)) {
body["instances"] = request.instances ?? [];
}
if (!TeaUtils.Client.isUnset(request.planDesc)) {
body["planDesc"] = request.planDesc ?? "";
}
if (!TeaUtils.Client.isUnset(request.planName)) {
body["planName"] = request.planName ?? "";
}
if (!TeaUtils.Client.isUnset(request.planType)) {
body["planType"] = request.planType ?? "";
}
if (!TeaUtils.Client.isUnset(request.syncCheckpointEnabled)) {
body["syncCheckpointEnabled"] = request.syncCheckpointEnabled!;
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "CreateDisasterRecoveryPlan",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery",
"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(CreateDisasterRecoveryPlanResponse(), 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(CreateDisasterRecoveryPlanResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createDisasterRecoveryPlan(_ request: CreateDisasterRecoveryPlanRequest) async throws -> CreateDisasterRecoveryPlanResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await createDisasterRecoveryPlanWithOptions(request as! CreateDisasterRecoveryPlanRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createInstanceWithOptions(_ request: CreateInstanceRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> CreateInstanceResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.clientToken)) {
query["clientToken"] = request.clientToken ?? "";
}
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.autoRenew)) {
body["autoRenew"] = request.autoRenew!;
}
if (!TeaUtils.Client.isUnset(request.autoRenewPeriod)) {
body["autoRenewPeriod"] = request.autoRenewPeriod!;
}
if (!TeaUtils.Client.isUnset(request.commodityCode)) {
body["commodityCode"] = request.commodityCode ?? "";
}
if (!TeaUtils.Client.isUnset(request.instanceName)) {
body["instanceName"] = request.instanceName ?? "";
}
if (!TeaUtils.Client.isUnset(request.networkInfo)) {
body["networkInfo"] = request.networkInfo!;
}
if (!TeaUtils.Client.isUnset(request.paymentType)) {
body["paymentType"] = request.paymentType ?? "";
}
if (!TeaUtils.Client.isUnset(request.period)) {
body["period"] = request.period!;
}
if (!TeaUtils.Client.isUnset(request.periodUnit)) {
body["periodUnit"] = request.periodUnit ?? "";
}
if (!TeaUtils.Client.isUnset(request.productInfo)) {
body["productInfo"] = request.productInfo!;
}
if (!TeaUtils.Client.isUnset(request.remark)) {
body["remark"] = request.remark ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceGroupId)) {
body["resourceGroupId"] = request.resourceGroupId ?? "";
}
if (!TeaUtils.Client.isUnset(request.seriesCode)) {
body["seriesCode"] = request.seriesCode ?? "";
}
if (!TeaUtils.Client.isUnset(request.serviceCode)) {
body["serviceCode"] = request.serviceCode ?? "";
}
if (!TeaUtils.Client.isUnset(request.subSeriesCode)) {
body["subSeriesCode"] = request.subSeriesCode ?? "";
}
if (!TeaUtils.Client.isUnset(request.tags)) {
body["tags"] = request.tags ?? [];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query),
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "CreateInstance",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances",
"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(CreateInstanceResponse(), 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(CreateInstanceResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createInstance(_ request: CreateInstanceRequest) async throws -> CreateInstanceResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await createInstanceWithOptions(request as! CreateInstanceRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createInstanceAccountWithOptions(_ instanceId: String, _ request: CreateInstanceAccountRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> CreateInstanceAccountResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.password)) {
body["password"] = request.password ?? "";
}
if (!TeaUtils.Client.isUnset(request.username)) {
body["username"] = request.username ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "CreateInstanceAccount",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/accounts",
"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(CreateInstanceAccountResponse(), 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(CreateInstanceAccountResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createInstanceAccount(_ instanceId: String, _ request: CreateInstanceAccountRequest) async throws -> CreateInstanceAccountResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await createInstanceAccountWithOptions(instanceId as! String, request as! CreateInstanceAccountRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createInstanceAclWithOptions(_ instanceId: String, _ username: String, _ request: CreateInstanceAclRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> CreateInstanceAclResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.actions)) {
body["actions"] = request.actions ?? [];
}
if (!TeaUtils.Client.isUnset(request.decision)) {
body["decision"] = request.decision ?? "";
}
if (!TeaUtils.Client.isUnset(request.ipWhitelists)) {
body["ipWhitelists"] = request.ipWhitelists ?? [];
}
if (!TeaUtils.Client.isUnset(request.resourceName)) {
body["resourceName"] = request.resourceName ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceType)) {
body["resourceType"] = request.resourceType ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "CreateInstanceAcl",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/acl/account/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(username)),
"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(CreateInstanceAclResponse(), 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(CreateInstanceAclResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createInstanceAcl(_ instanceId: String, _ username: String, _ request: CreateInstanceAclRequest) async throws -> CreateInstanceAclResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await createInstanceAclWithOptions(instanceId as! String, username as! String, request as! CreateInstanceAclRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createInstanceIpWhitelistWithOptions(_ instanceId: String, _ request: CreateInstanceIpWhitelistRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> CreateInstanceIpWhitelistResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.ipWhitelists)) {
body["ipWhitelists"] = request.ipWhitelists ?? [];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "CreateInstanceIpWhitelist",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/ip/whitelist",
"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(CreateInstanceIpWhitelistResponse(), 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(CreateInstanceIpWhitelistResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createInstanceIpWhitelist(_ instanceId: String, _ request: CreateInstanceIpWhitelistRequest) async throws -> CreateInstanceIpWhitelistResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await createInstanceIpWhitelistWithOptions(instanceId as! String, request as! CreateInstanceIpWhitelistRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createTopicWithOptions(_ instanceId: String, _ topicName: String, _ request: CreateTopicRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> CreateTopicResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.maxSendTps)) {
body["maxSendTps"] = request.maxSendTps!;
}
if (!TeaUtils.Client.isUnset(request.messageType)) {
body["messageType"] = request.messageType ?? "";
}
if (!TeaUtils.Client.isUnset(request.remark)) {
body["remark"] = request.remark ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "CreateTopic",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)),
"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(CreateTopicResponse(), 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(CreateTopicResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func createTopic(_ instanceId: String, _ topicName: String, _ request: CreateTopicRequest) async throws -> CreateTopicResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await createTopicWithOptions(instanceId as! String, topicName as! String, request as! CreateTopicRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteConsumerGroupWithOptions(_ instanceId: String, _ consumerGroupId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> DeleteConsumerGroupResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "DeleteConsumerGroup",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(consumerGroupId)),
"method": "DELETE",
"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(DeleteConsumerGroupResponse(), 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(DeleteConsumerGroupResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteConsumerGroup(_ instanceId: String, _ consumerGroupId: String) async throws -> DeleteConsumerGroupResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await deleteConsumerGroupWithOptions(instanceId as! String, consumerGroupId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteConsumerGroupSubscriptionWithOptions(_ instanceId: String, _ consumerGroupId: String, _ request: DeleteConsumerGroupSubscriptionRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> DeleteConsumerGroupSubscriptionResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.filterExpression)) {
query["filterExpression"] = request.filterExpression ?? "";
}
if (!TeaUtils.Client.isUnset(request.filterType)) {
query["filterType"] = request.filterType ?? "";
}
if (!TeaUtils.Client.isUnset(request.topicName)) {
query["topicName"] = request.topicName ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "DeleteConsumerGroupSubscription",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(consumerGroupId)) + "/subscriptions",
"method": "DELETE",
"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(DeleteConsumerGroupSubscriptionResponse(), 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(DeleteConsumerGroupSubscriptionResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteConsumerGroupSubscription(_ instanceId: String, _ consumerGroupId: String, _ request: DeleteConsumerGroupSubscriptionRequest) async throws -> DeleteConsumerGroupSubscriptionResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await deleteConsumerGroupSubscriptionWithOptions(instanceId as! String, consumerGroupId as! String, request as! DeleteConsumerGroupSubscriptionRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteDisasterRecoveryItemWithOptions(_ planId: String, _ itemId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> DeleteDisasterRecoveryItemResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "DeleteDisasterRecoveryItem",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)) + "/items/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(itemId)),
"method": "DELETE",
"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(DeleteDisasterRecoveryItemResponse(), 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(DeleteDisasterRecoveryItemResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteDisasterRecoveryItem(_ planId: String, _ itemId: String) async throws -> DeleteDisasterRecoveryItemResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await deleteDisasterRecoveryItemWithOptions(planId as! String, itemId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteDisasterRecoveryPlanWithOptions(_ planId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> DeleteDisasterRecoveryPlanResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "DeleteDisasterRecoveryPlan",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)),
"method": "DELETE",
"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(DeleteDisasterRecoveryPlanResponse(), 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(DeleteDisasterRecoveryPlanResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteDisasterRecoveryPlan(_ planId: String) async throws -> DeleteDisasterRecoveryPlanResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await deleteDisasterRecoveryPlanWithOptions(planId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteInstanceWithOptions(_ instanceId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> DeleteInstanceResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "DeleteInstance",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)),
"method": "DELETE",
"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(DeleteInstanceResponse(), 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(DeleteInstanceResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteInstance(_ instanceId: String) async throws -> DeleteInstanceResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await deleteInstanceWithOptions(instanceId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteInstanceAccountWithOptions(_ instanceId: String, _ username: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> DeleteInstanceAccountResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "DeleteInstanceAccount",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/accounts/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(username)),
"method": "DELETE",
"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(DeleteInstanceAccountResponse(), 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(DeleteInstanceAccountResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteInstanceAccount(_ instanceId: String, _ username: String) async throws -> DeleteInstanceAccountResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await deleteInstanceAccountWithOptions(instanceId as! String, username as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteInstanceAclWithOptions(_ instanceId: String, _ username: String, _ request: DeleteInstanceAclRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> DeleteInstanceAclResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.resourceName)) {
query["resourceName"] = request.resourceName ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceType)) {
query["resourceType"] = request.resourceType ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "DeleteInstanceAcl",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/acl/account/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(username)),
"method": "DELETE",
"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(DeleteInstanceAclResponse(), 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(DeleteInstanceAclResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteInstanceAcl(_ instanceId: String, _ username: String, _ request: DeleteInstanceAclRequest) async throws -> DeleteInstanceAclResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await deleteInstanceAclWithOptions(instanceId as! String, username as! String, request as! DeleteInstanceAclRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteInstanceIpWhitelistWithOptions(_ instanceId: String, _ tmpReq: DeleteInstanceIpWhitelistRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> DeleteInstanceIpWhitelistResponse {
try TeaUtils.Client.validateModel(tmpReq)
var request: DeleteInstanceIpWhitelistShrinkRequest = DeleteInstanceIpWhitelistShrinkRequest([:])
AlibabaCloudOpenApiUtil.Client.convert(tmpReq, request)
if (!TeaUtils.Client.isUnset(tmpReq.ipWhitelists)) {
request.ipWhitelistsShrink = AlibabaCloudOpenApiUtil.Client.arrayToStringWithSpecifiedStyle(tmpReq.ipWhitelists, "ipWhitelists", "simple")
}
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.ipWhitelist)) {
query["ipWhitelist"] = request.ipWhitelist ?? "";
}
if (!TeaUtils.Client.isUnset(request.ipWhitelistsShrink)) {
query["ipWhitelists"] = request.ipWhitelistsShrink ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "DeleteInstanceIpWhitelist",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/ip/whitelist",
"method": "DELETE",
"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(DeleteInstanceIpWhitelistResponse(), 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(DeleteInstanceIpWhitelistResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteInstanceIpWhitelist(_ instanceId: String, _ request: DeleteInstanceIpWhitelistRequest) async throws -> DeleteInstanceIpWhitelistResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await deleteInstanceIpWhitelistWithOptions(instanceId as! String, request as! DeleteInstanceIpWhitelistRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteTopicWithOptions(_ instanceId: String, _ topicName: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> DeleteTopicResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "DeleteTopic",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)),
"method": "DELETE",
"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(DeleteTopicResponse(), 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(DeleteTopicResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func deleteTopic(_ instanceId: String, _ topicName: String) async throws -> DeleteTopicResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await deleteTopicWithOptions(instanceId as! String, topicName as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getConsumerGroupWithOptions(_ instanceId: String, _ consumerGroupId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetConsumerGroupResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetConsumerGroup",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(consumerGroupId)),
"method": "GET",
"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(GetConsumerGroupResponse(), 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(GetConsumerGroupResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getConsumerGroup(_ instanceId: String, _ consumerGroupId: String) async throws -> GetConsumerGroupResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getConsumerGroupWithOptions(instanceId as! String, consumerGroupId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getConsumerGroupLagWithOptions(_ instanceId: String, _ consumerGroupId: String, _ request: GetConsumerGroupLagRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetConsumerGroupLagResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.topicName)) {
query["topicName"] = request.topicName ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetConsumerGroupLag",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(consumerGroupId)) + "/lag",
"method": "GET",
"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(GetConsumerGroupLagResponse(), 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(GetConsumerGroupLagResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getConsumerGroupLag(_ instanceId: String, _ consumerGroupId: String, _ request: GetConsumerGroupLagRequest) async throws -> GetConsumerGroupLagResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getConsumerGroupLagWithOptions(instanceId as! String, consumerGroupId as! String, request as! GetConsumerGroupLagRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getConsumerGroupSubscriptionWithOptions(_ instanceId: String, _ consumerGroupId: String, _ topicName: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetConsumerGroupSubscriptionResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetConsumerGroupSubscription",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(consumerGroupId)) + "/subscriptions/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)),
"method": "GET",
"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(GetConsumerGroupSubscriptionResponse(), 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(GetConsumerGroupSubscriptionResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getConsumerGroupSubscription(_ instanceId: String, _ consumerGroupId: String, _ topicName: String) async throws -> GetConsumerGroupSubscriptionResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getConsumerGroupSubscriptionWithOptions(instanceId as! String, consumerGroupId as! String, topicName as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getConsumerStackWithOptions(_ instanceId: String, _ consumerGroupId: String, _ request: GetConsumerStackRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetConsumerStackResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.clientId)) {
query["clientId"] = request.clientId ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetConsumerStack",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(consumerGroupId)) + "/stack",
"method": "GET",
"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(GetConsumerStackResponse(), 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(GetConsumerStackResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getConsumerStack(_ instanceId: String, _ consumerGroupId: String, _ request: GetConsumerStackRequest) async throws -> GetConsumerStackResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getConsumerStackWithOptions(instanceId as! String, consumerGroupId as! String, request as! GetConsumerStackRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getDisasterRecoveryItemWithOptions(_ planId: String, _ itemId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetDisasterRecoveryItemResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetDisasterRecoveryItem",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)) + "/items/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(itemId)),
"method": "GET",
"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(GetDisasterRecoveryItemResponse(), 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(GetDisasterRecoveryItemResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getDisasterRecoveryItem(_ planId: String, _ itemId: String) async throws -> GetDisasterRecoveryItemResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getDisasterRecoveryItemWithOptions(planId as! String, itemId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getDisasterRecoveryPlanWithOptions(_ planId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetDisasterRecoveryPlanResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetDisasterRecoveryPlan",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)),
"method": "GET",
"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(GetDisasterRecoveryPlanResponse(), 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(GetDisasterRecoveryPlanResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getDisasterRecoveryPlan(_ planId: String) async throws -> GetDisasterRecoveryPlanResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getDisasterRecoveryPlanWithOptions(planId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getInstanceWithOptions(_ instanceId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetInstanceResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetInstance",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)),
"method": "GET",
"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(GetInstanceResponse(), 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(GetInstanceResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getInstance(_ instanceId: String) async throws -> GetInstanceResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getInstanceWithOptions(instanceId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getInstanceAccountWithOptions(_ instanceId: String, _ request: GetInstanceAccountRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetInstanceAccountResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.username)) {
query["username"] = request.username ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetInstanceAccount",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/account",
"method": "GET",
"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(GetInstanceAccountResponse(), 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(GetInstanceAccountResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getInstanceAccount(_ instanceId: String, _ request: GetInstanceAccountRequest) async throws -> GetInstanceAccountResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getInstanceAccountWithOptions(instanceId as! String, request as! GetInstanceAccountRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getInstanceAclWithOptions(_ instanceId: String, _ username: String, _ request: GetInstanceAclRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetInstanceAclResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.resourceName)) {
query["resourceName"] = request.resourceName ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceType)) {
query["resourceType"] = request.resourceType ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetInstanceAcl",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/acl/account/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(username)),
"method": "GET",
"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(GetInstanceAclResponse(), 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(GetInstanceAclResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getInstanceAcl(_ instanceId: String, _ username: String, _ request: GetInstanceAclRequest) async throws -> GetInstanceAclResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getInstanceAclWithOptions(instanceId as! String, username as! String, request as! GetInstanceAclRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getInstanceIpWhitelistWithOptions(_ instanceId: String, _ tmpReq: GetInstanceIpWhitelistRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetInstanceIpWhitelistResponse {
try TeaUtils.Client.validateModel(tmpReq)
var request: GetInstanceIpWhitelistShrinkRequest = GetInstanceIpWhitelistShrinkRequest([:])
AlibabaCloudOpenApiUtil.Client.convert(tmpReq, request)
if (!TeaUtils.Client.isUnset(tmpReq.ipWhitelists)) {
request.ipWhitelistsShrink = AlibabaCloudOpenApiUtil.Client.arrayToStringWithSpecifiedStyle(tmpReq.ipWhitelists, "ipWhitelists", "simple")
}
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.ipWhitelistsShrink)) {
query["ipWhitelists"] = request.ipWhitelistsShrink ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetInstanceIpWhitelist",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/ip/whitelists",
"method": "GET",
"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(GetInstanceIpWhitelistResponse(), 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(GetInstanceIpWhitelistResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getInstanceIpWhitelist(_ instanceId: String, _ request: GetInstanceIpWhitelistRequest) async throws -> GetInstanceIpWhitelistResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getInstanceIpWhitelistWithOptions(instanceId as! String, request as! GetInstanceIpWhitelistRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getMessageDetailWithOptions(_ instanceId: String, _ topicName: String, _ messageId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetMessageDetailResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetMessageDetail",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)) + "/messages/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(messageId)),
"method": "GET",
"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(GetMessageDetailResponse(), 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(GetMessageDetailResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getMessageDetail(_ instanceId: String, _ topicName: String, _ messageId: String) async throws -> GetMessageDetailResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getMessageDetailWithOptions(instanceId as! String, topicName as! String, messageId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getTopicWithOptions(_ instanceId: String, _ topicName: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetTopicResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetTopic",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)),
"method": "GET",
"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(GetTopicResponse(), 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(GetTopicResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getTopic(_ instanceId: String, _ topicName: String) async throws -> GetTopicResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getTopicWithOptions(instanceId as! String, topicName as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getTraceWithOptions(_ instanceId: String, _ topicName: String, _ messageId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> GetTraceResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "GetTrace",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)) + "/traces/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(messageId)),
"method": "GET",
"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(GetTraceResponse(), 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(GetTraceResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func getTrace(_ instanceId: String, _ topicName: String, _ messageId: String) async throws -> GetTraceResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await getTraceWithOptions(instanceId as! String, topicName as! String, messageId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listAvailableZonesWithOptions(_ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListAvailableZonesResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListAvailableZones",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/zones",
"method": "GET",
"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(ListAvailableZonesResponse(), 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(ListAvailableZonesResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listAvailableZones() async throws -> ListAvailableZonesResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listAvailableZonesWithOptions(headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listConsumerConnectionsWithOptions(_ instanceId: String, _ consumerGroupId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListConsumerConnectionsResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListConsumerConnections",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(consumerGroupId)) + "/connections",
"method": "GET",
"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(ListConsumerConnectionsResponse(), 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(ListConsumerConnectionsResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listConsumerConnections(_ instanceId: String, _ consumerGroupId: String) async throws -> ListConsumerConnectionsResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listConsumerConnectionsWithOptions(instanceId as! String, consumerGroupId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listConsumerGroupSubscriptionsWithOptions(_ instanceId: String, _ consumerGroupId: String, _ request: ListConsumerGroupSubscriptionsRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListConsumerGroupSubscriptionsResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.topicName)) {
query["topicName"] = request.topicName ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListConsumerGroupSubscriptions",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(consumerGroupId)) + "/subscriptions",
"method": "GET",
"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(ListConsumerGroupSubscriptionsResponse(), 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(ListConsumerGroupSubscriptionsResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listConsumerGroupSubscriptions(_ instanceId: String, _ consumerGroupId: String, _ request: ListConsumerGroupSubscriptionsRequest) async throws -> ListConsumerGroupSubscriptionsResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listConsumerGroupSubscriptionsWithOptions(instanceId as! String, consumerGroupId as! String, request as! ListConsumerGroupSubscriptionsRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listConsumerGroupsWithOptions(_ instanceId: String, _ request: ListConsumerGroupsRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListConsumerGroupsResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.filter)) {
query["filter"] = request.filter ?? "";
}
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListConsumerGroups",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups",
"method": "GET",
"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(ListConsumerGroupsResponse(), 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(ListConsumerGroupsResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listConsumerGroups(_ instanceId: String, _ request: ListConsumerGroupsRequest) async throws -> ListConsumerGroupsResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listConsumerGroupsWithOptions(instanceId as! String, request as! ListConsumerGroupsRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listDisasterRecoveryCheckpointsWithOptions(_ planId: String, _ itemId: String, _ request: ListDisasterRecoveryCheckpointsRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListDisasterRecoveryCheckpointsResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.filter)) {
query["filter"] = request.filter ?? "";
}
if (!TeaUtils.Client.isUnset(request.instanceId)) {
query["instanceId"] = request.instanceId ?? "";
}
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListDisasterRecoveryCheckpoints",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)) + "/items/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(itemId)) + "/checkpoints",
"method": "GET",
"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(ListDisasterRecoveryCheckpointsResponse(), 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(ListDisasterRecoveryCheckpointsResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listDisasterRecoveryCheckpoints(_ planId: String, _ itemId: String, _ request: ListDisasterRecoveryCheckpointsRequest) async throws -> ListDisasterRecoveryCheckpointsResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listDisasterRecoveryCheckpointsWithOptions(planId as! String, itemId as! String, request as! ListDisasterRecoveryCheckpointsRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listDisasterRecoveryItemsWithOptions(_ planId: String, _ request: ListDisasterRecoveryItemsRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListDisasterRecoveryItemsResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.filter)) {
query["filter"] = request.filter ?? "";
}
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
if (!TeaUtils.Client.isUnset(request.topicName)) {
query["topicName"] = request.topicName ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListDisasterRecoveryItems",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)) + "/items",
"method": "GET",
"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(ListDisasterRecoveryItemsResponse(), 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(ListDisasterRecoveryItemsResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listDisasterRecoveryItems(_ planId: String, _ request: ListDisasterRecoveryItemsRequest) async throws -> ListDisasterRecoveryItemsResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listDisasterRecoveryItemsWithOptions(planId as! String, request as! ListDisasterRecoveryItemsRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listDisasterRecoveryPlansWithOptions(_ request: ListDisasterRecoveryPlansRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListDisasterRecoveryPlansResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.filter)) {
query["filter"] = request.filter ?? "";
}
if (!TeaUtils.Client.isUnset(request.instanceId)) {
query["instanceId"] = request.instanceId ?? "";
}
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListDisasterRecoveryPlans",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery",
"method": "GET",
"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(ListDisasterRecoveryPlansResponse(), 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(ListDisasterRecoveryPlansResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listDisasterRecoveryPlans(_ request: ListDisasterRecoveryPlansRequest) async throws -> ListDisasterRecoveryPlansResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listDisasterRecoveryPlansWithOptions(request as! ListDisasterRecoveryPlansRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listInstanceAccountWithOptions(_ instanceId: String, _ request: ListInstanceAccountRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListInstanceAccountResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.accountStatus)) {
query["accountStatus"] = request.accountStatus ?? "";
}
if (!TeaUtils.Client.isUnset(request.accountType)) {
query["accountType"] = request.accountType ?? "";
}
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
if (!TeaUtils.Client.isUnset(request.username)) {
query["username"] = request.username ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListInstanceAccount",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/accounts",
"method": "GET",
"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(ListInstanceAccountResponse(), 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(ListInstanceAccountResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listInstanceAccount(_ instanceId: String, _ request: ListInstanceAccountRequest) async throws -> ListInstanceAccountResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listInstanceAccountWithOptions(instanceId as! String, request as! ListInstanceAccountRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listInstanceAclWithOptions(_ instanceId: String, _ request: ListInstanceAclRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListInstanceAclResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.filter)) {
query["filter"] = request.filter ?? "";
}
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListInstanceAcl",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/acl",
"method": "GET",
"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(ListInstanceAclResponse(), 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(ListInstanceAclResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listInstanceAcl(_ instanceId: String, _ request: ListInstanceAclRequest) async throws -> ListInstanceAclResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listInstanceAclWithOptions(instanceId as! String, request as! ListInstanceAclRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listInstanceIpWhitelistWithOptions(_ instanceId: String, _ request: ListInstanceIpWhitelistRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListInstanceIpWhitelistResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.ipWhitelist)) {
query["ipWhitelist"] = request.ipWhitelist ?? "";
}
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListInstanceIpWhitelist",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/ip/whitelist",
"method": "GET",
"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(ListInstanceIpWhitelistResponse(), 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(ListInstanceIpWhitelistResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listInstanceIpWhitelist(_ instanceId: String, _ request: ListInstanceIpWhitelistRequest) async throws -> ListInstanceIpWhitelistResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listInstanceIpWhitelistWithOptions(instanceId as! String, request as! ListInstanceIpWhitelistRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listInstancesWithOptions(_ tmpReq: ListInstancesRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListInstancesResponse {
try TeaUtils.Client.validateModel(tmpReq)
var request: ListInstancesShrinkRequest = ListInstancesShrinkRequest([:])
AlibabaCloudOpenApiUtil.Client.convert(tmpReq, request)
if (!TeaUtils.Client.isUnset(tmpReq.seriesCodes)) {
request.seriesCodesShrink = AlibabaCloudOpenApiUtil.Client.arrayToStringWithSpecifiedStyle(tmpReq.seriesCodes, "seriesCodes", "simple")
}
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.filter)) {
query["filter"] = request.filter ?? "";
}
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
if (!TeaUtils.Client.isUnset(request.resourceGroupId)) {
query["resourceGroupId"] = request.resourceGroupId ?? "";
}
if (!TeaUtils.Client.isUnset(request.seriesCodesShrink)) {
query["seriesCodes"] = request.seriesCodesShrink ?? "";
}
if (!TeaUtils.Client.isUnset(request.storageSecretKey)) {
query["storageSecretKey"] = request.storageSecretKey ?? "";
}
if (!TeaUtils.Client.isUnset(request.tags)) {
query["tags"] = request.tags ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListInstances",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances",
"method": "GET",
"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(ListInstancesResponse(), 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(ListInstancesResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listInstances(_ request: ListInstancesRequest) async throws -> ListInstancesResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listInstancesWithOptions(request as! ListInstancesRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listMessagesWithOptions(_ instanceId: String, _ topicName: String, _ request: ListMessagesRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListMessagesResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.endTime)) {
query["endTime"] = request.endTime ?? "";
}
if (!TeaUtils.Client.isUnset(request.messageId)) {
query["messageId"] = request.messageId ?? "";
}
if (!TeaUtils.Client.isUnset(request.messageKey)) {
query["messageKey"] = request.messageKey ?? "";
}
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
if (!TeaUtils.Client.isUnset(request.scrollId)) {
query["scrollId"] = request.scrollId ?? "";
}
if (!TeaUtils.Client.isUnset(request.startTime)) {
query["startTime"] = request.startTime ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListMessages",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)) + "/messages",
"method": "GET",
"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(ListMessagesResponse(), 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(ListMessagesResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listMessages(_ instanceId: String, _ topicName: String, _ request: ListMessagesRequest) async throws -> ListMessagesResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listMessagesWithOptions(instanceId as! String, topicName as! String, request as! ListMessagesRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listMetricMetaWithOptions(_ request: ListMetricMetaRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListMetricMetaResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListMetricMeta",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/monitor/metrics/meta",
"method": "GET",
"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(ListMetricMetaResponse(), 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(ListMetricMetaResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listMetricMeta(_ request: ListMetricMetaRequest) async throws -> ListMetricMetaResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listMetricMetaWithOptions(request as! ListMetricMetaRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listRegionsWithOptions(_ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListRegionsResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListRegions",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/regions",
"method": "GET",
"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(ListRegionsResponse(), 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(ListRegionsResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listRegions() async throws -> ListRegionsResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listRegionsWithOptions(headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listTagResourcesWithOptions(_ request: ListTagResourcesRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListTagResourcesResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.nextToken)) {
query["nextToken"] = request.nextToken ?? "";
}
if (!TeaUtils.Client.isUnset(request.regionId)) {
query["regionId"] = request.regionId ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceGroupId)) {
query["resourceGroupId"] = request.resourceGroupId ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceId)) {
query["resourceId"] = request.resourceId ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceType)) {
query["resourceType"] = request.resourceType ?? "";
}
if (!TeaUtils.Client.isUnset(request.tag)) {
query["tag"] = request.tag ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListTagResources",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/resourceTag/list",
"method": "GET",
"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(ListTagResourcesResponse(), 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(ListTagResourcesResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listTagResources(_ request: ListTagResourcesRequest) async throws -> ListTagResourcesResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listTagResourcesWithOptions(request as! ListTagResourcesRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listTopicSubscriptionsWithOptions(_ instanceId: String, _ topicName: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListTopicSubscriptionsResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListTopicSubscriptions",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)) + "/subscriptions",
"method": "GET",
"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(ListTopicSubscriptionsResponse(), 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(ListTopicSubscriptionsResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listTopicSubscriptions(_ instanceId: String, _ topicName: String) async throws -> ListTopicSubscriptionsResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listTopicSubscriptionsWithOptions(instanceId as! String, topicName as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listTopicsWithOptions(_ instanceId: String, _ tmpReq: ListTopicsRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListTopicsResponse {
try TeaUtils.Client.validateModel(tmpReq)
var request: ListTopicsShrinkRequest = ListTopicsShrinkRequest([:])
AlibabaCloudOpenApiUtil.Client.convert(tmpReq, request)
if (!TeaUtils.Client.isUnset(tmpReq.messageTypes)) {
request.messageTypesShrink = AlibabaCloudOpenApiUtil.Client.arrayToStringWithSpecifiedStyle(tmpReq.messageTypes, "messageTypes", "simple")
}
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.filter)) {
query["filter"] = request.filter ?? "";
}
if (!TeaUtils.Client.isUnset(request.messageTypesShrink)) {
query["messageTypes"] = request.messageTypesShrink ?? "";
}
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListTopics",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics",
"method": "GET",
"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(ListTopicsResponse(), 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(ListTopicsResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listTopics(_ instanceId: String, _ request: ListTopicsRequest) async throws -> ListTopicsResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listTopicsWithOptions(instanceId as! String, request as! ListTopicsRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listTracesWithOptions(_ instanceId: String, _ topicName: String, _ request: ListTracesRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ListTracesResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.endTime)) {
query["endTime"] = request.endTime ?? "";
}
if (!TeaUtils.Client.isUnset(request.messageId)) {
query["messageId"] = request.messageId ?? "";
}
if (!TeaUtils.Client.isUnset(request.messageKey)) {
query["messageKey"] = request.messageKey ?? "";
}
if (!TeaUtils.Client.isUnset(request.pageNumber)) {
query["pageNumber"] = request.pageNumber!;
}
if (!TeaUtils.Client.isUnset(request.pageSize)) {
query["pageSize"] = request.pageSize!;
}
if (!TeaUtils.Client.isUnset(request.queryType)) {
query["queryType"] = request.queryType ?? "";
}
if (!TeaUtils.Client.isUnset(request.startTime)) {
query["startTime"] = request.startTime ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ListTraces",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)) + "/traces",
"method": "GET",
"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(ListTracesResponse(), 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(ListTracesResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func listTraces(_ instanceId: String, _ topicName: String, _ request: ListTracesRequest) async throws -> ListTracesResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await listTracesWithOptions(instanceId as! String, topicName as! String, request as! ListTracesRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func resetConsumeOffsetWithOptions(_ instanceId: String, _ consumerGroupId: String, _ topicName: String, _ request: ResetConsumeOffsetRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> ResetConsumeOffsetResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.resetTime)) {
body["resetTime"] = request.resetTime ?? "";
}
if (!TeaUtils.Client.isUnset(request.resetType)) {
body["resetType"] = request.resetType ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "ResetConsumeOffset",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(consumerGroupId)) + "/consumeOffsets/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)),
"method": "PATCH",
"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(ResetConsumeOffsetResponse(), 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(ResetConsumeOffsetResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func resetConsumeOffset(_ instanceId: String, _ consumerGroupId: String, _ topicName: String, _ request: ResetConsumeOffsetRequest) async throws -> ResetConsumeOffsetResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await resetConsumeOffsetWithOptions(instanceId as! String, consumerGroupId as! String, topicName as! String, request as! ResetConsumeOffsetRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func startDisasterRecoveryItemWithOptions(_ planId: String, _ itemId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> StartDisasterRecoveryItemResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "StartDisasterRecoveryItem",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)) + "/items/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(itemId)) + "/start",
"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(StartDisasterRecoveryItemResponse(), 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(StartDisasterRecoveryItemResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func startDisasterRecoveryItem(_ planId: String, _ itemId: String) async throws -> StartDisasterRecoveryItemResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await startDisasterRecoveryItemWithOptions(planId as! String, itemId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func stopDisasterRecoveryItemWithOptions(_ planId: String, _ itemId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> StopDisasterRecoveryItemResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "StopDisasterRecoveryItem",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)) + "/items/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(itemId)) + "/stop",
"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(StopDisasterRecoveryItemResponse(), 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(StopDisasterRecoveryItemResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func stopDisasterRecoveryItem(_ planId: String, _ itemId: String) async throws -> StopDisasterRecoveryItemResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await stopDisasterRecoveryItemWithOptions(planId as! String, itemId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func syncDisasterRecoveryCheckpointWithOptions(_ planId: String, _ itemId: String, _ checkpointId: String, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> SyncDisasterRecoveryCheckpointResponse {
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String]
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "SyncDisasterRecoveryCheckpoint",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)) + "/items/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(itemId)) + "/checkpoints/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(checkpointId)),
"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(SyncDisasterRecoveryCheckpointResponse(), 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(SyncDisasterRecoveryCheckpointResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func syncDisasterRecoveryCheckpoint(_ planId: String, _ itemId: String, _ checkpointId: String) async throws -> SyncDisasterRecoveryCheckpointResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await syncDisasterRecoveryCheckpointWithOptions(planId as! String, itemId as! String, checkpointId as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func tagResourcesWithOptions(_ request: TagResourcesRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> TagResourcesResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.regionId)) {
query["regionId"] = request.regionId ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceId)) {
query["resourceId"] = request.resourceId ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceType)) {
query["resourceType"] = request.resourceType ?? "";
}
if (!TeaUtils.Client.isUnset(request.tag)) {
query["tag"] = request.tag ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "TagResources",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/resourceTag/create",
"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(TagResourcesResponse(), 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(TagResourcesResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func tagResources(_ request: TagResourcesRequest) async throws -> TagResourcesResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await tagResourcesWithOptions(request as! TagResourcesRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func untagResourcesWithOptions(_ request: UntagResourcesRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> UntagResourcesResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.all)) {
query["all"] = request.all!;
}
if (!TeaUtils.Client.isUnset(request.regionId)) {
query["regionId"] = request.regionId ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceId)) {
query["resourceId"] = request.resourceId ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceType)) {
query["resourceType"] = request.resourceType ?? "";
}
if (!TeaUtils.Client.isUnset(request.tagKey)) {
query["tagKey"] = request.tagKey ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "UntagResources",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/resourceTag/delete",
"method": "DELETE",
"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(UntagResourcesResponse(), 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(UntagResourcesResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func untagResources(_ request: UntagResourcesRequest) async throws -> UntagResourcesResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await untagResourcesWithOptions(request as! UntagResourcesRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateConsumerGroupWithOptions(_ instanceId: String, _ consumerGroupId: String, _ request: UpdateConsumerGroupRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> UpdateConsumerGroupResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.consumeRetryPolicy)) {
body["consumeRetryPolicy"] = request.consumeRetryPolicy!;
}
if (!TeaUtils.Client.isUnset(request.deliveryOrderType)) {
body["deliveryOrderType"] = request.deliveryOrderType ?? "";
}
if (!TeaUtils.Client.isUnset(request.maxReceiveTps)) {
body["maxReceiveTps"] = request.maxReceiveTps!;
}
if (!TeaUtils.Client.isUnset(request.remark)) {
body["remark"] = request.remark ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "UpdateConsumerGroup",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/consumerGroups/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(consumerGroupId)),
"method": "PATCH",
"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(UpdateConsumerGroupResponse(), 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(UpdateConsumerGroupResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateConsumerGroup(_ instanceId: String, _ consumerGroupId: String, _ request: UpdateConsumerGroupRequest) async throws -> UpdateConsumerGroupResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await updateConsumerGroupWithOptions(instanceId as! String, consumerGroupId as! String, request as! UpdateConsumerGroupRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateDisasterRecoveryItemWithOptions(_ planId: String, _ itemId: String, _ request: UpdateDisasterRecoveryItemRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> UpdateDisasterRecoveryItemResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.topics)) {
body["topics"] = request.topics ?? [];
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "UpdateDisasterRecoveryItem",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)) + "/items/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(itemId)),
"method": "PATCH",
"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(UpdateDisasterRecoveryItemResponse(), 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(UpdateDisasterRecoveryItemResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateDisasterRecoveryItem(_ planId: String, _ itemId: String, _ request: UpdateDisasterRecoveryItemRequest) async throws -> UpdateDisasterRecoveryItemResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await updateDisasterRecoveryItemWithOptions(planId as! String, itemId as! String, request as! UpdateDisasterRecoveryItemRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateDisasterRecoveryPlanWithOptions(_ planId: String, _ request: UpdateDisasterRecoveryPlanRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> UpdateDisasterRecoveryPlanResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.autoSyncCheckpoint)) {
body["autoSyncCheckpoint"] = request.autoSyncCheckpoint!;
}
if (!TeaUtils.Client.isUnset(request.instances)) {
body["instances"] = request.instances ?? [];
}
if (!TeaUtils.Client.isUnset(request.planDesc)) {
body["planDesc"] = request.planDesc ?? "";
}
if (!TeaUtils.Client.isUnset(request.planName)) {
body["planName"] = request.planName ?? "";
}
if (!TeaUtils.Client.isUnset(request.planType)) {
body["planType"] = request.planType ?? "";
}
if (!TeaUtils.Client.isUnset(request.syncCheckpointEnabled)) {
body["syncCheckpointEnabled"] = request.syncCheckpointEnabled!;
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "UpdateDisasterRecoveryPlan",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/disaster_recovery/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(planId)),
"method": "PATCH",
"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(UpdateDisasterRecoveryPlanResponse(), 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(UpdateDisasterRecoveryPlanResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateDisasterRecoveryPlan(_ planId: String, _ request: UpdateDisasterRecoveryPlanRequest) async throws -> UpdateDisasterRecoveryPlanResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await updateDisasterRecoveryPlanWithOptions(planId as! String, request as! UpdateDisasterRecoveryPlanRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateInstanceWithOptions(_ instanceId: String, _ request: UpdateInstanceRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> UpdateInstanceResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.aclInfo)) {
body["aclInfo"] = request.aclInfo!;
}
if (!TeaUtils.Client.isUnset(request.instanceName)) {
body["instanceName"] = request.instanceName ?? "";
}
if (!TeaUtils.Client.isUnset(request.networkInfo)) {
body["networkInfo"] = request.networkInfo!;
}
if (!TeaUtils.Client.isUnset(request.productInfo)) {
body["productInfo"] = request.productInfo!;
}
if (!TeaUtils.Client.isUnset(request.remark)) {
body["remark"] = request.remark ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "UpdateInstance",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)),
"method": "PATCH",
"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(UpdateInstanceResponse(), 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(UpdateInstanceResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateInstance(_ instanceId: String, _ request: UpdateInstanceRequest) async throws -> UpdateInstanceResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await updateInstanceWithOptions(instanceId as! String, request as! UpdateInstanceRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateInstanceAccountWithOptions(_ instanceId: String, _ username: String, _ request: UpdateInstanceAccountRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> UpdateInstanceAccountResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.accountStatus)) {
query["accountStatus"] = request.accountStatus ?? "";
}
if (!TeaUtils.Client.isUnset(request.password)) {
query["password"] = request.password ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "UpdateInstanceAccount",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/accounts/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(username)),
"method": "PATCH",
"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(UpdateInstanceAccountResponse(), 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(UpdateInstanceAccountResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateInstanceAccount(_ instanceId: String, _ username: String, _ request: UpdateInstanceAccountRequest) async throws -> UpdateInstanceAccountResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await updateInstanceAccountWithOptions(instanceId as! String, username as! String, request as! UpdateInstanceAccountRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateInstanceAclWithOptions(_ instanceId: String, _ username: String, _ request: UpdateInstanceAclRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> UpdateInstanceAclResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.actions)) {
body["actions"] = request.actions ?? [];
}
if (!TeaUtils.Client.isUnset(request.decision)) {
body["decision"] = request.decision ?? "";
}
if (!TeaUtils.Client.isUnset(request.ipWhitelists)) {
body["ipWhitelists"] = request.ipWhitelists ?? [];
}
if (!TeaUtils.Client.isUnset(request.resourceName)) {
body["resourceName"] = request.resourceName ?? "";
}
if (!TeaUtils.Client.isUnset(request.resourceType)) {
body["resourceType"] = request.resourceType ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "UpdateInstanceAcl",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/acl/account/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(username)),
"method": "PATCH",
"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(UpdateInstanceAclResponse(), 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(UpdateInstanceAclResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateInstanceAcl(_ instanceId: String, _ username: String, _ request: UpdateInstanceAclRequest) async throws -> UpdateInstanceAclResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await updateInstanceAclWithOptions(instanceId as! String, username as! String, request as! UpdateInstanceAclRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateTopicWithOptions(_ instanceId: String, _ topicName: String, _ request: UpdateTopicRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> UpdateTopicResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.maxSendTps)) {
body["maxSendTps"] = request.maxSendTps!;
}
if (!TeaUtils.Client.isUnset(request.remark)) {
body["remark"] = request.remark ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "UpdateTopic",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)),
"method": "PATCH",
"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(UpdateTopicResponse(), 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(UpdateTopicResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func updateTopic(_ instanceId: String, _ topicName: String, _ request: UpdateTopicRequest) async throws -> UpdateTopicResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await updateTopicWithOptions(instanceId as! String, topicName as! String, request as! UpdateTopicRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func verifyConsumeMessageWithOptions(_ instanceId: String, _ topicName: String, _ messageId: String, _ request: VerifyConsumeMessageRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> VerifyConsumeMessageResponse {
try TeaUtils.Client.validateModel(request)
var query: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.clientId)) {
query["clientId"] = request.clientId ?? "";
}
if (!TeaUtils.Client.isUnset(request.consumerGroupId)) {
query["consumerGroupId"] = request.consumerGroupId ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"query": AlibabaCloudOpenApiUtil.Client.query(query)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "VerifyConsumeMessage",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)) + "/messages/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(messageId)) + "/action/verifyConsume",
"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(VerifyConsumeMessageResponse(), 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(VerifyConsumeMessageResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func verifyConsumeMessage(_ instanceId: String, _ topicName: String, _ messageId: String, _ request: VerifyConsumeMessageRequest) async throws -> VerifyConsumeMessageResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await verifyConsumeMessageWithOptions(instanceId as! String, topicName as! String, messageId as! String, request as! VerifyConsumeMessageRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func verifySendMessageWithOptions(_ instanceId: String, _ topicName: String, _ request: VerifySendMessageRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> VerifySendMessageResponse {
try TeaUtils.Client.validateModel(request)
var body: [String: Any] = [:]
if (!TeaUtils.Client.isUnset(request.message)) {
body["message"] = request.message ?? "";
}
if (!TeaUtils.Client.isUnset(request.messageKey)) {
body["messageKey"] = request.messageKey ?? "";
}
if (!TeaUtils.Client.isUnset(request.messageTag)) {
body["messageTag"] = request.messageTag ?? "";
}
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
"headers": headers as! [String: String],
"body": AlibabaCloudOpenApiUtil.Client.parseToMap(body)
])
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
"action": "VerifySendMessage",
"version": "2022-08-01",
"protocol": "HTTPS",
"pathname": "/instances/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(instanceId)) + "/topics/" + (AlibabaCloudOpenApiUtil.Client.getEncodeParam(topicName)) + "/messages",
"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(VerifySendMessageResponse(), 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(VerifySendMessageResponse(), tmp)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func verifySendMessage(_ instanceId: String, _ topicName: String, _ request: VerifySendMessageRequest) async throws -> VerifySendMessageResponse {
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
var headers: [String: String] = [:]
return try await verifySendMessageWithOptions(instanceId as! String, topicName as! String, request as! VerifySendMessageRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
}
}