Skip to content

Commit

Permalink
Updates service models to 2023-09-28
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Oct 2, 2023
1 parent 10f7a10 commit 75b6ed0
Show file tree
Hide file tree
Showing 1,305 changed files with 76,983 additions and 11,347 deletions.
6 changes: 6 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ let package = Package(
.library(name: "TecoCdnV20180606", targets: ["TecoCdnV20180606"]),
.library(name: "TecoCdsV20180420", targets: ["TecoCdsV20180420"]),
.library(name: "TecoCdwchV20200915", targets: ["TecoCdwchV20200915"]),
.library(name: "TecoCdwpgV20201230", targets: ["TecoCdwpgV20201230"]),
.library(name: "TecoCfgV20210820", targets: ["TecoCfgV20210820"]),
.library(name: "TecoCfsV20190719", targets: ["TecoCfsV20190719"]),
.library(name: "TecoCfwV20190904", targets: ["TecoCfwV20190904"]),
Expand Down Expand Up @@ -108,6 +109,7 @@ let package = Package(
.library(name: "TecoDomainV20180808", targets: ["TecoDomainV20180808"]),
.library(name: "TecoDrmV20181115", targets: ["TecoDrmV20181115"]),
.library(name: "TecoDsV20180523", targets: ["TecoDsV20180523"]),
.library(name: "TecoDsgcV20190723", targets: ["TecoDsgcV20190723"]),
.library(name: "TecoDtfV20200506", targets: ["TecoDtfV20200506"]),
.library(name: "TecoDtsV20211206", targets: ["TecoDtsV20211206"]),
.library(name: "TecoDtsV20180330", targets: ["TecoDtsV20180330"]),
Expand Down Expand Up @@ -281,6 +283,7 @@ let package = Package(
.library(name: "TecoWafV20180125", targets: ["TecoWafV20180125"]),
.library(name: "TecoWavV20210129", targets: ["TecoWavV20210129"]),
.library(name: "TecoWedataV20210820", targets: ["TecoWedataV20210820"]),
.library(name: "TecoWeilingwithV20230427", targets: ["TecoWeilingwithV20230427"]),
.library(name: "TecoWssV20180426", targets: ["TecoWssV20180426"]),
.library(name: "TecoYinsudaV20220527", targets: ["TecoYinsudaV20220527"]),
.library(name: "TecoYoumallV20180228", targets: ["TecoYoumallV20180228"]),
Expand Down Expand Up @@ -342,6 +345,7 @@ let package = Package(
.target(name: "TecoCdnV20180606", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Cdn/V20180606"),
.target(name: "TecoCdsV20180420", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Cds/V20180420"),
.target(name: "TecoCdwchV20200915", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Cdwch/V20200915"),
.target(name: "TecoCdwpgV20201230", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Cdwpg/V20201230"),
.target(name: "TecoCfgV20210820", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Cfg/V20210820"),
.target(name: "TecoCfsV20190719", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Cfs/V20190719"),
.target(name: "TecoCfwV20190904", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Cfw/V20190904"),
Expand Down Expand Up @@ -383,6 +387,7 @@ let package = Package(
.target(name: "TecoDomainV20180808", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Domain/V20180808"),
.target(name: "TecoDrmV20181115", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Drm/V20181115"),
.target(name: "TecoDsV20180523", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Ds/V20180523"),
.target(name: "TecoDsgcV20190723", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Dsgc/V20190723"),
.target(name: "TecoDtfV20200506", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Dtf/V20200506"),
.target(name: "TecoDtsV20211206", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Dts/V20211206"),
.target(name: "TecoDtsV20180330", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Dts/V20180330"),
Expand Down Expand Up @@ -556,6 +561,7 @@ let package = Package(
.target(name: "TecoWafV20180125", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Waf/V20180125"),
.target(name: "TecoWavV20210129", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Wav/V20210129"),
.target(name: "TecoWedataV20210820", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Wedata/V20210820"),
.target(name: "TecoWeilingwithV20230427", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Weilingwith/V20230427"),
.target(name: "TecoWssV20180426", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Wss/V20180426"),
.target(name: "TecoYinsudaV20220527", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Yinsuda/V20220527"),
.target(name: "TecoYoumallV20180228", dependencies: [.product(name: "TecoCore", package: "teco-core")], path: "./Sources/Teco/Youmall/V20180228"),
Expand Down
6 changes: 3 additions & 3 deletions Sources/Teco/Aai/V20180522/actions/Chat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extension Aai {
/// json格式,比如 {"id":"test","gender":"male"}。记录当前与机器人交互的用户id,非必须但强烈建议传入,否则多轮聊天功能会受影响
public let user: String?

public init(text: String, projectId: Int64 = 0, user: String? = nil) {
public init(text: String, projectId: Int64, user: String? = nil) {
self.text = text
self.projectId = projectId
self.user = user
Expand Down Expand Up @@ -77,15 +77,15 @@ extension Aai {
///
/// 提供基于文本的基础聊天能力,可以让您的应用快速拥有具备深度语义理解的机器聊天功能。
@inlinable
public func chat(text: String, projectId: Int64 = 0, user: String? = nil, region: TCRegion? = nil, logger: Logger = TCClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<ChatResponse> {
public func chat(text: String, projectId: Int64, user: String? = nil, region: TCRegion? = nil, logger: Logger = TCClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<ChatResponse> {
self.chat(.init(text: text, projectId: projectId, user: user), region: region, logger: logger, on: eventLoop)
}

/// 智能闲聊
///
/// 提供基于文本的基础聊天能力,可以让您的应用快速拥有具备深度语义理解的机器聊天功能。
@inlinable
public func chat(text: String, projectId: Int64 = 0, user: String? = nil, region: TCRegion? = nil, logger: Logger = TCClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ChatResponse {
public func chat(text: String, projectId: Int64, user: String? = nil, region: TCRegion? = nil, logger: Logger = TCClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ChatResponse {
try await self.chat(.init(text: text, projectId: projectId, user: user), region: region, logger: logger, on: eventLoop)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extension Aai {
/// 表明当前语音分片的索引,从0开始
public let seq: UInt64

public init(projectId: UInt64 = 0, subServiceType: UInt64 = 3, recEngineModelType: String = "16k_zh", data: String, dataLen: UInt64, voiceId: String, isEnd: UInt64, voiceFormat: UInt64, openTranslate: UInt64, sourceLanguage: String = "zh", targetLanguage: String = "en", seq: UInt64) {
public init(projectId: UInt64, subServiceType: UInt64, recEngineModelType: String, data: String, dataLen: UInt64, voiceId: String, isEnd: UInt64, voiceFormat: UInt64, openTranslate: UInt64, sourceLanguage: String, targetLanguage: String, seq: UInt64) {
self.projectId = projectId
self.subServiceType = subServiceType
self.recEngineModelType = recEngineModelType
Expand Down Expand Up @@ -126,15 +126,15 @@ extension Aai {
///
/// 该接口是实时流式识别,可同时返回语音识别文本及翻译文本,当前仅支持中文和英文。该接口可配合同传windows客户端,提供会议现场同传服务。
@inlinable
public func simultaneousInterpreting(projectId: UInt64 = 0, subServiceType: UInt64 = 3, recEngineModelType: String = "16k_zh", data: String, dataLen: UInt64, voiceId: String, isEnd: UInt64, voiceFormat: UInt64, openTranslate: UInt64, sourceLanguage: String = "zh", targetLanguage: String = "en", seq: UInt64, region: TCRegion? = nil, logger: Logger = TCClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<SimultaneousInterpretingResponse> {
public func simultaneousInterpreting(projectId: UInt64, subServiceType: UInt64, recEngineModelType: String, data: String, dataLen: UInt64, voiceId: String, isEnd: UInt64, voiceFormat: UInt64, openTranslate: UInt64, sourceLanguage: String, targetLanguage: String, seq: UInt64, region: TCRegion? = nil, logger: Logger = TCClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<SimultaneousInterpretingResponse> {
self.simultaneousInterpreting(.init(projectId: projectId, subServiceType: subServiceType, recEngineModelType: recEngineModelType, data: data, dataLen: dataLen, voiceId: voiceId, isEnd: isEnd, voiceFormat: voiceFormat, openTranslate: openTranslate, sourceLanguage: sourceLanguage, targetLanguage: targetLanguage, seq: seq), region: region, logger: logger, on: eventLoop)
}

/// 同传
///
/// 该接口是实时流式识别,可同时返回语音识别文本及翻译文本,当前仅支持中文和英文。该接口可配合同传windows客户端,提供会议现场同传服务。
@inlinable
public func simultaneousInterpreting(projectId: UInt64 = 0, subServiceType: UInt64 = 3, recEngineModelType: String = "16k_zh", data: String, dataLen: UInt64, voiceId: String, isEnd: UInt64, voiceFormat: UInt64, openTranslate: UInt64, sourceLanguage: String = "zh", targetLanguage: String = "en", seq: UInt64, region: TCRegion? = nil, logger: Logger = TCClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> SimultaneousInterpretingResponse {
public func simultaneousInterpreting(projectId: UInt64, subServiceType: UInt64, recEngineModelType: String, data: String, dataLen: UInt64, voiceId: String, isEnd: UInt64, voiceFormat: UInt64, openTranslate: UInt64, sourceLanguage: String, targetLanguage: String, seq: UInt64, region: TCRegion? = nil, logger: Logger = TCClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> SimultaneousInterpretingResponse {
try await self.simultaneousInterpreting(.init(projectId: projectId, subServiceType: subServiceType, recEngineModelType: recEngineModelType, data: data, dataLen: dataLen, voiceId: voiceId, isEnd: isEnd, voiceFormat: voiceFormat, openTranslate: openTranslate, sourceLanguage: sourceLanguage, targetLanguage: targetLanguage, seq: seq), region: region, logger: logger, on: eventLoop)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extension Advisor {
public struct DescribeStrategiesResponse: TCResponse {
/// 评估项列表
/// 注意:此字段可能返回 null,表示取不到有效值。
public let strategies: [DescribeStrategie]?
public let strategies: [Strategies]?

/// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
public let requestId: String
Expand Down
104 changes: 52 additions & 52 deletions Sources/Teco/Advisor/V20200721/models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,59 +17,8 @@
import TecoCore

extension Advisor {
/// 评估项信息
public struct DescribeStrategie: TCOutputModel {
/// 评估项ID
/// 注意:此字段可能返回 null,表示取不到有效值。
public let strategyId: UInt64?

/// 评估项名称
/// 注意:此字段可能返回 null,表示取不到有效值。
public let name: String?

/// 评估项描述
/// 注意:此字段可能返回 null,表示取不到有效值。
public let desc: String?

/// 评估项对应产品ID
/// 注意:此字段可能返回 null,表示取不到有效值。
public let product: String?

/// 评估项对应产品名称
/// 注意:此字段可能返回 null,表示取不到有效值。
public let productDesc: String?

/// 评估项优化建议
/// 注意:此字段可能返回 null,表示取不到有效值。
public let repair: String?

/// 评估项类别ID
/// 注意:此字段可能返回 null,表示取不到有效值。
public let groupId: UInt64?

/// 评估项类别名称
/// 注意:此字段可能返回 null,表示取不到有效值。
public let groupName: String?

/// 评估项风险列表
/// 注意:此字段可能返回 null,表示取不到有效值。
public let conditions: [DescribeStrategiesCondition]?

enum CodingKeys: String, CodingKey {
case strategyId = "StrategyId"
case name = "Name"
case desc = "Desc"
case product = "Product"
case productDesc = "ProductDesc"
case repair = "Repair"
case groupId = "GroupId"
case groupName = "GroupName"
case conditions = "Conditions"
}
}

/// 评估项警告条件
public struct DescribeStrategiesCondition: TCOutputModel {
public struct Conditions: TCOutputModel {
/// 警告条件ID
/// 注意:此字段可能返回 null,表示取不到有效值。
public let conditionId: UInt64?
Expand Down Expand Up @@ -138,4 +87,55 @@ extension Advisor {
case fieldDict = "FieldDict"
}
}

/// 评估项信息
public struct Strategies: TCOutputModel {
/// 评估项ID
/// 注意:此字段可能返回 null,表示取不到有效值。
public let strategyId: UInt64?

/// 评估项名称
/// 注意:此字段可能返回 null,表示取不到有效值。
public let name: String?

/// 评估项描述
/// 注意:此字段可能返回 null,表示取不到有效值。
public let desc: String?

/// 评估项对应产品ID
/// 注意:此字段可能返回 null,表示取不到有效值。
public let product: String?

/// 评估项对应产品名称
/// 注意:此字段可能返回 null,表示取不到有效值。
public let productDesc: String?

/// 评估项优化建议
/// 注意:此字段可能返回 null,表示取不到有效值。
public let repair: String?

/// 评估项类别ID
/// 注意:此字段可能返回 null,表示取不到有效值。
public let groupId: UInt64?

/// 评估项类别名称
/// 注意:此字段可能返回 null,表示取不到有效值。
public let groupName: String?

/// 评估项风险列表
/// 注意:此字段可能返回 null,表示取不到有效值。
public let conditions: [Conditions]?

enum CodingKeys: String, CodingKey {
case strategyId = "StrategyId"
case name = "Name"
case desc = "Desc"
case product = "Product"
case productDesc = "ProductDesc"
case repair = "Repair"
case groupId = "GroupId"
case groupName = "GroupName"
case conditions = "Conditions"
}
}
}
72 changes: 0 additions & 72 deletions Sources/Teco/Ame/V20190916/errors/AmeError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,12 @@ public protocol TCAmeErrorType: TCServiceErrorType {

public struct TCAmeError: TCAmeErrorType {
enum Code: String {
case authFailure = "AuthFailure"
case dryRunOperation = "DryRunOperation"
case failedOperation = "FailedOperation"
case internalError = "InternalError"
case invalidParameter = "InvalidParameter"
case invalidParameterValue = "InvalidParameterValue"
case limitExceeded = "LimitExceeded"
case missingParameter = "MissingParameter"
case operationDenied = "OperationDenied"
case requestLimitExceeded = "RequestLimitExceeded"
case resourceInUse = "ResourceInUse"
case resourceInsufficient = "ResourceInsufficient"
case resourceNotFound = "ResourceNotFound"
case resourceUnavailable = "ResourceUnavailable"
case resourcesSoldOut = "ResourcesSoldOut"
case unauthorizedOperation = "UnauthorizedOperation"
case unknownParameter = "UnknownParameter"
case unsupportedOperation = "UnsupportedOperation"
}

private let error: Code
Expand All @@ -68,31 +56,11 @@ public struct TCAmeError: TCAmeErrorType {
self.context = context
}

/// CAM签名/鉴权错误。
public static var authFailure: TCAmeError {
TCAmeError(.authFailure)
}

/// DryRun 操作,代表请求将会是成功的,只是多传了 DryRun 参数。
public static var dryRunOperation: TCAmeError {
TCAmeError(.dryRunOperation)
}

/// 操作失败。
public static var failedOperation: TCAmeError {
TCAmeError(.failedOperation)
}

/// 内部错误。
public static var internalError: TCAmeError {
TCAmeError(.internalError)
}

/// 参数错误。
public static var invalidParameter: TCAmeError {
TCAmeError(.invalidParameter)
}

/// 参数取值错误。
public static var invalidParameterValue: TCAmeError {
TCAmeError(.invalidParameterValue)
Expand All @@ -103,31 +71,6 @@ public struct TCAmeError: TCAmeErrorType {
TCAmeError(.limitExceeded)
}

/// 缺少参数错误。
public static var missingParameter: TCAmeError {
TCAmeError(.missingParameter)
}

/// 操作被拒绝。
public static var operationDenied: TCAmeError {
TCAmeError(.operationDenied)
}

/// 请求的次数超过了频率限制。
public static var requestLimitExceeded: TCAmeError {
TCAmeError(.requestLimitExceeded)
}

/// 资源被占用。
public static var resourceInUse: TCAmeError {
TCAmeError(.resourceInUse)
}

/// 资源不足。
public static var resourceInsufficient: TCAmeError {
TCAmeError(.resourceInsufficient)
}

/// 资源不存在。
public static var resourceNotFound: TCAmeError {
TCAmeError(.resourceNotFound)
Expand All @@ -138,26 +81,11 @@ public struct TCAmeError: TCAmeErrorType {
TCAmeError(.resourceUnavailable)
}

/// 资源售罄。
public static var resourcesSoldOut: TCAmeError {
TCAmeError(.resourcesSoldOut)
}

/// 未授权操作。
public static var unauthorizedOperation: TCAmeError {
TCAmeError(.unauthorizedOperation)
}

/// 未知参数错误。
public static var unknownParameter: TCAmeError {
TCAmeError(.unknownParameter)
}

/// 操作不支持。
public static var unsupportedOperation: TCAmeError {
TCAmeError(.unsupportedOperation)
}

public func asAmeError() -> TCAmeError {
return self
}
Expand Down
Loading

0 comments on commit 75b6ed0

Please sign in to comment.