Skip to content

Commit 079f648

Browse files
This release introduces two additional protocols AWS JSON 1.1 and Smithy RPC v2 CBOR, replacing the currently utilized one, AWSQuery. AWS SDKs will prioritize the protocol that is the most performant for each language.
1 parent 00b452e commit 079f648

File tree

147 files changed

+7958
-5692
lines changed

Some content is hidden

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

147 files changed

+7958
-5692
lines changed

generator/ServiceModels/monitoring/monitoring-2010-08-01.api.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22
"version":"2.0",
33
"metadata":{
44
"apiVersion":"2010-08-01",
5+
"awsQueryCompatible":{},
56
"endpointPrefix":"monitoring",
6-
"protocol":"query",
7-
"protocols":["query"],
7+
"jsonVersion":"1.0",
8+
"protocol":"smithy-rpc-v2-cbor",
9+
"protocols":[
10+
"smithy-rpc-v2-cbor",
11+
"json",
12+
"query"
13+
],
814
"serviceAbbreviation":"CloudWatch",
915
"serviceFullName":"Amazon CloudWatch",
1016
"serviceId":"CloudWatch",
1117
"signatureVersion":"v4",
18+
"targetPrefix":"GraniteServiceVersion20100801",
1219
"uid":"monitoring-2010-08-01",
1320
"xmlNamespace":"http://monitoring.amazonaws.com/doc/2010-08-01/",
1421
"auth":["aws.auth#sigv4"]
@@ -905,6 +912,7 @@
905912
"members":{
906913
"Message":{"shape":"ErrorMessage"}
907914
},
915+
"error":{"httpStatusCode":409},
908916
"exception":true
909917
},
910918
"ContributorAttributes":{

generator/ServiceModels/monitoring/monitoring-2010-08-01.normal.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22
"version":"2.0",
33
"metadata":{
44
"apiVersion":"2010-08-01",
5+
"awsQueryCompatible":{},
56
"endpointPrefix":"monitoring",
6-
"protocol":"query",
7-
"protocols":["query"],
7+
"jsonVersion":"1.0",
8+
"protocol":"smithy-rpc-v2-cbor",
9+
"protocols":[
10+
"smithy-rpc-v2-cbor",
11+
"json",
12+
"query"
13+
],
814
"serviceAbbreviation":"CloudWatch",
915
"serviceFullName":"Amazon CloudWatch",
1016
"serviceId":"CloudWatch",
1117
"signatureVersion":"v4",
18+
"targetPrefix":"GraniteServiceVersion20100801",
1219
"uid":"monitoring-2010-08-01",
1320
"xmlNamespace":"http://monitoring.amazonaws.com/doc/2010-08-01/",
1421
"auth":["aws.auth#sigv4"]
@@ -1069,6 +1076,7 @@
10691076
"Message":{"shape":"ErrorMessage"}
10701077
},
10711078
"documentation":"<p>This operation attempted to create a resource that already exists.</p>",
1079+
"error":{"httpStatusCode":409},
10721080
"exception":true
10731081
},
10741082
"ContributorAttributes":{

generator/ServiceModels/monitoring/monitoring-2010-08-01.smoke2.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@
1313
"config": {
1414
"region": "us-west-2"
1515
}
16+
},
17+
{
18+
"id": "AmbiguousErrorResolution",
19+
"operationName": "GetDashboard",
20+
"input": {
21+
"DashboardName": "foo"
22+
},
23+
"expectation": {
24+
"failure": {
25+
"errorId": "ResourceNotFound"
26+
}
27+
},
28+
"config": {
29+
"region": "us-west-2"
30+
},
31+
"tags": ["query-compatibility"]
1632
}
1733
]
1834
}

sdk/src/Services/CloudWatch/AWSSDK.CloudWatch.NetFramework.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
</ItemGroup>
6262

6363
<ItemGroup>
64+
<ProjectReference Include="../../../../extensions/src/AWSSDK.Extensions.CborProtocol/AWSSDK.Extensions.CborProtocol.NetFramework.csproj"/>
6465
<ProjectReference Include="../../Core/AWSSDK.Core.NetFramework.csproj"/>
6566
</ItemGroup>
6667

sdk/src/Services/CloudWatch/AWSSDK.CloudWatch.NetStandard.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<SignAssembly>true</SignAssembly>
2323
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2424

25+
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
2526
<NoWarn>CA1822</NoWarn>
2627
</PropertyGroup>
2728
<!-- Async Enumerable Compatibility -->
@@ -71,6 +72,7 @@
7172
</ItemGroup>
7273

7374
<ItemGroup>
75+
<ProjectReference Include="../../../../extensions/src/AWSSDK.Extensions.CborProtocol/AWSSDK.Extensions.CborProtocol.NetStandard.csproj"/>
7476
<ProjectReference Include="../../Core/AWSSDK.Core.NetStandard.csproj"/>
7577
</ItemGroup>
7678

sdk/src/Services/CloudWatch/CloudWatch.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSSDK.Core.NetFramework",
88
EndProject
99
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSSDK.Core.NetStandard", "../../Core/AWSSDK.Core.NetStandard.csproj", "{A855B58E-ED32-40AE-AE8F-054F448B9F2C}"
1010
EndProject
11+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSSDK.Extensions.CborProtocol.NetFramework", "../../../../extensions/src/AWSSDK.Extensions.CborProtocol/AWSSDK.Extensions.CborProtocol.NetFramework.csproj", "{4DA5E05E-1162-49A2-857B-0D1B3BAE0E17}"
12+
EndProject
13+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSSDK.Extensions.CborProtocol.NetStandard", "../../../../extensions/src/AWSSDK.Extensions.CborProtocol/AWSSDK.Extensions.CborProtocol.NetStandard.csproj", "{9445495A-3045-4141-A00B-6B67715E1419}"
14+
EndProject
1115
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{939EC5C2-8345-43E2-8F97-72EEEBEEA0AB}"
1216
EndProject
1317
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CloudWatch", "CloudWatch", "{4A5408C4-6E9B-2089-624F-98402298A58E}"
@@ -60,6 +64,14 @@ Global
6064
{A855B58E-ED32-40AE-AE8F-054F448B9F2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
6165
{A855B58E-ED32-40AE-AE8F-054F448B9F2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
6266
{A855B58E-ED32-40AE-AE8F-054F448B9F2C}.Release|Any CPU.Build.0 = Release|Any CPU
67+
{4DA5E05E-1162-49A2-857B-0D1B3BAE0E17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
68+
{4DA5E05E-1162-49A2-857B-0D1B3BAE0E17}.Debug|Any CPU.Build.0 = Debug|Any CPU
69+
{4DA5E05E-1162-49A2-857B-0D1B3BAE0E17}.Release|Any CPU.ActiveCfg = Release|Any CPU
70+
{4DA5E05E-1162-49A2-857B-0D1B3BAE0E17}.Release|Any CPU.Build.0 = Release|Any CPU
71+
{9445495A-3045-4141-A00B-6B67715E1419}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72+
{9445495A-3045-4141-A00B-6B67715E1419}.Debug|Any CPU.Build.0 = Debug|Any CPU
73+
{9445495A-3045-4141-A00B-6B67715E1419}.Release|Any CPU.ActiveCfg = Release|Any CPU
74+
{9445495A-3045-4141-A00B-6B67715E1419}.Release|Any CPU.Build.0 = Release|Any CPU
6375
{434D91D7-9794-460E-AAD6-1564523A3464}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6476
{434D91D7-9794-460E-AAD6-1564523A3464}.Debug|Any CPU.Build.0 = Debug|Any CPU
6577
{434D91D7-9794-460E-AAD6-1564523A3464}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -127,6 +139,8 @@ Global
127139
GlobalSection(NestedProjects) = preSolution
128140
{7DE3AFA0-1B2D-41B1-82BD-120B8B210B43} = {9863FCB3-BFA4-4B9C-B8F6-302BA5F660B8}
129141
{A855B58E-ED32-40AE-AE8F-054F448B9F2C} = {9863FCB3-BFA4-4B9C-B8F6-302BA5F660B8}
142+
{4DA5E05E-1162-49A2-857B-0D1B3BAE0E17} = {9863FCB3-BFA4-4B9C-B8F6-302BA5F660B8}
143+
{9445495A-3045-4141-A00B-6B67715E1419} = {9863FCB3-BFA4-4B9C-B8F6-302BA5F660B8}
130144
{4A5408C4-6E9B-2089-624F-98402298A58E} = {939EC5C2-8345-43E2-8F97-72EEEBEEA0AB}
131145
{434D91D7-9794-460E-AAD6-1564523A3464} = {4A5408C4-6E9B-2089-624F-98402298A58E}
132146
{3E591FA3-A9CE-49C0-96C3-AD583E523AF2} = {4A5408C4-6E9B-2089-624F-98402298A58E}

sdk/src/Services/CloudWatch/Generated/Model/Internal/MarshallTransformations/AlarmContributorUnmarshaller.cs

Lines changed: 53 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -29,71 +29,81 @@
2929
using Amazon.Runtime.Internal;
3030
using Amazon.Runtime.Internal.Transform;
3131
using Amazon.Runtime.Internal.Util;
32+
using System.Formats.Cbor;
33+
using Amazon.Extensions.CborProtocol.Internal.Transform;
3234
#pragma warning disable CS0612,CS0618
3335
namespace Amazon.CloudWatch.Model.Internal.MarshallTransformations
3436
{
3537
/// <summary>
3638
/// Response Unmarshaller for AlarmContributor Object
3739
/// </summary>
38-
public class AlarmContributorUnmarshaller : IXmlUnmarshaller<AlarmContributor, XmlUnmarshallerContext>
40+
public class AlarmContributorUnmarshaller : ICborUnmarshaller<AlarmContributor, CborUnmarshallerContext>
3941
{
4042
/// <summary>
4143
/// Unmarshaller the response from the service to the response class.
4244
/// </summary>
4345
/// <param name="context"></param>
44-
/// <returns></returns>
45-
public AlarmContributor Unmarshall(XmlUnmarshallerContext context)
46+
/// <returns>The unmarshalled object</returns>
47+
public AlarmContributor Unmarshall(CborUnmarshallerContext context)
4648
{
4749
AlarmContributor unmarshalledObject = new AlarmContributor();
48-
int originalDepth = context.CurrentDepth;
49-
int targetDepth = originalDepth + 1;
50-
51-
if (context.IsStartOfDocument)
52-
targetDepth += 2;
53-
54-
while (context.ReadAtDepth(originalDepth))
50+
if (context.IsEmptyResponse)
51+
return null;
52+
var reader = context.Reader;
53+
if (reader.PeekState() == CborReaderState.Null)
5554
{
56-
if (context.IsStartElement || context.IsAttribute)
55+
reader.ReadNull();
56+
return null;
57+
}
58+
59+
reader.ReadStartMap();
60+
while (reader.PeekState() != CborReaderState.EndMap)
61+
{
62+
string propertyName = reader.ReadTextString();
63+
switch (propertyName)
5764
{
58-
if (context.TestExpression("ContributorAttributes/entry", targetDepth))
59-
{
60-
var unmarshaller = new XmlKeyValueUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance, "key", "value");
61-
if (unmarshalledObject.ContributorAttributes == null)
65+
case "ContributorAttributes":
6266
{
63-
unmarshalledObject.ContributorAttributes = new Dictionary<string, string>();
67+
context.AddPathSegment("ContributorAttributes");
68+
var unmarshaller = new CborDictionaryUnmarshaller<string, string, CborStringUnmarshaller, CborStringUnmarshaller>(CborStringUnmarshaller.Instance, CborStringUnmarshaller.Instance);
69+
unmarshalledObject.ContributorAttributes = unmarshaller.Unmarshall(context);
70+
context.PopPathSegment();
71+
break;
6472
}
65-
var item = unmarshaller.Unmarshall(context);
66-
unmarshalledObject.ContributorAttributes.Add(item);
67-
continue;
68-
}
69-
if (context.TestExpression("ContributorId", targetDepth))
70-
{
71-
var unmarshaller = StringUnmarshaller.Instance;
72-
unmarshalledObject.ContributorId = unmarshaller.Unmarshall(context);
73-
continue;
74-
}
75-
if (context.TestExpression("StateReason", targetDepth))
76-
{
77-
var unmarshaller = StringUnmarshaller.Instance;
78-
unmarshalledObject.StateReason = unmarshaller.Unmarshall(context);
79-
continue;
80-
}
81-
if (context.TestExpression("StateTransitionedTimestamp", targetDepth))
82-
{
83-
var unmarshaller = NullableDateTimeUnmarshaller.Instance;
84-
unmarshalledObject.StateTransitionedTimestamp = unmarshaller.Unmarshall(context);
85-
continue;
86-
}
87-
}
88-
else if (context.IsEndElement && context.CurrentDepth < originalDepth)
89-
{
90-
return unmarshalledObject;
73+
case "ContributorId":
74+
{
75+
context.AddPathSegment("ContributorId");
76+
var unmarshaller = CborStringUnmarshaller.Instance;
77+
unmarshalledObject.ContributorId = unmarshaller.Unmarshall(context);
78+
context.PopPathSegment();
79+
break;
80+
}
81+
case "StateReason":
82+
{
83+
context.AddPathSegment("StateReason");
84+
var unmarshaller = CborStringUnmarshaller.Instance;
85+
unmarshalledObject.StateReason = unmarshaller.Unmarshall(context);
86+
context.PopPathSegment();
87+
break;
88+
}
89+
case "StateTransitionedTimestamp":
90+
{
91+
context.AddPathSegment("StateTransitionedTimestamp");
92+
var unmarshaller = CborNullableDateTimeUnmarshaller.Instance;
93+
unmarshalledObject.StateTransitionedTimestamp = unmarshaller.Unmarshall(context);
94+
context.PopPathSegment();
95+
break;
96+
}
97+
default:
98+
reader.SkipValue();
99+
break;
91100
}
92101
}
93-
102+
reader.ReadEndMap();
94103
return unmarshalledObject;
95104
}
96105

106+
97107
private static AlarmContributorUnmarshaller _instance = new AlarmContributorUnmarshaller();
98108

99109
/// <summary>

0 commit comments

Comments
 (0)