@@ -117,61 +117,58 @@ static List<MemberShape> getBlobStreamingMembers(Model model, StructureShape sha
117
117
return shape .getAllMembers ().values ().stream ()
118
118
.filter (memberShape -> {
119
119
// Streaming blobs need to have their types modified
120
- // See `writeStreamingCommandTypeToSer `
120
+ // See `writeClientCommandStreamingInputType `
121
121
Shape target = model .expectShape (memberShape .getTarget ());
122
122
return target .isBlobShape () && target .hasTrait (StreamingTrait .class );
123
123
})
124
124
.collect (Collectors .toList ());
125
125
}
126
126
127
127
/**
128
- * Generate the type of the command output of server sdk or the input of the client sdk given the streaming blob
128
+ * Generate the type of the command input of the client sdk given the streaming blob
129
129
* member of the shape. The generated type eases the streaming member requirement so that users don't need to
130
130
* construct a stream every time.
131
131
* This type decoration is allowed in Smithy because it makes, for the same member, the type to be serialized is
132
132
* more permissive than the type to be deserialized.
133
133
* Refer here for more rationales: https://github.com/aws/aws-sdk-js-v3/issues/843
134
134
*/
135
- static void writeStreamingCommandTypeToSer (
135
+ static void writeClientCommandStreamingInputType (
136
136
TypeScriptWriter writer ,
137
137
Symbol containerSymbol ,
138
138
String typeName ,
139
139
MemberShape streamingMember
140
140
) {
141
141
String memberName = streamingMember .getMemberName ();
142
142
String optionalSuffix = streamingMember .isRequired () ? "" : "?" ;
143
- writer .openBlock ("type $LType = Omit<$T, $S> & {" , "};" , typeName , containerSymbol , memberName , () -> {
144
- writer .writeDocs (String .format ("For *`%1$s[\" %2$s\" ]`*, see {@link %1$s.%2$s}." ,
145
- containerSymbol .getName (), memberName ));
146
- writer .write ("$1L$2L: $3T[$1S]|string|Uint8Array|Buffer;" , memberName , optionalSuffix , containerSymbol );
143
+ writer .openBlock ("type $LType = Omit<$T, $S> & {" , "};" , typeName ,
144
+ containerSymbol , memberName , () -> {
145
+ writer .writeDocs (String .format ("For *`%1$s[\" %2$s\" ]`*, see {@link %1$s.%2$s}." ,
146
+ containerSymbol .getName (), memberName ));
147
+ writer .write ("$1L$2L: $3T[$1S]|string|Uint8Array|Buffer;" , memberName , optionalSuffix ,
148
+ containerSymbol );
147
149
});
148
150
writer .writeDocs (String .format ("This interface extends from `%1$s` interface. There are more parameters than"
149
151
+ " `%2$s` defined in {@link %1$s}" , containerSymbol .getName (), memberName ));
150
152
writer .write ("export interface $1L extends $1LType {}" , typeName );
151
153
}
152
154
153
155
/**
154
- * Generate the type of the command input of server sdk or the output of the client sdk given the streaming blob
156
+ * Generate the type of the command output of the client sdk given the streaming blob
155
157
* member of the shape. The type marks the streaming blob member to contain the utility methods to transform the
156
158
* stream to string, buffer or WHATWG stream API.
157
159
*/
158
- static void writeStreamingCommandTypeFromDeser (
160
+ static void writeClientCommandStreamingOutputType (
159
161
TypeScriptWriter writer ,
160
162
Symbol containerSymbol ,
161
163
String typeName ,
162
- MemberShape streamingMember ,
163
- TypeScriptSettings settings
164
+ MemberShape streamingMember
164
165
) {
165
166
String memberName = streamingMember .getMemberName ();
166
167
String optionalSuffix = streamingMember .isRequired () ? "" : "?" ;
167
- boolean isClientSdk = settings .generateClient ();
168
- if (isClientSdk ) {
169
- writer .addImport ("MetadataBearer" , "__MetadataBearer" , TypeScriptDependency .AWS_SDK_TYPES .packageName );
170
- }
171
- String metadataBearerType = isClientSdk ? "__MetadataBearer & " : "" ;
168
+ writer .addImport ("MetadataBearer" , "__MetadataBearer" , TypeScriptDependency .AWS_SDK_TYPES .packageName );
172
169
writer .addImport ("SdkStream" , "__SdkStream" , TypeScriptDependency .AWS_SDK_TYPES .packageName );
173
- writer .openBlock ("type $LType = $LOmit <$T, $S> & {" , "};" ,
174
- typeName , metadataBearerType , containerSymbol , memberName , () -> {
170
+ writer .openBlock ("type $LType = __MetadataBearer & Omit <$T, $S> & {" , "};" ,
171
+ typeName , containerSymbol , memberName , () -> {
175
172
writer .writeDocs (String .format ("For *`%1$s[\" %2$s\" ]`*, see {@link %1$s.%2$s}." ,
176
173
containerSymbol .getName (), memberName ));
177
174
writer .write ("$1L$2L: __SdkStream<Required<$3T>[$1S]>;" , memberName , optionalSuffix ,
0 commit comments