├── LICENSE.txt ├── README.md └── samples ├── A ├── BadRequest.java ├── BadRequestCode.java ├── BadRequest_GsonTypeAdapter.java ├── EmptyResponseErrors.java ├── Endpoint1Errors.java ├── InternalServerErrorCode.java ├── NoContent.java ├── RateLimited.java ├── RateLimitedCode.java ├── RateLimited_GsonTypeAdapter.java ├── SampleEnum.java ├── SampleException.java ├── SampleException_GsonTypeAdapter.java ├── SampleRequest.java ├── SampleRequestPushModel.java ├── SampleRequest_GsonTypeAdapter.java ├── SampleServiceApi.java ├── SampleServiceClient.java ├── SampleServiceClient_Factory.java ├── SampleUnion.java ├── SampleUnionUnionType.java ├── SampleUnion_GsonTypeAdapter.java ├── ServerError.java ├── ServerError_GsonTypeAdapter.java ├── TypedefA.java ├── TypedefA_GsonTypeAdapter.java ├── TypedefB.java ├── TypedefB_GsonTypeAdapter.java ├── TypedefC.java ├── TypedefC_GsonTypeAdapter.java ├── TypedefD.java ├── TypedefD_GsonTypeAdapter.java ├── Unauthenticated.java ├── UnauthenticatedCode.java ├── Unauthenticated_GsonTypeAdapter.java └── build.gradle ├── B ├── BadRequest.java ├── BadRequestCode.java ├── BadRequest_GsonTypeAdapter.java ├── EmptyResponseErrors.java ├── Endpoint1Errors.java ├── InternalServerErrorCode.java ├── NoContent.java ├── RateLimited.java ├── RateLimitedCode.java ├── RateLimited_GsonTypeAdapter.java ├── SampleEnum.java ├── SampleException.java ├── SampleException_GsonTypeAdapter.java ├── SampleRequest.java ├── SampleRequestPushModel.java ├── SampleRequest_GsonTypeAdapter.java ├── SampleServiceApi.java ├── SampleServiceClient.java ├── SampleServiceClient_Factory.java ├── SampleUnion.java ├── SampleUnionUnionType.java ├── SampleUnion_GsonTypeAdapter.java ├── ServerError.java ├── ServerError_GsonTypeAdapter.java ├── TypedefA.java ├── TypedefA_GsonTypeAdapter.java ├── TypedefB.java ├── TypedefB_GsonTypeAdapter.java ├── TypedefC.java ├── TypedefC_GsonTypeAdapter.java ├── TypedefD.java ├── TypedefD_GsonTypeAdapter.java ├── Unauthenticated.java ├── UnauthenticatedCode.java ├── Unauthenticated_GsonTypeAdapter.java └── build.gradle ├── C ├── BadRequest.java ├── BadRequestCode.java ├── BadRequest_GsonTypeAdapter.java ├── EmptyResponseErrors.java ├── Endpoint1Errors.java ├── InternalServerErrorCode.java ├── NoContent.java ├── RateLimited.java ├── RateLimitedCode.java ├── RateLimited_GsonTypeAdapter.java ├── SampleEnum.java ├── SampleException.java ├── SampleException_GsonTypeAdapter.java ├── SampleRequest.java ├── SampleRequestPushModel.java ├── SampleRequest_GsonTypeAdapter.java ├── SampleServiceApi.java ├── SampleServiceClient.java ├── SampleUnion.java ├── SampleUnionUnionType.java ├── SampleUnion_GsonTypeAdapter.java ├── ServerError.java ├── ServerError_GsonTypeAdapter.java ├── TypedefA.java ├── TypedefA_GsonTypeAdapter.java ├── TypedefB.java ├── TypedefB_GsonTypeAdapter.java ├── TypedefC.java ├── TypedefC_GsonTypeAdapter.java ├── TypedefD.java ├── TypedefD_GsonTypeAdapter.java ├── Unauthenticated.java ├── UnauthenticatedCode.java ├── Unauthenticated_GsonTypeAdapter.java ├── apt-generated │ └── SampleServiceClient_Factory.java └── build.gradle ├── D ├── BadRequest.kt ├── BadRequestCode.kt ├── BadRequestJsonAdapter.kt ├── EmptyResponseErrors.kt ├── Endpoint1Errors.kt ├── InternalServerErrorCode.kt ├── NoContent.kt ├── RateLimited.kt ├── RateLimitedCode.kt ├── RateLimitedJsonAdapter.kt ├── SampleEnum.kt ├── SampleException.kt ├── SampleExceptionJsonAdapter.kt ├── SampleRequest.kt ├── SampleRequestJsonAdapter.kt ├── SampleRequestPushModel.kt ├── SampleServiceApi.kt ├── SampleServiceClient.kt ├── SampleUnion.kt ├── SampleUnionJsonAdapter.kt ├── SampleUnionUnionType.kt ├── ServerError.kt ├── ServerErrorJsonAdapter.kt ├── TypedefA.kt ├── TypedefB.kt ├── TypedefC.kt ├── TypedefD.kt ├── Unauthenticated.kt ├── UnauthenticatedCode.kt ├── UnauthenticatedJsonAdapter.kt ├── build.gradle └── kapt-generated │ └── SampleServiceClient_Factory.java ├── E ├── BadRequest.kt ├── BadRequestCode.kt ├── EmptyResponseErrors.java ├── Endpoint1Errors.java ├── InternalServerErrorCode.kt ├── NoContent.kt ├── RateLimited.kt ├── RateLimitedCode.kt ├── SampleEnum.kt ├── SampleException.kt ├── SampleRequest.kt ├── SampleRequestPushModel.java ├── SampleServiceApi.java ├── SampleServiceClient.java ├── SampleServiceClient_Factory.java ├── SampleUnion.kt ├── SampleUnionUnionType.kt ├── ServerError.kt ├── TypedefA.kt ├── TypedefB.kt ├── TypedefC.kt ├── TypedefD.kt ├── Unauthenticated.kt ├── UnauthenticatedCode.kt ├── build.gradle └── kapt-generated │ ├── BadRequestJsonAdapter.kt │ ├── RateLimitedJsonAdapter.kt │ ├── SampleExceptionJsonAdapter.kt │ ├── SampleRequestJsonAdapter.kt │ ├── SampleUnionJsonAdapter.kt │ ├── ServerErrorJsonAdapter.kt │ └── UnauthenticatedJsonAdapter.kt ├── F ├── BadRequest.kt ├── BadRequestCode.kt ├── EmptyResponseErrors.kt ├── Endpoint1Errors.kt ├── InternalServerErrorCode.kt ├── NoContent.kt ├── RateLimited.kt ├── RateLimitedCode.kt ├── SampleEnum.kt ├── SampleException.kt ├── SampleRequest.kt ├── SampleRequestPushModel.kt ├── SampleServiceApi.kt ├── SampleServiceClient.kt ├── SampleUnion.kt ├── SampleUnionUnionType.kt ├── ServerError.kt ├── TypedefA.kt ├── TypedefB.kt ├── TypedefC.kt ├── TypedefD.kt ├── Unauthenticated.kt ├── UnauthenticatedCode.kt ├── build.gradle └── kapt-generated │ ├── BadRequestJsonAdapter.kt │ ├── RateLimitedJsonAdapter.kt │ ├── SampleExceptionJsonAdapter.kt │ ├── SampleRequestJsonAdapter.kt │ ├── SampleServiceClient_Factory.java │ ├── SampleUnionJsonAdapter.kt │ ├── ServerErrorJsonAdapter.kt │ └── UnauthenticatedJsonAdapter.kt ├── G ├── BadRequest.kt ├── BadRequestCode.kt ├── BadRequestJsonAdapter.kt ├── EmptyResponseErrors.kt ├── Endpoint1Errors.kt ├── InternalServerErrorCode.kt ├── NoContent.kt ├── RateLimited.kt ├── RateLimitedCode.kt ├── RateLimitedJsonAdapter.kt ├── SampleEnum.kt ├── SampleException.kt ├── SampleExceptionJsonAdapter.kt ├── SampleRequest.kt ├── SampleRequestJsonAdapter.kt ├── SampleRequestPushModel.kt ├── SampleServiceApi.kt ├── SampleServiceClient.kt ├── SampleServiceClient_Factory.java ├── SampleUnion.kt ├── SampleUnionJsonAdapter.kt ├── SampleUnionUnionType.kt ├── ServerError.kt ├── ServerErrorJsonAdapter.kt ├── TypedefA.kt ├── TypedefB.kt ├── TypedefC.kt ├── TypedefD.kt ├── Unauthenticated.kt ├── UnauthenticatedCode.kt ├── UnauthenticatedJsonAdapter.kt └── build.gradle ├── H ├── BadRequest.kt ├── BadRequestCode.kt ├── BadRequest_GsonTypeAdapter.java ├── EmptyResponseErrors.java ├── Endpoint1Errors.java ├── InternalServerErrorCode.kt ├── NoContent.kt ├── RateLimited.kt ├── RateLimitedCode.kt ├── RateLimited_GsonTypeAdapter.java ├── SampleEnum.kt ├── SampleException.kt ├── SampleException_GsonTypeAdapter.java ├── SampleRequest.kt ├── SampleRequestPushModel.java ├── SampleRequest_GsonTypeAdapter.java ├── SampleServiceApi.java ├── SampleServiceClient.java ├── SampleServiceClient_Factory.java ├── SampleUnion.kt ├── SampleUnionUnionType.kt ├── SampleUnion_GsonTypeAdapter.java ├── ServerError.kt ├── ServerError_GsonTypeAdapter.java ├── TypedefA.kt ├── TypedefA_GsonTypeAdapter.java ├── TypedefB.kt ├── TypedefB_GsonTypeAdapter.java ├── TypedefC.kt ├── TypedefC_GsonTypeAdapter.java ├── TypedefD.kt ├── TypedefD_GsonTypeAdapter.java ├── Unauthenticated.kt ├── UnauthenticatedCode.kt ├── Unauthenticated_GsonTypeAdapter.java └── build.gradle ├── I ├── BadRequest.kt ├── BadRequestCode.kt ├── EmptyResponseErrors.kt ├── Endpoint1Errors.kt ├── InternalServerErrorCode.kt ├── NoContent.kt ├── RateLimited.kt ├── RateLimitedCode.kt ├── SampleEnum.kt ├── SampleException.kt ├── SampleRequest.kt ├── SampleRequestPushModel.kt ├── SampleServiceApi.kt ├── SampleServiceClient.kt ├── SampleServiceClient_Factory.kt ├── SampleUnion.kt ├── SampleUnionUnionType.kt ├── ServerError.kt ├── TypedefA.kt ├── TypedefB.kt ├── TypedefC.kt ├── TypedefD.kt ├── Unauthenticated.kt ├── UnauthenticatedCode.kt ├── build.gradle └── kapt-generated │ ├── BadRequestJsonAdapter.kt │ ├── RateLimitedJsonAdapter.kt │ ├── SampleExceptionJsonAdapter.kt │ ├── SampleRequestJsonAdapter.kt │ ├── SampleUnionJsonAdapter.kt │ ├── ServerErrorJsonAdapter.kt │ └── UnauthenticatedJsonAdapter.kt ├── J ├── BadRequest.kt ├── BadRequestCode.kt ├── BadRequestJsonAdapter.kt ├── EmptyResponseErrors.kt ├── Endpoint1Errors.kt ├── InternalServerErrorCode.kt ├── NoContent.kt ├── RateLimited.kt ├── RateLimitedCode.kt ├── RateLimitedJsonAdapter.kt ├── SampleEnum.kt ├── SampleException.kt ├── SampleExceptionJsonAdapter.kt ├── SampleRequest.kt ├── SampleRequestJsonAdapter.kt ├── SampleRequestPushModel.kt ├── SampleServiceApi.kt ├── SampleServiceClient.kt ├── SampleServiceClient_Factory.kt ├── SampleUnion.kt ├── SampleUnionJsonAdapter.kt ├── SampleUnionUnionType.kt ├── ServerError.kt ├── ServerErrorJsonAdapter.kt ├── TypedefA.kt ├── TypedefB.kt ├── TypedefC.kt ├── TypedefD.kt ├── Unauthenticated.kt ├── UnauthenticatedCode.kt ├── UnauthenticatedJsonAdapter.kt └── build.gradle ├── K ├── BadRequest.kt ├── BadRequestCode.kt ├── BadRequestJsonAdapter.kt ├── EmptyResponseErrors.kt ├── Endpoint1Errors.kt ├── InternalServerErrorCode.kt ├── NoContent.kt ├── RateLimited.kt ├── RateLimitedCode.kt ├── RateLimitedJsonAdapter.kt ├── SampleEnum.kt ├── SampleException.kt ├── SampleExceptionJsonAdapter.kt ├── SampleRequest.kt ├── SampleRequestJsonAdapter.kt ├── SampleRequestPushModel.kt ├── SampleServiceApi.kt ├── SampleServiceClient.kt ├── SampleServiceClient_Factory.kt ├── SampleUnion.kt ├── SampleUnionJsonAdapter.kt ├── SampleUnionUnionType.kt ├── ServerError.kt ├── ServerErrorJsonAdapter.kt ├── TypedefA.kt ├── TypedefB.kt ├── TypedefC.kt ├── TypedefD.kt ├── Unauthenticated.kt ├── UnauthenticatedCode.kt ├── UnauthenticatedJsonAdapter.kt └── build.gradle ├── L ├── BadRequest.kt ├── BadRequestCode.kt ├── BadRequestJsonAdapter.kt ├── EmptyResponseErrors.kt ├── Endpoint1Errors.kt ├── InternalServerErrorCode.kt ├── NoContent.kt ├── RateLimited.kt ├── RateLimitedCode.kt ├── RateLimitedJsonAdapter.kt ├── SampleEnum.kt ├── SampleException.kt ├── SampleExceptionJsonAdapter.kt ├── SampleRequest.kt ├── SampleRequestJsonAdapter.kt ├── SampleRequestPushModel.kt ├── SampleServiceApi.kt ├── SampleServiceClient.kt ├── SampleServiceClient_Factory.kt ├── SampleUnion.kt ├── SampleUnionJsonAdapter.kt ├── SampleUnionUnionType.kt ├── ServerError.kt ├── ServerErrorJsonAdapter.kt ├── TypedefA.kt ├── TypedefB.kt ├── TypedefC.kt ├── TypedefD.kt ├── Unauthenticated.kt ├── UnauthenticatedCode.kt ├── UnauthenticatedJsonAdapter.kt └── build.gradle ├── M ├── BadRequest.kt ├── BadRequestCode.kt ├── BadRequestJsonAdapter.kt ├── EmptyResponseErrors.kt ├── Endpoint1Errors.kt ├── InternalServerErrorCode.kt ├── NoContent.kt ├── RateLimited.kt ├── RateLimitedCode.kt ├── RateLimitedJsonAdapter.kt ├── SampleEnum.kt ├── SampleException.kt ├── SampleExceptionJsonAdapter.kt ├── SampleRequest.kt ├── SampleRequestJsonAdapter.kt ├── SampleRequestPushModel.kt ├── SampleServiceApi.kt ├── SampleServiceClient.kt ├── SampleServiceClient_Factory.kt ├── SampleUnion.kt ├── SampleUnionJsonAdapter.kt ├── SampleUnionUnionType.kt ├── ServerError.kt ├── ServerErrorJsonAdapter.kt ├── TypedefA.kt ├── TypedefB.kt ├── TypedefC.kt ├── TypedefD.kt ├── Unauthenticated.kt ├── UnauthenticatedCode.kt ├── UnauthenticatedJsonAdapter.kt └── build.gradle └── example.thrift /samples/A/BadRequestCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/A/InternalServerErrorCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/A/NoContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.google.errorprone.annotations.Immutable; 20 | import com.uber.errorprone.annotations.DoNotMock; 21 | import com.uber.model.core.annotation.ThriftElement; 22 | import javax.annotation.Generated; 23 | 24 | @Generated( 25 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock("Use the singleton INSTANCE instead.") 30 | @Immutable 31 | public final class NoContent { 32 | public static final NoContent INSTANCE = new NoContent(); 33 | 34 | private NoContent() {} 35 | 36 | @Override 37 | public String toString() { 38 | return "NoContent"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /samples/A/RateLimitedCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/A/SampleEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/A/SampleRequestPushModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.presidio.realtime.core.PushModel; 20 | import javax.annotation.Generated; 21 | 22 | @Generated( 23 | value = "ThriftCodeGen Compiler", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | public final class SampleRequestPushModel extends PushModel { 27 | public static final SampleRequestPushModel INSTANCE = new SampleRequestPushModel(); 28 | 29 | private SampleRequestPushModel() { 30 | super(SampleRequest.class, "push_sample"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/A/SampleServiceApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.model.core.annotation.ThriftElement; 20 | import io.reactivex.Single; 21 | import javax.annotation.Generated; 22 | import kotlin.Unit; 23 | import retrofit2.http.Body; 24 | import retrofit2.http.GET; 25 | import retrofit2.http.POST; 26 | import retrofit2.http.Path; 27 | import retrofit2.http.Query; 28 | 29 | @Generated( 30 | value = "ThriftCodeGen Compiler", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | public interface SampleServiceApi { 35 | @POST("/sample/endpoint2") 36 | Single emptyResponse(@Body String param1, @Body String param2); 37 | 38 | @GET("/sample") 39 | Single endpoint1( 40 | @Path("examplePath") String pathParam, @Query("exampleQuery") String queryParam); 41 | } 42 | -------------------------------------------------------------------------------- /samples/A/SampleUnionUnionType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | import com.uber.errorprone.annotations.DoNotMock; 21 | import com.uber.model.core.annotation.ThriftElement; 22 | import javax.annotation.Generated; 23 | 24 | @Generated( 25 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | public enum SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @SerializedName("option1") 34 | OPTION1, 35 | 36 | @SerializedName("option2") 37 | OPTION2, 38 | 39 | @SerializedName("option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/A/TypedefA_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeStringTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefA_GsonTypeAdapter extends TypeSafeStringTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefA read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefA.wrap(in.nextString()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/A/TypedefB_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeIntTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefB_GsonTypeAdapter extends TypeSafeIntTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefB read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefB.wrap(in.nextInt()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/A/TypedefC_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeBooleanTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefC_GsonTypeAdapter extends TypeSafeBooleanTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefC read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefC.wrap(in.nextBoolean()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/A/TypedefD_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeLongTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefD_GsonTypeAdapter extends TypeSafeLongTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefD read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefD.wrap(in.nextLong()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/A/UnauthenticatedCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/A/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "java-library" 5 | 6 | dependencies { 7 | api deps.androidx.annotations 8 | api deps.external.errorProneAnnotations 9 | api deps.external.rxjava2 10 | api deps.external.threetenbpnotzdb 11 | api deps.kotlin.stdLibJdk7 12 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 13 | api project(":libraries:foundation:realtime:presidio-realtime") 14 | api project(":libraries:foundation:uava:uava") 15 | compileOnly deps.external.javax 16 | compileOnly deps.external.javaxInject 17 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 18 | implementation deps.external.dagger 19 | implementation deps.external.gson 20 | implementation deps.external.retrofit2 21 | implementation project(":libraries:foundation:lumber:lumber-logger") 22 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 23 | implementation project(":libraries:foundation:uava:adapters:gson") 24 | } 25 | -------------------------------------------------------------------------------- /samples/B/BadRequestCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/B/InternalServerErrorCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/B/NoContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.google.errorprone.annotations.Immutable; 20 | import com.uber.errorprone.annotations.DoNotMock; 21 | import com.uber.model.core.annotation.ThriftElement; 22 | import javax.annotation.Generated; 23 | 24 | @Generated( 25 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock("Use the singleton INSTANCE instead.") 30 | @Immutable 31 | public final class NoContent { 32 | public static final NoContent INSTANCE = new NoContent(); 33 | 34 | private NoContent() {} 35 | 36 | @Override 37 | public String toString() { 38 | return "NoContent"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /samples/B/RateLimitedCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/B/SampleEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/B/SampleRequestPushModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.presidio.realtime.core.PushModel; 20 | import javax.annotation.Generated; 21 | 22 | @Generated( 23 | value = "ThriftCodeGen Compiler", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | public final class SampleRequestPushModel extends PushModel { 27 | public static final SampleRequestPushModel INSTANCE = new SampleRequestPushModel(); 28 | 29 | private SampleRequestPushModel() { 30 | super(SampleRequest.class, "push_sample"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/B/SampleServiceApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.model.core.annotation.ThriftElement; 20 | import io.reactivex.Single; 21 | import javax.annotation.Generated; 22 | import kotlin.Unit; 23 | import retrofit2.http.Body; 24 | import retrofit2.http.GET; 25 | import retrofit2.http.POST; 26 | import retrofit2.http.Path; 27 | import retrofit2.http.Query; 28 | 29 | @Generated( 30 | value = "ThriftCodeGen Compiler", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | public interface SampleServiceApi { 35 | @POST("/sample/endpoint2") 36 | Single emptyResponse(@Body String param1, @Body String param2); 37 | 38 | @GET("/sample") 39 | Single endpoint1( 40 | @Path("examplePath") String pathParam, @Query("exampleQuery") String queryParam); 41 | } 42 | -------------------------------------------------------------------------------- /samples/B/SampleUnionUnionType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | import com.uber.errorprone.annotations.DoNotMock; 21 | import com.uber.model.core.annotation.ThriftElement; 22 | import javax.annotation.Generated; 23 | 24 | @Generated( 25 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | public enum SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @SerializedName("option1") 34 | OPTION1, 35 | 36 | @SerializedName("option2") 37 | OPTION2, 38 | 39 | @SerializedName("option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/B/TypedefA_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeStringTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefA_GsonTypeAdapter extends TypeSafeStringTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefA read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefA.wrap(in.nextString()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/B/TypedefB_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeIntTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefB_GsonTypeAdapter extends TypeSafeIntTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefB read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefB.wrap(in.nextInt()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/B/TypedefC_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeBooleanTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefC_GsonTypeAdapter extends TypeSafeBooleanTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefC read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefC.wrap(in.nextBoolean()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/B/TypedefD_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeLongTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefD_GsonTypeAdapter extends TypeSafeLongTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefD read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefD.wrap(in.nextLong()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/B/UnauthenticatedCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/B/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "java-library" 5 | 6 | dependencies { 7 | api deps.androidx.annotations 8 | api deps.external.errorProneAnnotations 9 | api deps.external.rxjava2 10 | api deps.external.threetenbpnotzdb 11 | api deps.kotlin.stdLibJdk7 12 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 13 | api project(":libraries:foundation:realtime:presidio-realtime") 14 | api project(":libraries:foundation:uava:uava") 15 | compileOnly deps.external.javax 16 | compileOnly deps.external.javaxInject 17 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 18 | implementation deps.external.dagger 19 | implementation deps.external.gson 20 | implementation deps.external.retrofit2 21 | implementation project(":libraries:foundation:lumber:lumber-logger") 22 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 23 | implementation project(":libraries:foundation:uava:adapters:gson") 24 | } 25 | -------------------------------------------------------------------------------- /samples/C/BadRequestCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/C/InternalServerErrorCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/C/NoContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.google.errorprone.annotations.Immutable; 20 | import com.uber.errorprone.annotations.DoNotMock; 21 | import com.uber.model.core.annotation.ThriftElement; 22 | import javax.annotation.Generated; 23 | 24 | @Generated( 25 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock("Use the singleton INSTANCE instead.") 30 | @Immutable 31 | public final class NoContent { 32 | public static final NoContent INSTANCE = new NoContent(); 33 | 34 | private NoContent() {} 35 | 36 | @Override 37 | public String toString() { 38 | return "NoContent"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /samples/C/RateLimitedCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/C/SampleEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/C/SampleRequestPushModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.presidio.realtime.core.PushModel; 20 | import javax.annotation.Generated; 21 | 22 | @Generated( 23 | value = "ThriftCodeGen Compiler", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | public final class SampleRequestPushModel extends PushModel { 27 | public static final SampleRequestPushModel INSTANCE = new SampleRequestPushModel(); 28 | 29 | private SampleRequestPushModel() { 30 | super(SampleRequest.class, "push_sample"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/C/SampleServiceApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.model.core.annotation.ThriftElement; 20 | import io.reactivex.Single; 21 | import javax.annotation.Generated; 22 | import kotlin.Unit; 23 | import retrofit2.http.Body; 24 | import retrofit2.http.GET; 25 | import retrofit2.http.POST; 26 | import retrofit2.http.Path; 27 | import retrofit2.http.Query; 28 | 29 | @Generated( 30 | value = "ThriftCodeGen Compiler", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | public interface SampleServiceApi { 35 | @POST("/sample/endpoint2") 36 | Single emptyResponse(@Body String param1, @Body String param2); 37 | 38 | @GET("/sample") 39 | Single endpoint1( 40 | @Path("examplePath") String pathParam, @Query("exampleQuery") String queryParam); 41 | } 42 | -------------------------------------------------------------------------------- /samples/C/SampleUnionUnionType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | import com.uber.errorprone.annotations.DoNotMock; 21 | import com.uber.model.core.annotation.ThriftElement; 22 | import javax.annotation.Generated; 23 | 24 | @Generated( 25 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | public enum SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @SerializedName("option1") 34 | OPTION1, 35 | 36 | @SerializedName("option2") 37 | OPTION2, 38 | 39 | @SerializedName("option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/C/TypedefA_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeStringTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefA_GsonTypeAdapter extends TypeSafeStringTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefA read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefA.wrap(in.nextString()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/C/TypedefB_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeIntTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefB_GsonTypeAdapter extends TypeSafeIntTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefB read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefB.wrap(in.nextInt()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/C/TypedefC_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeBooleanTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefC_GsonTypeAdapter extends TypeSafeBooleanTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefC read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefC.wrap(in.nextBoolean()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/C/TypedefD_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeLongTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefD_GsonTypeAdapter extends TypeSafeLongTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefD read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefD.wrap(in.nextLong()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/C/UnauthenticatedCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.errorprone.annotations.DoNotMock; 20 | import com.uber.model.core.annotation.ThriftElement; 21 | import javax.annotation.Generated; 22 | 23 | @Generated( 24 | value = "com.uber.codegen.compiler.JavaThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | public enum UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/C/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "java-library" 5 | 6 | dependencies { 7 | annotationProcessor deps.apt.daggerCompiler 8 | annotationProcessor deps.external.failureAccess 9 | api deps.androidx.annotations 10 | api deps.external.errorProneAnnotations 11 | api deps.external.rxjava2 12 | api deps.external.threetenbpnotzdb 13 | api deps.kotlin.stdLibJdk7 14 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 15 | api project(":libraries:foundation:realtime:presidio-realtime") 16 | api project(":libraries:foundation:uava:uava") 17 | compileOnly deps.external.javax 18 | compileOnly deps.external.javaxInject 19 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 20 | implementation deps.external.dagger 21 | implementation deps.external.gson 22 | implementation deps.external.retrofit2 23 | implementation project(":libraries:foundation:lumber:lumber-logger") 24 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 25 | implementation project(":libraries:foundation:uava:adapters:gson") 26 | } 27 | -------------------------------------------------------------------------------- /samples/D/BadRequestCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/D/InternalServerErrorCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/D/NoContent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import javax.annotation.Generated 21 | import kotlin.String 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @Immutable 28 | object NoContent { 29 | override fun toString(): String = "NoContent" 30 | } 31 | -------------------------------------------------------------------------------- /samples/D/RateLimitedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/D/SampleEnum.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/D/SampleRequestPushModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.presidio.realtime.core.PushModel 20 | import javax.annotation.Generated 21 | 22 | @Generated( 23 | "com.uber.realtime.android.typeprocessors.pushmodel.PushModelKotlinTypeProcessor", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | object SampleRequestPushModel : PushModel(SampleRequest::class.java, "push_sample") 27 | -------------------------------------------------------------------------------- /samples/D/SampleServiceApi.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.model.core.annotation.ThriftElement 20 | import io.reactivex.Single 21 | import javax.annotation.Generated 22 | import kotlin.String 23 | import kotlin.Unit 24 | import retrofit2.http.Body 25 | import retrofit2.http.GET 26 | import retrofit2.http.POST 27 | import retrofit2.http.Path 28 | import retrofit2.http.Query 29 | 30 | @Generated( 31 | "ThriftCodeGen Compiler", 32 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 33 | ) 34 | @ThriftElement 35 | interface SampleServiceApi { 36 | @POST("/sample/endpoint2") 37 | fun emptyResponse(@Body param1: String, @Body param2: String): Single 38 | 39 | @GET("/sample") 40 | fun endpoint1(@Path("examplePath") pathParam: String, @Query("exampleQuery") queryParam: String): 41 | Single 42 | } 43 | -------------------------------------------------------------------------------- /samples/D/SampleUnionUnionType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.squareup.moshi.Json 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.model.core.annotation.ThriftElement 22 | import javax.annotation.Generated 23 | 24 | @Generated( 25 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | enum class SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @Json(name = "option1") 34 | OPTION1, 35 | 36 | @Json(name = "option2") 37 | OPTION2, 38 | 39 | @Json(name = "option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/D/TypedefA.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeString 25 | import javax.annotation.Generated 26 | import kotlin.String 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | class TypedefA @KotlinOnly constructor(value: String) : TypeSafeString(value) { 38 | companion object { 39 | /** 40 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 41 | */ 42 | @JvmStatic 43 | fun wrapFrom(other: TypeSafeString): TypedefA = wrap(other.get()) 44 | 45 | @JvmStatic 46 | fun wrap(value: String): TypedefA = TypedefA(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /samples/D/UnauthenticatedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/D/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "java-library" 5 | apply plugin: "org.jetbrains.kotlin.jvm" 6 | apply plugin: "org.jetbrains.kotlin.kapt" 7 | 8 | dependencies { 9 | api deps.androidx.annotations 10 | api deps.external.errorProneAnnotations 11 | api deps.external.rxjava2 12 | api deps.external.threetenbpnotzdb 13 | api deps.kotlin.stdLibJdk7 14 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 15 | api project(":libraries:foundation:realtime:presidio-realtime") 16 | api project(":libraries:foundation:uava:uava") 17 | compileOnly deps.external.javax 18 | compileOnly deps.external.javaxInject 19 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 20 | implementation deps.external.dagger 21 | implementation deps.external.gson 22 | implementation deps.external.moshi 23 | implementation deps.external.retrofit2 24 | implementation project(":libraries:foundation:lumber:lumber-logger") 25 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 26 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-moshi") 27 | implementation project(":libraries:foundation:uava:adapters:gson") 28 | implementation project(":libraries:foundation:uava:adapters:moshi") 29 | kapt deps.apt.daggerCompiler 30 | kapt deps.external.failureAccess 31 | } 32 | -------------------------------------------------------------------------------- /samples/E/BadRequestCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/E/InternalServerErrorCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/E/NoContent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import javax.annotation.Generated 21 | import kotlin.String 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @Immutable 28 | object NoContent { 29 | override fun toString(): String = "NoContent" 30 | } 31 | -------------------------------------------------------------------------------- /samples/E/RateLimitedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/E/SampleEnum.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/E/SampleRequestPushModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.presidio.realtime.core.PushModel; 20 | import javax.annotation.Generated; 21 | 22 | @Generated( 23 | value = "ThriftCodeGen Compiler", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | public final class SampleRequestPushModel extends PushModel { 27 | public static final SampleRequestPushModel INSTANCE = new SampleRequestPushModel(); 28 | 29 | private SampleRequestPushModel() { 30 | super(SampleRequest.class, "push_sample"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/E/SampleServiceApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.model.core.annotation.ThriftElement; 20 | import io.reactivex.Single; 21 | import javax.annotation.Generated; 22 | import kotlin.Unit; 23 | import retrofit2.http.Body; 24 | import retrofit2.http.GET; 25 | import retrofit2.http.POST; 26 | import retrofit2.http.Path; 27 | import retrofit2.http.Query; 28 | 29 | @Generated( 30 | value = "ThriftCodeGen Compiler", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | public interface SampleServiceApi { 35 | @POST("/sample/endpoint2") 36 | Single emptyResponse(@Body String param1, @Body String param2); 37 | 38 | @GET("/sample") 39 | Single endpoint1( 40 | @Path("examplePath") String pathParam, @Query("exampleQuery") String queryParam); 41 | } 42 | -------------------------------------------------------------------------------- /samples/E/SampleUnionUnionType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.squareup.moshi.Json 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.model.core.annotation.ThriftElement 22 | import javax.annotation.Generated 23 | 24 | @Generated( 25 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | enum class SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @Json(name = "option1") 34 | OPTION1, 35 | 36 | @Json(name = "option2") 37 | OPTION2, 38 | 39 | @Json(name = "option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/E/TypedefA.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeString 25 | import javax.annotation.Generated 26 | import kotlin.String 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | class TypedefA @KotlinOnly constructor(value: String) : TypeSafeString(value) { 38 | companion object { 39 | /** 40 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 41 | */ 42 | @JvmStatic 43 | fun wrapFrom(other: TypeSafeString): TypedefA = wrap(other.get()) 44 | 45 | @JvmStatic 46 | fun wrap(value: String): TypedefA = TypedefA(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /samples/E/UnauthenticatedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/E/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "java-library" 5 | apply plugin: "org.jetbrains.kotlin.jvm" 6 | apply plugin: "org.jetbrains.kotlin.kapt" 7 | 8 | dependencies { 9 | api deps.androidx.annotations 10 | api deps.external.errorProneAnnotations 11 | api deps.external.rxjava2 12 | api deps.external.threetenbpnotzdb 13 | api deps.kotlin.stdLibJdk7 14 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 15 | api project(":libraries:foundation:realtime:presidio-realtime") 16 | api project(":libraries:foundation:uava:uava") 17 | compileOnly deps.external.javax 18 | compileOnly deps.external.javaxInject 19 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 20 | implementation deps.external.dagger 21 | implementation deps.external.gson 22 | implementation deps.external.moshi 23 | implementation deps.external.retrofit2 24 | implementation project(":libraries:foundation:lumber:lumber-logger") 25 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 26 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-moshi") 27 | implementation project(":libraries:foundation:uava:adapters:gson") 28 | implementation project(":libraries:foundation:uava:adapters:moshi") 29 | kapt deps.apt.moshiKotlinCodegen 30 | } 31 | -------------------------------------------------------------------------------- /samples/F/BadRequestCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/F/InternalServerErrorCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/F/NoContent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import javax.annotation.Generated 21 | import kotlin.String 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @Immutable 28 | object NoContent { 29 | override fun toString(): String = "NoContent" 30 | } 31 | -------------------------------------------------------------------------------- /samples/F/RateLimitedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/F/SampleEnum.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/F/SampleRequestPushModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.presidio.realtime.core.PushModel 20 | import javax.annotation.Generated 21 | 22 | @Generated( 23 | "com.uber.realtime.android.typeprocessors.pushmodel.PushModelKotlinTypeProcessor", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | object SampleRequestPushModel : PushModel(SampleRequest::class.java, "push_sample") 27 | -------------------------------------------------------------------------------- /samples/F/SampleServiceApi.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.model.core.annotation.ThriftElement 20 | import io.reactivex.Single 21 | import javax.annotation.Generated 22 | import kotlin.String 23 | import kotlin.Unit 24 | import retrofit2.http.Body 25 | import retrofit2.http.GET 26 | import retrofit2.http.POST 27 | import retrofit2.http.Path 28 | import retrofit2.http.Query 29 | 30 | @Generated( 31 | "ThriftCodeGen Compiler", 32 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 33 | ) 34 | @ThriftElement 35 | interface SampleServiceApi { 36 | @POST("/sample/endpoint2") 37 | fun emptyResponse(@Body param1: String, @Body param2: String): Single 38 | 39 | @GET("/sample") 40 | fun endpoint1(@Path("examplePath") pathParam: String, @Query("exampleQuery") queryParam: String): 41 | Single 42 | } 43 | -------------------------------------------------------------------------------- /samples/F/SampleUnionUnionType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.squareup.moshi.Json 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.model.core.annotation.ThriftElement 22 | import javax.annotation.Generated 23 | 24 | @Generated( 25 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | enum class SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @Json(name = "option1") 34 | OPTION1, 35 | 36 | @Json(name = "option2") 37 | OPTION2, 38 | 39 | @Json(name = "option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/F/TypedefA.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeString 25 | import javax.annotation.Generated 26 | import kotlin.String 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | class TypedefA @KotlinOnly constructor(value: String) : TypeSafeString(value) { 38 | companion object { 39 | /** 40 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 41 | */ 42 | @JvmStatic 43 | fun wrapFrom(other: TypeSafeString): TypedefA = wrap(other.get()) 44 | 45 | @JvmStatic 46 | fun wrap(value: String): TypedefA = TypedefA(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /samples/F/UnauthenticatedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/F/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "java-library" 5 | apply plugin: "org.jetbrains.kotlin.jvm" 6 | apply plugin: "org.jetbrains.kotlin.kapt" 7 | 8 | dependencies { 9 | api deps.androidx.annotations 10 | api deps.external.errorProneAnnotations 11 | api deps.external.rxjava2 12 | api deps.external.threetenbpnotzdb 13 | api deps.kotlin.stdLibJdk7 14 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 15 | api project(":libraries:foundation:realtime:presidio-realtime") 16 | api project(":libraries:foundation:uava:uava") 17 | compileOnly deps.external.javax 18 | compileOnly deps.external.javaxInject 19 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 20 | implementation deps.external.dagger 21 | implementation deps.external.gson 22 | implementation deps.external.moshi 23 | implementation deps.external.retrofit2 24 | implementation project(":libraries:foundation:lumber:lumber-logger") 25 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 26 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-moshi") 27 | implementation project(":libraries:foundation:uava:adapters:gson") 28 | implementation project(":libraries:foundation:uava:adapters:moshi") 29 | kapt deps.apt.daggerCompiler 30 | kapt deps.apt.moshiKotlinCodegen 31 | kapt deps.external.failureAccess 32 | } 33 | -------------------------------------------------------------------------------- /samples/G/BadRequestCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/G/InternalServerErrorCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/G/NoContent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import javax.annotation.Generated 21 | import kotlin.String 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @Immutable 28 | object NoContent { 29 | override fun toString(): String = "NoContent" 30 | } 31 | -------------------------------------------------------------------------------- /samples/G/RateLimitedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/G/SampleEnum.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/G/SampleRequestPushModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.presidio.realtime.core.PushModel 20 | import javax.annotation.Generated 21 | 22 | @Generated( 23 | "com.uber.realtime.android.typeprocessors.pushmodel.PushModelKotlinTypeProcessor", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | object SampleRequestPushModel : PushModel(SampleRequest::class.java, "push_sample") 27 | -------------------------------------------------------------------------------- /samples/G/SampleServiceApi.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.model.core.annotation.ThriftElement 20 | import io.reactivex.Single 21 | import javax.annotation.Generated 22 | import kotlin.String 23 | import kotlin.Unit 24 | import retrofit2.http.Body 25 | import retrofit2.http.GET 26 | import retrofit2.http.POST 27 | import retrofit2.http.Path 28 | import retrofit2.http.Query 29 | 30 | @Generated( 31 | "ThriftCodeGen Compiler", 32 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 33 | ) 34 | @ThriftElement 35 | interface SampleServiceApi { 36 | @POST("/sample/endpoint2") 37 | fun emptyResponse(@Body param1: String, @Body param2: String): Single 38 | 39 | @GET("/sample") 40 | fun endpoint1(@Path("examplePath") pathParam: String, @Query("exampleQuery") queryParam: String): 41 | Single 42 | } 43 | -------------------------------------------------------------------------------- /samples/G/SampleUnionUnionType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.squareup.moshi.Json 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.model.core.annotation.ThriftElement 22 | import javax.annotation.Generated 23 | 24 | @Generated( 25 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | enum class SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @Json(name = "option1") 34 | OPTION1, 35 | 36 | @Json(name = "option2") 37 | OPTION2, 38 | 39 | @Json(name = "option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/G/TypedefA.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeString 25 | import javax.annotation.Generated 26 | import kotlin.String 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | class TypedefA @KotlinOnly constructor(value: String) : TypeSafeString(value) { 38 | companion object { 39 | /** 40 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 41 | */ 42 | @JvmStatic 43 | fun wrapFrom(other: TypeSafeString): TypedefA = wrap(other.get()) 44 | 45 | @JvmStatic 46 | fun wrap(value: String): TypedefA = TypedefA(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /samples/G/UnauthenticatedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/G/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "org.jetbrains.kotlin.jvm" 5 | 6 | dependencies { 7 | api deps.androidx.annotations 8 | api deps.external.errorProneAnnotations 9 | api deps.external.rxjava2 10 | api deps.external.threetenbpnotzdb 11 | api deps.kotlin.stdLibJdk7 12 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 13 | api project(":libraries:foundation:realtime:presidio-realtime") 14 | api project(":libraries:foundation:uava:uava") 15 | compileOnly deps.external.javax 16 | compileOnly deps.external.javaxInject 17 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 18 | implementation deps.external.dagger 19 | implementation deps.external.gson 20 | implementation deps.external.moshi 21 | implementation deps.external.retrofit2 22 | implementation project(":libraries:foundation:lumber:lumber-logger") 23 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 24 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-moshi") 25 | implementation project(":libraries:foundation:uava:adapters:gson") 26 | implementation project(":libraries:foundation:uava:adapters:moshi") 27 | } 28 | -------------------------------------------------------------------------------- /samples/H/BadRequestCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/H/InternalServerErrorCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/H/NoContent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import javax.annotation.Generated 21 | import kotlin.String 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @Immutable 28 | object NoContent { 29 | override fun toString(): String = "NoContent" 30 | } 31 | -------------------------------------------------------------------------------- /samples/H/RateLimitedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/H/SampleEnum.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/H/SampleRequestPushModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.presidio.realtime.core.PushModel; 20 | import javax.annotation.Generated; 21 | 22 | @Generated( 23 | value = "ThriftCodeGen Compiler", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | public final class SampleRequestPushModel extends PushModel { 27 | public static final SampleRequestPushModel INSTANCE = new SampleRequestPushModel(); 28 | 29 | private SampleRequestPushModel() { 30 | super(SampleRequest.class, "push_sample"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/H/SampleServiceApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import com.uber.model.core.annotation.ThriftElement; 20 | import io.reactivex.Single; 21 | import javax.annotation.Generated; 22 | import kotlin.Unit; 23 | import retrofit2.http.Body; 24 | import retrofit2.http.GET; 25 | import retrofit2.http.POST; 26 | import retrofit2.http.Path; 27 | import retrofit2.http.Query; 28 | 29 | @Generated( 30 | value = "ThriftCodeGen Compiler", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | public interface SampleServiceApi { 35 | @POST("/sample/endpoint2") 36 | Single emptyResponse(@Body String param1, @Body String param2); 37 | 38 | @GET("/sample") 39 | Single endpoint1( 40 | @Path("examplePath") String pathParam, @Query("exampleQuery") String queryParam); 41 | } 42 | -------------------------------------------------------------------------------- /samples/H/SampleUnionUnionType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.gson.annotations.SerializedName 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.model.core.annotation.ThriftElement 22 | import javax.annotation.Generated 23 | 24 | @Generated( 25 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | enum class SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @SerializedName("option1") 34 | OPTION1, 35 | 36 | @SerializedName("option2") 37 | OPTION2, 38 | 39 | @SerializedName("option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/H/TypedefA_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeStringTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefA_GsonTypeAdapter extends TypeSafeStringTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefA read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefA.wrap(in.nextString()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/H/TypedefB_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeIntTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefB_GsonTypeAdapter extends TypeSafeIntTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefB read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefB.wrap(in.nextInt()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/H/TypedefC_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeBooleanTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefC_GsonTypeAdapter extends TypeSafeBooleanTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefC read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefC.wrap(in.nextBoolean()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/H/TypedefD_GsonTypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.gson.stream.JsonReader; 21 | import com.google.gson.stream.JsonToken; 22 | import com.uber.model.core.adapter.gson.GsonSerializable; 23 | import com.uber.model.core.adapter.gson.wrapper.TypeSafeLongTypeAdapter; 24 | import java.io.IOException; 25 | import javax.annotation.Generated; 26 | 27 | @Generated( 28 | value = "GsonTypeProcessor", 29 | comments = "This code was generated by the Uber GsonTypeProcessor" 30 | ) 31 | @GsonSerializable.ConstructorParameterCount(0) 32 | final class TypedefD_GsonTypeAdapter extends TypeSafeLongTypeAdapter { 33 | @Nullable 34 | @Override 35 | public TypedefD read(JsonReader in) throws IOException { 36 | if (in.peek() == JsonToken.NULL) { 37 | in.nextNull(); 38 | return null; 39 | } 40 | return TypedefD.wrap(in.nextLong()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/H/UnauthenticatedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/H/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "java-library" 5 | apply plugin: "org.jetbrains.kotlin.jvm" 6 | apply plugin: "org.jetbrains.kotlin.kapt" 7 | 8 | dependencies { 9 | api deps.androidx.annotations 10 | api deps.external.errorProneAnnotations 11 | api deps.external.rxjava2 12 | api deps.external.threetenbpnotzdb 13 | api deps.kotlin.stdLibJdk7 14 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 15 | api project(":libraries:foundation:realtime:presidio-realtime") 16 | api project(":libraries:foundation:uava:uava") 17 | compileOnly deps.external.javax 18 | compileOnly deps.external.javaxInject 19 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 20 | implementation deps.external.dagger 21 | implementation deps.external.gson 22 | implementation deps.external.moshi 23 | implementation deps.external.retrofit2 24 | implementation project(":libraries:foundation:lumber:lumber-logger") 25 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 26 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-moshi") 27 | implementation project(":libraries:foundation:uava:adapters:gson") 28 | implementation project(":libraries:foundation:uava:adapters:moshi") 29 | kapt deps.apt.moshiKotlinCodegen 30 | } 31 | -------------------------------------------------------------------------------- /samples/I/BadRequestCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/I/InternalServerErrorCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/I/NoContent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import javax.annotation.Generated 21 | import kotlin.String 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @Immutable 28 | object NoContent { 29 | override fun toString(): String = "NoContent" 30 | } 31 | -------------------------------------------------------------------------------- /samples/I/RateLimitedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/I/SampleEnum.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/I/SampleRequestPushModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.presidio.realtime.core.PushModel 20 | import javax.annotation.Generated 21 | 22 | @Generated( 23 | "com.uber.realtime.android.typeprocessors.pushmodel.PushModelKotlinTypeProcessor", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | object SampleRequestPushModel : PushModel(SampleRequest::class.java, "push_sample") 27 | -------------------------------------------------------------------------------- /samples/I/SampleServiceApi.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.model.core.annotation.ThriftElement 20 | import io.reactivex.Single 21 | import javax.annotation.Generated 22 | import kotlin.String 23 | import kotlin.Unit 24 | import retrofit2.http.Body 25 | import retrofit2.http.GET 26 | import retrofit2.http.POST 27 | import retrofit2.http.Path 28 | import retrofit2.http.Query 29 | 30 | @Generated( 31 | "ThriftCodeGen Compiler", 32 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 33 | ) 34 | @ThriftElement 35 | interface SampleServiceApi { 36 | @POST("/sample/endpoint2") 37 | fun emptyResponse(@Body param1: String, @Body param2: String): Single 38 | 39 | @GET("/sample") 40 | fun endpoint1(@Path("examplePath") pathParam: String, @Query("exampleQuery") queryParam: String): 41 | Single 42 | } 43 | -------------------------------------------------------------------------------- /samples/I/SampleUnionUnionType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.squareup.moshi.Json 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.model.core.annotation.ThriftElement 22 | import javax.annotation.Generated 23 | 24 | @Generated( 25 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | enum class SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @Json(name = "option1") 34 | OPTION1, 35 | 36 | @Json(name = "option2") 37 | OPTION2, 38 | 39 | @Json(name = "option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/I/TypedefA.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeString 25 | import javax.annotation.Generated 26 | import kotlin.String 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | class TypedefA @KotlinOnly constructor(value: String) : TypeSafeString(value) { 38 | companion object { 39 | /** 40 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 41 | */ 42 | @JvmStatic 43 | fun wrapFrom(other: TypeSafeString): TypedefA = wrap(other.get()) 44 | 45 | @JvmStatic 46 | fun wrap(value: String): TypedefA = TypedefA(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /samples/I/UnauthenticatedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/I/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "org.jetbrains.kotlin.jvm" 5 | apply plugin: "org.jetbrains.kotlin.kapt" 6 | 7 | dependencies { 8 | api deps.androidx.annotations 9 | api deps.external.errorProneAnnotations 10 | api deps.external.rxjava2 11 | api deps.external.threetenbpnotzdb 12 | api deps.kotlin.stdLibJdk7 13 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 14 | api project(":libraries:foundation:realtime:presidio-realtime") 15 | api project(":libraries:foundation:uava:uava") 16 | compileOnly deps.external.javax 17 | compileOnly deps.external.javaxInject 18 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 19 | implementation deps.external.dagger 20 | implementation deps.external.gson 21 | implementation deps.external.moshi 22 | implementation deps.external.retrofit2 23 | implementation project(":libraries:foundation:lumber:lumber-logger") 24 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 25 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-moshi") 26 | implementation project(":libraries:foundation:uava:adapters:gson") 27 | implementation project(":libraries:foundation:uava:adapters:moshi") 28 | kapt deps.apt.moshiKotlinCodegen 29 | } 30 | -------------------------------------------------------------------------------- /samples/J/BadRequestCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/J/InternalServerErrorCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/J/NoContent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import javax.annotation.Generated 21 | import kotlin.String 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @Immutable 28 | object NoContent { 29 | override fun toString(): String = "NoContent" 30 | } 31 | -------------------------------------------------------------------------------- /samples/J/RateLimitedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/J/SampleEnum.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/J/SampleRequestPushModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.presidio.realtime.core.PushModel 20 | import javax.annotation.Generated 21 | 22 | @Generated( 23 | "com.uber.realtime.android.typeprocessors.pushmodel.PushModelKotlinTypeProcessor", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | object SampleRequestPushModel : PushModel(SampleRequest::class.java, "push_sample") 27 | -------------------------------------------------------------------------------- /samples/J/SampleServiceApi.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.model.core.annotation.ThriftElement 20 | import io.reactivex.Single 21 | import javax.annotation.Generated 22 | import kotlin.String 23 | import kotlin.Unit 24 | import retrofit2.http.Body 25 | import retrofit2.http.GET 26 | import retrofit2.http.POST 27 | import retrofit2.http.Path 28 | import retrofit2.http.Query 29 | 30 | @Generated( 31 | "ThriftCodeGen Compiler", 32 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 33 | ) 34 | @ThriftElement 35 | interface SampleServiceApi { 36 | @POST("/sample/endpoint2") 37 | fun emptyResponse(@Body param1: String, @Body param2: String): Single 38 | 39 | @GET("/sample") 40 | fun endpoint1(@Path("examplePath") pathParam: String, @Query("exampleQuery") queryParam: String): 41 | Single 42 | } 43 | -------------------------------------------------------------------------------- /samples/J/SampleUnionUnionType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.squareup.moshi.Json 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.model.core.annotation.ThriftElement 22 | import javax.annotation.Generated 23 | 24 | @Generated( 25 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | enum class SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @Json(name = "option1") 34 | OPTION1, 35 | 36 | @Json(name = "option2") 37 | OPTION2, 38 | 39 | @Json(name = "option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/J/TypedefA.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeString 25 | import javax.annotation.Generated 26 | import kotlin.String 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | class TypedefA @KotlinOnly constructor(value: String) : TypeSafeString(value) { 38 | companion object { 39 | /** 40 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 41 | */ 42 | @JvmStatic 43 | fun wrapFrom(other: TypeSafeString): TypedefA = wrap(other.get()) 44 | 45 | @JvmStatic 46 | fun wrap(value: String): TypedefA = TypedefA(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /samples/J/UnauthenticatedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/J/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "org.jetbrains.kotlin.jvm" 5 | 6 | dependencies { 7 | api deps.androidx.annotations 8 | api deps.external.errorProneAnnotations 9 | api deps.external.rxjava2 10 | api deps.external.threetenbpnotzdb 11 | api deps.kotlin.stdLibJdk7 12 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 13 | api project(":libraries:foundation:realtime:presidio-realtime") 14 | api project(":libraries:foundation:uava:uava") 15 | compileOnly deps.external.javax 16 | compileOnly deps.external.javaxInject 17 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 18 | implementation deps.external.dagger 19 | implementation deps.external.gson 20 | implementation deps.external.moshi 21 | implementation deps.external.retrofit2 22 | implementation project(":libraries:foundation:lumber:lumber-logger") 23 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 24 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-moshi") 25 | implementation project(":libraries:foundation:uava:adapters:gson") 26 | implementation project(":libraries:foundation:uava:adapters:moshi") 27 | } 28 | -------------------------------------------------------------------------------- /samples/K/BadRequestCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/K/InternalServerErrorCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/K/NoContent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import javax.annotation.Generated 21 | 22 | @Generated( 23 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | @Immutable 27 | object NoContent { 28 | override fun toString() = "NoContent" 29 | } 30 | -------------------------------------------------------------------------------- /samples/K/RateLimitedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/K/SampleEnum.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/K/SampleRequestPushModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.presidio.realtime.core.PushModel 20 | import javax.annotation.Generated 21 | 22 | @Generated( 23 | "com.uber.realtime.android.typeprocessors.pushmodel.PushModelKotlinTypeProcessor", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | object SampleRequestPushModel : PushModel(SampleRequest::class.java, "push_sample") 27 | -------------------------------------------------------------------------------- /samples/K/SampleServiceApi.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.model.core.annotation.ThriftElement 20 | import io.reactivex.Single 21 | import javax.annotation.Generated 22 | import kotlin.String 23 | import kotlin.Unit 24 | import retrofit2.http.Body 25 | import retrofit2.http.GET 26 | import retrofit2.http.POST 27 | import retrofit2.http.Path 28 | import retrofit2.http.Query 29 | 30 | @Generated( 31 | "ThriftCodeGen Compiler", 32 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 33 | ) 34 | @ThriftElement 35 | interface SampleServiceApi { 36 | @POST("/sample/endpoint2") 37 | fun emptyResponse(@Body param1: String, @Body param2: String): Single 38 | 39 | @GET("/sample") 40 | fun endpoint1(@Path("examplePath") pathParam: String, @Query("exampleQuery") queryParam: String): 41 | Single 42 | } 43 | -------------------------------------------------------------------------------- /samples/K/SampleUnionUnionType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.squareup.moshi.Json 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.model.core.annotation.ThriftElement 22 | import javax.annotation.Generated 23 | 24 | @Generated( 25 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | enum class SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @Json(name = "option1") 34 | OPTION1, 35 | 36 | @Json(name = "option2") 37 | OPTION2, 38 | 39 | @Json(name = "option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/K/TypedefA.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeString 25 | import javax.annotation.Generated 26 | import kotlin.String 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | class TypedefA @KotlinOnly constructor(value: String) : TypeSafeString(value) { 38 | companion object { 39 | /** 40 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 41 | */ 42 | @JvmStatic 43 | fun wrapFrom(other: TypeSafeString) = wrap(other.get()) 44 | 45 | @JvmStatic 46 | fun wrap(value: String) = TypedefA(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /samples/K/TypedefB.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeInt 25 | import javax.annotation.Generated 26 | import kotlin.Int 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | data class TypedefB @KotlinOnly constructor(private val value: Int) : TypeSafeInt { 38 | override fun get() = value 39 | 40 | override fun toString() = value.toString() 41 | 42 | companion object { 43 | /** 44 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 45 | */ 46 | @JvmStatic 47 | fun wrapFrom(other: TypeSafeInt) = wrap(other.get()) 48 | 49 | @JvmStatic 50 | fun wrap(value: Int) = TypedefB(value) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /samples/K/TypedefC.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeBoolean 25 | import javax.annotation.Generated 26 | import kotlin.Boolean 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | data class TypedefC @KotlinOnly constructor(private val value: Boolean) : TypeSafeBoolean { 38 | override fun get() = value 39 | 40 | override fun toString() = value.toString() 41 | 42 | companion object { 43 | /** 44 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 45 | */ 46 | @JvmStatic 47 | fun wrapFrom(other: TypeSafeBoolean) = wrap(other.get()) 48 | 49 | @JvmStatic 50 | fun wrap(value: Boolean) = TypedefC(value) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /samples/K/TypedefD.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeLong 25 | import javax.annotation.Generated 26 | import kotlin.Long 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | data class TypedefD @KotlinOnly constructor(private val value: Long) : TypeSafeLong { 38 | override fun get() = value 39 | 40 | override fun toString() = value.toString() 41 | 42 | companion object { 43 | /** 44 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 45 | */ 46 | @JvmStatic 47 | fun wrapFrom(other: TypeSafeLong) = wrap(other.get()) 48 | 49 | @JvmStatic 50 | fun wrap(value: Long) = TypedefD(value) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /samples/K/UnauthenticatedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/K/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "org.jetbrains.kotlin.jvm" 5 | 6 | dependencies { 7 | api deps.androidx.annotations 8 | api deps.external.errorProneAnnotations 9 | api deps.external.rxjava2 10 | api deps.external.threetenbpnotzdb 11 | api deps.kotlin.stdLibJdk7 12 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 13 | api project(":libraries:foundation:realtime:presidio-realtime") 14 | api project(":libraries:foundation:uava:uava") 15 | compileOnly deps.external.javax 16 | compileOnly deps.external.javaxInject 17 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 18 | implementation deps.external.dagger 19 | implementation deps.external.gson 20 | implementation deps.external.moshi 21 | implementation deps.external.retrofit2 22 | implementation project(":libraries:foundation:lumber:lumber-logger") 23 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 24 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-moshi") 25 | implementation project(":libraries:foundation:uava:adapters:gson") 26 | implementation project(":libraries:foundation:uava:adapters:moshi") 27 | } 28 | 29 | tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { 30 | kotlinOptions { 31 | freeCompilerArgs += [ 32 | "-XXLanguage:+NewInference" 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /samples/L/BadRequestCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/L/InternalServerErrorCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/L/NoContent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import javax.annotation.Generated 21 | import kotlin.String 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @Immutable 28 | object NoContent { 29 | override fun toString(): String = "NoContent" 30 | } 31 | -------------------------------------------------------------------------------- /samples/L/RateLimitedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/L/SampleEnum.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/L/SampleRequestPushModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.presidio.realtime.core.PushModel 20 | import javax.annotation.Generated 21 | 22 | @Generated( 23 | "com.uber.realtime.android.typeprocessors.pushmodel.PushModelKotlinTypeProcessor", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | object SampleRequestPushModel : PushModel(SampleRequest::class.java, "push_sample") 27 | -------------------------------------------------------------------------------- /samples/L/SampleServiceApi.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.model.core.annotation.ThriftElement 20 | import io.reactivex.Single 21 | import javax.annotation.Generated 22 | import kotlin.String 23 | import kotlin.Unit 24 | import retrofit2.http.Body 25 | import retrofit2.http.GET 26 | import retrofit2.http.POST 27 | import retrofit2.http.Path 28 | import retrofit2.http.Query 29 | 30 | @Generated( 31 | "ThriftCodeGen Compiler", 32 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 33 | ) 34 | @ThriftElement 35 | interface SampleServiceApi { 36 | @POST("/sample/endpoint2") 37 | fun emptyResponse(@Body param1: String, @Body param2: String): Single 38 | 39 | @GET("/sample") 40 | fun endpoint1(@Path("examplePath") pathParam: String, @Query("exampleQuery") queryParam: String): 41 | Single 42 | } 43 | -------------------------------------------------------------------------------- /samples/L/SampleUnionUnionType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.squareup.moshi.Json 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.model.core.annotation.ThriftElement 22 | import javax.annotation.Generated 23 | 24 | @Generated( 25 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | enum class SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @Json(name = "option1") 34 | OPTION1, 35 | 36 | @Json(name = "option2") 37 | OPTION2, 38 | 39 | @Json(name = "option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/L/TypedefA.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeString 25 | import javax.annotation.Generated 26 | import kotlin.String 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | class TypedefA @KotlinOnly constructor(value: String) : TypeSafeString(value) { 38 | companion object { 39 | /** 40 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 41 | */ 42 | @JvmStatic 43 | fun wrapFrom(other: TypeSafeString): TypedefA = wrap(other.get()) 44 | 45 | @JvmStatic 46 | fun wrap(value: String): TypedefA = TypedefA(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /samples/L/UnauthenticatedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/L/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "org.jetbrains.kotlin.jvm" 5 | 6 | dependencies { 7 | api deps.androidx.annotations 8 | api deps.external.errorProneAnnotations 9 | api deps.external.rxjava2 10 | api deps.external.threetenbpnotzdb 11 | api deps.kotlin.stdLibJdk7 12 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 13 | api project(":libraries:foundation:realtime:presidio-realtime") 14 | api project(":libraries:foundation:uava:uava") 15 | compileOnly deps.external.javax 16 | compileOnly deps.external.javaxInject 17 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 18 | implementation deps.external.dagger 19 | implementation deps.external.gson 20 | implementation deps.external.moshi 21 | implementation deps.external.retrofit2 22 | implementation project(":libraries:foundation:lumber:lumber-logger") 23 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 24 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-moshi") 25 | implementation project(":libraries:foundation:uava:adapters:gson") 26 | implementation project(":libraries:foundation:uava:adapters:moshi") 27 | } 28 | -------------------------------------------------------------------------------- /samples/M/BadRequestCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class BadRequestCode { 30 | BAD_REQUEST 31 | } 32 | -------------------------------------------------------------------------------- /samples/M/InternalServerErrorCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class InternalServerErrorCode { 30 | SERVER_ERROR 31 | } 32 | -------------------------------------------------------------------------------- /samples/M/NoContent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import javax.annotation.Generated 21 | import kotlin.String 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @Immutable 28 | object NoContent { 29 | override fun toString(): String = "NoContent" 30 | } 31 | -------------------------------------------------------------------------------- /samples/M/RateLimitedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class RateLimitedCode { 30 | RATE_LIMITED 31 | } 32 | -------------------------------------------------------------------------------- /samples/M/SampleEnum.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class SampleEnum { 30 | MEMBER_0, 31 | 32 | MEMBER_1, 33 | 34 | MEMBER_2 35 | } 36 | -------------------------------------------------------------------------------- /samples/M/SampleRequestPushModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.presidio.realtime.core.PushModel 20 | import javax.annotation.Generated 21 | 22 | @Generated( 23 | "com.uber.realtime.android.typeprocessors.pushmodel.PushModelKotlinTypeProcessor", 24 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 25 | ) 26 | object SampleRequestPushModel : PushModel(SampleRequest::class.java, "push_sample") 27 | -------------------------------------------------------------------------------- /samples/M/SampleServiceApi.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.model.core.annotation.ThriftElement 20 | import io.reactivex.Single 21 | import javax.annotation.Generated 22 | import kotlin.String 23 | import kotlin.Unit 24 | import retrofit2.http.Body 25 | import retrofit2.http.GET 26 | import retrofit2.http.POST 27 | import retrofit2.http.Path 28 | import retrofit2.http.Query 29 | 30 | @Generated( 31 | "ThriftCodeGen Compiler", 32 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 33 | ) 34 | @ThriftElement 35 | interface SampleServiceApi { 36 | @POST("/sample/endpoint2") 37 | fun emptyResponse(@Body param1: String, @Body param2: String): Single 38 | 39 | @GET("/sample") 40 | fun endpoint1(@Path("examplePath") pathParam: String, @Query("exampleQuery") queryParam: String): 41 | Single 42 | } 43 | -------------------------------------------------------------------------------- /samples/M/SampleUnionUnionType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.squareup.moshi.Json 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.model.core.annotation.ThriftElement 22 | import javax.annotation.Generated 23 | 24 | @Generated( 25 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 26 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 27 | ) 28 | @ThriftElement 29 | @DoNotMock 30 | enum class SampleUnionUnionType { 31 | UNKNOWN, 32 | 33 | @Json(name = "option1") 34 | OPTION1, 35 | 36 | @Json(name = "option2") 37 | OPTION2, 38 | 39 | @Json(name = "option3") 40 | OPTION3 41 | } 42 | -------------------------------------------------------------------------------- /samples/M/TypedefA.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.google.errorprone.annotations.Immutable 20 | import com.uber.errorprone.annotations.DoNotMock 21 | import com.uber.errorprone.annotations.KotlinOnly 22 | import com.uber.model.core.annotation.ThriftElement 23 | import com.uber.model.core.annotation.TypeSafeWrapper 24 | import com.uber.model.core.wrapper.TypeSafeString 25 | import javax.annotation.Generated 26 | import kotlin.String 27 | import kotlin.jvm.JvmStatic 28 | 29 | @Generated( 30 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 31 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 32 | ) 33 | @ThriftElement 34 | @Immutable 35 | @DoNotMock("Create a real instance via wrap().") 36 | @TypeSafeWrapper 37 | class TypedefA @KotlinOnly constructor(value: String) : TypeSafeString(value) { 38 | companion object { 39 | /** 40 | * Creates a new instance from another wrapper's value. Useful for quick conversions. 41 | */ 42 | @JvmStatic 43 | fun wrapFrom(other: TypeSafeString): TypedefA = wrap(other.get()) 44 | 45 | @JvmStatic 46 | fun wrap(value: String): TypedefA = TypedefA(value) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /samples/M/UnauthenticatedCode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Uber Technologies, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.uber.model.core.generated.example 18 | 19 | import com.uber.errorprone.annotations.DoNotMock 20 | import com.uber.model.core.annotation.ThriftElement 21 | import javax.annotation.Generated 22 | 23 | @Generated( 24 | "com.uber.codegen.compiler.KotlinThriftCodeGenCodeGenerator", 25 | comments = "This code was generated by the Uber ThriftCodeGen Compiler from: example.thrift" 26 | ) 27 | @ThriftElement 28 | @DoNotMock 29 | enum class UnauthenticatedCode { 30 | UNAUTHENTICATED 31 | } 32 | -------------------------------------------------------------------------------- /samples/M/build.gradle: -------------------------------------------------------------------------------- 1 | // @generated 2 | // Generated by ThriftProjectGeneration, do not modify! 3 | 4 | apply plugin: "org.jetbrains.kotlin.jvm" 5 | 6 | dependencies { 7 | api deps.androidx.annotations 8 | api deps.external.errorProneAnnotations 9 | api deps.external.rxjava2 10 | api deps.external.threetenbpnotzdb 11 | api deps.kotlin.stdLibJdk7 12 | api project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime") 13 | api project(":libraries:foundation:realtime:presidio-realtime") 14 | api project(":libraries:foundation:uava:uava") 15 | compileOnly deps.external.javax 16 | compileOnly deps.external.javaxInject 17 | compileOnly project(":tooling:program-analysis:error-prone:annotations") 18 | implementation deps.external.dagger 19 | implementation deps.external.gson 20 | implementation deps.external.moshi 21 | implementation deps.external.retrofit2 22 | implementation project(":libraries:foundation:lumber:lumber-logger") 23 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-gson") 24 | implementation project(":libraries:foundation:modelgen:thriftcodegen:thriftcodegen-runtime-moshi") 25 | implementation project(":libraries:foundation:uava:adapters:gson") 26 | implementation project(":libraries:foundation:uava:adapters:moshi") 27 | } 28 | 29 | tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { 30 | kotlinOptions { 31 | freeCompilerArgs += [ 32 | "-XXLanguage:+NewInference" 33 | ] 34 | } 35 | } 36 | --------------------------------------------------------------------------------