File tree 4 files changed +2
-28
lines changed
codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/protocols
4 files changed +2
-28
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,11 @@ import software.amazon.smithy.model.shapes.MemberShape
12
12
import software.amazon.smithy.model.shapes.OperationShape
13
13
import software.amazon.smithy.model.shapes.Shape
14
14
import software.amazon.smithy.model.shapes.ShapeId
15
- import software.amazon.smithy.model.traits.HostLabelTrait
16
15
import software.amazon.smithy.swift.codegen.integration.HttpBindingResolver
17
16
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
18
17
import software.amazon.smithy.swift.codegen.integration.isEventStreaming
19
18
import software.amazon.smithy.swift.codegen.integration.middlewares.ContentTypeMiddleware
20
19
import software.amazon.smithy.swift.codegen.integration.middlewares.OperationInputBodyMiddleware
21
- import software.amazon.smithy.swift.codegen.model.hasTrait
22
20
import software.amazon.smithy.swift.codegen.model.targetOrSelf
23
21
24
22
@Suppress(" ktlint:standard:class-naming" )
@@ -65,9 +63,6 @@ class AWSJSON1_0ProtocolGenerator : AWSHTTPBindingProtocolGenerator(AWSJSONCusto
65
63
): List <MemberShape > =
66
64
shape
67
65
.members()
68
- // The only place an input member can be bound to in AWS JSON other than the body
69
- // is the host prefix, using the host label trait.
70
- .filter { ! it.hasTrait<HostLabelTrait >() }
71
66
// For RPC protocols that support event streaming, we need to send initial request
72
67
// with streaming member excluded during encoding the input struct.
73
68
.filter { ! it.targetOrSelf(ctx.model).isEventStreaming }
Original file line number Diff line number Diff line change @@ -12,13 +12,11 @@ import software.amazon.smithy.model.shapes.MemberShape
12
12
import software.amazon.smithy.model.shapes.OperationShape
13
13
import software.amazon.smithy.model.shapes.Shape
14
14
import software.amazon.smithy.model.shapes.ShapeId
15
- import software.amazon.smithy.model.traits.HostLabelTrait
16
15
import software.amazon.smithy.swift.codegen.integration.HttpBindingResolver
17
16
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
18
17
import software.amazon.smithy.swift.codegen.integration.isEventStreaming
19
18
import software.amazon.smithy.swift.codegen.integration.middlewares.ContentTypeMiddleware
20
19
import software.amazon.smithy.swift.codegen.integration.middlewares.OperationInputBodyMiddleware
21
- import software.amazon.smithy.swift.codegen.model.hasTrait
22
20
import software.amazon.smithy.swift.codegen.model.targetOrSelf
23
21
24
22
@Suppress(" ktlint:standard:class-naming" )
@@ -63,9 +61,6 @@ class AWSJSON1_1ProtocolGenerator : AWSHTTPBindingProtocolGenerator(AWSJSONCusto
63
61
): List <MemberShape > =
64
62
shape
65
63
.members()
66
- // The only place an input member can be bound to in AWS JSON other than the body
67
- // is the host prefix, using the host label trait.
68
- .filter { ! it.hasTrait<HostLabelTrait >() }
69
64
// For RPC protocols that support event streaming, we need to send initial request
70
65
// with streaming member excluded during encoding the input struct.
71
66
.filter { ! it.targetOrSelf(ctx.model).isEventStreaming }
Original file line number Diff line number Diff line change @@ -12,12 +12,10 @@ import software.amazon.smithy.model.shapes.MemberShape
12
12
import software.amazon.smithy.model.shapes.OperationShape
13
13
import software.amazon.smithy.model.shapes.Shape
14
14
import software.amazon.smithy.model.shapes.ShapeId
15
- import software.amazon.smithy.model.traits.HostLabelTrait
16
15
import software.amazon.smithy.swift.codegen.integration.HttpBindingResolver
17
16
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
18
17
import software.amazon.smithy.swift.codegen.integration.middlewares.ContentTypeMiddleware
19
18
import software.amazon.smithy.swift.codegen.integration.middlewares.OperationInputBodyMiddleware
20
- import software.amazon.smithy.swift.codegen.model.hasTrait
21
19
22
20
open class AWSQueryProtocolGenerator : AWSHTTPBindingProtocolGenerator (AWSQueryCustomizations ()) {
23
21
override val defaultContentType = " application/x-www-form-urlencoded"
@@ -56,11 +54,5 @@ open class AWSQueryProtocolGenerator : AWSHTTPBindingProtocolGenerator(AWSQueryC
56
54
override fun httpBodyMembers (
57
55
ctx : ProtocolGenerator .GenerationContext ,
58
56
shape : Shape ,
59
- ): List <MemberShape > =
60
- shape
61
- .members()
62
- // The only place an input member can be bound to in AWSQuery other than the body
63
- // is the host prefix, using the host label trait.
64
- .filter { ! it.hasTrait<HostLabelTrait >() }
65
- .toList()
57
+ ): List <MemberShape > = shape.members().toList()
66
58
}
Original file line number Diff line number Diff line change @@ -12,12 +12,10 @@ import software.amazon.smithy.model.shapes.MemberShape
12
12
import software.amazon.smithy.model.shapes.OperationShape
13
13
import software.amazon.smithy.model.shapes.Shape
14
14
import software.amazon.smithy.model.shapes.ShapeId
15
- import software.amazon.smithy.model.traits.HostLabelTrait
16
15
import software.amazon.smithy.swift.codegen.integration.HttpBindingResolver
17
16
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
18
17
import software.amazon.smithy.swift.codegen.integration.middlewares.ContentTypeMiddleware
19
18
import software.amazon.smithy.swift.codegen.integration.middlewares.OperationInputBodyMiddleware
20
- import software.amazon.smithy.swift.codegen.model.hasTrait
21
19
22
20
class EC2QueryProtocolGenerator : AWSHTTPBindingProtocolGenerator (EC2QueryCustomizations ()) {
23
21
override val defaultContentType = " application/x-www-form-urlencoded"
@@ -56,11 +54,5 @@ class EC2QueryProtocolGenerator : AWSHTTPBindingProtocolGenerator(EC2QueryCustom
56
54
override fun httpBodyMembers (
57
55
ctx : ProtocolGenerator .GenerationContext ,
58
56
shape : Shape ,
59
- ): List <MemberShape > =
60
- shape
61
- .members()
62
- // The only place an input member can be bound to in EC2Query other than the body
63
- // is the host prefix, using the host label trait.
64
- .filter { ! it.hasTrait<HostLabelTrait >() }
65
- .toList()
57
+ ): List <MemberShape > = shape.members().toList()
66
58
}
You can’t perform that action at this time.
0 commit comments