Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(AWSCore): Adding support for the ca-west-1 region #5141

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions AWSCore/Service/AWSService.m
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ - (id)copyWithZone:(NSZone *)zone {
static NSString *const AWSRegionNameCNNorth1 = @"cn-north-1";
static NSString *const AWSRegionNameCNNorthWest1 = @"cn-northwest-1";
static NSString *const AWSRegionNameCACentral1 = @"ca-central-1";
static NSString *const AWSRegionNameCAWest1 = @"ca-west-1";
static NSString *const AWSRegionNameUSGovWest1 = @"us-gov-west-1";
static NSString *const AWSRegionNameUSGovEast1 = @"us-gov-east-1";
static NSString *const AWSRegionNameMECentral1 = @"me-central-1";
Expand Down Expand Up @@ -491,6 +492,8 @@ + (NSString *)regionNameFromType:(AWSRegionType)regionType {
return AWSRegionNameCNNorth1;
case AWSRegionCACentral1:
return AWSRegionNameCACentral1;
case AWSRegionCAWest1:
return AWSRegionNameCAWest1;
case AWSRegionUSGovWest1:
return AWSRegionNameUSGovWest1;
case AWSRegionCNNorthWest1:
Expand Down
4 changes: 4 additions & 0 deletions AWSCore/Service/AWSServiceEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ typedef NS_ENUM(NSInteger, AWSRegionType) {
* Canada (Central)
*/
AWSRegionCACentral1 NS_SWIFT_NAME(CACentral1),
/**
* Canada West (Calgary)
*/
AWSRegionCAWest1 NS_SWIFT_NAME(CAWest1),
/**
* AWS GovCloud (US West)
*/
Expand Down
5 changes: 5 additions & 0 deletions AWSCore/Utility/AWSCategory.m
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,11 @@ - (AWSRegionType)aws_regionTypeValue {
|| [self isEqualToString:@"ca-central-1"]) {
return AWSRegionCACentral1;
}
if ([self isEqualToString:@"AWSRegionCAWest1"]
|| [self isEqualToString:@"CAWest1"]
|| [self isEqualToString:@"ca-west-1"]) {
return AWSRegionCAWest1;
}
if ([self isEqualToString:@"AWSRegionUSGovWest1"]
|| [self isEqualToString:@"USGovWest1"]
|| [self isEqualToString:@"us-gov-west-1"]) {
Expand Down
5 changes: 5 additions & 0 deletions AWSCoreUnitTests/AWSServiceTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ - (void)testRegionTypeNames {

XCTAssertEqualObjects([AWSEndpoint regionNameFromType:AWSRegionAFSouth1], @"af-south-1");
XCTAssertEqualObjects([AWSEndpoint regionNameFromType:AWSRegionCACentral1], @"ca-central-1");
XCTAssertEqualObjects([AWSEndpoint regionNameFromType:AWSRegionCAWest1], @"ca-west-1");
XCTAssertEqualObjects([AWSEndpoint regionNameFromType:AWSRegionILCentral1], @"il-central-1");
XCTAssertEqualObjects([AWSEndpoint regionNameFromType:AWSRegionSAEast1], @"sa-east-1");
}
Expand Down Expand Up @@ -626,6 +627,10 @@ - (void)testStringRegionTypeValue {
XCTAssertEqual([@"AWSRegionCACentral1" aws_regionTypeValue], AWSRegionCACentral1);
XCTAssertEqual([@"CACentral1" aws_regionTypeValue], AWSRegionCACentral1);
XCTAssertEqual([@"ca-central-1" aws_regionTypeValue], AWSRegionCACentral1);

XCTAssertEqual([@"AWSRegionCAWest1" aws_regionTypeValue], AWSRegionCAWest1);
XCTAssertEqual([@"CAWest1" aws_regionTypeValue], AWSRegionCAWest1);
XCTAssertEqual([@"ca-west-1" aws_regionTypeValue], AWSRegionCAWest1);

XCTAssertEqual([@"AWSRegionILCentral1" aws_regionTypeValue], AWSRegionILCentral1);
XCTAssertEqual([@"ILCentral1" aws_regionTypeValue], AWSRegionILCentral1);
Expand Down
1 change: 1 addition & 0 deletions AWSS3/AWSS3Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ typedef NS_ENUM(NSInteger, AWSS3BucketLocationConstraint) {
AWSS3BucketLocationConstraintAPSoutheast3,
AWSS3BucketLocationConstraintAPSoutheast4,
AWSS3BucketLocationConstraintCACentral1,
AWSS3BucketLocationConstraintCAWest1,
AWSS3BucketLocationConstraintCNNorth1,
AWSS3BucketLocationConstraintCNNorthwest1,
AWSS3BucketLocationConstraintEU,
Expand Down
10 changes: 10 additions & 0 deletions AWSS3/AWSS3Model.m
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,9 @@ + (NSValueTransformer *)locationConstraintJSONTransformer {
if ([value caseInsensitiveCompare:@"ca-central-1"] == NSOrderedSame) {
return @(AWSS3BucketLocationConstraintCACentral1);
}
if ([value caseInsensitiveCompare:@"ca-west-1"] == NSOrderedSame) {
return @(AWSS3BucketLocationConstraintCAWest1);
}
if ([value caseInsensitiveCompare:@"cn-north-1"] == NSOrderedSame) {
return @(AWSS3BucketLocationConstraintCNNorth1);
}
Expand Down Expand Up @@ -1318,6 +1321,8 @@ + (NSValueTransformer *)locationConstraintJSONTransformer {
return @"ap-southeast-4";
case AWSS3BucketLocationConstraintCACentral1:
return @"ca-central-1";
case AWSS3BucketLocationConstraintCAWest1:
return @"ca-west-1";
case AWSS3BucketLocationConstraintCNNorth1:
return @"cn-north-1";
case AWSS3BucketLocationConstraintCNNorthwest1:
Expand Down Expand Up @@ -2842,6 +2847,9 @@ + (NSValueTransformer *)locationConstraintJSONTransformer {
if ([value caseInsensitiveCompare:@"ca-central-1"] == NSOrderedSame) {
return @(AWSS3BucketLocationConstraintCACentral1);
}
if ([value caseInsensitiveCompare:@"ca-west-1"] == NSOrderedSame) {
return @(AWSS3BucketLocationConstraintCAWest1);
}
if ([value caseInsensitiveCompare:@"cn-north-1"] == NSOrderedSame) {
return @(AWSS3BucketLocationConstraintCNNorth1);
}
Expand Down Expand Up @@ -2931,6 +2939,8 @@ + (NSValueTransformer *)locationConstraintJSONTransformer {
return @"ap-southeast-4";
case AWSS3BucketLocationConstraintCACentral1:
return @"ca-central-1";
case AWSS3BucketLocationConstraintCAWest1:
return @"ca-west-1";
case AWSS3BucketLocationConstraintCNNorth1:
return @"cn-north-1";
case AWSS3BucketLocationConstraintCNNorthwest1:
Expand Down
1 change: 1 addition & 0 deletions AWSS3/AWSS3Resources.m
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ - (NSString *)definitionString {
\"ap-southeast-3\",\
\"ap-southeast-4\",\
\"ca-central-1\",\
\"ca-west-1\",\
\"cn-north-1\",\
\"cn-northwest-1\",\
\"EU\",\
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

## Unreleased

-Features for next release
### New features
- **AWSCore**
- Support for `ca-west-1` - Canada West (Calgary) (see [AWS Regional Services List](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/) for a list of services supported in the region)

## 2.33.6

Expand Down
Loading