Skip to content
Merged
11 changes: 11 additions & 0 deletions generator/.DevConfigs/034a6dd8-9283-4dce-b019-8723f2fcc351.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"services": [
{
"serviceName": "S3",
"type": "patch",
"changeLogMessages": [
"Generate GetBucketMetricsConfiguration"
]
}
]
}
2 changes: 1 addition & 1 deletion generator/ServiceClientGeneratorLib/ServiceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public List<Operation> S3AllowListOperations
//new Operation(this, "GetBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["GetBucketIntelligentTieringConfiguration"]),
//new Operation(this, "GetBucketInventoryConfiguration", DocumentRoot[OperationsKey]["GetBucketInventoryConfiguration"]),
//new Operation(this, "GetBucketLogging", DocumentRoot[OperationsKey]["GetBucketLogging"]),
// new Operation(this, "GetBucketMetricsConfiguration", DocumentRoot[OperationsKey]["GetBucketMetricsConfiguration"]),
new Operation(this, "GetBucketMetricsConfiguration", DocumentRoot[OperationsKey]["GetBucketMetricsConfiguration"]),
//new Operation(this, "GetBucketVersioning", DocumentRoot[OperationsKey]["GetBucketVersioning"]),
//new Operation(this, "GetBucketWebsite", DocumentRoot[OperationsKey]["GetBucketWebsite"]),
//new Operation(this, "ListBucketAnalyticsConfigurations", DocumentRoot[OperationsKey]["ListBucketAnalyticsConfigurations"]),
Expand Down
12 changes: 12 additions & 0 deletions generator/ServiceModels/s3/s3.customizations.json
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,18 @@
}
}
]
},
"GetBucketMetricsConfigurationRequest":{
"modify":[
{
"Id":{"emitPropertyName": "MetricsId"}
},
{
"ExpectedBucketOwner" :{
"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]
}
}
]
}
},
"operationModifiers": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,49 +24,11 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations
/// <summary>
/// Get Bucket MetricsConfigurationRequest Marshaller
/// </summary>
public class GetBucketMetricsConfigurationRequestMarshaller : IMarshaller<IRequest, GetBucketMetricsConfigurationRequest>, IMarshaller<IRequest, Amazon.Runtime.AmazonWebServiceRequest>
public partial class GetBucketMetricsConfigurationRequestMarshaller : IMarshaller<IRequest, GetBucketMetricsConfigurationRequest>, IMarshaller<IRequest, Amazon.Runtime.AmazonWebServiceRequest>
{
public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input)
partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketMetricsConfigurationRequest publicRequest)
{
return this.Marshall((GetBucketMetricsConfigurationRequest)input);
}

public IRequest Marshall(GetBucketMetricsConfigurationRequest getBucketMetricsConfigurationRequest)
{
IRequest request = new DefaultRequest(getBucketMetricsConfigurationRequest, "AmazonS3");

request.Suppress404Exceptions = true;
request.HttpMethod = "GET";

if (getBucketMetricsConfigurationRequest.IsSetExpectedBucketOwner())
request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(getBucketMetricsConfigurationRequest.ExpectedBucketOwner));

if (string.IsNullOrEmpty(getBucketMetricsConfigurationRequest.BucketName))
throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetBucketMetricsConfigurationRequest.BucketName");

request.ResourcePath = "/";
request.AddSubResource("metrics");
request.AddSubResource("id", getBucketMetricsConfigurationRequest.MetricsId);
request.UseQueryString = true;

return request;
}

private static GetBucketMetricsConfigurationRequestMarshaller _instance;

/// <summary>
/// Singleton for marshaller
/// </summary>
public static GetBucketMetricsConfigurationRequestMarshaller Instance
{
get
{
if (_instance == null)
{
_instance = new GetBucketMetricsConfigurationRequestMarshaller();
}
return _instance;
}
defaultRequest.Suppress404Exceptions = true;
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,28 @@
* 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 GetBucketMetricsConfiguration operation.
/// <note>
/// <para>
/// This operation is not supported by directory buckets.
/// This operation is not supported for directory buckets.
/// </para>
/// </note>
/// <para>
Expand All @@ -36,7 +42,7 @@ namespace Amazon.S3.Model
/// </para>
///
/// <para>
/// To use this operation, you must have permissions to perform the <code>s3:GetMetricsConfiguration</code>
/// To use this operation, you must have permissions to perform the <c>s3:GetMetricsConfiguration</c>
/// action. The bucket owner has this permission by default. The bucket owner can grant
/// this permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions
/// Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing
Expand All @@ -49,7 +55,7 @@ namespace Amazon.S3.Model
/// </para>
///
/// <para>
/// The following operations are related to <code>GetBucketMetricsConfiguration</code>:
/// The following operations are related to <c>GetBucketMetricsConfiguration</c>:
/// </para>
/// <ul> <li>
/// <para>
Expand All @@ -71,68 +77,78 @@ namespace Amazon.S3.Model
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html">Monitoring
/// Metrics with Amazon CloudWatch</a>
/// </para>
/// </li> </ul>
/// </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 GetBucketMetricsConfigurationRequest : AmazonWebServiceRequest
{
private string bucketName;
private string metricsId;
private string expectedBucketOwner;
private string _bucketName;
private string _expectedBucketOwner;
private string _metricsId;

/// <summary>
/// Gets and sets the property BucketName.
/// <para>
/// The name of the bucket containing the metrics configuration to retrieve.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string BucketName
{
get { return this.bucketName; }
set { this.bucketName = value; }
get { return this._bucketName; }
set { this._bucketName = value; }
}

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

/// <summary>
/// Gets and sets the property ExpectedBucketOwner.
/// <para>
/// The ID used to identify the metrics configuration.
/// The ID has a 64 character limit and can only contain letters, numbers, periods, dashes, and underscores.
/// The account ID of the expected bucket owner. If the account ID that you provide does
/// not match the actual owner of the bucket, the request fails with the HTTP status code
/// <c>403 Forbidden</c> (access denied).
/// </para>
/// </summary>
public string MetricsId
public string ExpectedBucketOwner
{
get { return this.metricsId; }
set { this.metricsId = value; }
get { return this._expectedBucketOwner; }
set { this._expectedBucketOwner = value; }
}

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

/// <summary>
/// Gets and sets the property ExpectedBucketOwner.
/// Gets and sets the property MetricsId.
/// <para>
/// The account ID of the expected bucket owner. If the account ID that you provide does
/// not match the actual owner of the bucket, the request fails with the HTTP status code
/// <code>403 Forbidden</code> (access denied).
/// The ID used to identify the metrics configuration. The ID has a 64 character limit
/// and can only contain letters, numbers, periods, dashes, and underscores.
/// </para>
/// </summary>
public string ExpectedBucketOwner
[AWSProperty(Required=true)]
public string MetricsId
{
get { return this.expectedBucketOwner; }
set { this.expectedBucketOwner = value; }
get { return this._metricsId; }
set { this._metricsId = value; }
}

/// <summary>
/// Checks to see if ExpectedBucketOwner is set.
/// </summary>
/// <returns>true, if ExpectedBucketOwner property is set.</returns>
internal bool IsSetExpectedBucketOwner()
// Check to see if MetricsId property is set
internal bool IsSetMetricsId()
{
return !String.IsNullOrEmpty(this.expectedBucketOwner);
return this._metricsId != null;
}

}
}
}
Loading