1
15
16 package software.amazon.awssdk.protocols.core;
17
18 import software.amazon.awssdk.annotations.SdkProtectedApi;
19 import software.amazon.awssdk.http.SdkHttpMethod;
20 import software.amazon.awssdk.utils.AttributeMap;
21
22
25 @SdkProtectedApi
26 public final class OperationInfo {
27
28 private final String requestUri;
29 private final SdkHttpMethod httpMethod;
30 private final String operationIdentifier;
31 private final String apiVersion;
32 private final boolean hasExplicitPayloadMember;
33 private final boolean hasPayloadMembers;
34 private final boolean hasStreamingInput;
35 private final boolean hasEventStreamingInput;
36 private final boolean hasEvent;
37 private final AttributeMap additionalMetadata;
38
39 private OperationInfo(Builder builder) {
40 this.requestUri = builder.requestUri;
41 this.httpMethod = builder.httpMethod;
42 this.operationIdentifier = builder.operationIdentifier;
43 this.apiVersion = builder.apiVersion;
44 this.hasExplicitPayloadMember = builder.hasExplicitPayloadMember;
45 this.hasPayloadMembers = builder.hasPayloadMembers;
46 this.hasStreamingInput = builder.hasStreamingInput;
47 this.additionalMetadata = builder.additionalMetadata.build();
48 this.hasEventStreamingInput = builder.hasEventStreamingInput;
49 this.hasEvent = builder.hasEvent;
50 }
51
52
55 public String requestUri() {
56 return requestUri;
57 }
58
59
62 public SdkHttpMethod httpMethod() {
63 return httpMethod;
64 }
65
66
71 public String operationIdentifier() {
72 return operationIdentifier;
73 }
74
75
78 public String apiVersion() {
79 return apiVersion;
80 }
81
82
86 public boolean hasExplicitPayloadMember() {
87 return hasExplicitPayloadMember;
88 }
89
90
94 public boolean hasPayloadMembers() {
95 return hasPayloadMembers;
96 }
97
98
101 public boolean hasStreamingInput() {
102 return hasStreamingInput;
103 }
104
105
108 public boolean hasEventStreamingInput() {
109 return hasEventStreamingInput;
110 }
111
112
115 public boolean hasEvent() {
116 return hasEvent;
117 }
118
119
126 public <T> T addtionalMetadata(OperationMetadataAttribute<T> key) {
127 return additionalMetadata.get(key);
128 }
129
130
133 public static Builder builder() {
134 return new Builder();
135 }
136
137
140 public static final class Builder {
141
142 private String requestUri;
143 private SdkHttpMethod httpMethod;
144 private String operationIdentifier;
145 private String apiVersion;
146 private boolean hasExplicitPayloadMember;
147 private boolean hasPayloadMembers;
148 private boolean hasStreamingInput;
149 private boolean hasEventStreamingInput;
150 private boolean hasEvent;
151 private AttributeMap.Builder additionalMetadata = AttributeMap.builder();
152
153 private Builder() {
154 }
155
156 public Builder requestUri(String requestUri) {
157 this.requestUri = requestUri;
158 return this;
159 }
160
161 public Builder httpMethod(SdkHttpMethod httpMethod) {
162 this.httpMethod = httpMethod;
163 return this;
164 }
165
166 public Builder operationIdentifier(String operationIdentifier) {
167 this.operationIdentifier = operationIdentifier;
168 return this;
169 }
170
171 public Builder apiVersion(String apiVersion) {
172 this.apiVersion = apiVersion;
173 return this;
174 }
175
176 public Builder hasExplicitPayloadMember(boolean hasExplicitPayloadMember) {
177 this.hasExplicitPayloadMember = hasExplicitPayloadMember;
178 return this;
179 }
180
181 public Builder hasPayloadMembers(boolean hasPayloadMembers) {
182 this.hasPayloadMembers = hasPayloadMembers;
183 return this;
184 }
185
186 public Builder hasStreamingInput(boolean hasStreamingInput) {
187 this.hasStreamingInput = hasStreamingInput;
188 return this;
189 }
190
191 public Builder hasEventStreamingInput(boolean hasEventStreamingInput) {
192 this.hasEventStreamingInput = hasEventStreamingInput;
193 return this;
194 }
195
196 public Builder hasEvent(boolean hasEvent) {
197 this.hasEvent = hasEvent;
198 return this;
199 }
200
201
210 public <T> Builder putAdditionalMetadata(OperationMetadataAttribute<T> key, T value) {
211 additionalMetadata.put(key, value);
212 return this;
213 }
214
215
218 public OperationInfo build() {
219 return new OperationInfo(this);
220 }
221 }
222 }
223