Skip to content

Commit 2801cfe

Browse files
committed
Support API DescribeSpotDiscountHistory.
1 parent 308b436 commit 2801cfe

File tree

5 files changed

+231
-5
lines changed

5 files changed

+231
-5
lines changed

AlibabacloudEas20210701.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |spec|
22

33
spec.name = "AlibabacloudEas20210701"
4-
spec.version = "4.1.0"
4+
spec.version = "4.2.0"
55
spec.license = "Apache 2.0"
66
spec.summary = "Alibaba Cloud eas (20210701) SDK Library for Swift"
77
spec.homepage = "https://github.com/alibabacloud-sdk-swift/eas-20210701"

README-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
要使用 [Carthage](https://github.com/Carthage/Carthage)`AlibabacloudEas20210701` 集成到你的 Xcode 项目中,需要在 `Cartfile` 中定义以下内容:
1818

1919
```ogdl
20-
github "alibabacloud-sdk-swift/eas-20210701" "4.1.0"
20+
github "alibabacloud-sdk-swift/eas-20210701" "4.2.0"
2121
```
2222

2323
### Swift 包管理工具
@@ -26,7 +26,7 @@ github "alibabacloud-sdk-swift/eas-20210701" "4.1.0"
2626

2727
```swift
2828
dependencies: [
29-
.package(url: "https://github.com/alibabacloud-sdk-swift/eas-20210701.git", from: "4.1.0")
29+
.package(url: "https://github.com/alibabacloud-sdk-swift/eas-20210701.git", from: "4.2.0")
3030
]
3131
```
3232

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ English | [简体中文](README-CN.md)
1717
To integrate `AlibabacloudEas20210701` into your Xcode project using [Carthage](https://github.com/Carthage/Carthage), specify it in your `Cartfile`:
1818

1919
```ogdl
20-
github "alibabacloud-sdk-swift/eas-20210701" "4.1.0"
20+
github "alibabacloud-sdk-swift/eas-20210701" "4.2.0"
2121
```
2222

2323
### Swift Package Manager
@@ -26,7 +26,7 @@ To integrate `AlibabacloudEas20210701` into your Xcode project using [Swift Pack
2626

2727
```swift
2828
dependencies: [
29-
.package(url: "https://github.com/alibabacloud-sdk-swift/eas-20210701.git", from: "4.1.0")
29+
.package(url: "https://github.com/alibabacloud-sdk-swift/eas-20210701.git", from: "4.2.0")
3030
]
3131
```
3232

Sources/AlibabacloudEas20210701/Client.swift

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,42 @@ open class Client : AlibabacloudOpenApi.Client {
14181418
return try await describeServiceMirrorWithOptions(ClusterId as! String, ServiceName as! String, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
14191419
}
14201420

1421+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1422+
public func describeSpotDiscountHistoryWithOptions(_ request: DescribeSpotDiscountHistoryRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> DescribeSpotDiscountHistoryResponse {
1423+
try TeaUtils.Client.validateModel(request)
1424+
var query: [String: Any] = [:]
1425+
if (!TeaUtils.Client.isUnset(request.instanceType)) {
1426+
query["InstanceType"] = request.instanceType ?? "";
1427+
}
1428+
if (!TeaUtils.Client.isUnset(request.isProtect)) {
1429+
query["IsProtect"] = request.isProtect!;
1430+
}
1431+
var req: AlibabacloudOpenApi.OpenApiRequest = AlibabacloudOpenApi.OpenApiRequest([
1432+
"headers": headers as! [String: String],
1433+
"query": AlibabaCloudOpenApiUtil.Client.query(query)
1434+
])
1435+
var params: AlibabacloudOpenApi.Params = AlibabacloudOpenApi.Params([
1436+
"action": "DescribeSpotDiscountHistory",
1437+
"version": "2021-07-01",
1438+
"protocol": "HTTPS",
1439+
"pathname": "/api/v2/public/spot_discount",
1440+
"method": "GET",
1441+
"authType": "AK",
1442+
"style": "ROA",
1443+
"reqBodyType": "json",
1444+
"bodyType": "json"
1445+
])
1446+
var tmp: [String: Any] = try await callApi(params as! AlibabacloudOpenApi.Params, req as! AlibabacloudOpenApi.OpenApiRequest, runtime as! TeaUtils.RuntimeOptions)
1447+
return Tea.TeaConverter.fromMap(DescribeSpotDiscountHistoryResponse(), tmp)
1448+
}
1449+
1450+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1451+
public func describeSpotDiscountHistory(_ request: DescribeSpotDiscountHistoryRequest) async throws -> DescribeSpotDiscountHistoryResponse {
1452+
var runtime: TeaUtils.RuntimeOptions = TeaUtils.RuntimeOptions([:])
1453+
var headers: [String: String] = [:]
1454+
return try await describeSpotDiscountHistoryWithOptions(request as! DescribeSpotDiscountHistoryRequest, headers as! [String: String], runtime as! TeaUtils.RuntimeOptions)
1455+
}
1456+
14211457
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
14221458
public func developServiceWithOptions(_ ClusterId: String, _ ServiceName: String, _ request: DevelopServiceRequest, _ headers: [String: String], _ runtime: TeaUtils.RuntimeOptions) async throws -> DevelopServiceResponse {
14231459
try TeaUtils.Client.validateModel(request)

Sources/AlibabacloudEas20210701/Models.swift

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7419,6 +7419,196 @@ public class DescribeServiceMirrorResponse : Tea.TeaModel {
74197419
}
74207420
}
74217421

7422+
public class DescribeSpotDiscountHistoryRequest : Tea.TeaModel {
7423+
public var instanceType: String?
7424+
7425+
public var isProtect: Bool?
7426+
7427+
public override init() {
7428+
super.init()
7429+
}
7430+
7431+
public init(_ dict: [String: Any]) {
7432+
super.init()
7433+
self.fromMap(dict)
7434+
}
7435+
7436+
public override func validate() throws -> Void {
7437+
}
7438+
7439+
public override func toMap() -> [String : Any] {
7440+
var map = super.toMap()
7441+
if self.instanceType != nil {
7442+
map["InstanceType"] = self.instanceType!
7443+
}
7444+
if self.isProtect != nil {
7445+
map["IsProtect"] = self.isProtect!
7446+
}
7447+
return map
7448+
}
7449+
7450+
public override func fromMap(_ dict: [String: Any]) -> Void {
7451+
if dict.keys.contains("InstanceType") && dict["InstanceType"] != nil {
7452+
self.instanceType = dict["InstanceType"] as! String
7453+
}
7454+
if dict.keys.contains("IsProtect") && dict["IsProtect"] != nil {
7455+
self.isProtect = dict["IsProtect"] as! Bool
7456+
}
7457+
}
7458+
}
7459+
7460+
public class DescribeSpotDiscountHistoryResponseBody : Tea.TeaModel {
7461+
public class SpotDiscounts : Tea.TeaModel {
7462+
public var instanceType: String?
7463+
7464+
public var spotDiscount: String?
7465+
7466+
public var timestamp: String?
7467+
7468+
public var zoneId: String?
7469+
7470+
public override init() {
7471+
super.init()
7472+
}
7473+
7474+
public init(_ dict: [String: Any]) {
7475+
super.init()
7476+
self.fromMap(dict)
7477+
}
7478+
7479+
public override func validate() throws -> Void {
7480+
}
7481+
7482+
public override func toMap() -> [String : Any] {
7483+
var map = super.toMap()
7484+
if self.instanceType != nil {
7485+
map["InstanceType"] = self.instanceType!
7486+
}
7487+
if self.spotDiscount != nil {
7488+
map["SpotDiscount"] = self.spotDiscount!
7489+
}
7490+
if self.timestamp != nil {
7491+
map["Timestamp"] = self.timestamp!
7492+
}
7493+
if self.zoneId != nil {
7494+
map["ZoneId"] = self.zoneId!
7495+
}
7496+
return map
7497+
}
7498+
7499+
public override func fromMap(_ dict: [String: Any]) -> Void {
7500+
if dict.keys.contains("InstanceType") && dict["InstanceType"] != nil {
7501+
self.instanceType = dict["InstanceType"] as! String
7502+
}
7503+
if dict.keys.contains("SpotDiscount") && dict["SpotDiscount"] != nil {
7504+
self.spotDiscount = dict["SpotDiscount"] as! String
7505+
}
7506+
if dict.keys.contains("Timestamp") && dict["Timestamp"] != nil {
7507+
self.timestamp = dict["Timestamp"] as! String
7508+
}
7509+
if dict.keys.contains("ZoneId") && dict["ZoneId"] != nil {
7510+
self.zoneId = dict["ZoneId"] as! String
7511+
}
7512+
}
7513+
}
7514+
public var requestId: String?
7515+
7516+
public var spotDiscounts: [DescribeSpotDiscountHistoryResponseBody.SpotDiscounts]?
7517+
7518+
public override init() {
7519+
super.init()
7520+
}
7521+
7522+
public init(_ dict: [String: Any]) {
7523+
super.init()
7524+
self.fromMap(dict)
7525+
}
7526+
7527+
public override func validate() throws -> Void {
7528+
}
7529+
7530+
public override func toMap() -> [String : Any] {
7531+
var map = super.toMap()
7532+
if self.requestId != nil {
7533+
map["RequestId"] = self.requestId!
7534+
}
7535+
if self.spotDiscounts != nil {
7536+
var tmp : [Any] = []
7537+
for k in self.spotDiscounts! {
7538+
tmp.append(k.toMap())
7539+
}
7540+
map["SpotDiscounts"] = tmp
7541+
}
7542+
return map
7543+
}
7544+
7545+
public override func fromMap(_ dict: [String: Any]) -> Void {
7546+
if dict.keys.contains("RequestId") && dict["RequestId"] != nil {
7547+
self.requestId = dict["RequestId"] as! String
7548+
}
7549+
if dict.keys.contains("SpotDiscounts") && dict["SpotDiscounts"] != nil {
7550+
var tmp : [DescribeSpotDiscountHistoryResponseBody.SpotDiscounts] = []
7551+
for v in dict["SpotDiscounts"] as! [Any] {
7552+
var model = DescribeSpotDiscountHistoryResponseBody.SpotDiscounts()
7553+
if v != nil {
7554+
model.fromMap(v as! [String: Any])
7555+
}
7556+
tmp.append(model)
7557+
}
7558+
self.spotDiscounts = tmp
7559+
}
7560+
}
7561+
}
7562+
7563+
public class DescribeSpotDiscountHistoryResponse : Tea.TeaModel {
7564+
public var headers: [String: String]?
7565+
7566+
public var statusCode: Int32?
7567+
7568+
public var body: DescribeSpotDiscountHistoryResponseBody?
7569+
7570+
public override init() {
7571+
super.init()
7572+
}
7573+
7574+
public init(_ dict: [String: Any]) {
7575+
super.init()
7576+
self.fromMap(dict)
7577+
}
7578+
7579+
public override func validate() throws -> Void {
7580+
try self.body?.validate()
7581+
}
7582+
7583+
public override func toMap() -> [String : Any] {
7584+
var map = super.toMap()
7585+
if self.headers != nil {
7586+
map["headers"] = self.headers!
7587+
}
7588+
if self.statusCode != nil {
7589+
map["statusCode"] = self.statusCode!
7590+
}
7591+
if self.body != nil {
7592+
map["body"] = self.body?.toMap()
7593+
}
7594+
return map
7595+
}
7596+
7597+
public override func fromMap(_ dict: [String: Any]) -> Void {
7598+
if dict.keys.contains("headers") && dict["headers"] != nil {
7599+
self.headers = dict["headers"] as! [String: String]
7600+
}
7601+
if dict.keys.contains("statusCode") && dict["statusCode"] != nil {
7602+
self.statusCode = dict["statusCode"] as! Int32
7603+
}
7604+
if dict.keys.contains("body") && dict["body"] != nil {
7605+
var model = DescribeSpotDiscountHistoryResponseBody()
7606+
model.fromMap(dict["body"] as! [String: Any])
7607+
self.body = model
7608+
}
7609+
}
7610+
}
7611+
74227612
public class DevelopServiceRequest : Tea.TeaModel {
74237613
public var exit: String?
74247614

0 commit comments

Comments
 (0)