Skip to content

Commit d015ee2

Browse files
Updated list of the valid AWS Region values for the LocationConstraint parameter for general purpose buckets.
1 parent b676a24 commit d015ee2

File tree

15 files changed

+2640
-2071
lines changed

15 files changed

+2640
-2071
lines changed

generator/ServiceModels/s3/s3-2006-03-01.api.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,17 +1609,22 @@
16091609
"ap-southeast-1",
16101610
"ap-southeast-2",
16111611
"ap-southeast-3",
1612+
"ap-southeast-4",
1613+
"ap-southeast-5",
16121614
"ca-central-1",
16131615
"cn-north-1",
16141616
"cn-northwest-1",
16151617
"EU",
16161618
"eu-central-1",
1619+
"eu-central-2",
16171620
"eu-north-1",
16181621
"eu-south-1",
16191622
"eu-south-2",
16201623
"eu-west-1",
16211624
"eu-west-2",
16221625
"eu-west-3",
1626+
"il-central-1",
1627+
"me-central-1",
16231628
"me-south-1",
16241629
"sa-east-1",
16251630
"us-east-2",

generator/ServiceModels/s3/s3-2006-03-01.docs.json

Lines changed: 83 additions & 83 deletions
Large diffs are not rendered by default.

generator/ServiceModels/s3/s3-2006-03-01.examples.json

Lines changed: 132 additions & 132 deletions
Large diffs are not rendered by default.

generator/ServiceModels/s3/s3-2006-03-01.normal.json

Lines changed: 88 additions & 83 deletions
Large diffs are not rendered by default.

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketRequestMarshaller.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ public IRequest Marshall(PutBucketRequest putBucketRequest)
8787
{
8888
if(regionCode == null)
8989
xmlWriter.WriteStartElement("CreateBucketConfiguration", S3Constants.S3RequestXmlNamespace);
90+
if (putBucketRequest.PutBucketConfiguration.IsSetLocationConstraint())
91+
{
92+
xmlWriter.WriteElementString("LocationConstraint", S3Constants.S3RequestXmlNamespace, StringUtils.FromString(putBucketRequest.PutBucketConfiguration.LocationConstraint));
93+
}
9094
if (putBucketRequest.PutBucketConfiguration.BucketInfo != null)
9195
{
9296
xmlWriter.WriteStartElement("Bucket", S3Constants.S3RequestXmlNamespace);

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketResponseUnmarshaller.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,20 @@ public class PutBucketResponseUnmarshaller : S3ReponseUnmarshaller
3737
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
3838
{
3939
PutBucketResponse response = new PutBucketResponse();
40+
UnmarshallResult(context, response);
4041

4142
return response;
4243
}
4344

45+
private static void UnmarshallResult(XmlUnmarshallerContext context, PutBucketResponse response)
46+
{
47+
IWebResponseData responseData = context.ResponseData;
48+
49+
if (responseData.IsHeaderPresent("Location"))
50+
response.Location = BucketLocationConstraint.FindValue(responseData.GetHeaderValue("Location"));
51+
return;
52+
}
53+
4454
/// <summary>
4555
/// Unmarshaller error response to exception.
4656
/// </summary>

sdk/src/Services/S3/Custom/Model/PutBucketConfiguration.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ public class PutBucketConfiguration
2626
{
2727
private BucketInfo _bucketInfo;
2828
private LocationInfo _location;
29+
private BucketLocationConstraint _bucketLocationConstraint;
30+
31+
/// <summary>
32+
/// Gets and sets the property LocationConstraint.
33+
/// </summary>
34+
public BucketLocationConstraint LocationConstraint
35+
{
36+
get { return this._bucketLocationConstraint; }
37+
set { this._bucketLocationConstraint = value; }
38+
}
39+
40+
// Check to see if LocationConstraint property is set
41+
internal bool IsSetLocationConstraint()
42+
{
43+
return this._bucketLocationConstraint != null;
44+
}
2945

3046
/// <summary>
3147
/// Gets and sets the property BucketInfo.

sdk/src/Services/S3/Custom/Model/PutBucketResponse.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,22 @@ namespace Amazon.S3.Model
2626
/// </summary>
2727
public class PutBucketResponse : AmazonWebServiceResponse
2828
{
29+
private string _location;
2930

31+
/// <summary>
32+
/// Gets and sets the property Location.
33+
/// </summary>
34+
public string Location
35+
{
36+
get { return this._location; }
37+
set { this._location = value; }
38+
}
39+
40+
// Check to see if Location property is set
41+
internal bool IsSetLocation()
42+
{
43+
return this._location != null;
44+
}
3045
}
3146
}
32-
47+

sdk/src/Services/S3/Custom/S3Enumerations.cs

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,184 @@ public static implicit operator S3Permission(string value)
676676
}
677677
}
678678

679+
/// <summary>
680+
/// Constants used for properties of type BucketLocationConstraint.
681+
/// </summary>
682+
public class BucketLocationConstraint : ConstantClass
683+
{
684+
685+
/// <summary>
686+
/// Constant AfSouth1 for BucketLocationConstraint
687+
/// </summary>
688+
public static readonly BucketLocationConstraint AfSouth1 = new BucketLocationConstraint("af-south-1");
689+
/// <summary>
690+
/// Constant ApEast1 for BucketLocationConstraint
691+
/// </summary>
692+
public static readonly BucketLocationConstraint ApEast1 = new BucketLocationConstraint("ap-east-1");
693+
/// <summary>
694+
/// Constant ApNortheast1 for BucketLocationConstraint
695+
/// </summary>
696+
public static readonly BucketLocationConstraint ApNortheast1 = new BucketLocationConstraint("ap-northeast-1");
697+
/// <summary>
698+
/// Constant ApNortheast2 for BucketLocationConstraint
699+
/// </summary>
700+
public static readonly BucketLocationConstraint ApNortheast2 = new BucketLocationConstraint("ap-northeast-2");
701+
/// <summary>
702+
/// Constant ApNortheast3 for BucketLocationConstraint
703+
/// </summary>
704+
public static readonly BucketLocationConstraint ApNortheast3 = new BucketLocationConstraint("ap-northeast-3");
705+
/// <summary>
706+
/// Constant ApSouth1 for BucketLocationConstraint
707+
/// </summary>
708+
public static readonly BucketLocationConstraint ApSouth1 = new BucketLocationConstraint("ap-south-1");
709+
/// <summary>
710+
/// Constant ApSouth2 for BucketLocationConstraint
711+
/// </summary>
712+
public static readonly BucketLocationConstraint ApSouth2 = new BucketLocationConstraint("ap-south-2");
713+
/// <summary>
714+
/// Constant ApSoutheast1 for BucketLocationConstraint
715+
/// </summary>
716+
public static readonly BucketLocationConstraint ApSoutheast1 = new BucketLocationConstraint("ap-southeast-1");
717+
/// <summary>
718+
/// Constant ApSoutheast2 for BucketLocationConstraint
719+
/// </summary>
720+
public static readonly BucketLocationConstraint ApSoutheast2 = new BucketLocationConstraint("ap-southeast-2");
721+
/// <summary>
722+
/// Constant ApSoutheast3 for BucketLocationConstraint
723+
/// </summary>
724+
public static readonly BucketLocationConstraint ApSoutheast3 = new BucketLocationConstraint("ap-southeast-3");
725+
/// <summary>
726+
/// Constant ApSoutheast4 for BucketLocationConstraint
727+
/// </summary>
728+
public static readonly BucketLocationConstraint ApSoutheast4 = new BucketLocationConstraint("ap-southeast-4");
729+
/// <summary>
730+
/// Constant ApSoutheast5 for BucketLocationConstraint
731+
/// </summary>
732+
public static readonly BucketLocationConstraint ApSoutheast5 = new BucketLocationConstraint("ap-southeast-5");
733+
/// <summary>
734+
/// Constant CaCentral1 for BucketLocationConstraint
735+
/// </summary>
736+
public static readonly BucketLocationConstraint CaCentral1 = new BucketLocationConstraint("ca-central-1");
737+
/// <summary>
738+
/// Constant CaWest1 for BucketLocationConstraint
739+
/// </summary>
740+
public static readonly BucketLocationConstraint CaWest1 = new BucketLocationConstraint("ca-west-1");
741+
/// <summary>
742+
/// Constant CnNorth1 for BucketLocationConstraint
743+
/// </summary>
744+
public static readonly BucketLocationConstraint CnNorth1 = new BucketLocationConstraint("cn-north-1");
745+
/// <summary>
746+
/// Constant CnNorthwest1 for BucketLocationConstraint
747+
/// </summary>
748+
public static readonly BucketLocationConstraint CnNorthwest1 = new BucketLocationConstraint("cn-northwest-1");
749+
/// <summary>
750+
/// Constant EU for BucketLocationConstraint
751+
/// </summary>
752+
public static readonly BucketLocationConstraint EU = new BucketLocationConstraint("EU");
753+
/// <summary>
754+
/// Constant EuCentral1 for BucketLocationConstraint
755+
/// </summary>
756+
public static readonly BucketLocationConstraint EuCentral1 = new BucketLocationConstraint("eu-central-1");
757+
/// <summary>
758+
/// Constant EuCentral2 for BucketLocationConstraint
759+
/// </summary>
760+
public static readonly BucketLocationConstraint EuCentral2 = new BucketLocationConstraint("eu-central-2");
761+
/// <summary>
762+
/// Constant EuNorth1 for BucketLocationConstraint
763+
/// </summary>
764+
public static readonly BucketLocationConstraint EuNorth1 = new BucketLocationConstraint("eu-north-1");
765+
/// <summary>
766+
/// Constant EuSouth1 for BucketLocationConstraint
767+
/// </summary>
768+
public static readonly BucketLocationConstraint EuSouth1 = new BucketLocationConstraint("eu-south-1");
769+
/// <summary>
770+
/// Constant EuSouth2 for BucketLocationConstraint
771+
/// </summary>
772+
public static readonly BucketLocationConstraint EuSouth2 = new BucketLocationConstraint("eu-south-2");
773+
/// <summary>
774+
/// Constant EuWest1 for BucketLocationConstraint
775+
/// </summary>
776+
public static readonly BucketLocationConstraint EuWest1 = new BucketLocationConstraint("eu-west-1");
777+
/// <summary>
778+
/// Constant EuWest2 for BucketLocationConstraint
779+
/// </summary>
780+
public static readonly BucketLocationConstraint EuWest2 = new BucketLocationConstraint("eu-west-2");
781+
/// <summary>
782+
/// Constant EuWest3 for BucketLocationConstraint
783+
/// </summary>
784+
public static readonly BucketLocationConstraint EuWest3 = new BucketLocationConstraint("eu-west-3");
785+
/// <summary>
786+
/// Constant IlCentral1 for BucketLocationConstraint
787+
/// </summary>
788+
public static readonly BucketLocationConstraint IlCentral1 = new BucketLocationConstraint("il-central-1");
789+
/// <summary>
790+
/// Constant MeCentral1 for BucketLocationConstraint
791+
/// </summary>
792+
public static readonly BucketLocationConstraint MeCentral1 = new BucketLocationConstraint("me-central-1");
793+
/// <summary>
794+
/// Constant MeSouth1 for BucketLocationConstraint
795+
/// </summary>
796+
public static readonly BucketLocationConstraint MeSouth1 = new BucketLocationConstraint("me-south-1");
797+
/// <summary>
798+
/// Constant SaEast1 for BucketLocationConstraint
799+
/// </summary>
800+
public static readonly BucketLocationConstraint SaEast1 = new BucketLocationConstraint("sa-east-1");
801+
/// <summary>
802+
/// Constant UsEast2 for BucketLocationConstraint
803+
/// </summary>
804+
public static readonly BucketLocationConstraint UsEast2 = new BucketLocationConstraint("us-east-2");
805+
/// <summary>
806+
/// Constant UsGovEast1 for BucketLocationConstraint
807+
/// </summary>
808+
public static readonly BucketLocationConstraint UsGovEast1 = new BucketLocationConstraint("us-gov-east-1");
809+
/// <summary>
810+
/// Constant UsGovWest1 for BucketLocationConstraint
811+
/// </summary>
812+
public static readonly BucketLocationConstraint UsGovWest1 = new BucketLocationConstraint("us-gov-west-1");
813+
/// <summary>
814+
/// Constant UsWest1 for BucketLocationConstraint
815+
/// </summary>
816+
public static readonly BucketLocationConstraint UsWest1 = new BucketLocationConstraint("us-west-1");
817+
/// <summary>
818+
/// Constant UsWest2 for BucketLocationConstraint
819+
/// </summary>
820+
public static readonly BucketLocationConstraint UsWest2 = new BucketLocationConstraint("us-west-2");
821+
822+
/// <summary>
823+
/// This constant constructor does not need to be called if the constant
824+
/// you are attempting to use is already defined as a static instance of
825+
/// this class.
826+
/// This constructor should be used to construct constants that are not
827+
/// defined as statics, for instance if attempting to use a feature that is
828+
/// newer than the current version of the SDK.
829+
/// </summary>
830+
public BucketLocationConstraint(string value)
831+
: base(value)
832+
{
833+
}
834+
835+
/// <summary>
836+
/// Finds the constant for the unique value.
837+
/// </summary>
838+
/// <param name="value">The unique value for the constant</param>
839+
/// <returns>The constant for the unique value</returns>
840+
public static BucketLocationConstraint FindValue(string value)
841+
{
842+
return FindValue<BucketLocationConstraint>(value);
843+
}
844+
845+
/// <summary>
846+
/// Utility method to convert strings to the constant class.
847+
/// </summary>
848+
/// <param name="value">The string value to convert to the constant class.</param>
849+
/// <returns></returns>
850+
public static implicit operator BucketLocationConstraint(string value)
851+
{
852+
return FindValue(value);
853+
}
854+
}
855+
856+
679857
/// <summary>
680858
/// An enumeration of all Metadata directives that
681859
/// can be used for the CopyObject operation.

0 commit comments

Comments
 (0)