diff --git a/generators/java/sdk/CHANGELOG.md b/generators/java/sdk/CHANGELOG.md index e00930126b6..ab463514b81 100644 --- a/generators/java/sdk/CHANGELOG.md +++ b/generators/java/sdk/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.8.2] - 2024-02-21 +- Fix: File upload endpoints no longer fail to compile because the reference to + the mime type variable is present. + + ```java + // Code that failed to compile + String fileMimeType = Files.probeContentType(file.toPath()); + MediaType fileMediaType = fileMimeType != null ? MediaType.parse(mimeType) : null; // mimeType undefined + // Code that now compiles + MediaType fileMediaType = fileMimeType != null ? MediaType.parse(fileMimeType) : null; + ``` + ## [0.8.1] - 2024-02-14 - Feature: The RequestOptions object now supports configuring an optional timeout to apply per-request. ```java @@ -14,7 +26,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 client.films.list(ro); ``` - ## [0.8.0] - 2024-02-11 - Feature: The SDK generator now supports whitelabelling. When this is turned on, there will be no mention of Fern in the generated code. diff --git a/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/WrappedRequestEndpointWriter.java b/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/WrappedRequestEndpointWriter.java index 06389e20bfa..220a4166b63 100644 --- a/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/WrappedRequestEndpointWriter.java +++ b/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/WrappedRequestEndpointWriter.java @@ -345,18 +345,19 @@ private void initializeMultipartBody( requestBodyCodeBlock .beginControlFlow("if ($N.isPresent())", getFilePropertyParameterName(fileProperty)) .addStatement( - "String $L = $T.probeContentType($L.toPath())", + "String $L = $T.probeContentType($L.get().toPath())", mimeTypeVariableName, Files.class, filePropertyParameterName) .addStatement( - "$T $L = $L != null ? $T.parse(mimeType) : null", + "$T $L = $L != null ? $T.parse($L) : null", MediaType.class, mediaTypeVariableName, mimeTypeVariableName, - MediaType.class) + MediaType.class, + mimeTypeVariableName) .addStatement( - "$L.addFormDataPart($S, $L.getName(), $T.create($L, $L.get()))", + "$L.addFormDataPart($S, $L.get().getName(), $T.create($L, $L.get()))", getMultipartBodyPropertiesName(), fileProperty.getKey().getWireValue(), filePropertyParameterName, @@ -372,11 +373,12 @@ private void initializeMultipartBody( Files.class, filePropertyParameterName) .addStatement( - "$T $L = $L != null ? $T.parse(mimeType) : null", + "$T $L = $L != null ? $T.parse($L) : null", MediaType.class, mediaTypeVariableName, mimeTypeVariableName, - MediaType.class) + MediaType.class, + mimeTypeVariableName) .addStatement( "$L.addFormDataPart($S, $L.getName(), $T.create($L, $L))", getMultipartBodyPropertiesName(), diff --git a/seed/java-model/file-upload/src/main/java/com/seed/fileUpload/model/service/MaybeList.java b/seed/java-model/file-upload/src/main/java/com/seed/fileUpload/model/service/MaybeList.java deleted file mode 100644 index 96ffe124c8a..00000000000 --- a/seed/java-model/file-upload/src/main/java/com/seed/fileUpload/model/service/MaybeList.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.fileUpload.model.service; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.seed.fileUpload.core.ObjectMappers; -import java.io.IOException; -import java.util.List; -import java.util.Objects; - -@JsonDeserialize(using = MaybeList.Deserializer.class) -public final class MaybeList { - private final Object value; - - private final int type; - - private MaybeList(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((List) this.value); - } else if (this.type == 2) { - return visitor.visit((int) this.value); - } else if (this.type == 3) { - return visitor.visit((List) this.value); - } else if (this.type == 4) { - return visitor.visit((List>) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MaybeList && equalTo((MaybeList) other); - } - - private boolean equalTo(MaybeList other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static MaybeList of(String value) { - return new MaybeList(value, 0); - } - - public static MaybeList of(List value) { - return new MaybeList(value, 1); - } - - public static MaybeList of(int value) { - return new MaybeList(value, 2); - } - - public static MaybeList of(List value) { - return new MaybeList(value, 3); - } - - public static MaybeList of(List> value) { - return new MaybeList(value, 4); - } - - public interface Visitor { - T visit(String value); - - T visit(List value); - - T visit(int value); - - T visit(List value); - - T visit(List> value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(MaybeList.class); - } - - @java.lang.Override - public MaybeList deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); - } catch (IllegalArgumentException e) { - } - if (value instanceof Integer) { - return of((Integer) value); - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>>() {})); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/seed/java-model/file-upload/src/main/java/com/seed/fileUpload/model/service/MaybeListOrSet.java b/seed/java-model/file-upload/src/main/java/com/seed/fileUpload/model/service/MaybeListOrSet.java deleted file mode 100644 index aa3bce91aeb..00000000000 --- a/seed/java-model/file-upload/src/main/java/com/seed/fileUpload/model/service/MaybeListOrSet.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.fileUpload.model.service; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.seed.fileUpload.core.ObjectMappers; -import java.io.IOException; -import java.util.List; -import java.util.Objects; -import java.util.Set; - -@JsonDeserialize(using = MaybeListOrSet.Deserializer.class) -public final class MaybeListOrSet { - private final Object value; - - private final int type; - - private MaybeListOrSet(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((List) this.value); - } else if (this.type == 2) { - return visitor.visit((int) this.value); - } else if (this.type == 3) { - return visitor.visit((List) this.value); - } else if (this.type == 4) { - return visitor.visit((List>) this.value); - } else if (this.type == 5) { - return visitor.visit((Set) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MaybeListOrSet && equalTo((MaybeListOrSet) other); - } - - private boolean equalTo(MaybeListOrSet other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static MaybeListOrSet of(String value) { - return new MaybeListOrSet(value, 0); - } - - public static MaybeListOrSet of(List value) { - return new MaybeListOrSet(value, 1); - } - - public static MaybeListOrSet of(int value) { - return new MaybeListOrSet(value, 2); - } - - public static MaybeListOrSet of(List value) { - return new MaybeListOrSet(value, 3); - } - - public static MaybeListOrSet of(List> value) { - return new MaybeListOrSet(value, 4); - } - - public static MaybeListOrSet of(Set value) { - return new MaybeListOrSet(value, 5); - } - - public interface Visitor { - T visit(String value); - - T visit(List value); - - T visit(int value); - - T visit(List value); - - T visit(List> value); - - T visit(Set value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(MaybeListOrSet.class); - } - - @java.lang.Override - public MaybeListOrSet deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); - } catch (IllegalArgumentException e) { - } - if (value instanceof Integer) { - return of((Integer) value); - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>>() {})); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/seed/java-model/seed.yml b/seed/java-model/seed.yml index b38931672b2..1302ae8bd21 100644 --- a/seed/java-model/seed.yml +++ b/seed/java-model/seed.yml @@ -19,5 +19,4 @@ allowedFailures: - extends - reserved-keywords - trace - - file-upload - - undiscriminated-unions. + - undiscriminated-unions diff --git a/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/ServiceClient.java b/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/ServiceClient.java index c854d72eb86..92b4aed16eb 100644 --- a/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/ServiceClient.java +++ b/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/ServiceClient.java @@ -53,56 +53,39 @@ public void post( } body.addFormDataPart("integer", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getInteger())); String fileMimeType = Files.probeContentType(file.toPath()); - MediaType fileMediaType = fileMimeType != null ? MediaType.parse(mimeType) : null; + MediaType fileMediaType = fileMimeType != null ? MediaType.parse(fileMimeType) : null; body.addFormDataPart("file", file.getName(), RequestBody.create(fileMediaType, file)); String fileListMimeType = Files.probeContentType(fileList.toPath()); - MediaType fileListMediaType = fileListMimeType != null ? MediaType.parse(mimeType) : null; + MediaType fileListMediaType = fileListMimeType != null ? MediaType.parse(fileListMimeType) : null; body.addFormDataPart("fileList", fileList.getName(), RequestBody.create(fileListMediaType, fileList)); if (maybeFile.isPresent()) { - String maybeFileMimeType = Files.probeContentType(maybeFile.toPath()); - MediaType maybeFileMediaType = maybeFileMimeType != null ? MediaType.parse(mimeType) : null; + String maybeFileMimeType = + Files.probeContentType(maybeFile.get().toPath()); + MediaType maybeFileMediaType = maybeFileMimeType != null ? MediaType.parse(maybeFileMimeType) : null; body.addFormDataPart( - "maybeFile", maybeFile.getName(), RequestBody.create(maybeFileMediaType, maybeFile.get())); + "maybeFile", + maybeFile.get().getName(), + RequestBody.create(maybeFileMediaType, maybeFile.get())); } if (maybeFileList.isPresent()) { - String maybeFileListMimeType = Files.probeContentType(maybeFileList.toPath()); - MediaType maybeFileListMediaType = maybeFileListMimeType != null ? MediaType.parse(mimeType) : null; + String maybeFileListMimeType = + Files.probeContentType(maybeFileList.get().toPath()); + MediaType maybeFileListMediaType = + maybeFileListMimeType != null ? MediaType.parse(maybeFileListMimeType) : null; body.addFormDataPart( "maybeFileList", - maybeFileList.getName(), + maybeFileList.get().getName(), RequestBody.create(maybeFileListMediaType, maybeFileList.get())); } if (request.getMaybeInteger().isPresent()) { body.addFormDataPart( "maybeInteger", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getMaybeInteger())); } - body.addFormDataPart( - "listOfStrings", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getListOfStrings())); - body.addFormDataPart( - "setOfStrings", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getSetOfStrings())); if (request.getOptionalListOfStrings().isPresent()) { body.addFormDataPart( "optionalListOfStrings", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getOptionalListOfStrings())); } - if (request.getOptionalSetOfStrings().isPresent()) { - body.addFormDataPart( - "optionalSetOfStrings", - ObjectMappers.JSON_MAPPER.writeValueAsString(request.getOptionalSetOfStrings())); - } - body.addFormDataPart("maybeList", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getMaybeList())); - if (request.getOptionalMaybeList().isPresent()) { - body.addFormDataPart( - "optionalMaybeList", - ObjectMappers.JSON_MAPPER.writeValueAsString(request.getOptionalMaybeList())); - } - body.addFormDataPart( - "maybeListOrSet", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getMaybeListOrSet())); - if (request.getOptionalMaybeListOrSet().isPresent()) { - body.addFormDataPart( - "optionalMaybeListOrSet", - ObjectMappers.JSON_MAPPER.writeValueAsString(request.getOptionalMaybeListOrSet())); - } body.addFormDataPart( "listOfObjects", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getListOfObjects())); } catch (Exception e) { @@ -144,7 +127,7 @@ public void justFile(File file, JustFileRequet request, RequestOptions requestOp MultipartBody.Builder body = new MultipartBody.Builder().setType(MultipartBody.FORM); try { String fileMimeType = Files.probeContentType(file.toPath()); - MediaType fileMediaType = fileMimeType != null ? MediaType.parse(mimeType) : null; + MediaType fileMediaType = fileMimeType != null ? MediaType.parse(fileMimeType) : null; body.addFormDataPart("file", file.getName(), RequestBody.create(fileMediaType, file)); } catch (Exception e) { throw new RuntimeException(e); @@ -198,7 +181,7 @@ public void justFileWithQueryParams( MultipartBody.Builder body = new MultipartBody.Builder().setType(MultipartBody.FORM); try { String fileMimeType = Files.probeContentType(file.toPath()); - MediaType fileMediaType = fileMimeType != null ? MediaType.parse(mimeType) : null; + MediaType fileMediaType = fileMimeType != null ? MediaType.parse(fileMimeType) : null; body.addFormDataPart("file", file.getName(), RequestBody.create(fileMediaType, file)); } catch (Exception e) { throw new RuntimeException(e); diff --git a/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/requests/MyRequest.java b/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/requests/MyRequest.java index cdb4d3af401..c77ba5f8658 100644 --- a/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/requests/MyRequest.java +++ b/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/requests/MyRequest.java @@ -12,17 +12,13 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seed.fileUpload.core.ObjectMappers; -import com.seed.fileUpload.resources.service.types.MaybeList; -import com.seed.fileUpload.resources.service.types.MaybeListOrSet; import com.seed.fileUpload.resources.service.types.MyObject; import java.util.ArrayList; import java.util.HashMap; -import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; -import java.util.Set; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = MyRequest.Builder.class) @@ -33,22 +29,8 @@ public final class MyRequest { private final Optional maybeInteger; - private final List listOfStrings; - - private final Set setOfStrings; - private final Optional> optionalListOfStrings; - private final Optional> optionalSetOfStrings; - - private final MaybeList maybeList; - - private final Optional optionalMaybeList; - - private final MaybeListOrSet maybeListOrSet; - - private final Optional optionalMaybeListOrSet; - private final List listOfObjects; private final Map additionalProperties; @@ -57,27 +39,13 @@ private MyRequest( Optional maybeString, int integer, Optional maybeInteger, - List listOfStrings, - Set setOfStrings, Optional> optionalListOfStrings, - Optional> optionalSetOfStrings, - MaybeList maybeList, - Optional optionalMaybeList, - MaybeListOrSet maybeListOrSet, - Optional optionalMaybeListOrSet, List listOfObjects, Map additionalProperties) { this.maybeString = maybeString; this.integer = integer; this.maybeInteger = maybeInteger; - this.listOfStrings = listOfStrings; - this.setOfStrings = setOfStrings; this.optionalListOfStrings = optionalListOfStrings; - this.optionalSetOfStrings = optionalSetOfStrings; - this.maybeList = maybeList; - this.optionalMaybeList = optionalMaybeList; - this.maybeListOrSet = maybeListOrSet; - this.optionalMaybeListOrSet = optionalMaybeListOrSet; this.listOfObjects = listOfObjects; this.additionalProperties = additionalProperties; } @@ -97,46 +65,11 @@ public Optional getMaybeInteger() { return maybeInteger; } - @JsonProperty("listOfStrings") - public List getListOfStrings() { - return listOfStrings; - } - - @JsonProperty("setOfStrings") - public Set getSetOfStrings() { - return setOfStrings; - } - @JsonProperty("optionalListOfStrings") public Optional> getOptionalListOfStrings() { return optionalListOfStrings; } - @JsonProperty("optionalSetOfStrings") - public Optional> getOptionalSetOfStrings() { - return optionalSetOfStrings; - } - - @JsonProperty("maybeList") - public MaybeList getMaybeList() { - return maybeList; - } - - @JsonProperty("optionalMaybeList") - public Optional getOptionalMaybeList() { - return optionalMaybeList; - } - - @JsonProperty("maybeListOrSet") - public MaybeListOrSet getMaybeListOrSet() { - return maybeListOrSet; - } - - @JsonProperty("optionalMaybeListOrSet") - public Optional getOptionalMaybeListOrSet() { - return optionalMaybeListOrSet; - } - @JsonProperty("listOfObjects") public List getListOfObjects() { return listOfObjects; @@ -157,32 +90,14 @@ private boolean equalTo(MyRequest other) { return maybeString.equals(other.maybeString) && integer == other.integer && maybeInteger.equals(other.maybeInteger) - && listOfStrings.equals(other.listOfStrings) - && setOfStrings.equals(other.setOfStrings) && optionalListOfStrings.equals(other.optionalListOfStrings) - && optionalSetOfStrings.equals(other.optionalSetOfStrings) - && maybeList.equals(other.maybeList) - && optionalMaybeList.equals(other.optionalMaybeList) - && maybeListOrSet.equals(other.maybeListOrSet) - && optionalMaybeListOrSet.equals(other.optionalMaybeListOrSet) && listOfObjects.equals(other.listOfObjects); } @java.lang.Override public int hashCode() { return Objects.hash( - this.maybeString, - this.integer, - this.maybeInteger, - this.listOfStrings, - this.setOfStrings, - this.optionalListOfStrings, - this.optionalSetOfStrings, - this.maybeList, - this.optionalMaybeList, - this.maybeListOrSet, - this.optionalMaybeListOrSet, - this.listOfObjects); + this.maybeString, this.integer, this.maybeInteger, this.optionalListOfStrings, this.listOfObjects); } @java.lang.Override @@ -195,19 +110,11 @@ public static IntegerStage builder() { } public interface IntegerStage { - MaybeListStage integer(int integer); + _FinalStage integer(int integer); Builder from(MyRequest other); } - public interface MaybeListStage { - MaybeListOrSetStage maybeList(MaybeList maybeList); - } - - public interface MaybeListOrSetStage { - _FinalStage maybeListOrSet(MaybeListOrSet maybeListOrSet); - } - public interface _FinalStage { MyRequest build(); @@ -219,34 +126,10 @@ public interface _FinalStage { _FinalStage maybeInteger(Integer maybeInteger); - _FinalStage listOfStrings(List listOfStrings); - - _FinalStage addListOfStrings(String listOfStrings); - - _FinalStage addAllListOfStrings(List listOfStrings); - - _FinalStage setOfStrings(Set setOfStrings); - - _FinalStage addSetOfStrings(String setOfStrings); - - _FinalStage addAllSetOfStrings(Set setOfStrings); - _FinalStage optionalListOfStrings(Optional> optionalListOfStrings); _FinalStage optionalListOfStrings(List optionalListOfStrings); - _FinalStage optionalSetOfStrings(Optional> optionalSetOfStrings); - - _FinalStage optionalSetOfStrings(Set optionalSetOfStrings); - - _FinalStage optionalMaybeList(Optional optionalMaybeList); - - _FinalStage optionalMaybeList(MaybeList optionalMaybeList); - - _FinalStage optionalMaybeListOrSet(Optional optionalMaybeListOrSet); - - _FinalStage optionalMaybeListOrSet(MaybeListOrSet optionalMaybeListOrSet); - _FinalStage listOfObjects(List listOfObjects); _FinalStage addListOfObjects(MyObject listOfObjects); @@ -255,27 +138,13 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IntegerStage, MaybeListStage, MaybeListOrSetStage, _FinalStage { + public static final class Builder implements IntegerStage, _FinalStage { private int integer; - private MaybeList maybeList; - - private MaybeListOrSet maybeListOrSet; - private List listOfObjects = new ArrayList<>(); - private Optional optionalMaybeListOrSet = Optional.empty(); - - private Optional optionalMaybeList = Optional.empty(); - - private Optional> optionalSetOfStrings = Optional.empty(); - private Optional> optionalListOfStrings = Optional.empty(); - private Set setOfStrings = new LinkedHashSet<>(); - - private List listOfStrings = new ArrayList<>(); - private Optional maybeInteger = Optional.empty(); private Optional maybeString = Optional.empty(); @@ -290,39 +159,18 @@ public Builder from(MyRequest other) { maybeString(other.getMaybeString()); integer(other.getInteger()); maybeInteger(other.getMaybeInteger()); - listOfStrings(other.getListOfStrings()); - setOfStrings(other.getSetOfStrings()); optionalListOfStrings(other.getOptionalListOfStrings()); - optionalSetOfStrings(other.getOptionalSetOfStrings()); - maybeList(other.getMaybeList()); - optionalMaybeList(other.getOptionalMaybeList()); - maybeListOrSet(other.getMaybeListOrSet()); - optionalMaybeListOrSet(other.getOptionalMaybeListOrSet()); listOfObjects(other.getListOfObjects()); return this; } @java.lang.Override @JsonSetter("integer") - public MaybeListStage integer(int integer) { + public _FinalStage integer(int integer) { this.integer = integer; return this; } - @java.lang.Override - @JsonSetter("maybeList") - public MaybeListOrSetStage maybeList(MaybeList maybeList) { - this.maybeList = maybeList; - return this; - } - - @java.lang.Override - @JsonSetter("maybeListOrSet") - public _FinalStage maybeListOrSet(MaybeListOrSet maybeListOrSet) { - this.maybeListOrSet = maybeListOrSet; - return this; - } - @java.lang.Override public _FinalStage addAllListOfObjects(List listOfObjects) { this.listOfObjects.addAll(listOfObjects); @@ -343,45 +191,6 @@ public _FinalStage listOfObjects(List listOfObjects) { return this; } - @java.lang.Override - public _FinalStage optionalMaybeListOrSet(MaybeListOrSet optionalMaybeListOrSet) { - this.optionalMaybeListOrSet = Optional.of(optionalMaybeListOrSet); - return this; - } - - @java.lang.Override - @JsonSetter(value = "optionalMaybeListOrSet", nulls = Nulls.SKIP) - public _FinalStage optionalMaybeListOrSet(Optional optionalMaybeListOrSet) { - this.optionalMaybeListOrSet = optionalMaybeListOrSet; - return this; - } - - @java.lang.Override - public _FinalStage optionalMaybeList(MaybeList optionalMaybeList) { - this.optionalMaybeList = Optional.of(optionalMaybeList); - return this; - } - - @java.lang.Override - @JsonSetter(value = "optionalMaybeList", nulls = Nulls.SKIP) - public _FinalStage optionalMaybeList(Optional optionalMaybeList) { - this.optionalMaybeList = optionalMaybeList; - return this; - } - - @java.lang.Override - public _FinalStage optionalSetOfStrings(Set optionalSetOfStrings) { - this.optionalSetOfStrings = Optional.of(optionalSetOfStrings); - return this; - } - - @java.lang.Override - @JsonSetter(value = "optionalSetOfStrings", nulls = Nulls.SKIP) - public _FinalStage optionalSetOfStrings(Optional> optionalSetOfStrings) { - this.optionalSetOfStrings = optionalSetOfStrings; - return this; - } - @java.lang.Override public _FinalStage optionalListOfStrings(List optionalListOfStrings) { this.optionalListOfStrings = Optional.of(optionalListOfStrings); @@ -395,46 +204,6 @@ public _FinalStage optionalListOfStrings(Optional> optionalListOfSt return this; } - @java.lang.Override - public _FinalStage addAllSetOfStrings(Set setOfStrings) { - this.setOfStrings.addAll(setOfStrings); - return this; - } - - @java.lang.Override - public _FinalStage addSetOfStrings(String setOfStrings) { - this.setOfStrings.add(setOfStrings); - return this; - } - - @java.lang.Override - @JsonSetter(value = "setOfStrings", nulls = Nulls.SKIP) - public _FinalStage setOfStrings(Set setOfStrings) { - this.setOfStrings.clear(); - this.setOfStrings.addAll(setOfStrings); - return this; - } - - @java.lang.Override - public _FinalStage addAllListOfStrings(List listOfStrings) { - this.listOfStrings.addAll(listOfStrings); - return this; - } - - @java.lang.Override - public _FinalStage addListOfStrings(String listOfStrings) { - this.listOfStrings.add(listOfStrings); - return this; - } - - @java.lang.Override - @JsonSetter(value = "listOfStrings", nulls = Nulls.SKIP) - public _FinalStage listOfStrings(List listOfStrings) { - this.listOfStrings.clear(); - this.listOfStrings.addAll(listOfStrings); - return this; - } - @java.lang.Override public _FinalStage maybeInteger(Integer maybeInteger) { this.maybeInteger = Optional.of(maybeInteger); @@ -464,19 +233,7 @@ public _FinalStage maybeString(Optional maybeString) { @java.lang.Override public MyRequest build() { return new MyRequest( - maybeString, - integer, - maybeInteger, - listOfStrings, - setOfStrings, - optionalListOfStrings, - optionalSetOfStrings, - maybeList, - optionalMaybeList, - maybeListOrSet, - optionalMaybeListOrSet, - listOfObjects, - additionalProperties); + maybeString, integer, maybeInteger, optionalListOfStrings, listOfObjects, additionalProperties); } } } diff --git a/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/types/MaybeList.java b/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/types/MaybeList.java deleted file mode 100644 index 9b83a48f3b8..00000000000 --- a/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/types/MaybeList.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.fileUpload.resources.service.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.seed.fileUpload.core.ObjectMappers; -import java.io.IOException; -import java.util.List; -import java.util.Objects; - -@JsonDeserialize(using = MaybeList.Deserializer.class) -public final class MaybeList { - private final Object value; - - private final int type; - - private MaybeList(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((List) this.value); - } else if (this.type == 2) { - return visitor.visit((int) this.value); - } else if (this.type == 3) { - return visitor.visit((List) this.value); - } else if (this.type == 4) { - return visitor.visit((List>) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MaybeList && equalTo((MaybeList) other); - } - - private boolean equalTo(MaybeList other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static MaybeList of(String value) { - return new MaybeList(value, 0); - } - - public static MaybeList of(List value) { - return new MaybeList(value, 1); - } - - public static MaybeList of(int value) { - return new MaybeList(value, 2); - } - - public static MaybeList of(List value) { - return new MaybeList(value, 3); - } - - public static MaybeList of(List> value) { - return new MaybeList(value, 4); - } - - public interface Visitor { - T visit(String value); - - T visit(List value); - - T visit(int value); - - T visit(List value); - - T visit(List> value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(MaybeList.class); - } - - @java.lang.Override - public MaybeList deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); - } catch (IllegalArgumentException e) { - } - if (value instanceof Integer) { - return of((Integer) value); - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>>() {})); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/types/MaybeListOrSet.java b/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/types/MaybeListOrSet.java deleted file mode 100644 index 9e544e49b1b..00000000000 --- a/seed/java-sdk/file-upload/src/main/java/com/seed/fileUpload/resources/service/types/MaybeListOrSet.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.fileUpload.resources.service.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.seed.fileUpload.core.ObjectMappers; -import java.io.IOException; -import java.util.List; -import java.util.Objects; -import java.util.Set; - -@JsonDeserialize(using = MaybeListOrSet.Deserializer.class) -public final class MaybeListOrSet { - private final Object value; - - private final int type; - - private MaybeListOrSet(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((List) this.value); - } else if (this.type == 2) { - return visitor.visit((int) this.value); - } else if (this.type == 3) { - return visitor.visit((List) this.value); - } else if (this.type == 4) { - return visitor.visit((List>) this.value); - } else if (this.type == 5) { - return visitor.visit((Set) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MaybeListOrSet && equalTo((MaybeListOrSet) other); - } - - private boolean equalTo(MaybeListOrSet other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static MaybeListOrSet of(String value) { - return new MaybeListOrSet(value, 0); - } - - public static MaybeListOrSet of(List value) { - return new MaybeListOrSet(value, 1); - } - - public static MaybeListOrSet of(int value) { - return new MaybeListOrSet(value, 2); - } - - public static MaybeListOrSet of(List value) { - return new MaybeListOrSet(value, 3); - } - - public static MaybeListOrSet of(List> value) { - return new MaybeListOrSet(value, 4); - } - - public static MaybeListOrSet of(Set value) { - return new MaybeListOrSet(value, 5); - } - - public interface Visitor { - T visit(String value); - - T visit(List value); - - T visit(int value); - - T visit(List value); - - T visit(List> value); - - T visit(Set value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(MaybeListOrSet.class); - } - - @java.lang.Override - public MaybeListOrSet deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); - } catch (IllegalArgumentException e) { - } - if (value instanceof Integer) { - return of((Integer) value); - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>>() {})); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/seed/java-sdk/seed.yml b/seed/java-sdk/seed.yml index c803826c958..47d73962c68 100644 --- a/seed/java-sdk/seed.yml +++ b/seed/java-sdk/seed.yml @@ -34,7 +34,6 @@ allowedFailures: - response-property - examples - exhaustive:local-files - - file-upload - idempotency-headers - trace - undiscriminated-unions diff --git a/seed/openapi/file-upload/openapi.yml b/seed/openapi/file-upload/openapi.yml index a9054f3a8ad..7a297f975b2 100644 --- a/seed/openapi/file-upload/openapi.yml +++ b/seed/openapi/file-upload/openapi.yml @@ -39,34 +39,11 @@ paths: maybeInteger: type: integer nullable: true - listOfStrings: - type: array - items: - type: string - setOfStrings: - type: array - items: - type: string optionalListOfStrings: type: array items: type: string nullable: true - optionalSetOfStrings: - type: array - items: - type: string - nullable: true - maybeList: - $ref: '#/components/schemas/MaybeList' - optionalMaybeList: - $ref: '#/components/schemas/MaybeList' - nullable: true - maybeListOrSet: - $ref: '#/components/schemas/MaybeListOrSet' - optionalMaybeListOrSet: - $ref: '#/components/schemas/MaybeListOrSet' - nullable: true listOfObjects: type: array items: @@ -143,41 +120,6 @@ paths: format: binary components: schemas: - MaybeList: - title: MaybeList - oneOf: - - type: string - - type: array - items: - type: string - - type: integer - - type: array - items: - type: integer - - type: array - items: - type: array - items: - type: integer - MaybeListOrSet: - title: MaybeListOrSet - oneOf: - - type: string - - type: array - items: - type: string - - type: integer - - type: array - items: - type: integer - - type: array - items: - type: array - items: - type: integer - - type: array - items: - type: string MyObject: title: MyObject type: object diff --git a/seed/postman/file-upload/collection.json b/seed/postman/file-upload/collection.json index f02762a9da1..b6b570ea50f 100644 --- a/seed/postman/file-upload/collection.json +++ b/seed/postman/file-upload/collection.json @@ -37,7 +37,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"maybeString\": \"example\",\n \"integer\": 0,\n \"maybeInteger\": 0,\n \"listOfStrings\": [\n \"example\"\n ],\n \"setOfStrings\": [\n \"example\"\n ],\n \"optionalListOfStrings\": [\n \"example\"\n ],\n \"optionalSetOfStrings\": [\n \"example\"\n ],\n \"maybeList\": \"example\",\n \"maybeListOrSet\": \"example\",\n \"listOfObjects\": [\n {\n \"foo\": \"example\"\n }\n ]\n}", + "raw": "{\n \"maybeString\": \"example\",\n \"integer\": 0,\n \"maybeInteger\": 0,\n \"optionalListOfStrings\": [\n \"example\"\n ],\n \"listOfObjects\": [\n {\n \"foo\": \"example\"\n }\n ]\n}", "options": { "raw": { "language": "json" diff --git a/seed/pydantic/file-upload/src/seed/file_upload/__init__.py b/seed/pydantic/file-upload/src/seed/file_upload/__init__.py index 5a516e3b7d9..67e9e1a21dc 100644 --- a/seed/pydantic/file-upload/src/seed/file_upload/__init__.py +++ b/seed/pydantic/file-upload/src/seed/file_upload/__init__.py @@ -1,5 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from .resources import MaybeList, MaybeListOrSet, MyObject, service +from .resources import MyObject, service -__all__ = ["MaybeList", "MaybeListOrSet", "MyObject", "service"] +__all__ = ["MyObject", "service"] diff --git a/seed/pydantic/file-upload/src/seed/file_upload/resources/__init__.py b/seed/pydantic/file-upload/src/seed/file_upload/resources/__init__.py index 8f6146cfbf6..cd677494a1d 100644 --- a/seed/pydantic/file-upload/src/seed/file_upload/resources/__init__.py +++ b/seed/pydantic/file-upload/src/seed/file_upload/resources/__init__.py @@ -1,6 +1,6 @@ # This file was auto-generated by Fern from our API Definition. from . import service -from .service import MaybeList, MaybeListOrSet, MyObject +from .service import MyObject -__all__ = ["MaybeList", "MaybeListOrSet", "MyObject", "service"] +__all__ = ["MyObject", "service"] diff --git a/seed/pydantic/file-upload/src/seed/file_upload/resources/service/__init__.py b/seed/pydantic/file-upload/src/seed/file_upload/resources/service/__init__.py index d8516eb97d2..860b374d461 100644 --- a/seed/pydantic/file-upload/src/seed/file_upload/resources/service/__init__.py +++ b/seed/pydantic/file-upload/src/seed/file_upload/resources/service/__init__.py @@ -1,7 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from .maybe_list import MaybeList -from .maybe_list_or_set import MaybeListOrSet from .my_object import MyObject -__all__ = ["MaybeList", "MaybeListOrSet", "MyObject"] +__all__ = ["MyObject"] diff --git a/seed/pydantic/file-upload/src/seed/file_upload/resources/service/maybe_list.py b/seed/pydantic/file-upload/src/seed/file_upload/resources/service/maybe_list.py deleted file mode 100644 index 8a50df962ce..00000000000 --- a/seed/pydantic/file-upload/src/seed/file_upload/resources/service/maybe_list.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -MaybeList = typing.Union[str, typing.List[str], int, typing.List[int], typing.List[typing.List[int]]] diff --git a/seed/pydantic/file-upload/src/seed/file_upload/resources/service/maybe_list_or_set.py b/seed/pydantic/file-upload/src/seed/file_upload/resources/service/maybe_list_or_set.py deleted file mode 100644 index 0cbc7721135..00000000000 --- a/seed/pydantic/file-upload/src/seed/file_upload/resources/service/maybe_list_or_set.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -MaybeListOrSet = typing.Union[ - str, typing.List[str], int, typing.List[int], typing.List[typing.List[int]], typing.Set[str] -] diff --git a/seed/python-sdk/file-upload/src/seed/__init__.py b/seed/python-sdk/file-upload/src/seed/__init__.py index 5a516e3b7d9..67e9e1a21dc 100644 --- a/seed/python-sdk/file-upload/src/seed/__init__.py +++ b/seed/python-sdk/file-upload/src/seed/__init__.py @@ -1,5 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from .resources import MaybeList, MaybeListOrSet, MyObject, service +from .resources import MyObject, service -__all__ = ["MaybeList", "MaybeListOrSet", "MyObject", "service"] +__all__ = ["MyObject", "service"] diff --git a/seed/python-sdk/file-upload/src/seed/resources/__init__.py b/seed/python-sdk/file-upload/src/seed/resources/__init__.py index 8f6146cfbf6..cd677494a1d 100644 --- a/seed/python-sdk/file-upload/src/seed/resources/__init__.py +++ b/seed/python-sdk/file-upload/src/seed/resources/__init__.py @@ -1,6 +1,6 @@ # This file was auto-generated by Fern from our API Definition. from . import service -from .service import MaybeList, MaybeListOrSet, MyObject +from .service import MyObject -__all__ = ["MaybeList", "MaybeListOrSet", "MyObject", "service"] +__all__ = ["MyObject", "service"] diff --git a/seed/python-sdk/file-upload/src/seed/resources/service/__init__.py b/seed/python-sdk/file-upload/src/seed/resources/service/__init__.py index ffcba8b33ac..ee4df32757e 100644 --- a/seed/python-sdk/file-upload/src/seed/resources/service/__init__.py +++ b/seed/python-sdk/file-upload/src/seed/resources/service/__init__.py @@ -1,5 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from .types import MaybeList, MaybeListOrSet, MyObject +from .types import MyObject -__all__ = ["MaybeList", "MaybeListOrSet", "MyObject"] +__all__ = ["MyObject"] diff --git a/seed/python-sdk/file-upload/src/seed/resources/service/client.py b/seed/python-sdk/file-upload/src/seed/resources/service/client.py index 4a6affffc5a..e46936ab729 100644 --- a/seed/python-sdk/file-upload/src/seed/resources/service/client.py +++ b/seed/python-sdk/file-upload/src/seed/resources/service/client.py @@ -10,8 +10,6 @@ from ...core.jsonable_encoder import jsonable_encoder from ...core.remove_none_from_dict import remove_none_from_dict from ...core.request_options import RequestOptions -from .types.maybe_list import MaybeList -from .types.maybe_list_or_set import MaybeListOrSet from .types.my_object import MyObject # this is used as the default value for optional parameters @@ -32,14 +30,7 @@ def post( maybe_file: typing.Optional[core.File] = None, maybe_file_list: typing.Optional[typing.List[core.File]] = None, maybe_integer: typing.Optional[int] = None, - list_of_strings: typing.List[str], - set_of_strings: typing.Set[str], optional_list_of_strings: typing.Optional[typing.List[str]] = None, - optional_set_of_strings: typing.Optional[typing.Set[str]] = None, - maybe_list: MaybeList, - optional_maybe_list: typing.Optional[MaybeList] = None, - maybe_list_or_set: MaybeListOrSet, - optional_maybe_list_or_set: typing.Optional[MaybeListOrSet] = None, list_of_objects: typing.List[MyObject], request_options: typing.Optional[RequestOptions] = None, ) -> None: @@ -59,22 +50,8 @@ def post( - maybe_integer: typing.Optional[int]. - - list_of_strings: typing.List[str]. - - - set_of_strings: typing.Set[str]. - - optional_list_of_strings: typing.Optional[typing.List[str]]. - - optional_set_of_strings: typing.Optional[typing.Set[str]]. - - - maybe_list: MaybeList. - - - optional_maybe_list: typing.Optional[MaybeList]. - - - maybe_list_or_set: MaybeListOrSet. - - - optional_maybe_list_or_set: typing.Optional[MaybeListOrSet]. - - list_of_objects: typing.List[MyObject]. - request_options: typing.Optional[RequestOptions]. Request-specific configuration. @@ -91,14 +68,7 @@ def post( "maybeString": maybe_string, "integer": integer, "maybeInteger": maybe_integer, - "listOfStrings": list_of_strings, - "setOfStrings": set_of_strings, "optionalListOfStrings": optional_list_of_strings, - "optionalSetOfStrings": optional_set_of_strings, - "maybeList": maybe_list, - "optionalMaybeList": optional_maybe_list, - "maybeListOrSet": maybe_list_or_set, - "optionalMaybeListOrSet": optional_maybe_list_or_set, "listOfObjects": list_of_objects, } ) @@ -111,14 +81,7 @@ def post( "maybeString": maybe_string, "integer": integer, "maybeInteger": maybe_integer, - "listOfStrings": list_of_strings, - "setOfStrings": set_of_strings, "optionalListOfStrings": optional_list_of_strings, - "optionalSetOfStrings": optional_set_of_strings, - "maybeList": maybe_list, - "optionalMaybeList": optional_maybe_list, - "maybeListOrSet": maybe_list_or_set, - "optionalMaybeListOrSet": optional_maybe_list_or_set, "listOfObjects": list_of_objects, } ) @@ -278,14 +241,7 @@ async def post( maybe_file: typing.Optional[core.File] = None, maybe_file_list: typing.Optional[typing.List[core.File]] = None, maybe_integer: typing.Optional[int] = None, - list_of_strings: typing.List[str], - set_of_strings: typing.Set[str], optional_list_of_strings: typing.Optional[typing.List[str]] = None, - optional_set_of_strings: typing.Optional[typing.Set[str]] = None, - maybe_list: MaybeList, - optional_maybe_list: typing.Optional[MaybeList] = None, - maybe_list_or_set: MaybeListOrSet, - optional_maybe_list_or_set: typing.Optional[MaybeListOrSet] = None, list_of_objects: typing.List[MyObject], request_options: typing.Optional[RequestOptions] = None, ) -> None: @@ -305,22 +261,8 @@ async def post( - maybe_integer: typing.Optional[int]. - - list_of_strings: typing.List[str]. - - - set_of_strings: typing.Set[str]. - - optional_list_of_strings: typing.Optional[typing.List[str]]. - - optional_set_of_strings: typing.Optional[typing.Set[str]]. - - - maybe_list: MaybeList. - - - optional_maybe_list: typing.Optional[MaybeList]. - - - maybe_list_or_set: MaybeListOrSet. - - - optional_maybe_list_or_set: typing.Optional[MaybeListOrSet]. - - list_of_objects: typing.List[MyObject]. - request_options: typing.Optional[RequestOptions]. Request-specific configuration. @@ -337,14 +279,7 @@ async def post( "maybeString": maybe_string, "integer": integer, "maybeInteger": maybe_integer, - "listOfStrings": list_of_strings, - "setOfStrings": set_of_strings, "optionalListOfStrings": optional_list_of_strings, - "optionalSetOfStrings": optional_set_of_strings, - "maybeList": maybe_list, - "optionalMaybeList": optional_maybe_list, - "maybeListOrSet": maybe_list_or_set, - "optionalMaybeListOrSet": optional_maybe_list_or_set, "listOfObjects": list_of_objects, } ) @@ -357,14 +292,7 @@ async def post( "maybeString": maybe_string, "integer": integer, "maybeInteger": maybe_integer, - "listOfStrings": list_of_strings, - "setOfStrings": set_of_strings, "optionalListOfStrings": optional_list_of_strings, - "optionalSetOfStrings": optional_set_of_strings, - "maybeList": maybe_list, - "optionalMaybeList": optional_maybe_list, - "maybeListOrSet": maybe_list_or_set, - "optionalMaybeListOrSet": optional_maybe_list_or_set, "listOfObjects": list_of_objects, } ) diff --git a/seed/python-sdk/file-upload/src/seed/resources/service/types/__init__.py b/seed/python-sdk/file-upload/src/seed/resources/service/types/__init__.py index d8516eb97d2..860b374d461 100644 --- a/seed/python-sdk/file-upload/src/seed/resources/service/types/__init__.py +++ b/seed/python-sdk/file-upload/src/seed/resources/service/types/__init__.py @@ -1,7 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from .maybe_list import MaybeList -from .maybe_list_or_set import MaybeListOrSet from .my_object import MyObject -__all__ = ["MaybeList", "MaybeListOrSet", "MyObject"] +__all__ = ["MyObject"] diff --git a/seed/python-sdk/file-upload/src/seed/resources/service/types/maybe_list.py b/seed/python-sdk/file-upload/src/seed/resources/service/types/maybe_list.py deleted file mode 100644 index 8a50df962ce..00000000000 --- a/seed/python-sdk/file-upload/src/seed/resources/service/types/maybe_list.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -MaybeList = typing.Union[str, typing.List[str], int, typing.List[int], typing.List[typing.List[int]]] diff --git a/seed/python-sdk/file-upload/src/seed/resources/service/types/maybe_list_or_set.py b/seed/python-sdk/file-upload/src/seed/resources/service/types/maybe_list_or_set.py deleted file mode 100644 index 0cbc7721135..00000000000 --- a/seed/python-sdk/file-upload/src/seed/resources/service/types/maybe_list_or_set.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -MaybeListOrSet = typing.Union[ - str, typing.List[str], int, typing.List[int], typing.List[typing.List[int]], typing.Set[str] -] diff --git a/seed/ruby-model/file-upload/lib/seed_file_upload_client.rb b/seed/ruby-model/file-upload/lib/seed_file_upload_client.rb index 637baf999c3..00aabb254bb 100644 --- a/seed/ruby-model/file-upload/lib/seed_file_upload_client.rb +++ b/seed/ruby-model/file-upload/lib/seed_file_upload_client.rb @@ -1,5 +1,3 @@ # frozen_string_literal: true -require_relative "seed_file_upload_client/service/types/maybe_list" -require_relative "seed_file_upload_client/service/types/maybe_list_or_set" require_relative "seed_file_upload_client/service/types/my_object" diff --git a/seed/ruby-model/file-upload/lib/seed_file_upload_client/service/types/maybe_list.rb b/seed/ruby-model/file-upload/lib/seed_file_upload_client/service/types/maybe_list.rb deleted file mode 100644 index ee66ebe99c9..00000000000 --- a/seed/ruby-model/file-upload/lib/seed_file_upload_client/service/types/maybe_list.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -require "json" - -module SeedFileUploadClient - class Service - class MaybeList - # Deserialize a JSON object to an instance of MaybeList - # - # @param json_object [JSON] - # @return [Service::MaybeList] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - begin - struct.is_a?(String) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Integer) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - struct - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - begin - return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Integer) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - raise("Passed value matched no type within the union, validation failed.") - end - end - end -end diff --git a/seed/ruby-model/file-upload/lib/seed_file_upload_client/service/types/maybe_list_or_set.rb b/seed/ruby-model/file-upload/lib/seed_file_upload_client/service/types/maybe_list_or_set.rb deleted file mode 100644 index 13928fe3e8e..00000000000 --- a/seed/ruby-model/file-upload/lib/seed_file_upload_client/service/types/maybe_list_or_set.rb +++ /dev/null @@ -1,93 +0,0 @@ -# frozen_string_literal: true - -require "json" -require "set" - -module SeedFileUploadClient - class Service - class MaybeListOrSet - # Deserialize a JSON object to an instance of MaybeListOrSet - # - # @param json_object [JSON] - # @return [Service::MaybeListOrSet] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - begin - struct.is_a?(String) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Integer) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Set) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return Set.new(json_object) - rescue StandardError - # noop - end - struct - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - begin - return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Integer) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Set) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - raise("Passed value matched no type within the union, validation failed.") - end - end - end -end diff --git a/seed/ruby-sdk/file-upload/lib/seed_file_upload_client/service/client.rb b/seed/ruby-sdk/file-upload/lib/seed_file_upload_client/service/client.rb index e71f27447b0..7f73ac6905a 100644 --- a/seed/ruby-sdk/file-upload/lib/seed_file_upload_client/service/client.rb +++ b/seed/ruby-sdk/file-upload/lib/seed_file_upload_client/service/client.rb @@ -1,9 +1,6 @@ # frozen_string_literal: true require_relative "../../requests" -require "set" -require_relative "types/maybe_list" -require_relative "types/maybe_list_or_set" require_relative "types/my_object" require_relative "../../core/file_utilities" require "async" @@ -26,20 +23,13 @@ def initialize(request_client:) # @param maybe_file [String, IO] # @param maybe_file_list [String, IO] # @param maybe_integer [Integer] - # @param list_of_strings [Array] - # @param set_of_strings [Set] # @param optional_list_of_strings [Array] - # @param optional_set_of_strings [Set] - # @param maybe_list [String, Array, Integer, Array, Array>] - # @param optional_maybe_list [String, Array, Integer, Array, Array>] - # @param maybe_list_or_set [String, Array, Integer, Array, Array>, Set] - # @param optional_maybe_list_or_set [String, Array, Integer, Array, Array>, Set] # @param list_of_objects [Array] Request of type Array, as a Hash # * :foo (String) # @param request_options [RequestOptions] # @return [Void] - def post(integer:, file:, file_list:, list_of_strings:, set_of_strings:, maybe_list:, maybe_list_or_set:, - list_of_objects:, maybe_string: nil, maybe_file: nil, maybe_file_list: nil, maybe_integer: nil, optional_list_of_strings: nil, optional_set_of_strings: nil, optional_maybe_list: nil, optional_maybe_list_or_set: nil, request_options: nil) + def post(integer:, file:, file_list:, list_of_objects:, maybe_string: nil, maybe_file: nil, maybe_file_list: nil, maybe_integer: nil, + optional_list_of_strings: nil, request_options: nil) @request_client.conn.post("/") do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact @@ -52,14 +42,7 @@ def post(integer:, file:, file_list:, list_of_strings:, set_of_strings:, maybe_l maybeFile: (FileUtilities.as_faraday_multipart(file_like: maybe_file) unless maybe_file.nil?), maybeFileList: (FileUtilities.as_faraday_multipart(file_like: maybe_file_list) unless maybe_file_list.nil?), maybeInteger: maybe_integer, - listOfStrings: list_of_strings, - setOfStrings: set_of_strings, optionalListOfStrings: optional_list_of_strings, - optionalSetOfStrings: optional_set_of_strings, - maybeList: maybe_list, - optionalMaybeList: optional_maybe_list, - maybeListOrSet: maybe_list_or_set, - optionalMaybeListOrSet: optional_maybe_list_or_set, listOfObjects: list_of_objects }.compact end @@ -125,20 +108,13 @@ def initialize(request_client:) # @param maybe_file [String, IO] # @param maybe_file_list [String, IO] # @param maybe_integer [Integer] - # @param list_of_strings [Array] - # @param set_of_strings [Set] # @param optional_list_of_strings [Array] - # @param optional_set_of_strings [Set] - # @param maybe_list [String, Array, Integer, Array, Array>] - # @param optional_maybe_list [String, Array, Integer, Array, Array>] - # @param maybe_list_or_set [String, Array, Integer, Array, Array>, Set] - # @param optional_maybe_list_or_set [String, Array, Integer, Array, Array>, Set] # @param list_of_objects [Array] Request of type Array, as a Hash # * :foo (String) # @param request_options [RequestOptions] # @return [Void] - def post(integer:, file:, file_list:, list_of_strings:, set_of_strings:, maybe_list:, maybe_list_or_set:, - list_of_objects:, maybe_string: nil, maybe_file: nil, maybe_file_list: nil, maybe_integer: nil, optional_list_of_strings: nil, optional_set_of_strings: nil, optional_maybe_list: nil, optional_maybe_list_or_set: nil, request_options: nil) + def post(integer:, file:, file_list:, list_of_objects:, maybe_string: nil, maybe_file: nil, maybe_file_list: nil, maybe_integer: nil, + optional_list_of_strings: nil, request_options: nil) Async do @request_client.conn.post("/") do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? @@ -152,14 +128,7 @@ def post(integer:, file:, file_list:, list_of_strings:, set_of_strings:, maybe_l maybeFile: (FileUtilities.as_faraday_multipart(file_like: maybe_file) unless maybe_file.nil?), maybeFileList: (FileUtilities.as_faraday_multipart(file_like: maybe_file_list) unless maybe_file_list.nil?), maybeInteger: maybe_integer, - listOfStrings: list_of_strings, - setOfStrings: set_of_strings, optionalListOfStrings: optional_list_of_strings, - optionalSetOfStrings: optional_set_of_strings, - maybeList: maybe_list, - optionalMaybeList: optional_maybe_list, - maybeListOrSet: maybe_list_or_set, - optionalMaybeListOrSet: optional_maybe_list_or_set, listOfObjects: list_of_objects }.compact end diff --git a/seed/ruby-sdk/file-upload/lib/seed_file_upload_client/service/types/maybe_list.rb b/seed/ruby-sdk/file-upload/lib/seed_file_upload_client/service/types/maybe_list.rb deleted file mode 100644 index ee66ebe99c9..00000000000 --- a/seed/ruby-sdk/file-upload/lib/seed_file_upload_client/service/types/maybe_list.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -require "json" - -module SeedFileUploadClient - class Service - class MaybeList - # Deserialize a JSON object to an instance of MaybeList - # - # @param json_object [JSON] - # @return [Service::MaybeList] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - begin - struct.is_a?(String) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Integer) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - struct - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - begin - return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Integer) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - raise("Passed value matched no type within the union, validation failed.") - end - end - end -end diff --git a/seed/ruby-sdk/file-upload/lib/seed_file_upload_client/service/types/maybe_list_or_set.rb b/seed/ruby-sdk/file-upload/lib/seed_file_upload_client/service/types/maybe_list_or_set.rb deleted file mode 100644 index 13928fe3e8e..00000000000 --- a/seed/ruby-sdk/file-upload/lib/seed_file_upload_client/service/types/maybe_list_or_set.rb +++ /dev/null @@ -1,93 +0,0 @@ -# frozen_string_literal: true - -require "json" -require "set" - -module SeedFileUploadClient - class Service - class MaybeListOrSet - # Deserialize a JSON object to an instance of MaybeListOrSet - # - # @param json_object [JSON] - # @return [Service::MaybeListOrSet] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - begin - struct.is_a?(String) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Integer) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return json_object - rescue StandardError - # noop - end - begin - struct.is_a?(Set) != false || raise("Passed value for field struct is not the expected type, validation failed.") - return Set.new(json_object) - rescue StandardError - # noop - end - struct - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - begin - return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Integer) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - begin - return obj.is_a?(Set) != false || raise("Passed value for field obj is not the expected type, validation failed.") - rescue StandardError - # noop - end - raise("Passed value matched no type within the union, validation failed.") - end - end - end -end diff --git a/seed/ruby-sdk/file-upload/lib/types_export.rb b/seed/ruby-sdk/file-upload/lib/types_export.rb index 637baf999c3..00aabb254bb 100644 --- a/seed/ruby-sdk/file-upload/lib/types_export.rb +++ b/seed/ruby-sdk/file-upload/lib/types_export.rb @@ -1,5 +1,3 @@ # frozen_string_literal: true -require_relative "seed_file_upload_client/service/types/maybe_list" -require_relative "seed_file_upload_client/service/types/maybe_list_or_set" require_relative "seed_file_upload_client/service/types/my_object" diff --git a/seed/ts-sdk/file-upload/src/api/resources/service/client/Client.ts b/seed/ts-sdk/file-upload/src/api/resources/service/client/Client.ts index 857df8a8a56..0a5720700a5 100644 --- a/seed/ts-sdk/file-upload/src/api/resources/service/client/Client.ts +++ b/seed/ts-sdk/file-upload/src/api/resources/service/client/Client.ts @@ -51,53 +51,12 @@ export class Service { _request.append("maybeInteger", request.maybeInteger.toString()); } - for (const _item of request.listOfStrings) { - _request.append("listOfStrings", _item); - } - - for (const _item of request.setOfStrings) { - _request.append("setOfStrings", _item); - } - if (request.optionalListOfStrings != null) { for (const _item of request.optionalListOfStrings) { _request.append("optionalListOfStrings", _item); } } - if (request.optionalSetOfStrings != null) { - for (const _item of request.optionalSetOfStrings) { - _request.append("optionalSetOfStrings", _item); - } - } - - if (Array.isArray(request.maybeList)) - for (const _item of request.maybeList) { - _request.append("maybeList", typeof _item === "string" ? _item : JSON.stringify(_item)); - } - - if (request.optionalMaybeList != null) { - if (Array.isArray(request.optionalMaybeList)) - for (const _item of request.optionalMaybeList) { - _request.append("optionalMaybeList", typeof _item === "string" ? _item : JSON.stringify(_item)); - } - } - - if (Array.isArray(request.maybeListOrSet) || request.maybeListOrSet instanceof Set) - for (const _item of request.maybeListOrSet) { - _request.append("maybeListOrSet", typeof _item === "string" ? _item : JSON.stringify(_item)); - } - - if (request.optionalMaybeListOrSet != null) { - if (Array.isArray(request.optionalMaybeListOrSet) || request.optionalMaybeListOrSet instanceof Set) - for (const _item of request.optionalMaybeListOrSet) { - _request.append( - "optionalMaybeListOrSet", - typeof _item === "string" ? _item : JSON.stringify(_item) - ); - } - } - for (const _item of request.listOfObjects) { _request.append("listOfObjects", JSON.stringify(_item)); } diff --git a/seed/ts-sdk/file-upload/src/api/resources/service/client/requests/MyRequest.ts b/seed/ts-sdk/file-upload/src/api/resources/service/client/requests/MyRequest.ts index 5cd4c985d68..bff2c60aed0 100644 --- a/seed/ts-sdk/file-upload/src/api/resources/service/client/requests/MyRequest.ts +++ b/seed/ts-sdk/file-upload/src/api/resources/service/client/requests/MyRequest.ts @@ -8,13 +8,6 @@ export interface MyRequest { maybeString?: string; integer: number; maybeInteger?: number; - listOfStrings: string[]; - setOfStrings: Set; optionalListOfStrings?: string[]; - optionalSetOfStrings?: Set; - maybeList: SeedFileUpload.MaybeList; - optionalMaybeList?: SeedFileUpload.MaybeList; - maybeListOrSet: SeedFileUpload.MaybeListOrSet; - optionalMaybeListOrSet?: SeedFileUpload.MaybeListOrSet; listOfObjects: SeedFileUpload.MyObject[]; } diff --git a/seed/ts-sdk/file-upload/src/api/resources/service/types/MaybeList.ts b/seed/ts-sdk/file-upload/src/api/resources/service/types/MaybeList.ts deleted file mode 100644 index 566f40b2cd9..00000000000 --- a/seed/ts-sdk/file-upload/src/api/resources/service/types/MaybeList.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export type MaybeList = string | string[] | number | number[] | number[][]; diff --git a/seed/ts-sdk/file-upload/src/api/resources/service/types/MaybeListOrSet.ts b/seed/ts-sdk/file-upload/src/api/resources/service/types/MaybeListOrSet.ts deleted file mode 100644 index 3434aafee84..00000000000 --- a/seed/ts-sdk/file-upload/src/api/resources/service/types/MaybeListOrSet.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export type MaybeListOrSet = string | string[] | number | number[] | number[][] | Set; diff --git a/seed/ts-sdk/file-upload/src/api/resources/service/types/index.ts b/seed/ts-sdk/file-upload/src/api/resources/service/types/index.ts index ad1ac4050cd..022dc4d9819 100644 --- a/seed/ts-sdk/file-upload/src/api/resources/service/types/index.ts +++ b/seed/ts-sdk/file-upload/src/api/resources/service/types/index.ts @@ -1,3 +1 @@ -export * from "./MaybeList"; -export * from "./MaybeListOrSet"; export * from "./MyObject"; diff --git a/seed/ts-sdk/file-upload/src/serialization/resources/service/types/MaybeList.ts b/seed/ts-sdk/file-upload/src/serialization/resources/service/types/MaybeList.ts deleted file mode 100644 index 40f44a4489c..00000000000 --- a/seed/ts-sdk/file-upload/src/serialization/resources/service/types/MaybeList.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../.."; -import * as SeedFileUpload from "../../../../api"; -import * as core from "../../../../core"; - -export const MaybeList: core.serialization.Schema = - core.serialization.undiscriminatedUnion([ - core.serialization.string(), - core.serialization.list(core.serialization.string()), - core.serialization.number(), - core.serialization.list(core.serialization.number()), - core.serialization.list(core.serialization.list(core.serialization.number())), - ]); - -export declare namespace MaybeList { - type Raw = string | string[] | number | number[] | number[][]; -} diff --git a/seed/ts-sdk/file-upload/src/serialization/resources/service/types/MaybeListOrSet.ts b/seed/ts-sdk/file-upload/src/serialization/resources/service/types/MaybeListOrSet.ts deleted file mode 100644 index f7fd797d61c..00000000000 --- a/seed/ts-sdk/file-upload/src/serialization/resources/service/types/MaybeListOrSet.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../.."; -import * as SeedFileUpload from "../../../../api"; -import * as core from "../../../../core"; - -export const MaybeListOrSet: core.serialization.Schema = - core.serialization.undiscriminatedUnion([ - core.serialization.string(), - core.serialization.list(core.serialization.string()), - core.serialization.number(), - core.serialization.list(core.serialization.number()), - core.serialization.list(core.serialization.list(core.serialization.number())), - core.serialization.set(core.serialization.string()), - ]); - -export declare namespace MaybeListOrSet { - type Raw = string | string[] | number | number[] | number[][] | string[]; -} diff --git a/seed/ts-sdk/file-upload/src/serialization/resources/service/types/index.ts b/seed/ts-sdk/file-upload/src/serialization/resources/service/types/index.ts index ad1ac4050cd..022dc4d9819 100644 --- a/seed/ts-sdk/file-upload/src/serialization/resources/service/types/index.ts +++ b/seed/ts-sdk/file-upload/src/serialization/resources/service/types/index.ts @@ -1,3 +1 @@ -export * from "./MaybeList"; -export * from "./MaybeListOrSet"; export * from "./MyObject"; diff --git a/test-definitions/fern/apis/file-upload/definition/service.yml b/test-definitions/fern/apis/file-upload/definition/service.yml index ae685cfba2b..d8741d2235b 100644 --- a/test-definitions/fern/apis/file-upload/definition/service.yml +++ b/test-definitions/fern/apis/file-upload/definition/service.yml @@ -16,15 +16,9 @@ service: maybeFile: optional maybeFileList: optional> maybeInteger: optional - listOfStrings: list - setOfStrings: set optionalListOfStrings: optional> - optionalSetOfStrings: optional> - maybeList: MaybeList - optionalMaybeList: optional - maybeListOrSet: MaybeListOrSet - optionalMaybeListOrSet: optional listOfObjects: list + justFile: path: /just-file method: POST @@ -33,6 +27,7 @@ service: body: properties: file: file + justFileWithQueryParams: path: /just-file-with-query-params method: POST @@ -53,23 +48,7 @@ service: file: file types: - MaybeList: - discriminated: false - union: - - string - - list - - integer - - list - - list> - MaybeListOrSet: - discriminated: false - union: - - string - - list - - integer - - list - - list> - - set + MyObject: properties: foo: string