From 6e61614fed1963fa7a33387f908255993eae8ebb Mon Sep 17 00:00:00 2001 From: Abhash Kumar Singh Date: Tue, 10 Dec 2024 11:25:45 -0800 Subject: [PATCH 1/2] feat(AWSCore): Adding support for mx-central-1 region --- AWSCore/Service/AWSService.m | 3 +++ AWSCore/Service/AWSServiceEnum.h | 4 ++++ AWSCore/Utility/AWSCategory.m | 6 ++++++ AWSS3/AWSS3Model.h | 1 + AWSS3/AWSS3Model.m | 10 ++++++++++ AWSS3/AWSS3Resources.m | 1 + CHANGELOG.md | 4 +++- 7 files changed, 28 insertions(+), 1 deletion(-) diff --git a/AWSCore/Service/AWSService.m b/AWSCore/Service/AWSService.m index f4036e85cce..37893c8d2b8 100644 --- a/AWSCore/Service/AWSService.m +++ b/AWSCore/Service/AWSService.m @@ -276,6 +276,7 @@ - (id)copyWithZone:(NSZone *)zone { static NSString *const AWSRegionNameEUSouth1 = @"eu-south-1"; static NSString *const AWSRegionNameEUSouth2 = @"eu-south-2"; static NSString *const AWSRegionNameILCentral1 = @"il-central-1"; +static NSString *const AWSRegionNameMXCentral1 = @"mx-central-1"; static NSString *const AWSServiceNameAPIGateway = @"execute-api"; static NSString *const AWSServiceNameAutoScaling = @"autoscaling"; @@ -519,6 +520,8 @@ + (NSString *)regionNameFromType:(AWSRegionType)regionType { return AWSRegionNameEUSouth1; case AWSRegionEUSouth2: return AWSRegionNameEUSouth2; + case AWSRegionMXCentral1: + return AWSRegionNameMXCentral1; default: return nil; } diff --git a/AWSCore/Service/AWSServiceEnum.h b/AWSCore/Service/AWSServiceEnum.h index 074bd42f16c..8b418c76c48 100644 --- a/AWSCore/Service/AWSServiceEnum.h +++ b/AWSCore/Service/AWSServiceEnum.h @@ -159,6 +159,10 @@ typedef NS_ENUM(NSInteger, AWSRegionType) { * Israel (Tel Aviv) */ AWSRegionILCentral1 NS_SWIFT_NAME(ILCentral1), + /** + * Mexico + */ + AWSRegionMXCentral1 NS_SWIFT_NAME(MXCentral1), }; /** diff --git a/AWSCore/Utility/AWSCategory.m b/AWSCore/Utility/AWSCategory.m index 8cd95235906..4c854c40957 100644 --- a/AWSCore/Utility/AWSCategory.m +++ b/AWSCore/Utility/AWSCategory.m @@ -637,6 +637,12 @@ - (AWSRegionType)aws_regionTypeValue { || [self isEqualToString:@"il-central-1"]) { return AWSRegionILCentral1; } + + if ([self isEqualToString:@"AWSRegionMXCentral1"] + || [self isEqualToString:@"MXCentral1"] + || [self isEqualToString:@"mx-central-1"]) { + return AWSRegionMXCentral1; + } return AWSRegionUnknown; } diff --git a/AWSS3/AWSS3Model.h b/AWSS3/AWSS3Model.h index e2a6bf9fd1d..a8479595f48 100644 --- a/AWSS3/AWSS3Model.h +++ b/AWSS3/AWSS3Model.h @@ -93,6 +93,7 @@ typedef NS_ENUM(NSInteger, AWSS3BucketLocationConstraint) { AWSS3BucketLocationConstraintUSGovWest1, AWSS3BucketLocationConstraintUSWest1, AWSS3BucketLocationConstraintUSWest2, + AWSS3BucketLocationConstraintMXCentral1, }; typedef NS_ENUM(NSInteger, AWSS3BucketLogsPermission) { diff --git a/AWSS3/AWSS3Model.m b/AWSS3/AWSS3Model.m index 72d3721ce7d..12b5695c578 100644 --- a/AWSS3/AWSS3Model.m +++ b/AWSS3/AWSS3Model.m @@ -1295,6 +1295,9 @@ + (NSValueTransformer *)locationConstraintJSONTransformer { if ([value caseInsensitiveCompare:@"us-west-2"] == NSOrderedSame) { return @(AWSS3BucketLocationConstraintUSWest2); } + if ([value caseInsensitiveCompare:@"mx-central-1"] == NSOrderedSame) { + return @(AWSS3BucketLocationConstraintMXCentral1); + } return @(AWSS3BucketLocationConstraintUnknown); } reverseBlock:^NSString *(NSNumber *value) { switch ([value integerValue]) { @@ -1368,6 +1371,8 @@ + (NSValueTransformer *)locationConstraintJSONTransformer { return @"us-west-1"; case AWSS3BucketLocationConstraintUSWest2: return @"us-west-2"; + case AWSS3BucketLocationConstraintMXCentral1: + return @"mx-central-1"; default: return nil; } @@ -2918,6 +2923,9 @@ + (NSValueTransformer *)locationConstraintJSONTransformer { if ([value caseInsensitiveCompare:@"us-west-2"] == NSOrderedSame) { return @(AWSS3BucketLocationConstraintUSWest2); } + if ([value caseInsensitiveCompare:@"mx-central-1"] == NSOrderedSame) { + return @(AWSS3BucketLocationConstraintMXCentral1); + } return @(AWSS3BucketLocationConstraintUnknown); } reverseBlock:^NSString *(NSNumber *value) { switch ([value integerValue]) { @@ -2991,6 +2999,8 @@ + (NSValueTransformer *)locationConstraintJSONTransformer { return @"us-west-1"; case AWSS3BucketLocationConstraintUSWest2: return @"us-west-2"; + case AWSS3BucketLocationConstraintMXCentral1: + return @"mx-central-1"; default: return nil; } diff --git a/AWSS3/AWSS3Resources.m b/AWSS3/AWSS3Resources.m index d515ed81e0c..f200e965b99 100644 --- a/AWSS3/AWSS3Resources.m +++ b/AWSS3/AWSS3Resources.m @@ -1389,6 +1389,7 @@ - (NSString *)definitionString { \"eu-west-1\",\ \"eu-west-2\",\ \"eu-west-3\",\ + \"mx-central-1\",\ \"il-central-1\",\ \"me-central-1\",\ \"me-south-1\",\ diff --git a/CHANGELOG.md b/CHANGELOG.md index e9243c0731d..4fd94102bd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## Unreleased --Features for next release +### New features +- **AWSCore** + - Support for `mx-central-1` - Mexico (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.37.2 From c272794f0fb74184c2495a3c00e618b91410ddd3 Mon Sep 17 00:00:00 2001 From: Abhash Kumar Singh Date: Fri, 13 Dec 2024 09:40:09 -0800 Subject: [PATCH 2/2] address review comments --- AWSCore/Service/AWSServiceEnum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AWSCore/Service/AWSServiceEnum.h b/AWSCore/Service/AWSServiceEnum.h index 8b418c76c48..c352dce79f9 100644 --- a/AWSCore/Service/AWSServiceEnum.h +++ b/AWSCore/Service/AWSServiceEnum.h @@ -160,7 +160,7 @@ typedef NS_ENUM(NSInteger, AWSRegionType) { */ AWSRegionILCentral1 NS_SWIFT_NAME(ILCentral1), /** - * Mexico + * Mexico (Central) */ AWSRegionMXCentral1 NS_SWIFT_NAME(MXCentral1), };