Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ let package = Package(
.library(name: "SotoXRay", targets: ["SotoXRay"]),
],
dependencies: [
.package(url: "https://github.com/soto-project/soto-core.git", from: "7.4.0")
.package(url: "https://github.com/soto-project/soto-core.git", branch: "custom-errors")
Comment thread
adam-fowler marked this conversation as resolved.
Outdated
],
targets: [
.target(
Expand Down
7 changes: 7 additions & 0 deletions Sources/Soto/Extensions/DynamoDB/DynamoDB+Codable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ extension DynamoDB {
public let returnItemCollectionMetrics: ReturnItemCollectionMetrics?
/// Use ReturnValues if you want to get the item attributes as they appear before or after they are updated. For UpdateItem, the valid values are: NONE - If ReturnValues is not specified, or if its value is NONE, then nothing is returned. (This setting is the default for ReturnValues.) ALL_OLD - Returns all of the attributes of the item, as they appeared before the UpdateItem operation. UPDATED_OLD - Returns only the updated attributes, as they appeared before the UpdateItem operation. ALL_NEW - Returns all of the attributes of the item, as they appear after the UpdateItem operation. UPDATED_NEW - Returns only the updated attributes, as they appear after the UpdateItem operation. There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed. The values returned are strongly consistent.
public let returnValues: ReturnValue?
/// An optional parameter that returns the item attributes for an UpdateItem operation that failed a condition check. There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.
public let returnValuesOnConditionCheckFailure: ReturnValuesOnConditionCheckFailure?
/// The name of the table containing the item to update.
public let tableName: String
/// An expression that defines one or more attributes to be updated, the action to be performed on them, and new values for them. If this is not set the update is automatically constructed to SET all the values from the updateItem. If you are creating your own updateExpression then all the attribute names are prefixed with the symbol #. The following action values are available for UpdateExpression. SET - Adds one or more attributes and values to an item. If any of these attributes already exist, they are replaced by the new values. You can also use SET to add or subtract from an attribute that is of type Number. For example: SET myNum = myNum + :val SET supports the following functions: if_not_exists (path, operand) - if the item does not contain an attribute at the specified path, then if_not_exists evaluates to operand; otherwise, it evaluates to path. You can use this function to avoid overwriting an attribute that may already be present in the item. list_append (operand, operand) - evaluates to a list with a new element added to it. You can append the new element to the start or the end of the list by reversing the order of the operands. These function names are case-sensitive. REMOVE - Removes one or more attributes from an item. ADD - Adds the specified value to the item, if the attribute does not already exist. If the attribute does exist, then the behavior of ADD depends on the data type of the attribute: If the existing attribute is a number, and if Value is also a number, then Value is mathematically added to the existing attribute. If Value is a negative number, then it is subtracted from the existing attribute. If you use ADD to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses 0 as the initial value. Similarly, if you use ADD for an existing item to increment or decrement an attribute value that doesn't exist before the update, DynamoDB uses 0 as the initial value. For example, suppose that the item you want to update doesn't have an attribute named itemcount, but you decide to ADD the number 3 to this attribute anyway. DynamoDB will create the itemcount attribute, set its initial value to 0, and finally add 3 to it. The result will be a new itemcount attribute in the item, with a value of 3. If the existing data type is a set and if Value is also a set, then Value is added to the existing set. For example, if the attribute value is the set [1,2], and the ADD action specified [3], then the final attribute value is [1,2,3]. An error occurs if an ADD action is specified for a set attribute and the attribute type specified does not match the existing set type. Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the Value must also be a set of strings. The ADD action only supports Number and set data types. In addition, ADD can only be used on top-level attributes, not nested attributes. DELETE - Deletes an element from a set. If a set of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set [a,b,c] and the DELETE action specifies [a,c], then the final attribute value is [b]. Specifying an empty set is an error. The DELETE action only supports set data types. In addition, DELETE can only be used on top-level attributes, not nested attributes. You can have many actions in a single expression, such as the following: SET a=:value1, b=:value2 DELETE :value3, :value4, :value5 For more information on update expressions, see Modifying Items and Attributes in the Amazon DynamoDB Developer Guide.
Expand All @@ -256,6 +258,7 @@ extension DynamoDB {
returnConsumedCapacity: ReturnConsumedCapacity? = nil,
returnItemCollectionMetrics: ReturnItemCollectionMetrics? = nil,
returnValues: ReturnValue? = nil,
returnValuesOnConditionCheckFailure: ReturnValuesOnConditionCheckFailure? = nil,
tableName: String,
updateExpression: String? = nil,
updateItem: T
Expand All @@ -267,6 +270,7 @@ extension DynamoDB {
self.returnConsumedCapacity = returnConsumedCapacity
self.returnItemCollectionMetrics = returnItemCollectionMetrics
self.returnValues = returnValues
self.returnValuesOnConditionCheckFailure = returnValuesOnConditionCheckFailure
self.tableName = tableName
self.updateExpression = updateExpression
self.updateItem = updateItem
Expand All @@ -279,6 +283,7 @@ extension DynamoDB {
returnConsumedCapacity: ReturnConsumedCapacity? = nil,
returnItemCollectionMetrics: ReturnItemCollectionMetrics? = nil,
returnValues: ReturnValue? = nil,
returnValuesOnConditionCheckFailure: ReturnValuesOnConditionCheckFailure? = nil,
tableName: String,
updateItem: T
) throws {
Expand All @@ -289,6 +294,7 @@ extension DynamoDB {
self.returnConsumedCapacity = returnConsumedCapacity
self.returnItemCollectionMetrics = returnItemCollectionMetrics
self.returnValues = returnValues
self.returnValuesOnConditionCheckFailure = returnValuesOnConditionCheckFailure
self.tableName = tableName
self.updateExpression = nil
self.updateItem = updateItem
Expand Down Expand Up @@ -341,6 +347,7 @@ extension DynamoDB {
returnConsumedCapacity: self.returnConsumedCapacity,
returnItemCollectionMetrics: self.returnItemCollectionMetrics,
returnValues: self.returnValues,
returnValuesOnConditionCheckFailure: self.returnValuesOnConditionCheckFailure,
tableName: self.tableName,
updateExpression: updateExpression
)
Expand Down
74 changes: 74 additions & 0 deletions Sources/Soto/Services/APIGateway/APIGateway_shapes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3590,6 +3590,28 @@ extension APIGateway {
}
}

public struct LimitExceededException: AWSErrorShape {
public let message: String?
public let retryAfterSeconds: String?

@inlinable
public init(message: String? = nil, retryAfterSeconds: String? = nil) {
self.message = message
self.retryAfterSeconds = retryAfterSeconds
}

public init(from decoder: Decoder) throws {
let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer
let container = try decoder.container(keyedBy: CodingKeys.self)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.retryAfterSeconds = try response.decodeHeaderIfPresent(String.self, key: "Retry-After")
}

private enum CodingKeys: String, CodingKey {
case message = "message"
}
}

public struct Method: AWSDecodableShape {
/// A boolean flag specifying whether a valid ApiKey is required to invoke this method.
public let apiKeyRequired: Bool?
Expand Down Expand Up @@ -4504,6 +4526,28 @@ extension APIGateway {
}
}

public struct ServiceUnavailableException: AWSErrorShape {
public let message: String?
public let retryAfterSeconds: String?

@inlinable
public init(message: String? = nil, retryAfterSeconds: String? = nil) {
self.message = message
self.retryAfterSeconds = retryAfterSeconds
}

public init(from decoder: Decoder) throws {
let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer
let container = try decoder.container(keyedBy: CodingKeys.self)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.retryAfterSeconds = try response.decodeHeaderIfPresent(String.self, key: "Retry-After")
}

private enum CodingKeys: String, CodingKey {
case message = "message"
}
}

public struct Stage: AWSDecodableShape {
/// Settings for logging access in this stage.
public let accessLogSettings: AccessLogSettings?
Expand Down Expand Up @@ -4880,6 +4924,28 @@ extension APIGateway {
}
}

public struct TooManyRequestsException: AWSErrorShape {
public let message: String?
public let retryAfterSeconds: String?

@inlinable
public init(message: String? = nil, retryAfterSeconds: String? = nil) {
self.message = message
self.retryAfterSeconds = retryAfterSeconds
}

public init(from decoder: Decoder) throws {
let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer
let container = try decoder.container(keyedBy: CodingKeys.self)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.retryAfterSeconds = try response.decodeHeaderIfPresent(String.self, key: "Retry-After")
}

private enum CodingKeys: String, CodingKey {
case message = "message"
}
}

public struct UntagResourceRequest: AWSEncodableShape {
/// The ARN of a resource that can be tagged.
public let resourceArn: String
Expand Down Expand Up @@ -5759,6 +5825,14 @@ public struct APIGatewayErrorType: AWSErrorType {
public static var unauthorizedException: Self { .init(.unauthorizedException) }
}

extension APIGatewayErrorType: AWSServiceErrorType {
public static let errorCodeMap: [String: AWSErrorShape.Type] = [
"LimitExceededException": APIGateway.LimitExceededException.self,
"ServiceUnavailableException": APIGateway.ServiceUnavailableException.self,
"TooManyRequestsException": APIGateway.TooManyRequestsException.self
]
}

extension APIGatewayErrorType: Equatable {
public static func == (lhs: APIGatewayErrorType, rhs: APIGatewayErrorType) -> Bool {
lhs.error == rhs.error
Expand Down
69 changes: 69 additions & 0 deletions Sources/Soto/Services/ARCZonalShift/ARCZonalShift_shapes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ extension ARCZonalShift {
public var description: String { return self.rawValue }
}

public enum ConflictExceptionReason: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
case autoshiftEnabled = "AutoShiftEnabled"
case practiceConfigurationAlreadyExists = "PracticeConfigurationAlreadyExists"
case practiceConfigurationDoesNotExist = "PracticeConfigurationDoesNotExist"
case simultaneousZonalShiftsConflict = "SimultaneousZonalShiftsConflict"
case zonalShiftAlreadyExists = "ZonalShiftAlreadyExists"
case zonalShiftStatusNotActive = "ZonalShiftStatusNotActive"
public var description: String { return self.rawValue }
}

public enum ControlConditionType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
case cloudwatch = "CLOUDWATCH"
public var description: String { return self.rawValue }
Expand All @@ -63,6 +73,20 @@ extension ARCZonalShift {
public var description: String { return self.rawValue }
}

public enum ValidationExceptionReason: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
case invalidAlarmCondition = "InvalidAlarmCondition"
case invalidAz = "InvalidAz"
case invalidConditionType = "InvalidConditionType"
case invalidExpiresIn = "InvalidExpiresIn"
case invalidPracticeBlocker = "InvalidPracticeBlocker"
case invalidResourceIdentifier = "InvalidResourceIdentifier"
case invalidStatus = "InvalidStatus"
case invalidToken = "InvalidToken"
case missingValue = "MissingValue"
case unsupportedAz = "UnsupportedAz"
public var description: String { return self.rawValue }
}

public enum ZonalAutoshiftStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
case disabled = "DISABLED"
case enabled = "ENABLED"
Expand Down Expand Up @@ -165,6 +189,27 @@ extension ARCZonalShift {
private enum CodingKeys: CodingKey {}
}

public struct ConflictException: AWSErrorShape {
public let message: String
/// The reason for the conflict exception.
public let reason: ConflictExceptionReason
/// The zonal shift ID associated with the conflict exception.
public let zonalShiftId: String?

@inlinable
public init(message: String, reason: ConflictExceptionReason, zonalShiftId: String? = nil) {
self.message = message
self.reason = reason
self.zonalShiftId = zonalShiftId
}

private enum CodingKeys: String, CodingKey {
case message = "message"
case reason = "reason"
case zonalShiftId = "zonalShiftId"
}
}

public struct ControlCondition: AWSEncodableShape & AWSDecodableShape {
/// The Amazon Resource Name (ARN) for an Amazon CloudWatch alarm that you specify as a control condition for a practice run.
public let alarmIdentifier: String
Expand Down Expand Up @@ -942,6 +987,23 @@ extension ARCZonalShift {
}
}

public struct ValidationException: AWSErrorShape {
public let message: String
/// The reason for the validation exception.
public let reason: ValidationExceptionReason

@inlinable
public init(message: String, reason: ValidationExceptionReason) {
self.message = message
self.reason = reason
}

private enum CodingKeys: String, CodingKey {
case message = "message"
case reason = "reason"
}
}

public struct ZonalShift: AWSDecodableShape {
/// The Availability Zone (for example, use1-az1) that traffic is moved away from for a resource when you start a zonal shift.
/// Until the zonal shift expires or you cancel it, traffic for the resource is instead moved to other Availability Zones in the Amazon Web Services Region.
Expand Down Expand Up @@ -1129,6 +1191,13 @@ public struct ARCZonalShiftErrorType: AWSErrorType {
public static var validationException: Self { .init(.validationException) }
}

extension ARCZonalShiftErrorType: AWSServiceErrorType {
public static let errorCodeMap: [String: AWSErrorShape.Type] = [
"ConflictException": ARCZonalShift.ConflictException.self,
"ValidationException": ARCZonalShift.ValidationException.self
]
}

extension ARCZonalShiftErrorType: Equatable {
public static func == (lhs: ARCZonalShiftErrorType, rhs: ARCZonalShiftErrorType) -> Bool {
lhs.error == rhs.error
Expand Down
Loading
Loading