|
34 | 34 | import software.amazon.smithy.typescript.codegen.TypeScriptDependency;
|
35 | 35 | import software.amazon.smithy.typescript.codegen.TypeScriptWriter;
|
36 | 36 | import software.amazon.smithy.utils.IoUtils;
|
37 |
| -import software.amazon.smithy.utils.OptionalUtils; |
38 | 37 | import software.amazon.smithy.utils.SmithyInternalApi;
|
39 | 38 |
|
40 | 39 | /**
|
@@ -143,18 +142,17 @@ private void writePartitionHash() {
|
143 | 142 | }
|
144 | 143 | });
|
145 | 144 | writer.write("regionRegex: $S,", partition.regionRegex);
|
146 |
| - OptionalUtils.ifPresentOrElse(partition.getPartitionEndpoint(), |
147 |
| - endpoint -> writer.write("endpoint: $S,", endpoint), |
148 |
| - // TODO: Remove hostname after fully switching to variants. |
149 |
| - () -> writer.write("hostname: $S,", partition.hostnameTemplate)); |
150 |
| - List<Node> variants = partition.getVariants(); |
151 |
| - if (!variants.isEmpty()) { |
152 |
| - writer.openBlock("variants: [", "],", () -> { |
153 |
| - variants.forEach(variant -> { |
154 |
| - writer.write("$L, ", Node.prettyPrintJson(variant)); |
155 |
| - }); |
| 145 | + |
| 146 | + // TODO: Remove hostname after fully switching to variants. |
| 147 | + writer.write("hostname: $S,", partition.hostnameTemplate); |
| 148 | + writer.openBlock("variants: [", "],", () -> { |
| 149 | + partition.getVariants().forEach(variant -> { |
| 150 | + writer.write("$L, ", Node.prettyPrintJson(variant)); |
156 | 151 | });
|
157 |
| - } |
| 152 | + }); |
| 153 | + |
| 154 | + partition.getPartitionEndpoint().ifPresent( |
| 155 | + endpoint -> writer.write("endpoint: $S,", endpoint)); |
158 | 156 | });
|
159 | 157 | });
|
160 | 158 | });
|
@@ -275,8 +273,8 @@ List<Node> getVariants() {
|
275 | 273 | hostname = hostname.replace("{dnsSuffix}", dnsSuffix);
|
276 | 274 | allVariants.add(variantNode.withMember("hostname", hostname).withoutMember("dnsSuffix"));
|
277 | 275 | });
|
278 |
| - allVariants.add(getDefaultVariant(hostnameTemplate)); |
279 | 276 | }
|
| 277 | + allVariants.add(getDefaultVariant(hostnameTemplate)); |
280 | 278 |
|
281 | 279 | return allVariants;
|
282 | 280 | }
|
|
0 commit comments