Skip to content

Commit be37954

Browse files
authored
Generate GetBucketRequestPayment, GetBucketTagging,GetObjectAttributes, GetObjectLegalHold, GetObjectLockConfiguration, GetObjectRetention, GetObjectTagging, and GetPublicAccessBlock
* generate GetBucketRequestPayment, GetBucketTagging, GetObjectAttributes, GetObjectLegalHold, GetObjectLockConfiguration * Generate GetObjectRetention and GetObjectTagging, GetPublicAccessBlock * update devconfig * address PR feedback * update overrideTreatEnumsAsString customization * Update value from true to false * Add overrideTreatEnumsAsString logic to map as well
1 parent af0ba46 commit be37954

File tree

67 files changed

+2323
-1391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2323
-1391
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"services": [
3+
{
4+
"serviceName": "S3",
5+
"type": "patch",
6+
"changeLogMessages": [
7+
"Generate GetBucketRequestPayment, GetBucketTagging, and GetObjectAttributes, GetObjectLegalHold, GetObjectLockConfiguration, GetObjectRetention, GetObjectTagging, GetPublicAccessBlock"
8+
]
9+
}
10+
]
11+
}

generator/ServiceClientGeneratorLib/Customizations.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ public class CustomizationsModel
424424
public const string OverrideContentTypeKey = "overrideContentType";
425425
public const string StopPaginationOnSameTokenKey = "stopPaginationOnSameToken";
426426
public const string OriginalMemberKey = "originalMember";
427-
427+
public const string OverrideTreatEnumsAsStringKey = "overrideTreatEnumsAsString";
428428
JsonData _documentRoot;
429429

430430
SimpleMethodFormsModel _simpleMethodsModel;
@@ -600,6 +600,24 @@ public List<string> NoArgOverloads
600600
}
601601
}
602602

603+
/// <summary>
604+
/// For Lists of enums, the generator automatically treats the enum as a string via passing in true to "treatEnumAsString".
605+
/// This customization sets the "treatEnumAsString" value to whatever is set here. This can be used outside of list of enums
606+
/// but this is just one example of how it can be used.
607+
/// "overrideTreatEnumsAsString":{
608+
/// "ObjectAttributesList": false
609+
/// }
610+
///
611+
/// </summary>
612+
/// <returns></returns>
613+
public bool? OverrideTreatEnumsAsString(string shapeName)
614+
{
615+
var data = _documentRoot[OverrideTreatEnumsAsStringKey];
616+
if (data == null || data[shapeName] == null) return null;
617+
618+
return (bool)data[shapeName];
619+
}
620+
603621
private HashSet<string> _resultGenerationSuppressions = null;
604622

605623
/// <summary>

generator/ServiceClientGeneratorLib/GeneratorDriver.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ public void Execute()
211211
this.ExecuteGenerator(new ServiceEnumerations(), enumFileName);
212212
}
213213

214-
215214
// Any paginators for the service
216215
// skip paginators for s3 until we're at the end of s3 client generation
217216
if (Configuration.ServiceModel.HasPaginators && Configuration.ServiceId != "S3")

generator/ServiceClientGeneratorLib/Member.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,11 +579,13 @@ private string DetermineType(JsonData extendedData, bool treatEnumsAsString, boo
579579
}
580580
return typeName;
581581
case "map":
582-
var keyType = DetermineType(memberShape["key"], true, false);
583-
var valueType = DetermineType(memberShape["value"], true, false);
582+
bool overrideMapTreatEnumsAsString = this.model.Customizations.OverrideTreatEnumsAsString(this.Extends) ?? true;
583+
var keyType = DetermineType(memberShape["key"], overrideMapTreatEnumsAsString, false);
584+
var valueType = DetermineType(memberShape["value"], overrideMapTreatEnumsAsString, false);
584585
return string.Format("Dictionary<{0}, {1}>", keyType, valueType);
585586
case "list":
586-
var listType = DetermineType(memberShape["member"], true, false);
587+
bool overrideListTreatEnumsAsString = this.model.Customizations.OverrideTreatEnumsAsString(this.Extends) ?? true;
588+
var listType = DetermineType(memberShape["member"], overrideListTreatEnumsAsString, false);
587589
return string.Format("List<{0}>", listType);
588590

589591
case "decimal":

generator/ServiceClientGeneratorLib/ServiceModel.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -493,16 +493,16 @@ public List<Operation> S3AllowListOperations
493493
new Operation(this, "GetBucketPolicy", DocumentRoot[OperationsKey]["GetBucketPolicy"]),
494494
new Operation(this, "GetBucketPolicyStatus", DocumentRoot[OperationsKey]["GetBucketPolicyStatus"]),
495495
new Operation(this, "GetBucketReplication", DocumentRoot[OperationsKey]["GetBucketReplication"]),
496-
//new Operation(this, "GetBucketRequestPayment", DocumentRoot[OperationsKey]["GetBucketRequestPayment"]),
497-
//new Operation(this, "GetBucketTagging", DocumentRoot[OperationsKey]["GetBucketTagging"]),
496+
new Operation(this, "GetBucketRequestPayment", DocumentRoot[OperationsKey]["GetBucketRequestPayment"]),
497+
new Operation(this, "GetBucketTagging", DocumentRoot[OperationsKey]["GetBucketTagging"]),
498498
//new Operation(this, "GetBucketVersioning", DocumentRoot[OperationsKey]["GetBucketVersioning"]),
499499
//new Operation(this, "GetBucketWebsite", DocumentRoot[OperationsKey]["GetBucketWebsite"]),
500-
//new Operation(this, "GetObjectAttributes", DocumentRoot[OperationsKey]["GetObjectAttributes"]),
501-
//new Operation(this, "GetObjectLegalHold", DocumentRoot[OperationsKey]["GetObjectLegalHold"]),
502-
//new Operation(this, "GetObjectLockConfiguration", DocumentRoot[OperationsKey]["GetObjectLockConfiguration"]),
503-
//new Operation(this, "GetObjectRetention", DocumentRoot[OperationsKey]["GetObjectRetention"]),
504-
//new Operation(this, "GetObjectTagging", DocumentRoot[OperationsKey]["GetObjectTagging"]),
505-
//new Operation(this, "GetPublicAccessBlock", DocumentRoot[OperationsKey]["GetPublicAccessBlock"]),
500+
new Operation(this, "GetObjectAttributes", DocumentRoot[OperationsKey]["GetObjectAttributes"]),
501+
new Operation(this, "GetObjectLegalHold", DocumentRoot[OperationsKey]["GetObjectLegalHold"]),
502+
new Operation(this, "GetObjectLockConfiguration", DocumentRoot[OperationsKey]["GetObjectLockConfiguration"]),
503+
new Operation(this, "GetObjectRetention", DocumentRoot[OperationsKey]["GetObjectRetention"]),
504+
new Operation(this, "GetObjectTagging", DocumentRoot[OperationsKey]["GetObjectTagging"]),
505+
new Operation(this, "GetPublicAccessBlock", DocumentRoot[OperationsKey]["GetPublicAccessBlock"]),
506506
//new Operation(this, "HeadBucket", DocumentRoot[OperationsKey]["HeadBucket"]),
507507
//new Operation(this, "ListBucketAnalyticsConfigurations", DocumentRoot[OperationsKey]["ListBucketAnalyticsConfigurations"]),
508508
//new Operation(this, "ListBucketIntelligentTieringConfigurations", DocumentRoot[OperationsKey]["ListBucketIntelligentTieringConfigurations"]),
@@ -542,7 +542,9 @@ public List<string> S3AddParametersList
542542
_s3AddParametersList = new List<string>
543543
{
544544
"ListBuckets",
545-
"ListDirectoryBuckets"
545+
"ListDirectoryBuckets",
546+
"GetObjectLegalHold",
547+
"GetObjectRetention"
546548
};
547549
}
548550
return _s3AddParametersList;
@@ -567,7 +569,8 @@ public List<string> S3RequestMarshallerThrowGenericExceptionList
567569
{
568570
_s3RequestMarshallerThrowAmazonS3ExceptionList = new List<string>()
569571
{
570-
"CreateSession"
572+
"CreateSession",
573+
"GetObjectAttributes"
571574
};
572575
}
573576
return _s3RequestMarshallerThrowAmazonS3ExceptionList;

generator/ServiceModels/s3/s3.customizations.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@
137137
}
138138
]
139139
},
140+
"GetObjectTaggingOutput":{
141+
"modify":[
142+
{
143+
"TagSet": {"emitPropertyName": "Tagging"}
144+
}
145+
]
146+
},
140147
"LifecycleRule": {
141148
"modify": [
142149
{
@@ -381,6 +388,13 @@
381388
},
382389
"StorageClass":{
383390
"renameShape": "S3StorageClass"
391+
},
392+
"Payer":{
393+
"renameShape": "string"
384394
}
395+
396+
},
397+
"overrideTreatEnumsAsString":{
398+
"ObjectAttributesList": false
385399
}
386400
}

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

Lines changed: 0 additions & 47 deletions
This file was deleted.

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

Lines changed: 0 additions & 39 deletions
This file was deleted.

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

Lines changed: 0 additions & 71 deletions
This file was deleted.

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

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)