Skip to content

Commit

Permalink
chore: Updates version to 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sdk-swift-automation committed Sep 24, 2024
1 parent a37839a commit 6dde7e9
Show file tree
Hide file tree
Showing 13 changed files with 762 additions and 96 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func addResolvedTargets() {
// MARK: - Generated

addDependencies(
clientRuntimeVersion: "0.74.0",
clientRuntimeVersion: "0.75.0",
crtVersion: "0.36.0"
)

Expand Down
2 changes: 1 addition & 1 deletion Package.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.4
1.0.5
2 changes: 1 addition & 1 deletion Package.version.next
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.5
1.0.6
8 changes: 4 additions & 4 deletions Sources/Services/AWSBedrock/Sources/AWSBedrock/Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,12 @@ extension BedrockClientTypes {
}

extension BedrockClientTypes {
/// Contains the ARN of the Amazon Bedrock models specified in your model evaluation job. Each Amazon Bedrock model supports different inferenceParams. To learn more about supported inference parameters for Amazon Bedrock models, see [Inference parameters for foundation models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). The inferenceParams are specified using JSON. To successfully insert JSON as string make sure that all quotations are properly escaped. For example, "temperature":"0.25" key value pair would need to be formatted as \"temperature\":\"0.25\" to successfully accepted in the request.
/// Contains the ARN of the Amazon Bedrock model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) specified in your model evaluation job. Each Amazon Bedrock model supports different inferenceParams. To learn more about supported inference parameters for Amazon Bedrock models, see [Inference parameters for foundation models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). The inferenceParams are specified using JSON. To successfully insert JSON as string make sure that all quotations are properly escaped. For example, "temperature":"0.25" key value pair would need to be formatted as \"temperature\":\"0.25\" to successfully accepted in the request.
public struct EvaluationBedrockModel {
/// Each Amazon Bedrock support different inference parameters that change how the model behaves during inference.
/// This member is required.
public var inferenceParams: Swift.String?
/// The ARN of the Amazon Bedrock model specified.
/// The ARN of the Amazon Bedrock model or inference profile specified.
/// This member is required.
public var modelIdentifier: Swift.String?

Expand All @@ -578,7 +578,7 @@ extension BedrockClientTypes.EvaluationBedrockModel: Swift.CustomDebugStringConv
extension BedrockClientTypes {
/// Defines the models used in the model evaluation job.
public enum EvaluationModelConfig {
/// Defines the Amazon Bedrock model and inference parameters you want used.
/// Defines the Amazon Bedrock model or inference profile and inference parameters you want used.
case bedrockmodel(BedrockClientTypes.EvaluationBedrockModel)
case sdkUnknown(Swift.String)
}
Expand Down Expand Up @@ -642,7 +642,7 @@ public struct CreateEvaluationJobInput {
/// Specifies whether the model evaluation job is automatic or uses human worker.
/// This member is required.
public var evaluationConfig: BedrockClientTypes.EvaluationConfig?
/// Specify the models you want to use in your model evaluation job. Automatic model evaluation jobs support a single model, and model evaluation job that use human workers support two models.
/// Specify the models you want to use in your model evaluation job. Automatic model evaluation jobs support a single model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html), and model evaluation job that use human workers support two models or inference profiles.
/// This member is required.
public var inferenceConfig: BedrockClientTypes.EvaluationInferenceConfig?
/// A description of the model evaluation job.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public protocol EndpointResolver {
typealias DefaultEndpointResolver = ClientRuntime.DefaultEndpointResolver<EndpointParams>

extension DefaultEndpointResolver {
private static let ruleSet = "{\"version\":\"1.0\",\"parameters\":{\"Region\":{\"builtIn\":\"AWS::Region\",\"required\":false,\"documentation\":\"The AWS region used to dispatch the request.\",\"type\":\"String\"},\"UseDualStack\":{\"builtIn\":\"AWS::UseDualStack\",\"required\":true,\"default\":false,\"documentation\":\"When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.\",\"type\":\"Boolean\"},\"UseFIPS\":{\"builtIn\":\"AWS::UseFIPS\",\"required\":true,\"default\":false,\"documentation\":\"When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.\",\"type\":\"Boolean\"},\"Endpoint\":{\"builtIn\":\"SDK::Endpoint\",\"required\":false,\"documentation\":\"Override the endpoint used to send this request\",\"type\":\"String\"}},\"rules\":[{\"conditions\":[{\"fn\":\"isSet\",\"argv\":[{\"ref\":\"Endpoint\"}]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},true]}],\"error\":\"Invalid Configuration: FIPS and custom endpoint are not supported\",\"type\":\"error\"},{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},true]}],\"error\":\"Invalid Configuration: Dualstack and custom endpoint are not supported\",\"type\":\"error\"},{\"conditions\":[],\"endpoint\":{\"url\":{\"ref\":\"Endpoint\"},\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"},{\"conditions\":[{\"fn\":\"isSet\",\"argv\":[{\"ref\":\"Region\"}]}],\"rules\":[{\"conditions\":[{\"fn\":\"aws.partition\",\"argv\":[{\"ref\":\"Region\"}],\"assign\":\"PartitionResult\"}],\"rules\":[{\"conditions\":[{\"fn\":\"stringEquals\",\"argv\":[{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"name\"]},\"aws\"]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},false]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},false]}],\"endpoint\":{\"url\":\"https://budgets.amazonaws.com\",\"properties\":{\"authSchemes\":[{\"name\":\"sigv4\",\"signingName\":\"budgets\",\"signingRegion\":\"us-east-1\"}]},\"headers\":{}},\"type\":\"endpoint\"},{\"conditions\":[{\"fn\":\"stringEquals\",\"argv\":[{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"name\"]},\"aws-cn\"]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},false]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},false]}],\"endpoint\":{\"url\":\"https://budgets.amazonaws.com.cn\",\"properties\":{\"authSchemes\":[{\"name\":\"sigv4\",\"signingName\":\"budgets\",\"signingRegion\":\"cn-northwest-1\"}]},\"headers\":{}},\"type\":\"endpoint\"},{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},true]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},true]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[true,{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsFIPS\"]}]},{\"fn\":\"booleanEquals\",\"argv\":[true,{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsDualStack\"]}]}],\"rules\":[{\"conditions\":[],\"endpoint\":{\"url\":\"https://budgets-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"FIPS and DualStack are enabled, but this partition does not support one or both\",\"type\":\"error\"}],\"type\":\"tree\"},{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},true]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsFIPS\"]},true]}],\"rules\":[{\"conditions\":[],\"endpoint\":{\"url\":\"https://budgets-fips.{Region}.{PartitionResult#dnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"FIPS is enabled but this partition does not support FIPS\",\"type\":\"error\"}],\"type\":\"tree\"},{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},true]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[true,{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsDualStack\"]}]}],\"rules\":[{\"conditions\":[],\"endpoint\":{\"url\":\"https://budgets.{Region}.{PartitionResult#dualStackDnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"DualStack is enabled but this partition does not support DualStack\",\"type\":\"error\"}],\"type\":\"tree\"},{\"conditions\":[],\"endpoint\":{\"url\":\"https://budgets.{Region}.{PartitionResult#dnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"Invalid Configuration: Missing Region\",\"type\":\"error\"}]}"
private static let ruleSet = "{\"version\":\"1.0\",\"parameters\":{\"Region\":{\"builtIn\":\"AWS::Region\",\"required\":false,\"documentation\":\"The AWS region used to dispatch the request.\",\"type\":\"String\"},\"UseDualStack\":{\"builtIn\":\"AWS::UseDualStack\",\"required\":true,\"default\":false,\"documentation\":\"When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.\",\"type\":\"Boolean\"},\"UseFIPS\":{\"builtIn\":\"AWS::UseFIPS\",\"required\":true,\"default\":false,\"documentation\":\"When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.\",\"type\":\"Boolean\"},\"Endpoint\":{\"builtIn\":\"SDK::Endpoint\",\"required\":false,\"documentation\":\"Override the endpoint used to send this request\",\"type\":\"String\"}},\"rules\":[{\"conditions\":[{\"fn\":\"isSet\",\"argv\":[{\"ref\":\"Endpoint\"}]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},true]}],\"error\":\"Invalid Configuration: FIPS and custom endpoint are not supported\",\"type\":\"error\"},{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},true]}],\"error\":\"Invalid Configuration: Dualstack and custom endpoint are not supported\",\"type\":\"error\"},{\"conditions\":[],\"endpoint\":{\"url\":{\"ref\":\"Endpoint\"},\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"},{\"conditions\":[{\"fn\":\"isSet\",\"argv\":[{\"ref\":\"Region\"}]}],\"rules\":[{\"conditions\":[{\"fn\":\"aws.partition\",\"argv\":[{\"ref\":\"Region\"}],\"assign\":\"PartitionResult\"}],\"rules\":[{\"conditions\":[{\"fn\":\"stringEquals\",\"argv\":[{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"name\"]},\"aws\"]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},false]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},false]}],\"endpoint\":{\"url\":\"https://budgets.amazonaws.com\",\"properties\":{\"authSchemes\":[{\"name\":\"sigv4\",\"signingName\":\"budgets\",\"signingRegion\":\"us-east-1\"}]},\"headers\":{}},\"type\":\"endpoint\"},{\"conditions\":[{\"fn\":\"stringEquals\",\"argv\":[{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"name\"]},\"aws-cn\"]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},false]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},false]}],\"endpoint\":{\"url\":\"https://budgets.amazonaws.com.cn\",\"properties\":{\"authSchemes\":[{\"name\":\"sigv4\",\"signingName\":\"budgets\",\"signingRegion\":\"cn-northwest-1\"}]},\"headers\":{}},\"type\":\"endpoint\"},{\"conditions\":[{\"fn\":\"stringEquals\",\"argv\":[{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"name\"]},\"aws-iso-e\"]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},false]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},false]}],\"endpoint\":{\"url\":\"https://budgets.global.cloud.adc-e.uk\",\"properties\":{\"authSchemes\":[{\"name\":\"sigv4\",\"signingName\":\"budgets\",\"signingRegion\":\"eu-isoe-west-1\"}]},\"headers\":{}},\"type\":\"endpoint\"},{\"conditions\":[{\"fn\":\"stringEquals\",\"argv\":[{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"name\"]},\"aws-iso-f\"]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},false]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},false]}],\"endpoint\":{\"url\":\"https://budgets.global.csp.hci.ic.gov\",\"properties\":{\"authSchemes\":[{\"name\":\"sigv4\",\"signingName\":\"budgets\",\"signingRegion\":\"us-isof-south-1\"}]},\"headers\":{}},\"type\":\"endpoint\"},{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},true]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},true]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[true,{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsFIPS\"]}]},{\"fn\":\"booleanEquals\",\"argv\":[true,{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsDualStack\"]}]}],\"rules\":[{\"conditions\":[],\"endpoint\":{\"url\":\"https://budgets-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"FIPS and DualStack are enabled, but this partition does not support one or both\",\"type\":\"error\"}],\"type\":\"tree\"},{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},true]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsFIPS\"]},true]}],\"rules\":[{\"conditions\":[],\"endpoint\":{\"url\":\"https://budgets-fips.{Region}.{PartitionResult#dnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"FIPS is enabled but this partition does not support FIPS\",\"type\":\"error\"}],\"type\":\"tree\"},{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},true]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[true,{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsDualStack\"]}]}],\"rules\":[{\"conditions\":[],\"endpoint\":{\"url\":\"https://budgets.{Region}.{PartitionResult#dualStackDnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"DualStack is enabled but this partition does not support DualStack\",\"type\":\"error\"}],\"type\":\"tree\"},{\"conditions\":[],\"endpoint\":{\"url\":\"https://budgets.{Region}.{PartitionResult#dnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"Invalid Configuration: Missing Region\",\"type\":\"error\"}]}"

init() throws {
try self.init(partitions: AWSClientRuntime.awsPartitionJSON, ruleSet: Self.ruleSet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,64 @@ class EndpointResolverTest: XCTestCase {
XCTAssertEqual(expected, actual)
}

/// For custom endpoint with region set and fips disabled and dualstack disabled
/// For region eu-isoe-west-1 with FIPS disabled and DualStack disabled
func testResolve23() throws {
let endpointParams = EndpointParams(
region: "eu-isoe-west-1",
useDualStack: false,
useFIPS: false
)
let resolver = try DefaultEndpointResolver()

let actual = try resolver.resolve(params: endpointParams)

let properties: [String: AnyHashable] =
[
"authSchemes": [
[
"name": "sigv4",
"signingName": "budgets",
"signingRegion": "eu-isoe-west-1"
] as [String: AnyHashable]
] as [AnyHashable]
]

let headers = SmithyHTTPAPI.Headers()
let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://budgets.global.cloud.adc-e.uk", headers: headers, properties: properties)

XCTAssertEqual(expected, actual)
}

/// For region us-isof-south-1 with FIPS disabled and DualStack disabled
func testResolve24() throws {
let endpointParams = EndpointParams(
region: "us-isof-south-1",
useDualStack: false,
useFIPS: false
)
let resolver = try DefaultEndpointResolver()

let actual = try resolver.resolve(params: endpointParams)

let properties: [String: AnyHashable] =
[
"authSchemes": [
[
"name": "sigv4",
"signingName": "budgets",
"signingRegion": "us-isof-south-1"
] as [String: AnyHashable]
] as [AnyHashable]
]

let headers = SmithyHTTPAPI.Headers()
let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://budgets.global.csp.hci.ic.gov", headers: headers, properties: properties)

XCTAssertEqual(expected, actual)
}

/// For custom endpoint with region set and fips disabled and dualstack disabled
func testResolve25() throws {
let endpointParams = EndpointParams(
endpoint: "https://example.com",
region: "us-east-1",
Expand All @@ -510,7 +566,7 @@ class EndpointResolverTest: XCTestCase {
}

/// For custom endpoint with region not set and fips disabled and dualstack disabled
func testResolve24() throws {
func testResolve26() throws {
let endpointParams = EndpointParams(
endpoint: "https://example.com",
useDualStack: false,
Expand All @@ -530,7 +586,7 @@ class EndpointResolverTest: XCTestCase {
}

/// For custom endpoint with fips enabled and dualstack disabled
func testResolve25() throws {
func testResolve27() throws {
let endpointParams = EndpointParams(
endpoint: "https://example.com",
region: "us-east-1",
Expand All @@ -550,7 +606,7 @@ class EndpointResolverTest: XCTestCase {
}

/// For custom endpoint with fips disabled and dualstack enabled
func testResolve26() throws {
func testResolve28() throws {
let endpointParams = EndpointParams(
endpoint: "https://example.com",
region: "us-east-1",
Expand All @@ -570,7 +626,7 @@ class EndpointResolverTest: XCTestCase {
}

/// Missing region
func testResolve27() throws {
func testResolve29() throws {
let endpointParams = EndpointParams(
)
let resolver = try DefaultEndpointResolver()
Expand Down
Loading

0 comments on commit 6dde7e9

Please sign in to comment.