Skip to content

Commit eeb4674

Browse files
Added support for optional shard filter parameter in DescribeStream api that allows customers to fetch child shards of a read_only parent shard.
1 parent 8446230 commit eeb4674

File tree

10 files changed

+1045
-4
lines changed

10 files changed

+1045
-4
lines changed

generator/ServiceModels/streams.dynamodb/streams.dynamodb-2012-08-10.api.json

Lines changed: 421 additions & 0 deletions
Large diffs are not rendered by default.

generator/ServiceModels/streams.dynamodb/streams.dynamodb-2012-08-10.docs.json

Lines changed: 362 additions & 0 deletions
Large diffs are not rendered by default.

generator/ServiceModels/streams.dynamodb/streams.dynamodb-2012-08-10.normal.json

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
"endpointPrefix":"streams.dynamodb",
66
"jsonVersion":"1.0",
77
"protocol":"json",
8+
"protocols":["json"],
89
"serviceFullName":"Amazon DynamoDB Streams",
910
"serviceId":"DynamoDB Streams",
1011
"signatureVersion":"v4",
1112
"signingName":"dynamodb",
1213
"targetPrefix":"DynamoDBStreams_20120810",
13-
"uid":"streams-dynamodb-2012-08-10"
14+
"uid":"streams-dynamodb-2012-08-10",
15+
"auth":["aws.auth#sigv4"]
1416
},
1517
"operations":{
1618
"DescribeStream":{
@@ -152,6 +154,10 @@
152154
"ExclusiveStartShardId":{
153155
"shape":"ShardId",
154156
"documentation":"<p>The shard ID of the first item that this operation will evaluate. Use the value that was returned for <code>LastEvaluatedShardId</code> in the previous operation. </p>"
157+
},
158+
"ShardFilter":{
159+
"shape":"ShardFilter",
160+
"documentation":"<p>This optional field contains the filter definition for the <code>DescribeStream</code> API.</p>"
155161
}
156162
},
157163
"documentation":"<p>Represents the input of a <code>DescribeStream</code> operation.</p>"
@@ -470,6 +476,24 @@
470476
"type":"list",
471477
"member":{"shape":"Shard"}
472478
},
479+
"ShardFilter":{
480+
"type":"structure",
481+
"members":{
482+
"Type":{
483+
"shape":"ShardFilterType",
484+
"documentation":"<p>Contains the type of filter to be applied on the <code>DescribeStream</code> API. Currently, the only value this parameter accepts is <code>CHILD_SHARDS</code>.</p>"
485+
},
486+
"ShardId":{
487+
"shape":"ShardId",
488+
"documentation":"<p>Contains the <code>shardId</code> of the parent shard for which you are requesting child shards.</p> <p> <i>Sample request:</i> </p>"
489+
}
490+
},
491+
"documentation":"<p>This optional field contains the filter definition for the <code>DescribeStream</code> API.</p>"
492+
},
493+
"ShardFilterType":{
494+
"type":"string",
495+
"enum":["CHILD_SHARDS"]
496+
},
473497
"ShardId":{
474498
"type":"string",
475499
"max":65,
@@ -563,7 +587,7 @@
563587
"members":{
564588
"ApproximateCreationDateTime":{
565589
"shape":"Date",
566-
"documentation":"<p>The approximate date and time when the stream record was created, in <a href=\"http://www.epochconverter.com/\">UNIX epoch time</a> format and rounded down to the closest second.</p>"
590+
"documentation":"<p>The approximate date and time when the stream record was created, in <a href=\"https://www.iso.org/iso-8601-date-and-time-format.html\">ISO 8601</a> format and rounded down to the closest second.</p>"
567591
},
568592
"Keys":{
569593
"shape":"AttributeMap",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"pagination": {}
3+
}

sdk/src/Services/DynamoDBv2/Generated/Model/DescribeStreamRequest.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public partial class DescribeStreamRequest : AmazonDynamoDBStreamsRequest
5252
{
5353
private string _exclusiveStartShardId;
5454
private int? _limit;
55+
private ShardFilter _shardFilter;
5556
private string _streamArn;
5657

5758
/// <summary>
@@ -93,6 +94,24 @@ internal bool IsSetLimit()
9394
return this._limit.HasValue;
9495
}
9596

97+
/// <summary>
98+
/// Gets and sets the property ShardFilter.
99+
/// <para>
100+
/// This optional field contains the filter definition for the <c>DescribeStream</c> API.
101+
/// </para>
102+
/// </summary>
103+
public ShardFilter ShardFilter
104+
{
105+
get { return this._shardFilter; }
106+
set { this._shardFilter = value; }
107+
}
108+
109+
// Check to see if ShardFilter property is set
110+
internal bool IsSetShardFilter()
111+
{
112+
return this._shardFilter != null;
113+
}
114+
96115
/// <summary>
97116
/// Gets and sets the property StreamArn.
98117
/// <para>

sdk/src/Services/DynamoDBv2/Generated/Model/Internal/MarshallTransformations/DescribeStreamRequestMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ public IRequest Marshall(DescribeStreamRequest publicRequest)
8181
context.Writer.Write(publicRequest.Limit);
8282
}
8383

84+
if(publicRequest.IsSetShardFilter())
85+
{
86+
context.Writer.WritePropertyName("ShardFilter");
87+
context.Writer.WriteObjectStart();
88+
89+
var marshaller = ShardFilterMarshaller.Instance;
90+
marshaller.Marshall(publicRequest.ShardFilter, context);
91+
92+
context.Writer.WriteObjectEnd();
93+
}
94+
8495
if(publicRequest.IsSetStreamArn())
8596
{
8697
context.Writer.WritePropertyName("StreamArn");
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the streams.dynamodb-2012-08-10.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Globalization;
22+
using System.IO;
23+
using System.Text;
24+
using System.Xml.Serialization;
25+
26+
using Amazon.DynamoDBv2.Model;
27+
using Amazon.Runtime;
28+
using Amazon.Runtime.Internal;
29+
using Amazon.Runtime.Internal.Transform;
30+
using Amazon.Runtime.Internal.Util;
31+
using ThirdParty.Json.LitJson;
32+
33+
#pragma warning disable CS0612,CS0618
34+
namespace Amazon.DynamoDBv2.Model.Internal.MarshallTransformations
35+
{
36+
/// <summary>
37+
/// ShardFilter Marshaller
38+
/// </summary>
39+
public class ShardFilterMarshaller : IRequestMarshaller<ShardFilter, JsonMarshallerContext>
40+
{
41+
/// <summary>
42+
/// Unmarshaller the response from the service to the response class.
43+
/// </summary>
44+
/// <param name="requestObject"></param>
45+
/// <param name="context"></param>
46+
/// <returns></returns>
47+
public void Marshall(ShardFilter requestObject, JsonMarshallerContext context)
48+
{
49+
if(requestObject == null)
50+
return;
51+
if(requestObject.IsSetShardId())
52+
{
53+
context.Writer.WritePropertyName("ShardId");
54+
context.Writer.Write(requestObject.ShardId);
55+
}
56+
57+
if(requestObject.IsSetType())
58+
{
59+
context.Writer.WritePropertyName("Type");
60+
context.Writer.Write(requestObject.Type);
61+
}
62+
63+
}
64+
65+
/// <summary>
66+
/// Singleton Marshaller.
67+
/// </summary>
68+
public readonly static ShardFilterMarshaller Instance = new ShardFilterMarshaller();
69+
70+
}
71+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the streams.dynamodb-2012-08-10.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.DynamoDBv2.Model
31+
{
32+
/// <summary>
33+
/// This optional field contains the filter definition for the <c>DescribeStream</c> API.
34+
/// </summary>
35+
public partial class ShardFilter
36+
{
37+
private string _shardId;
38+
private ShardFilterType _type;
39+
40+
/// <summary>
41+
/// Gets and sets the property ShardId.
42+
/// <para>
43+
/// Contains the <c>shardId</c> of the parent shard for which you are requesting child
44+
/// shards.
45+
/// </para>
46+
///
47+
/// <para>
48+
/// <i>Sample request:</i>
49+
/// </para>
50+
/// </summary>
51+
[AWSProperty(Min=28, Max=65)]
52+
public string ShardId
53+
{
54+
get { return this._shardId; }
55+
set { this._shardId = value; }
56+
}
57+
58+
// Check to see if ShardId property is set
59+
internal bool IsSetShardId()
60+
{
61+
return this._shardId != null;
62+
}
63+
64+
/// <summary>
65+
/// Gets and sets the property Type.
66+
/// <para>
67+
/// Contains the type of filter to be applied on the <c>DescribeStream</c> API. Currently,
68+
/// the only value this parameter accepts is <c>CHILD_SHARDS</c>.
69+
/// </para>
70+
/// </summary>
71+
public ShardFilterType Type
72+
{
73+
get { return this._type; }
74+
set { this._type = value; }
75+
}
76+
77+
// Check to see if Type property is set
78+
internal bool IsSetType()
79+
{
80+
return this._type != null;
81+
}
82+
83+
}
84+
}

sdk/src/Services/DynamoDBv2/Generated/Model/StreamRecord.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public partial class StreamRecord
4646
/// <summary>
4747
/// Gets and sets the property ApproximateCreationDateTime.
4848
/// <para>
49-
/// The approximate date and time when the stream record was created, in <a href="http://www.epochconverter.com/">UNIX
50-
/// epoch time</a> format and rounded down to the closest second.
49+
/// The approximate date and time when the stream record was created, in <a href="https://www.iso.org/iso-8601-date-and-time-format.html">ISO
50+
/// 8601</a> format and rounded down to the closest second.
5151
/// </para>
5252
/// </summary>
5353
public DateTime ApproximateCreationDateTime

sdk/src/Services/DynamoDBv2/Generated/ServiceEnumerations.DynamoDBStreams.cs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,52 @@ public static implicit operator OperationType(string value)
7878
}
7979

8080

81+
/// <summary>
82+
/// Constants used for properties of type ShardFilterType.
83+
/// </summary>
84+
public class ShardFilterType : ConstantClass
85+
{
86+
87+
/// <summary>
88+
/// Constant CHILD_SHARDS for ShardFilterType
89+
/// </summary>
90+
public static readonly ShardFilterType CHILD_SHARDS = new ShardFilterType("CHILD_SHARDS");
91+
92+
/// <summary>
93+
/// This constant constructor does not need to be called if the constant
94+
/// you are attempting to use is already defined as a static instance of
95+
/// this class.
96+
/// This constructor should be used to construct constants that are not
97+
/// defined as statics, for instance if attempting to use a feature that is
98+
/// newer than the current version of the SDK.
99+
/// </summary>
100+
public ShardFilterType(string value)
101+
: base(value)
102+
{
103+
}
104+
105+
/// <summary>
106+
/// Finds the constant for the unique value.
107+
/// </summary>
108+
/// <param name="value">The unique value for the constant</param>
109+
/// <returns>The constant for the unique value</returns>
110+
public static ShardFilterType FindValue(string value)
111+
{
112+
return FindValue<ShardFilterType>(value);
113+
}
114+
115+
/// <summary>
116+
/// Utility method to convert strings to the constant class.
117+
/// </summary>
118+
/// <param name="value">The string value to convert to the constant class.</param>
119+
/// <returns></returns>
120+
public static implicit operator ShardFilterType(string value)
121+
{
122+
return FindValue(value);
123+
}
124+
}
125+
126+
81127
/// <summary>
82128
/// Constants used for properties of type ShardIteratorType.
83129
/// </summary>

0 commit comments

Comments
 (0)