Skip to content

Commit

Permalink
Updated list of the valid AWS Region values for the LocationConstrain…
Browse files Browse the repository at this point in the history
…t parameter for general purpose buckets.
  • Loading branch information
aws-sdk-dotnet-automation committed Feb 6, 2025
1 parent b676a24 commit d015ee2
Show file tree
Hide file tree
Showing 15 changed files with 2,640 additions and 2,071 deletions.
5 changes: 5 additions & 0 deletions generator/ServiceModels/s3/s3-2006-03-01.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1609,17 +1609,22 @@
"ap-southeast-1",
"ap-southeast-2",
"ap-southeast-3",
"ap-southeast-4",
"ap-southeast-5",
"ca-central-1",
"cn-north-1",
"cn-northwest-1",
"EU",
"eu-central-1",
"eu-central-2",
"eu-north-1",
"eu-south-1",
"eu-south-2",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"il-central-1",
"me-central-1",
"me-south-1",
"sa-east-1",
"us-east-2",
Expand Down
166 changes: 83 additions & 83 deletions generator/ServiceModels/s3/s3-2006-03-01.docs.json

Large diffs are not rendered by default.

264 changes: 132 additions & 132 deletions generator/ServiceModels/s3/s3-2006-03-01.examples.json

Large diffs are not rendered by default.

171 changes: 88 additions & 83 deletions generator/ServiceModels/s3/s3-2006-03-01.normal.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public IRequest Marshall(PutBucketRequest putBucketRequest)
{
if(regionCode == null)
xmlWriter.WriteStartElement("CreateBucketConfiguration", S3Constants.S3RequestXmlNamespace);
if (putBucketRequest.PutBucketConfiguration.IsSetLocationConstraint())
{
xmlWriter.WriteElementString("LocationConstraint", S3Constants.S3RequestXmlNamespace, StringUtils.FromString(putBucketRequest.PutBucketConfiguration.LocationConstraint));
}
if (putBucketRequest.PutBucketConfiguration.BucketInfo != null)
{
xmlWriter.WriteStartElement("Bucket", S3Constants.S3RequestXmlNamespace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,20 @@ public class PutBucketResponseUnmarshaller : S3ReponseUnmarshaller
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
{
PutBucketResponse response = new PutBucketResponse();
UnmarshallResult(context, response);

return response;
}

private static void UnmarshallResult(XmlUnmarshallerContext context, PutBucketResponse response)
{
IWebResponseData responseData = context.ResponseData;

if (responseData.IsHeaderPresent("Location"))
response.Location = BucketLocationConstraint.FindValue(responseData.GetHeaderValue("Location"));
return;
}

/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
Expand Down
16 changes: 16 additions & 0 deletions sdk/src/Services/S3/Custom/Model/PutBucketConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ public class PutBucketConfiguration
{
private BucketInfo _bucketInfo;
private LocationInfo _location;
private BucketLocationConstraint _bucketLocationConstraint;

/// <summary>
/// Gets and sets the property LocationConstraint.
/// </summary>
public BucketLocationConstraint LocationConstraint
{
get { return this._bucketLocationConstraint; }
set { this._bucketLocationConstraint = value; }
}

// Check to see if LocationConstraint property is set
internal bool IsSetLocationConstraint()
{
return this._bucketLocationConstraint != null;
}

/// <summary>
/// Gets and sets the property BucketInfo.
Expand Down
17 changes: 16 additions & 1 deletion sdk/src/Services/S3/Custom/Model/PutBucketResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,22 @@ namespace Amazon.S3.Model
/// </summary>
public class PutBucketResponse : AmazonWebServiceResponse
{
private string _location;

/// <summary>
/// Gets and sets the property Location.
/// </summary>
public string Location
{
get { return this._location; }
set { this._location = value; }
}

// Check to see if Location property is set
internal bool IsSetLocation()
{
return this._location != null;
}
}
}

178 changes: 178 additions & 0 deletions sdk/src/Services/S3/Custom/S3Enumerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,184 @@ public static implicit operator S3Permission(string value)
}
}

/// <summary>
/// Constants used for properties of type BucketLocationConstraint.
/// </summary>
public class BucketLocationConstraint : ConstantClass
{

/// <summary>
/// Constant AfSouth1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint AfSouth1 = new BucketLocationConstraint("af-south-1");
/// <summary>
/// Constant ApEast1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint ApEast1 = new BucketLocationConstraint("ap-east-1");
/// <summary>
/// Constant ApNortheast1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint ApNortheast1 = new BucketLocationConstraint("ap-northeast-1");
/// <summary>
/// Constant ApNortheast2 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint ApNortheast2 = new BucketLocationConstraint("ap-northeast-2");
/// <summary>
/// Constant ApNortheast3 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint ApNortheast3 = new BucketLocationConstraint("ap-northeast-3");
/// <summary>
/// Constant ApSouth1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint ApSouth1 = new BucketLocationConstraint("ap-south-1");
/// <summary>
/// Constant ApSouth2 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint ApSouth2 = new BucketLocationConstraint("ap-south-2");
/// <summary>
/// Constant ApSoutheast1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint ApSoutheast1 = new BucketLocationConstraint("ap-southeast-1");
/// <summary>
/// Constant ApSoutheast2 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint ApSoutheast2 = new BucketLocationConstraint("ap-southeast-2");
/// <summary>
/// Constant ApSoutheast3 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint ApSoutheast3 = new BucketLocationConstraint("ap-southeast-3");
/// <summary>
/// Constant ApSoutheast4 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint ApSoutheast4 = new BucketLocationConstraint("ap-southeast-4");
/// <summary>
/// Constant ApSoutheast5 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint ApSoutheast5 = new BucketLocationConstraint("ap-southeast-5");
/// <summary>
/// Constant CaCentral1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint CaCentral1 = new BucketLocationConstraint("ca-central-1");
/// <summary>
/// Constant CaWest1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint CaWest1 = new BucketLocationConstraint("ca-west-1");
/// <summary>
/// Constant CnNorth1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint CnNorth1 = new BucketLocationConstraint("cn-north-1");
/// <summary>
/// Constant CnNorthwest1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint CnNorthwest1 = new BucketLocationConstraint("cn-northwest-1");
/// <summary>
/// Constant EU for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint EU = new BucketLocationConstraint("EU");
/// <summary>
/// Constant EuCentral1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint EuCentral1 = new BucketLocationConstraint("eu-central-1");
/// <summary>
/// Constant EuCentral2 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint EuCentral2 = new BucketLocationConstraint("eu-central-2");
/// <summary>
/// Constant EuNorth1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint EuNorth1 = new BucketLocationConstraint("eu-north-1");
/// <summary>
/// Constant EuSouth1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint EuSouth1 = new BucketLocationConstraint("eu-south-1");
/// <summary>
/// Constant EuSouth2 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint EuSouth2 = new BucketLocationConstraint("eu-south-2");
/// <summary>
/// Constant EuWest1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint EuWest1 = new BucketLocationConstraint("eu-west-1");
/// <summary>
/// Constant EuWest2 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint EuWest2 = new BucketLocationConstraint("eu-west-2");
/// <summary>
/// Constant EuWest3 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint EuWest3 = new BucketLocationConstraint("eu-west-3");
/// <summary>
/// Constant IlCentral1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint IlCentral1 = new BucketLocationConstraint("il-central-1");
/// <summary>
/// Constant MeCentral1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint MeCentral1 = new BucketLocationConstraint("me-central-1");
/// <summary>
/// Constant MeSouth1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint MeSouth1 = new BucketLocationConstraint("me-south-1");
/// <summary>
/// Constant SaEast1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint SaEast1 = new BucketLocationConstraint("sa-east-1");
/// <summary>
/// Constant UsEast2 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint UsEast2 = new BucketLocationConstraint("us-east-2");
/// <summary>
/// Constant UsGovEast1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint UsGovEast1 = new BucketLocationConstraint("us-gov-east-1");
/// <summary>
/// Constant UsGovWest1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint UsGovWest1 = new BucketLocationConstraint("us-gov-west-1");
/// <summary>
/// Constant UsWest1 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint UsWest1 = new BucketLocationConstraint("us-west-1");
/// <summary>
/// Constant UsWest2 for BucketLocationConstraint
/// </summary>
public static readonly BucketLocationConstraint UsWest2 = new BucketLocationConstraint("us-west-2");

/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public BucketLocationConstraint(string value)
: base(value)
{
}

/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static BucketLocationConstraint FindValue(string value)
{
return FindValue<BucketLocationConstraint>(value);
}

/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator BucketLocationConstraint(string value)
{
return FindValue(value);
}
}


/// <summary>
/// An enumeration of all Metadata directives that
/// can be used for the CopyObject operation.
Expand Down
Loading

0 comments on commit d015ee2

Please sign in to comment.