Skip to content

Commit 537dab3

Browse files
committed
Generate PutBucketMetricsConfiguration and generate check to see if required query string params are set. Remove visitor pattern and move custom logic for putlifecycleconfiguration marshaller to custom partial method
1 parent 14e2efd commit 537dab3

22 files changed

+1535
-1551
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 PutBucketMetricsConfiguration, and add check in marshallers for required query strings. If required members for query strings are not set, the SDK will throw the base service-level exception."
8+
]
9+
}
10+
]
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"core": {
3+
"updateMinimum": true,
4+
"type": "patch",
5+
"changeLogMessages": [
6+
"Add check to see if required query string parameters are set. If not set, then the SDK will throw the generic service level exception."
7+
]
8+
}
9+
}

generator/ServiceClientGeneratorLib/Customizations.cs

Lines changed: 2 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,6 @@ public class CustomizationsModel
433433
public const string FlattenShapeKey = "flattenShapes";
434434
public const string ExcludeShapesKey = "excludeShapes";
435435
public const string AlternateLocationNameKey = "alternateLocationName";
436-
public const string ImplementsVisitorPatternKey = "implementsVisitorPattern";
437436

438437
JsonData _documentRoot;
439438

@@ -1458,9 +1457,9 @@ public class PropertyModifier
14581457
private readonly HashSet<string> _injectXmlPrivateMemberAssignment;
14591458
private readonly HashSet<string> _injectXmlPropertyGetter;
14601459
private readonly HashSet<string> _injectedXmlPropertySetter;
1460+
private readonly HashSet<string> _injectXmlMarshallCode;
14611461
private readonly bool _skipSetter;
14621462
private readonly bool _skipXmlIsSet;
1463-
private readonly HashSet<string> _injectXmlMarshallCode;
14641463

14651464
internal PropertyModifier(string modelPropertyName, JsonData modifierData)
14661465
{
@@ -1706,7 +1705,7 @@ public HashSet<string> InjectXmlUnmarshallCode
17061705
/// ]
17071706
/// }
17081707
/// </summary>
1709-
public bool SkipContextTestExpressionUnmarshallingLogic { get { return _modifierData[SkipContextTestExpressionUnmarshallingLogicKey] != null; } }
1708+
public bool SkipContextTestExpressionUnmarshallingLogic { get { return _modifierData[SkipContextTestExpressionUnmarshallingLogicKey] != null; } }
17101709
}
17111710

17121711
#endregion
@@ -2093,91 +2092,6 @@ public string AlternateLocationName
20932092
private set;
20942093
}
20952094
}
2096-
2097-
/// <summary>
2098-
/// A class that represents shapes that implement the visitor pattern.
2099-
/// </summary>
2100-
public class VisitorPattern
2101-
{
2102-
/// <summary>
2103-
/// Creates a Visitor
2104-
/// </summary>
2105-
/// <param name="predicateName"></param>
2106-
/// <param name="visitorName"></param>
2107-
/// <param name="visitorParam"></param>
2108-
public VisitorPattern(string predicateName, string visitorName, string visitorParam)
2109-
{
2110-
PredicateName = predicateName;
2111-
VisitorName = visitorName;
2112-
VisitorParam = visitorParam;
2113-
}
2114-
/// <summary>
2115-
/// The name of the predicate which is typically a property of a top-level
2116-
/// filter class.
2117-
/// </summary>
2118-
public string PredicateName
2119-
{
2120-
get;
2121-
private set;
2122-
}
2123-
2124-
/// <summary>
2125-
/// The name of the visitor which the predicate accepts.
2126-
/// </summary>
2127-
public string VisitorName
2128-
{
2129-
get;
2130-
private set;
2131-
}
2132-
2133-
/// <summary>
2134-
/// The argument to pass into the visitor. In XML services, this is typically
2135-
/// xmlWriter.
2136-
/// </summary>
2137-
public string VisitorParam
2138-
{
2139-
get;
2140-
private set;
2141-
}
2142-
2143-
/// <summary>
2144-
/// This is purely to communicate back to the generator that the visitor pattern has been written.
2145-
/// We want to write the visitor pattern to preserve existing behavior but in the future if more members
2146-
/// are added to the structure which implements the visitor pattern, we want that to be codegened so we don't have
2147-
/// to manually add the new predicates to the visitor.
2148-
/// Once we write the visitor pattern in the marshaller, we set Visited to true and then proceed with normal code-gen
2149-
/// for the same structure.
2150-
/// </summary>
2151-
public bool Visited
2152-
{
2153-
get;
2154-
set;
2155-
}
2156-
}
2157-
2158-
public bool TryGetVisitorPattern(string shapeName, out VisitorPattern visitorPattern)
2159-
{
2160-
visitorPattern = null;
2161-
var data = _documentRoot[ImplementsVisitorPatternKey];
2162-
if (data != null && data[shapeName] != null)
2163-
{
2164-
string predicateName = (string)data[shapeName]["predicateName"];
2165-
string visitorName = (string)data[shapeName]["visitorName"];
2166-
string visitorParam = (string)data[shapeName]["visitorParam"];
2167-
visitorPattern = new VisitorPattern(predicateName, visitorName, visitorParam);
2168-
return true;
2169-
}
2170-
2171-
return false;
2172-
}
2173-
2174-
public VisitorPattern GetVisitorPattern(string shapeName)
2175-
{
2176-
if (TryGetVisitorPattern(shapeName, out VisitorPattern visitorPattern))
2177-
return visitorPattern;
2178-
else
2179-
return null;
2180-
}
21812095
#endregion
21822096

21832097
#region RuntimePipelineOverride

generator/ServiceClientGeneratorLib/GeneratorDriver.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,8 @@ private void S3NeedsCustomUpdate(Shape shape)
17191719
// a dictionary of shape name to number of members that shape has
17201720
var customUpdateShapes = new Dictionary<string, int>
17211721
{
1722-
{"LifecycleFilter", 5 }
1722+
{"LifecycleFilter", 5 },
1723+
{"MetricsFilter", 4 }
17231724
};
17241725
if (customUpdateShapes.TryGetValue(shape.Name, out int membersCount))
17251726
{

0 commit comments

Comments
 (0)