Skip to content
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
6 changes: 4 additions & 2 deletions generator/ServiceClientGeneratorLib/ServiceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,8 @@ public List<Operation> S3AllowListOperations
new Operation(this, "DeleteBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["DeleteBucketIntelligentTieringConfiguration"]),
new Operation(this, "DeleteBucketInventoryConfiguration", DocumentRoot[OperationsKey]["DeleteBucketInventoryConfiguration"]),
new Operation(this,"PutBucketRequestPayment", DocumentRoot[OperationsKey]["PutBucketRequestPayment"]),
new Operation(this, "CreateBucketMetadataConfiguration",DocumentRoot[OperationsKey]["CreateBucketMetadataConfiguration"])
new Operation(this, "CreateBucketMetadataConfiguration",DocumentRoot[OperationsKey]["CreateBucketMetadataConfiguration"]),
new Operation(this, "GetBucketMetadataConfiguration", DocumentRoot[OperationsKey]["GetBucketMetadataConfiguration"])

};
}
Expand Down Expand Up @@ -604,7 +605,8 @@ public List<string> S3RequestMarshallerThrowGenericExceptionList
"PutObjectAcl",
"GetObjectAcl",
"PutBucketAcl",
"CreateBucketMetadataConfiguration"
"CreateBucketMetadataConfiguration",
"GetBucketMetadataConfiguration"
};
}
return _s3RequestMarshallerThrowAmazonS3ExceptionList;
Expand Down
10 changes: 10 additions & 0 deletions generator/ServiceModels/s3/s3.customizations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,16 @@
"KmsKeyArn":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._kmsKeyArn);"]}
}
]
},
"GetBucketMetadataConfigurationRequest":{
"modify":[
{
"BucketName":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._bucketName);"]}
},
{
"ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]}
}
]
}

},
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

/*
* Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

#pragma warning disable CS0612,CS0618,CS1570
namespace Amazon.S3.Model
{
/// <summary>
/// Container for the parameters to the GetBucketMetadataConfiguration operation.
/// Retrieves the S3 Metadata configuration for a general purpose bucket. For more information,
/// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html">Accelerating
/// data discovery with S3 Metadata</a> in the <i>Amazon S3 User Guide</i>.
///
/// <note>
/// <para>
/// You can use the V2 <c>GetBucketMetadataConfiguration</c> API operation with V1 or
/// V2 metadata configurations. However, if you try to use the V1 <c>GetBucketMetadataTableConfiguration</c>
/// API operation with V2 configurations, you will receive an HTTP <c>405 Method Not Allowed</c>
/// error.
/// </para>
/// </note> <dl> <dt>Permissions</dt> <dd>
/// <para>
/// To use this operation, you must have the <c>s3:GetBucketMetadataTableConfiguration</c>
/// permission. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html">Setting
/// up permissions for configuring metadata tables</a> in the <i>Amazon S3 User Guide</i>.
///
/// </para>
/// <note>
/// <para>
/// The IAM policy action name is the same for the V1 and V2 API operations.
/// </para>
/// </note> </dd> </dl>
/// <para>
/// The following operations are related to <c>GetBucketMetadataConfiguration</c>:
/// </para>
/// <ul> <li>
/// <para>
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataConfiguration.html">CreateBucketMetadataConfiguration</a>
///
/// </para>
/// </li> <li>
/// <para>
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetadataConfiguration.html">DeleteBucketMetadataConfiguration</a>
///
/// </para>
/// </li> <li>
/// <para>
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataInventoryTableConfiguration.html">UpdateBucketMetadataInventoryTableConfiguration</a>
///
/// </para>
/// </li> <li>
/// <para>
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataJournalTableConfiguration.html">UpdateBucketMetadataJournalTableConfiguration</a>
///
/// </para>
/// </li> </ul> <important>
/// <para>
/// You must URL encode any signed header values that contain spaces. For example, if
/// your header value is <c>my file.txt</c>, containing two spaces after <c>my</c>, you
/// must URL encode this value to <c>my%20%20file.txt</c>.
/// </para>
/// </important>
/// </summary>
public partial class GetBucketMetadataConfigurationRequest : AmazonWebServiceRequest
{
private string _bucketName;
private string _expectedBucketOwner;

/// <summary>
/// Gets and sets the property BucketName.
/// <para>
/// The general purpose bucket that corresponds to the metadata configuration that you
/// want to retrieve.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string BucketName
{
get { return this._bucketName; }
set { this._bucketName = value; }
}

// Check to see if BucketName property is set
internal bool IsSetBucketName()
{
return !String.IsNullOrEmpty(this._bucketName);
}

/// <summary>
/// Gets and sets the property ExpectedBucketOwner.
/// <para>
/// The expected owner of the general purpose bucket that you want to retrieve the metadata
/// table configuration for.
/// </para>
/// </summary>
public string ExpectedBucketOwner
{
get { return this._expectedBucketOwner; }
set { this._expectedBucketOwner = value; }
}

// Check to see if ExpectedBucketOwner property is set
internal bool IsSetExpectedBucketOwner()
{
return !String.IsNullOrEmpty(this._expectedBucketOwner);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public partial class GetBucketMetadataConfigurationResponse : AmazonWebServiceRe
private GetBucketMetadataConfigurationResult _getBucketMetadataConfigurationResult;

/// <summary>
/// Gets and sets the property GetBucketMetadataConfigurationResult.
/// Gets and sets the property GetBucketMetadataConfigurationResult.
/// <para>
/// The metadata configuration for the general purpose bucket.
/// </para>
/// </summary>
public GetBucketMetadataConfigurationResult GetBucketMetadataConfigurationResult
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@
namespace Amazon.S3.Model
{
/// <summary>
///
/// The S3 Metadata configuration for a general purpose bucket.
/// </summary>
public partial class GetBucketMetadataConfigurationResult
{
private MetadataConfigurationResult _metadataConfigurationResult;

/// <summary>
/// Gets and sets the property MetadataConfigurationResult.
/// Gets and sets the property MetadataConfigurationResult.
/// <para>
/// The metadata configuration for a general purpose bucket.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public MetadataConfigurationResult MetadataConfigurationResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations
/// <summary>
/// Response Unmarshaller for DestinationResult Object
/// </summary>
public class DestinationResultUnmarshaller : IXmlUnmarshaller<DestinationResult, XmlUnmarshallerContext>
public partial class DestinationResultUnmarshaller : IXmlUnmarshaller<DestinationResult, XmlUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
Expand Down Expand Up @@ -74,6 +74,8 @@ public DestinationResult Unmarshall(XmlUnmarshallerContext context)
unmarshalledObject.TableNamespace = unmarshaller.Unmarshall(context);
continue;
}

XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember seeing XmlStructureUnmarshallCustomization in the other PRs I reviewed. What does it do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was in other PRs but probably missed because there weren't many structure unmarshallers. It is just a partial method defined for any customizations that apply to unmarshalling structures that use the rest-xml protocol. I have yet to use it though 😅

}
else if (context.IsEndElement && context.CurrentDepth < originalDepth)
{
Expand All @@ -83,6 +85,8 @@ public DestinationResult Unmarshall(XmlUnmarshallerContext context)
return unmarshalledObject;
}

partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, DestinationResult unmarshalledObject, int targetDepth);

private static DestinationResultUnmarshaller _instance = new DestinationResultUnmarshaller();

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations
/// <summary>
/// GetBucketMetadataConfiguration Request Marshaller
/// </summary>
public class GetBucketMetadataConfigurationRequestMarshaller : IMarshaller<IRequest, GetBucketMetadataConfigurationRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
public partial class GetBucketMetadataConfigurationRequestMarshaller : IMarshaller<IRequest, GetBucketMetadataConfigurationRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
Expand All @@ -56,6 +56,7 @@ public IRequest Marshall(AmazonWebServiceRequest input)
public IRequest Marshall(GetBucketMetadataConfigurationRequest publicRequest)
{
var request = new DefaultRequest(publicRequest, "Amazon.S3");
PreMarshallCustomization(request, publicRequest);
request.HttpMethod = "GET";
request.AddSubResource("metadataConfiguration");

Expand All @@ -65,10 +66,9 @@ public IRequest Marshall(GetBucketMetadataConfigurationRequest publicRequest)
}
if (!publicRequest.IsSetBucketName())
throw new AmazonS3Exception("Request object does not have required field BucketName set");
request.AddPathResource("{Bucket}", StringUtils.FromString(publicRequest.BucketName));
request.ResourcePath = "/{Bucket}";

request.ResourcePath = "/";

PostMarshallCustomization(request, publicRequest);
return request;
}
private static GetBucketMetadataConfigurationRequestMarshaller _instance = new GetBucketMetadataConfigurationRequestMarshaller();
Expand All @@ -89,5 +89,7 @@ public static GetBucketMetadataConfigurationRequestMarshaller Instance
}
}

partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetBucketMetadataConfigurationRequest publicRequest);
partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketMetadataConfigurationRequest publicRequest);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations
/// <summary>
/// Response Unmarshaller for GetBucketMetadataConfiguration operation
/// </summary>
public class GetBucketMetadataConfigurationResponseUnmarshaller : S3ReponseUnmarshaller
public partial class GetBucketMetadataConfigurationResponseUnmarshaller : S3ReponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
Expand All @@ -48,6 +48,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte
GetBucketMetadataConfigurationResponse response = new GetBucketMetadataConfigurationResponse();
UnmarshallResult(context,response);

PostUnmarshallCustomization(context, response);
return response;
}

Expand Down Expand Up @@ -75,7 +76,6 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketMe
return;
}
}

return;
}

Expand All @@ -89,7 +89,7 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketMe
/// <returns></returns>
public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context);
S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;

Expand All @@ -99,11 +99,17 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex
using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null))
{
}
return new AmazonS3Exception(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
return base.ConstructS3Exception(context, errorResponse, innerException, statusCode);
}

partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, GetBucketMetadataConfigurationResponse response);

private static GetBucketMetadataConfigurationResponseUnmarshaller _instance = new GetBucketMetadataConfigurationResponseUnmarshaller();

internal static GetBucketMetadataConfigurationResponseUnmarshaller GetInstance()
{
return _instance;
}

/// <summary>
/// Gets the singleton.
Expand Down
Loading