From 8ee365815f616d708a129b92610e8e20f24e8b38 Mon Sep 17 00:00:00 2001 From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Date: Wed, 17 Jul 2024 10:05:44 -0400 Subject: [PATCH] Call into overload with context instead of duplicating logic (#2862) Call into overload with context instead of duplicating logic --- .../clientmodel/AndroidClientMethod.java | 72 +- .../implementation/DocumentModelsImpl.java | 75 +- .../implementation/MiscellaneousImpl.java | 8 +- .../implementation/AuthenticationsImpl.java | 10 +- .../ContainerRegistriesImpl.java | 62 +- .../ContainerRegistryBlobsImpl.java | 101 +-- .../implementation/SchemasImpl.java | 64 +- .../ParameterGroupings.java | 133 +--- .../AutoRestReportServiceForAzure.java | 6 +- .../azurespecials/ApiVersionDefaults.java | 32 +- .../azurespecials/ApiVersionLocals.java | 35 +- .../java/fixtures/azurespecials/Headers.java | 83 +-- .../java/fixtures/azurespecials/Odatas.java | 8 +- .../azurespecials/SkipUrlEncodings.java | 69 +- .../SubscriptionInCredentials.java | 60 +- .../azurespecials/SubscriptionInMethods.java | 44 +- .../azurespecials/XMsClientRequestIds.java | 18 +- .../subscriptionidapiversion/Groups.java | 16 +- .../implementation/ArraysImpl.java | 15 +- .../implementation/BasicsImpl.java | 19 +- .../implementation/DictionariesImpl.java | 18 +- .../implementation/FlattencomplexesImpl.java | 3 +- .../implementation/InheritancesImpl.java | 6 +- .../PolymorphicrecursivesImpl.java | 6 +- .../implementation/PolymorphismsImpl.java | 32 +- .../implementation/PrimitivesImpl.java | 69 +- .../ReadonlypropertiesImpl.java | 6 +- .../method/FluentActionMethod.java | 3 +- .../template/FluentClientMethodTemplate.java | 15 +- .../autorest/mapper/ClientMethodMapper.java | 12 +- .../model/clientmodel/ClientMethod.java | 323 ++++---- .../model/clientmodel/ProxyMethod.java | 116 ++- .../autorest/model/javamodel/JavaBlock.java | 4 + .../template/ClientMethodTemplate.java | 202 +++-- .../template/MethodGroupTemplate.java | 4 +- .../com/azure/autorest/util/MethodNamer.java | 22 +- .../fixtures/additionalproperties/Pets.java | 85 +-- .../main/java/fixtures/bodyarray/Arrays.java | 553 ++------------ .../main/java/fixtures/bodyboolean/Bools.java | 44 +- .../fixtures/bodyboolean/quirks/Bools.java | 42 +- .../fixtures/bodybyte/ByteOperations.java | 38 +- .../java/fixtures/bodycomplex/Arrays.java | 45 +- .../java/fixtures/bodycomplex/Basics.java | 48 +- .../fixtures/bodycomplex/Dictionaries.java | 52 +- .../bodycomplex/Flattencomplexes.java | 7 +- .../fixtures/bodycomplex/Inheritances.java | 19 +- .../bodycomplex/Polymorphicrecursives.java | 19 +- .../fixtures/bodycomplex/Polymorphisms.java | 88 +-- .../java/fixtures/bodycomplex/Primitives.java | 212 +----- .../bodycomplex/Readonlyproperties.java | 19 +- .../fixtures/bodydate/DateOperations.java | 62 +- .../bodydatetime/DatetimeOperations.java | 196 +---- .../bodydatetimerfc1123/Datetimerfc1123s.java | 75 +- .../implementation/DictionariesImpl.java | 520 ++----------- .../bodyduration/DurationOperations.java | 32 +- .../main/java/fixtures/bodyfile/Files.java | 21 +- .../Formdataurlencodeds.java | 29 +- .../main/java/fixtures/bodyinteger/Ints.java | 103 +-- .../java/fixtures/bodynumber/Numbers.java | 191 +---- .../bodystring/implementation/EnumsImpl.java | 56 +- .../implementation/StringOperationsImpl.java | 100 +-- .../java/fixtures/constants/Contants.java | 153 +--- .../java/fixtures/custombaseuri/Paths.java | 10 +- .../custombaseuri/moreoptions/Paths.java | 21 +- .../HeadExceptions.java | 18 +- .../discriminatorenum/EnumDiscriminator.java | 6 +- .../discriminatorflattening/MetricAlerts.java | 7 +- .../clientflatten/MetricAlerts.java | 7 +- .../noflatten/MetricAlerts.java | 7 +- .../requirexmsflattened/MetricAlerts.java | 7 +- .../EnumDiscriminator.java | 6 +- .../java/fixtures/extensibleenums/Pets.java | 20 +- .../main/java/fixtures/head/HttpSuccess.java | 18 +- .../main/java/fixtures/header/Headers.java | 464 ++---------- .../headexceptions/HeadExceptions.java | 18 +- .../HttpClientFailures.java | 195 +---- .../httpinfrastructure/HttpFailures.java | 21 +- .../httpinfrastructure/HttpRedirects.java | 246 +----- .../httpinfrastructure/HttpRetries.java | 69 +- .../HttpServerFailures.java | 30 +- .../httpinfrastructure/HttpSuccess.java | 147 +--- .../httpinfrastructure/MultipleResponses.java | 255 +------ .../passdiscriminator/MetricAlerts.java | 7 +- .../src/main/java/fixtures/lro/LRORetrys.java | 128 +--- .../src/main/java/fixtures/lro/LROs.java | 700 +++--------------- .../java/fixtures/lro/LROsCustomHeaders.java | 79 +- .../src/main/java/fixtures/lro/LrosaDs.java | 473 ++---------- .../fixtures/mediatypes/MediaTypesClient.java | 174 +---- ...AutoRestResourceFlatteningTestService.java | 124 +--- .../MultipleInheritanceServiceClient.java | 85 +-- .../nonamedresponsetypes/Headers.java | 464 ++---------- .../implementation/FloatOperationsImpl.java | 14 +- .../implementation/IntsImpl.java | 14 +- .../notypedheadersmethods/Headers.java | 315 +------- .../parameterflattening/AvailabilitySets.java | 21 +- .../report/AutoRestReportService.java | 12 +- ...equiredFieldsAsCtorArgsTransformation.java | 6 +- .../fixtures/requiredoptional/Explicits.java | 280 +------ .../fixtures/requiredoptional/Implicits.java | 85 +-- .../java/fixtures/specialheader/Headers.java | 32 +- .../streamstyleserialization/Arrays.java | 47 +- .../streamstyleserialization/Basics.java | 49 +- .../Dictionaries.java | 54 +- .../Flattencomplexes.java | 7 +- .../Inheritances.java | 20 +- .../Polymorphicrecursives.java | 20 +- .../Polymorphisms.java | 92 +-- .../streamstyleserialization/Primitives.java | 223 +----- .../Readonlyproperties.java | 20 +- .../Arrays.java | 47 +- .../Basics.java | 49 +- .../Dictionaries.java | 54 +- .../Flattencomplexes.java | 7 +- .../Inheritances.java | 20 +- .../Polymorphicrecursives.java | 20 +- .../Polymorphisms.java | 92 +-- .../Primitives.java | 223 +----- .../Readonlyproperties.java | 20 +- .../Arrays.java | 47 +- .../Basics.java | 49 +- .../Dictionaries.java | 54 +- .../Flattencomplexes.java | 7 +- .../Inheritances.java | 20 +- .../Polymorphicrecursives.java | 20 +- .../Polymorphisms.java | 92 +-- .../Primitives.java | 223 +----- .../Readonlyproperties.java | 20 +- .../streamstylexmlserialization/Xmls.java | 332 +-------- .../src/main/java/fixtures/url/PathItems.java | 88 +-- .../src/main/java/fixtures/url/Paths.java | 265 +------ .../src/main/java/fixtures/url/Queries.java | 326 +------- .../main/java/fixtures/url/multi/Queries.java | 33 +- .../validation/AutoRestValidationTest.java | 51 +- .../main/java/fixtures/xmlservice/Xmls.java | 332 +-------- 134 files changed, 1806 insertions(+), 10382 deletions(-) diff --git a/androidgen/src/main/java/com/azure/autorest/android/model/clientmodel/AndroidClientMethod.java b/androidgen/src/main/java/com/azure/autorest/android/model/clientmodel/AndroidClientMethod.java index 97180cc7bc..0e22d38dea 100644 --- a/androidgen/src/main/java/com/azure/autorest/android/model/clientmodel/AndroidClientMethod.java +++ b/androidgen/src/main/java/com/azure/autorest/android/model/clientmodel/AndroidClientMethod.java @@ -24,14 +24,16 @@ public class AndroidClientMethod extends ClientMethod { /** * Create a new ClientMethod with the provided properties. + * * @param description The description of this ClientMethod. * @param returnValue The return value of this ClientMethod. * @param name The name of this ClientMethod. * @param parameters The parameters of this ClientMethod. - * @param onlyRequiredParameters Whether or not this ClientMethod has omitted optional parameters. + * @param onlyRequiredParameters Whether this ClientMethod has omitted optional parameters. * @param type The type of this ClientMethod. * @param proxyMethod The ProxyMethod that this ClientMethod eventually calls. - * @param validateExpressions The expressions (parameters and service client properties) that need to be validated in this ClientMethod. + * @param validateExpressions The expressions (parameters and service client properties) that need to be validated + * in this ClientMethod. * @param clientReference The reference to the service client. * @param requiredNullableParameterExpressions The parameter expressions which are required. * @param isGroupedParameterRequired The parameter that needs to transformed before pagination. @@ -39,34 +41,21 @@ public class AndroidClientMethod extends ClientMethod { * @param methodPageDetails The pagination information if this is a paged method. * @param methodTransformationDetails The parameter transformations before calling ProxyMethod. * @param externalDocumentation The external documentation. + * @param hasWithContextOverload Whether this ClientMethod has a withContext overload. */ protected AndroidClientMethod(String description, ReturnValue returnValue, String name, - List parameters, boolean onlyRequiredParameters, - ClientMethodType type, ProxyMethod proxyMethod, Map validateExpressions, - String clientReference, List requiredNullableParameterExpressions, - boolean isGroupedParameterRequired, String groupedParameterTypeName, - MethodPageDetails methodPageDetails, List methodTransformationDetails, - JavaVisibility methodVisibility, JavaVisibility methodVisibilityInWrapperClient, MethodPollingDetails methodPollingDetails, ExternalDocumentation externalDocumentation) { - super(description, - returnValue, - name, - parameters, - onlyRequiredParameters, - type, - proxyMethod, - validateExpressions, - clientReference, - requiredNullableParameterExpressions, - isGroupedParameterRequired, - groupedParameterTypeName, - methodPageDetails, - methodTransformationDetails, - methodVisibility, - methodVisibilityInWrapperClient, - null, - methodPollingDetails, - externalDocumentation, - null); + List parameters, boolean onlyRequiredParameters, ClientMethodType type, + ProxyMethod proxyMethod, Map validateExpressions, String clientReference, + List requiredNullableParameterExpressions, boolean isGroupedParameterRequired, + String groupedParameterTypeName, MethodPageDetails methodPageDetails, + List methodTransformationDetails, JavaVisibility methodVisibility, + JavaVisibility methodVisibilityInWrapperClient, MethodPollingDetails methodPollingDetails, + ExternalDocumentation externalDocumentation, boolean hasWithContextOverload) { + super(description, returnValue, name, parameters, onlyRequiredParameters, type, proxyMethod, + validateExpressions, clientReference, requiredNullableParameterExpressions, isGroupedParameterRequired, + groupedParameterTypeName, methodPageDetails, methodTransformationDetails, methodVisibility, + methodVisibilityInWrapperClient, null, methodPollingDetails, externalDocumentation, null, + hasWithContextOverload); } @Override @@ -101,29 +90,12 @@ public void addImportsTo(Set imports, boolean includeImplementationImpor public static class Builder extends ClientMethod.Builder { @Override - /** - * @return an immutable ClientMethod instance with the configurations on this builder. - */ public ClientMethod build() { - return new AndroidClientMethod( - description, - returnValue, - name, - parameters, - onlyRequiredParameters, - type, - proxyMethod, - validateExpressions, - clientReference, - requiredNullableParameterExpressions, - isGroupedParameterRequired, - groupedParameterTypeName, - methodPageDetails, - methodTransformationDetails, - methodVisibility, - methodVisibilityInWrapperClient, - methodPollingDetails, - externalDocumentation); + return new AndroidClientMethod(description, returnValue, name, parameters, onlyRequiredParameters, type, + proxyMethod, validateExpressions, clientReference, requiredNullableParameterExpressions, + isGroupedParameterRequired, groupedParameterTypeName, methodPageDetails, methodTransformationDetails, + methodVisibility, methodVisibilityInWrapperClient, methodPollingDetails, externalDocumentation, + hasWithContextOverload); } } } diff --git a/azure-dataplane-tests/src/main/java/com/azure/ai/formrecognizer/documentanalysis/implementation/DocumentModelsImpl.java b/azure-dataplane-tests/src/main/java/com/azure/ai/formrecognizer/documentanalysis/implementation/DocumentModelsImpl.java index f9ef3f9f9b..c03535e1ab 100644 --- a/azure-dataplane-tests/src/main/java/com/azure/ai/formrecognizer/documentanalysis/implementation/DocumentModelsImpl.java +++ b/azure-dataplane-tests/src/main/java/com/azure/ai/formrecognizer/documentanalysis/implementation/DocumentModelsImpl.java @@ -389,9 +389,8 @@ Response listModelsNextSync( public Mono> analyzeDocumentWithResponseAsync( String modelId, String pages, String locale, StringIndexType stringIndexType, AnalyzeDocumentRequest analyzeRequest) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.analyzeDocument(this.client.getEndpoint(), modelId, pages, - locale, stringIndexType, this.client.getApiVersion(), analyzeRequest, accept, context)); + return FluxUtil.withContext(context -> analyzeDocumentWithResponseAsync(modelId, pages, locale, stringIndexType, + analyzeRequest, context)); } /** @@ -563,9 +562,8 @@ public SyncPoller beginAnalyzeDocument(String modelId, S @ServiceMethod(returns = ReturnType.SINGLE) public Mono> analyzeDocumentNoCustomHeadersWithResponseAsync(String modelId, String pages, String locale, StringIndexType stringIndexType, AnalyzeDocumentRequest analyzeRequest) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.analyzeDocumentNoCustomHeaders(this.client.getEndpoint(), - modelId, pages, locale, stringIndexType, this.client.getApiVersion(), analyzeRequest, accept, context)); + return FluxUtil.withContext(context -> analyzeDocumentNoCustomHeadersWithResponseAsync(modelId, pages, locale, + stringIndexType, analyzeRequest, context)); } /** @@ -740,10 +738,8 @@ public SyncPoller beginAnalyzeDocumentNoCustomHeaders(St public Mono> analyzeDocumentWithResponseAsync( String modelId, ContentType contentType, String pages, String locale, StringIndexType stringIndexType, Flux analyzeRequest, Long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.analyzeDocument(this.client.getEndpoint(), modelId, pages, locale, stringIndexType, - this.client.getApiVersion(), contentType, analyzeRequest, contentLength, accept, context)); + return FluxUtil.withContext(context -> analyzeDocumentWithResponseAsync(modelId, contentType, pages, locale, + stringIndexType, analyzeRequest, contentLength, context)); } /** @@ -851,10 +847,8 @@ public PollerFlux beginAnalyzeDocumentAsync(String model public Mono> analyzeDocumentNoCustomHeadersWithResponseAsync(String modelId, ContentType contentType, String pages, String locale, StringIndexType stringIndexType, Flux analyzeRequest, Long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.analyzeDocumentNoCustomHeaders(this.client.getEndpoint(), - modelId, pages, locale, stringIndexType, this.client.getApiVersion(), contentType, analyzeRequest, - contentLength, accept, context)); + return FluxUtil.withContext(context -> analyzeDocumentNoCustomHeadersWithResponseAsync(modelId, contentType, + pages, locale, stringIndexType, analyzeRequest, contentLength, context)); } /** @@ -962,10 +956,8 @@ public PollerFlux beginAnalyzeDocumentNoCustomHeadersAsy public Mono> analyzeDocumentWithResponseAsync( String modelId, ContentType contentType, String pages, String locale, StringIndexType stringIndexType, BinaryData analyzeRequest, Long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.analyzeDocument(this.client.getEndpoint(), modelId, pages, locale, stringIndexType, - this.client.getApiVersion(), contentType, analyzeRequest, contentLength, accept, context)); + return FluxUtil.withContext(context -> analyzeDocumentWithResponseAsync(modelId, contentType, pages, locale, + stringIndexType, analyzeRequest, contentLength, context)); } /** @@ -1155,10 +1147,8 @@ public SyncPoller beginAnalyzeDocument(String modelId, C @ServiceMethod(returns = ReturnType.SINGLE) public Mono> analyzeDocumentNoCustomHeadersWithResponseAsync(String modelId, ContentType contentType, String pages, String locale, StringIndexType stringIndexType, BinaryData analyzeRequest, Long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.analyzeDocumentNoCustomHeaders(this.client.getEndpoint(), - modelId, pages, locale, stringIndexType, this.client.getApiVersion(), contentType, analyzeRequest, - contentLength, accept, context)); + return FluxUtil.withContext(context -> analyzeDocumentNoCustomHeadersWithResponseAsync(modelId, contentType, + pages, locale, stringIndexType, analyzeRequest, contentLength, context)); } /** @@ -1343,9 +1333,7 @@ public SyncPoller beginAnalyzeDocumentNoCustomHeaders(St */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAnalyzeResultWithResponseAsync(String modelId, String resultId) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAnalyzeResult(this.client.getEndpoint(), modelId, resultId, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getAnalyzeResultWithResponseAsync(modelId, resultId, context)); } /** @@ -1445,9 +1433,7 @@ public AnalyzeResultOperation getAnalyzeResult(String modelId, String resultId) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> buildModelWithResponseAsync(BuildDocumentModelRequest buildRequest) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.buildModel(this.client.getEndpoint(), - this.client.getApiVersion(), buildRequest, accept, context)); + return FluxUtil.withContext(context -> buildModelWithResponseAsync(buildRequest, context)); } /** @@ -1573,9 +1559,7 @@ public SyncPoller beginBuildModel(BuildDocumentModelRequ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> buildModelNoCustomHeadersWithResponseAsync(BuildDocumentModelRequest buildRequest) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.buildModelNoCustomHeaders(this.client.getEndpoint(), - this.client.getApiVersion(), buildRequest, accept, context)); + return FluxUtil.withContext(context -> buildModelNoCustomHeadersWithResponseAsync(buildRequest, context)); } /** @@ -1707,9 +1691,7 @@ public SyncPoller beginBuildModelNoCustomHeaders(BuildDo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> composeModelWithResponseAsync(ComposeDocumentModelRequest composeRequest) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.composeModel(this.client.getEndpoint(), - this.client.getApiVersion(), composeRequest, accept, context)); + return FluxUtil.withContext(context -> composeModelWithResponseAsync(composeRequest, context)); } /** @@ -1839,9 +1821,7 @@ public SyncPoller beginComposeModel(ComposeDocumentModel @ServiceMethod(returns = ReturnType.SINGLE) public Mono> composeModelNoCustomHeadersWithResponseAsync(ComposeDocumentModelRequest composeRequest) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.composeModelNoCustomHeaders(this.client.getEndpoint(), - this.client.getApiVersion(), composeRequest, accept, context)); + return FluxUtil.withContext(context -> composeModelNoCustomHeadersWithResponseAsync(composeRequest, context)); } /** @@ -1976,9 +1956,7 @@ public Response composeModelNoCustomHeadersWithResponse(ComposeDocumentMod @ServiceMethod(returns = ReturnType.SINGLE) public Mono> authorizeModelCopyWithResponseAsync(AuthorizeCopyRequest authorizeCopyRequest) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.authorizeModelCopy(this.client.getEndpoint(), - this.client.getApiVersion(), authorizeCopyRequest, accept, context)); + return FluxUtil.withContext(context -> authorizeModelCopyWithResponseAsync(authorizeCopyRequest, context)); } /** @@ -2084,9 +2062,7 @@ public CopyAuthorization authorizeModelCopy(AuthorizeCopyRequest authorizeCopyRe @ServiceMethod(returns = ReturnType.SINGLE) public Mono> copyModelToWithResponseAsync(String modelId, CopyAuthorization copyToRequest) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.copyModelTo(this.client.getEndpoint(), modelId, - this.client.getApiVersion(), copyToRequest, accept, context)); + return FluxUtil.withContext(context -> copyModelToWithResponseAsync(modelId, copyToRequest, context)); } /** @@ -2223,9 +2199,8 @@ public SyncPoller beginCopyModelTo(String modelId, CopyA @ServiceMethod(returns = ReturnType.SINGLE) public Mono> copyModelToNoCustomHeadersWithResponseAsync(String modelId, CopyAuthorization copyToRequest) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.copyModelToNoCustomHeaders(this.client.getEndpoint(), modelId, - this.client.getApiVersion(), copyToRequest, accept, context)); + return FluxUtil + .withContext(context -> copyModelToNoCustomHeadersWithResponseAsync(modelId, copyToRequest, context)); } /** @@ -2488,9 +2463,7 @@ public PagedIterable listModels(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getModelWithResponseAsync(String modelId) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(this.client.getEndpoint(), modelId, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getModelWithResponseAsync(modelId, context)); } /** @@ -2579,9 +2552,7 @@ public DocumentModelDetails getModel(String modelId) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteModelWithResponseAsync(String modelId) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteModel(this.client.getEndpoint(), modelId, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> deleteModelWithResponseAsync(modelId, context)); } /** diff --git a/azure-dataplane-tests/src/main/java/com/azure/ai/formrecognizer/documentanalysis/implementation/MiscellaneousImpl.java b/azure-dataplane-tests/src/main/java/com/azure/ai/formrecognizer/documentanalysis/implementation/MiscellaneousImpl.java index 490701085e..d83348c2fe 100644 --- a/azure-dataplane-tests/src/main/java/com/azure/ai/formrecognizer/documentanalysis/implementation/MiscellaneousImpl.java +++ b/azure-dataplane-tests/src/main/java/com/azure/ai/formrecognizer/documentanalysis/implementation/MiscellaneousImpl.java @@ -251,9 +251,7 @@ public PagedIterable listOperations(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getOperationWithResponseAsync(String operationId) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getOperation(this.client.getEndpoint(), operationId, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getOperationWithResponseAsync(operationId, context)); } /** @@ -343,9 +341,7 @@ public OperationDetails getOperation(String operationId) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getResourceInfoWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getResourceInfo(this.client.getEndpoint(), - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getResourceInfoWithResponseAsync(context)); } /** diff --git a/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/AuthenticationsImpl.java b/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/AuthenticationsImpl.java index 35b01c643e..08f2f98711 100644 --- a/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/AuthenticationsImpl.java +++ b/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/AuthenticationsImpl.java @@ -114,9 +114,8 @@ Response exchangeAcrRefreshTokenForAcrAccessTokenSync(@HostParam public Mono> exchangeAadAccessTokenForAcrRefreshTokenWithResponseAsync( PostContentSchemaGrantType grantType, String serviceParam, String tenant, String refreshToken, String accessToken) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.exchangeAadAccessTokenForAcrRefreshToken(this.client.getUrl(), - this.client.getApiVersion(), grantType, serviceParam, tenant, refreshToken, accessToken, accept, context)); + return FluxUtil.withContext(context -> exchangeAadAccessTokenForAcrRefreshTokenWithResponseAsync(grantType, + serviceParam, tenant, refreshToken, accessToken, context)); } /** @@ -242,9 +241,8 @@ public AcrRefreshToken exchangeAadAccessTokenForAcrRefreshToken(PostContentSchem @ServiceMethod(returns = ReturnType.SINGLE) public Mono> exchangeAcrRefreshTokenForAcrAccessTokenWithResponseAsync(String serviceParam, String scope, String refreshToken, TokenGrantType grantType) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.exchangeAcrRefreshTokenForAcrAccessToken(this.client.getUrl(), - this.client.getApiVersion(), serviceParam, scope, refreshToken, grantType, accept, context)); + return FluxUtil.withContext(context -> exchangeAcrRefreshTokenForAcrAccessTokenWithResponseAsync(serviceParam, + scope, refreshToken, grantType, context)); } /** diff --git a/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/ContainerRegistriesImpl.java b/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/ContainerRegistriesImpl.java index e1845f7a28..d50a7b93bb 100644 --- a/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/ContainerRegistriesImpl.java +++ b/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/ContainerRegistriesImpl.java @@ -477,8 +477,7 @@ Response getManifestsNextNoCustomHeadersSync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> checkDockerV2SupportWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.checkDockerV2Support(this.client.getUrl(), accept, context)); + return FluxUtil.withContext(context -> checkDockerV2SupportWithResponseAsync(context)); } /** @@ -563,8 +562,7 @@ public void checkDockerV2Support() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getManifestWithResponseAsync(String name, String reference, String accept) { - return FluxUtil - .withContext(context -> service.getManifest(this.client.getUrl(), name, reference, accept, context)); + return FluxUtil.withContext(context -> getManifestWithResponseAsync(name, reference, accept, context)); } /** @@ -677,9 +675,8 @@ public BinaryData getManifest(String name, String reference, String accept) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createManifestWithResponseAsync( String name, String reference, Flux payload, long contentLength, String contentType) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createManifest(this.client.getUrl(), name, reference, - contentType, payload, contentLength, accept, context)); + return FluxUtil.withContext( + context -> createManifestWithResponseAsync(name, reference, payload, contentLength, contentType, context)); } /** @@ -762,9 +759,8 @@ public Mono createManifestAsync(String name, String reference, Flux> createManifestNoCustomHeadersWithResponseAsync(String name, String reference, Flux payload, long contentLength, String contentType) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createManifestNoCustomHeaders(this.client.getUrl(), name, - reference, contentType, payload, contentLength, accept, context)); + return FluxUtil.withContext(context -> createManifestNoCustomHeadersWithResponseAsync(name, reference, payload, + contentLength, contentType, context)); } /** @@ -805,9 +801,8 @@ public Mono> createManifestNoCustomHeadersWithResponseAsync(Strin @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createManifestWithResponseAsync( String name, String reference, BinaryData payload, long contentLength, String contentType) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createManifest(this.client.getUrl(), name, reference, - contentType, payload, contentLength, accept, context)); + return FluxUtil.withContext( + context -> createManifestWithResponseAsync(name, reference, payload, contentLength, contentType, context)); } /** @@ -889,9 +884,8 @@ public Mono createManifestAsync(String name, String reference, BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createManifestNoCustomHeadersWithResponseAsync(String name, String reference, BinaryData payload, long contentLength, String contentType) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createManifestNoCustomHeaders(this.client.getUrl(), name, - reference, contentType, payload, contentLength, accept, context)); + return FluxUtil.withContext(context -> createManifestNoCustomHeadersWithResponseAsync(name, reference, payload, + contentLength, contentType, context)); } /** @@ -990,9 +984,7 @@ public Response createManifestNoCustomHeadersWithResponse(String name, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteManifestWithResponseAsync(String name, String reference) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteManifest(this.client.getUrl(), name, reference, accept, context)); + return FluxUtil.withContext(context -> deleteManifestWithResponseAsync(name, reference, context)); } /** @@ -1241,9 +1233,7 @@ public PagedIterable getRepositoriesNoCustomHeaders(String last, Integer */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getPropertiesWithResponseAsync(String name) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getProperties(this.client.getUrl(), name, this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getPropertiesWithResponseAsync(name, context)); } /** @@ -1332,9 +1322,7 @@ public ContainerRepositoryProperties getProperties(String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteRepositoryWithResponseAsync(String name) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteRepository(this.client.getUrl(), name, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> deleteRepositoryWithResponseAsync(name, context)); } /** @@ -1425,9 +1413,7 @@ public DeleteRepositoryResult deleteRepository(String name) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updatePropertiesWithResponseAsync(String name, RepositoryWriteableProperties value) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateProperties(this.client.getUrl(), name, - this.client.getApiVersion(), value, accept, context)); + return FluxUtil.withContext(context -> updatePropertiesWithResponseAsync(name, value, context)); } /** @@ -1717,9 +1703,7 @@ public PagedIterable getTagsNoCustomHeaders(String name, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getTagPropertiesWithResponseAsync(String name, String reference) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTagProperties(this.client.getUrl(), name, reference, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getTagPropertiesWithResponseAsync(name, reference, context)); } /** @@ -1821,9 +1805,7 @@ public ArtifactTagPropertiesInternal getTagProperties(String name, String refere @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateTagAttributesWithResponseAsync(String name, String reference, TagWriteableProperties value) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateTagAttributes(this.client.getUrl(), name, reference, - this.client.getApiVersion(), value, accept, context)); + return FluxUtil.withContext(context -> updateTagAttributesWithResponseAsync(name, reference, value, context)); } /** @@ -1932,9 +1914,7 @@ public ArtifactTagPropertiesInternal updateTagAttributes(String name, String ref */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteTagWithResponseAsync(String name, String reference) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteTag(this.client.getUrl(), name, reference, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> deleteTagWithResponseAsync(name, reference, context)); } /** @@ -2211,9 +2191,7 @@ public PagedIterable getManifestsNoCustomHeaders(String @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getManifestPropertiesWithResponseAsync(String name, String digest) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getManifestProperties(this.client.getUrl(), name, digest, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getManifestPropertiesWithResponseAsync(name, digest, context)); } /** @@ -2316,9 +2294,7 @@ public ArtifactManifestPropertiesInternal getManifestProperties(String name, Str @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateManifestPropertiesWithResponseAsync(String name, String digest, ManifestWriteableProperties value) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateManifestProperties(this.client.getUrl(), name, digest, - this.client.getApiVersion(), value, accept, context)); + return FluxUtil.withContext(context -> updateManifestPropertiesWithResponseAsync(name, digest, value, context)); } /** diff --git a/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/ContainerRegistryBlobsImpl.java b/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/ContainerRegistryBlobsImpl.java index 62ae0505d8..c2d0cce578 100644 --- a/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/ContainerRegistryBlobsImpl.java +++ b/azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/ContainerRegistryBlobsImpl.java @@ -414,8 +414,7 @@ Response checkChunkExistsNoCustomHeadersSync(@HostParam("url") String url, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBlobWithResponseAsync(String name, String digest) { - final String accept = "application/octet-stream"; - return FluxUtil.withContext(context -> service.getBlob(this.client.getUrl(), name, digest, accept, context)); + return FluxUtil.withContext(context -> getBlobWithResponseAsync(name, digest, context)); } /** @@ -479,9 +478,7 @@ public Mono getBlobAsync(String name, String digest, Context context */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBlobNoCustomHeadersWithResponseAsync(String name, String digest) { - final String accept = "application/octet-stream"; - return FluxUtil.withContext( - context -> service.getBlobNoCustomHeaders(this.client.getUrl(), name, digest, accept, context)); + return FluxUtil.withContext(context -> getBlobNoCustomHeadersWithResponseAsync(name, digest, context)); } /** @@ -565,9 +562,7 @@ public Response getBlobNoCustomHeadersWithResponse(String name, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Mono> checkBlobExistsWithResponseAsync(String name, String digest) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.checkBlobExists(this.client.getUrl(), name, digest, accept, context)); + return FluxUtil.withContext(context -> checkBlobExistsWithResponseAsync(name, digest, context)); } /** @@ -631,9 +626,7 @@ public Mono checkBlobExistsAsync(String name, String digest, Context conte */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> checkBlobExistsNoCustomHeadersWithResponseAsync(String name, String digest) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.checkBlobExistsNoCustomHeaders(this.client.getUrl(), name, digest, accept, context)); + return FluxUtil.withContext(context -> checkBlobExistsNoCustomHeadersWithResponseAsync(name, digest, context)); } /** @@ -716,7 +709,7 @@ public Response checkBlobExistsNoCustomHeadersWithResponse(String name, St @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteBlobWithResponseAsync(String name, String digest) { - return FluxUtil.withContext(context -> service.deleteBlob(this.client.getUrl(), name, digest, context)); + return FluxUtil.withContext(context -> deleteBlobWithResponseAsync(name, digest, context)); } /** @@ -779,8 +772,7 @@ public Mono deleteBlobAsync(String name, String digest, Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteBlobNoCustomHeadersWithResponseAsync(String name, String digest) { - return FluxUtil - .withContext(context -> service.deleteBlobNoCustomHeaders(this.client.getUrl(), name, digest, context)); + return FluxUtil.withContext(context -> deleteBlobNoCustomHeadersWithResponseAsync(name, digest, context)); } /** @@ -861,9 +853,7 @@ public Response deleteBlobNoCustomHeadersWithResponse(String name, String @ServiceMethod(returns = ReturnType.SINGLE) public Mono> mountBlobWithResponseAsync(String name, String from, String mount) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.mountBlob(this.client.getUrl(), name, from, mount, accept, context)); + return FluxUtil.withContext(context -> mountBlobWithResponseAsync(name, from, mount, context)); } /** @@ -931,9 +921,7 @@ public Mono mountBlobAsync(String name, String from, String mount, Context */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> mountBlobNoCustomHeadersWithResponseAsync(String name, String from, String mount) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.mountBlobNoCustomHeaders(this.client.getUrl(), name, from, mount, accept, context)); + return FluxUtil.withContext(context -> mountBlobNoCustomHeadersWithResponseAsync(name, from, mount, context)); } /** @@ -1022,9 +1010,7 @@ public Response mountBlobNoCustomHeadersWithResponse(String name, String f @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUploadStatusWithResponseAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getUploadStatus(this.client.getUrl(), nextLink, accept, context)); + return FluxUtil.withContext(context -> getUploadStatusWithResponseAsync(nextLink, context)); } /** @@ -1092,9 +1078,7 @@ public Mono getUploadStatusAsync(String nextLink, Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUploadStatusNoCustomHeadersWithResponseAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getUploadStatusNoCustomHeaders(this.client.getUrl(), nextLink, accept, context)); + return FluxUtil.withContext(context -> getUploadStatusNoCustomHeadersWithResponseAsync(nextLink, context)); } /** @@ -1182,9 +1166,7 @@ public Response getUploadStatusNoCustomHeadersWithResponse(String nextLink @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadChunkWithResponseAsync(String nextLink, Flux value, long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.uploadChunk(this.client.getUrl(), nextLink, value, contentLength, accept, context)); + return FluxUtil.withContext(context -> uploadChunkWithResponseAsync(nextLink, value, contentLength, context)); } /** @@ -1257,9 +1239,8 @@ public Mono uploadChunkAsync(String nextLink, Flux value, long @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadChunkNoCustomHeadersWithResponseAsync(String nextLink, Flux value, long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadChunkNoCustomHeaders(this.client.getUrl(), nextLink, value, - contentLength, accept, context)); + return FluxUtil.withContext( + context -> uploadChunkNoCustomHeadersWithResponseAsync(nextLink, value, contentLength, context)); } /** @@ -1298,9 +1279,7 @@ public Mono> uploadChunkNoCustomHeadersWithResponseAsync(String n @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadChunkWithResponseAsync(String nextLink, BinaryData value, long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.uploadChunk(this.client.getUrl(), nextLink, value, contentLength, accept, context)); + return FluxUtil.withContext(context -> uploadChunkWithResponseAsync(nextLink, value, contentLength, context)); } /** @@ -1373,9 +1352,8 @@ public Mono uploadChunkAsync(String nextLink, BinaryData value, long conte @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadChunkNoCustomHeadersWithResponseAsync(String nextLink, BinaryData value, long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadChunkNoCustomHeaders(this.client.getUrl(), nextLink, value, - contentLength, accept, context)); + return FluxUtil.withContext( + context -> uploadChunkNoCustomHeadersWithResponseAsync(nextLink, value, contentLength, context)); } /** @@ -1473,9 +1451,8 @@ public Response uploadChunkNoCustomHeadersWithResponse(String nextLink, Bi @ServiceMethod(returns = ReturnType.SINGLE) public Mono> completeUploadWithResponseAsync(String digest, String nextLink, Flux value, Long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.completeUpload(this.client.getUrl(), digest, nextLink, value, - contentLength, accept, context)); + return FluxUtil + .withContext(context -> completeUploadWithResponseAsync(digest, nextLink, value, contentLength, context)); } /** @@ -1558,9 +1535,8 @@ public Mono completeUploadAsync(String digest, String nextLink, Flux> completeUploadNoCustomHeadersWithResponseAsync(String digest, String nextLink, Flux value, Long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.completeUploadNoCustomHeaders(this.client.getUrl(), digest, - nextLink, value, contentLength, accept, context)); + return FluxUtil.withContext( + context -> completeUploadNoCustomHeadersWithResponseAsync(digest, nextLink, value, contentLength, context)); } /** @@ -1603,9 +1579,8 @@ public Mono> completeUploadNoCustomHeadersWithResponseAsync(Strin @ServiceMethod(returns = ReturnType.SINGLE) public Mono> completeUploadWithResponseAsync(String digest, String nextLink, BinaryData value, Long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.completeUpload(this.client.getUrl(), digest, nextLink, value, - contentLength, accept, context)); + return FluxUtil + .withContext(context -> completeUploadWithResponseAsync(digest, nextLink, value, contentLength, context)); } /** @@ -1688,9 +1663,8 @@ public Mono completeUploadAsync(String digest, String nextLink, BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Mono> completeUploadNoCustomHeadersWithResponseAsync(String digest, String nextLink, BinaryData value, Long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.completeUploadNoCustomHeaders(this.client.getUrl(), digest, - nextLink, value, contentLength, accept, context)); + return FluxUtil.withContext( + context -> completeUploadNoCustomHeadersWithResponseAsync(digest, nextLink, value, contentLength, context)); } /** @@ -1793,8 +1767,7 @@ public Response completeUploadNoCustomHeadersWithResponse(String digest, S */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> cancelUploadWithResponseAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.cancelUpload(this.client.getUrl(), nextLink, accept, context)); + return FluxUtil.withContext(context -> cancelUploadWithResponseAsync(nextLink, context)); } /** @@ -1893,8 +1866,7 @@ public void cancelUpload(String nextLink) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> startUploadWithResponseAsync(String name) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.startUpload(this.client.getUrl(), name, accept, context)); + return FluxUtil.withContext(context -> startUploadWithResponseAsync(name, context)); } /** @@ -1954,9 +1926,7 @@ public Mono startUploadAsync(String name, Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> startUploadNoCustomHeadersWithResponseAsync(String name) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.startUploadNoCustomHeaders(this.client.getUrl(), name, accept, context)); + return FluxUtil.withContext(context -> startUploadNoCustomHeadersWithResponseAsync(name, context)); } /** @@ -2037,9 +2007,7 @@ public Response startUploadNoCustomHeadersWithResponse(String name, Contex @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getChunkWithResponseAsync(String name, String digest, String range) { - final String accept = "application/octet-stream"; - return FluxUtil - .withContext(context -> service.getChunk(this.client.getUrl(), name, digest, range, accept, context)); + return FluxUtil.withContext(context -> getChunkWithResponseAsync(name, digest, range, context)); } /** @@ -2116,9 +2084,7 @@ public Mono getChunkAsync(String name, String digest, String range, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getChunkNoCustomHeadersWithResponseAsync(String name, String digest, String range) { - final String accept = "application/octet-stream"; - return FluxUtil.withContext( - context -> service.getChunkNoCustomHeaders(this.client.getUrl(), name, digest, range, accept, context)); + return FluxUtil.withContext(context -> getChunkNoCustomHeadersWithResponseAsync(name, digest, range, context)); } /** @@ -2216,9 +2182,7 @@ public Response getChunkNoCustomHeadersWithResponse(String name, Str @ServiceMethod(returns = ReturnType.SINGLE) public Mono> checkChunkExistsWithResponseAsync(String name, String digest, String range) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.checkChunkExists(this.client.getUrl(), name, digest, range, accept, context)); + return FluxUtil.withContext(context -> checkChunkExistsWithResponseAsync(name, digest, range, context)); } /** @@ -2287,9 +2251,8 @@ public Mono checkChunkExistsAsync(String name, String digest, String range @ServiceMethod(returns = ReturnType.SINGLE) public Mono> checkChunkExistsNoCustomHeadersWithResponseAsync(String name, String digest, String range) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.checkChunkExistsNoCustomHeaders(this.client.getUrl(), name, - digest, range, accept, context)); + return FluxUtil + .withContext(context -> checkChunkExistsNoCustomHeadersWithResponseAsync(name, digest, range, context)); } /** diff --git a/azure-dataplane-tests/src/main/java/com/azure/data/schemaregistry/implementation/SchemasImpl.java b/azure-dataplane-tests/src/main/java/com/azure/data/schemaregistry/implementation/SchemasImpl.java index 39acd3fb8a..fd4d623e9d 100644 --- a/azure-dataplane-tests/src/main/java/com/azure/data/schemaregistry/implementation/SchemasImpl.java +++ b/azure-dataplane-tests/src/main/java/com/azure/data/schemaregistry/implementation/SchemasImpl.java @@ -282,10 +282,7 @@ Response getVersionsNextSync(@PathParam(value = "nextLink", enco */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getByIdWithResponseAsync(String id) { - final String accept - = "application/json; serialization=Avro, application/json; serialization=json, text/plain; charset=utf-8, text/vnd.ms.protobuf"; - return FluxUtil.withContext( - context -> service.getById(this.client.getEndpoint(), id, this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getByIdWithResponseAsync(id, context)); } /** @@ -359,10 +356,7 @@ public Mono> getByIdAsync(String id, Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getByIdNoCustomHeadersWithResponseAsync(String id) { - final String accept - = "application/json; serialization=Avro, application/json; serialization=json, text/plain; charset=utf-8, text/vnd.ms.protobuf"; - return FluxUtil.withContext(context -> service.getByIdNoCustomHeaders(this.client.getEndpoint(), id, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getByIdNoCustomHeadersWithResponseAsync(id, context)); } /** @@ -634,10 +628,8 @@ public PagedIterable getVersions(String groupName, String schemaName, C @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getSchemaVersionWithResponseAsync(String groupName, String schemaName, int schemaVersion) { - final String accept - = "application/json; serialization=Avro, application/json; serialization=json, text/plain; charset=utf-8, text/vnd.ms.protobuf"; - return FluxUtil.withContext(context -> service.getSchemaVersion(this.client.getEndpoint(), groupName, - schemaName, schemaVersion, this.client.getApiVersion(), accept, context)); + return FluxUtil + .withContext(context -> getSchemaVersionWithResponseAsync(groupName, schemaName, schemaVersion, context)); } /** @@ -724,10 +716,8 @@ public Mono> getSchemaVersionAsync(String groupName, String sch @ServiceMethod(returns = ReturnType.SINGLE) public Mono getSchemaVersionNoCustomHeadersWithResponseAsync(String groupName, String schemaName, int schemaVersion) { - final String accept - = "application/json; serialization=Avro, application/json; serialization=json, text/plain; charset=utf-8, text/vnd.ms.protobuf"; - return FluxUtil.withContext(context -> service.getSchemaVersionNoCustomHeaders(this.client.getEndpoint(), - groupName, schemaName, schemaVersion, this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext( + context -> getSchemaVersionNoCustomHeadersWithResponseAsync(groupName, schemaName, schemaVersion, context)); } /** @@ -842,9 +832,8 @@ public Response getSchemaVersionNoCustomHeadersWithResponse(String g @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryIdByContentWithResponseAsync(String groupName, String schemaName, SchemaFormat contentType, Flux schemaContent, long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.queryIdByContent(this.client.getEndpoint(), groupName, - schemaName, this.client.getApiVersion(), contentType, schemaContent, contentLength, accept, context)); + return FluxUtil.withContext(context -> queryIdByContentWithResponseAsync(groupName, schemaName, contentType, + schemaContent, contentLength, context)); } /** @@ -947,10 +936,8 @@ public Mono queryIdByContentAsync(String groupName, String schemaName, Sch @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryIdByContentNoCustomHeadersWithResponseAsync(String groupName, String schemaName, SchemaFormat contentType, Flux schemaContent, long contentLength) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.queryIdByContentNoCustomHeaders(this.client.getEndpoint(), groupName, - schemaName, this.client.getApiVersion(), contentType, schemaContent, contentLength, accept, context)); + return FluxUtil.withContext(context -> queryIdByContentNoCustomHeadersWithResponseAsync(groupName, schemaName, + contentType, schemaContent, contentLength, context)); } /** @@ -1001,9 +988,8 @@ public Mono> queryIdByContentNoCustomHeadersWithResponseAsync(Str @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryIdByContentWithResponseAsync(String groupName, String schemaName, SchemaFormat contentType, BinaryData schemaContent, long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.queryIdByContent(this.client.getEndpoint(), groupName, - schemaName, this.client.getApiVersion(), contentType, schemaContent, contentLength, accept, context)); + return FluxUtil.withContext(context -> queryIdByContentWithResponseAsync(groupName, schemaName, contentType, + schemaContent, contentLength, context)); } /** @@ -1105,10 +1091,8 @@ public Mono queryIdByContentAsync(String groupName, String schemaName, Sch @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryIdByContentNoCustomHeadersWithResponseAsync(String groupName, String schemaName, SchemaFormat contentType, BinaryData schemaContent, long contentLength) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.queryIdByContentNoCustomHeaders(this.client.getEndpoint(), groupName, - schemaName, this.client.getApiVersion(), contentType, schemaContent, contentLength, accept, context)); + return FluxUtil.withContext(context -> queryIdByContentNoCustomHeadersWithResponseAsync(groupName, schemaName, + contentType, schemaContent, contentLength, context)); } /** @@ -1234,9 +1218,8 @@ public Response queryIdByContentNoCustomHeadersWithResponse(String groupNa @ServiceMethod(returns = ReturnType.SINGLE) public Mono> registerWithResponseAsync(String groupName, String schemaName, String contentType, Flux schemaContent, long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.register(this.client.getEndpoint(), groupName, schemaName, - this.client.getApiVersion(), contentType, schemaContent, contentLength, accept, context)); + return FluxUtil.withContext(context -> registerWithResponseAsync(groupName, schemaName, contentType, + schemaContent, contentLength, context)); } /** @@ -1334,9 +1317,8 @@ public Mono registerAsync(String groupName, String schemaName, String cont @ServiceMethod(returns = ReturnType.SINGLE) public Mono> registerNoCustomHeadersWithResponseAsync(String groupName, String schemaName, String contentType, Flux schemaContent, long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.registerNoCustomHeaders(this.client.getEndpoint(), groupName, - schemaName, this.client.getApiVersion(), contentType, schemaContent, contentLength, accept, context)); + return FluxUtil.withContext(context -> registerNoCustomHeadersWithResponseAsync(groupName, schemaName, + contentType, schemaContent, contentLength, context)); } /** @@ -1385,9 +1367,8 @@ public Mono> registerNoCustomHeadersWithResponseAsync(String grou @ServiceMethod(returns = ReturnType.SINGLE) public Mono> registerWithResponseAsync(String groupName, String schemaName, String contentType, BinaryData schemaContent, long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.register(this.client.getEndpoint(), groupName, schemaName, - this.client.getApiVersion(), contentType, schemaContent, contentLength, accept, context)); + return FluxUtil.withContext(context -> registerWithResponseAsync(groupName, schemaName, contentType, + schemaContent, contentLength, context)); } /** @@ -1485,9 +1466,8 @@ public Mono registerAsync(String groupName, String schemaName, String cont @ServiceMethod(returns = ReturnType.SINGLE) public Mono> registerNoCustomHeadersWithResponseAsync(String groupName, String schemaName, String contentType, BinaryData schemaContent, long contentLength) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.registerNoCustomHeaders(this.client.getEndpoint(), groupName, - schemaName, this.client.getApiVersion(), contentType, schemaContent, contentLength, accept, context)); + return FluxUtil.withContext(context -> registerNoCustomHeadersWithResponseAsync(groupName, schemaName, + contentType, schemaContent, contentLength, context)); } /** diff --git a/azure-tests/src/main/java/fixtures/azureparametergrouping/ParameterGroupings.java b/azure-tests/src/main/java/fixtures/azureparametergrouping/ParameterGroupings.java index a08796d248..d424bca0e7 100644 --- a/azure-tests/src/main/java/fixtures/azureparametergrouping/ParameterGroupings.java +++ b/azure-tests/src/main/java/fixtures/azureparametergrouping/ParameterGroupings.java @@ -119,23 +119,8 @@ Mono> groupWithConstant(@HostParam("$host") String host, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredWithResponseAsync(ParameterGroupingPostRequiredParameters parameterGroupingPostRequiredParameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (parameterGroupingPostRequiredParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter parameterGroupingPostRequiredParameters is required and cannot be null.")); - } else { - parameterGroupingPostRequiredParameters.validate(); - } - final String accept = "application/json"; - String customHeader = parameterGroupingPostRequiredParameters.getCustomHeader(); - Integer query = parameterGroupingPostRequiredParameters.getQuery(); - String path = parameterGroupingPostRequiredParameters.getPath(); - int body = parameterGroupingPostRequiredParameters.getBody(); - return FluxUtil.withContext( - context -> service.postRequired(this.client.getHost(), customHeader, query, path, body, accept, context)); + return FluxUtil + .withContext(context -> postRequiredWithResponseAsync(parameterGroupingPostRequiredParameters, context)); } /** @@ -242,26 +227,8 @@ public void postRequired(ParameterGroupingPostRequiredParameters parameterGroupi @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalWithResponseAsync(ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (parameterGroupingPostOptionalParameters != null) { - parameterGroupingPostOptionalParameters.validate(); - } - final String accept = "application/json"; - String customHeaderInternal = null; - if (parameterGroupingPostOptionalParameters != null) { - customHeaderInternal = parameterGroupingPostOptionalParameters.getCustomHeader(); - } - String customHeader = customHeaderInternal; - Integer queryInternal = null; - if (parameterGroupingPostOptionalParameters != null) { - queryInternal = parameterGroupingPostOptionalParameters.getQuery(); - } - Integer query = queryInternal; return FluxUtil - .withContext(context -> service.postOptional(this.client.getHost(), customHeader, query, accept, context)); + .withContext(context -> postOptionalWithResponseAsync(parameterGroupingPostOptionalParameters, context)); } /** @@ -396,26 +363,8 @@ public void postOptional() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postReservedWordsWithResponseAsync( ParameterGroupingPostReservedWordsParameters parameterGroupingPostReservedWordsParameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (parameterGroupingPostReservedWordsParameters != null) { - parameterGroupingPostReservedWordsParameters.validate(); - } - final String acceptParam = "application/json"; - String fromInternal = null; - if (parameterGroupingPostReservedWordsParameters != null) { - fromInternal = parameterGroupingPostReservedWordsParameters.getFrom(); - } - String from = fromInternal; - String acceptInternal = null; - if (parameterGroupingPostReservedWordsParameters != null) { - acceptInternal = parameterGroupingPostReservedWordsParameters.getAccept(); - } - String accept = acceptInternal; return FluxUtil.withContext( - context -> service.postReservedWords(this.client.getHost(), from, accept, acceptParam, context)); + context -> postReservedWordsWithResponseAsync(parameterGroupingPostReservedWordsParameters, context)); } /** @@ -554,39 +503,8 @@ public void postReservedWords() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postMultiParamGroupsWithResponseAsync(FirstParameterGroup firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (firstParameterGroup != null) { - firstParameterGroup.validate(); - } - if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) { - parameterGroupingPostMultiParamGroupsSecondParamGroup.validate(); - } - final String accept = "application/json"; - String headerOneInternal = null; - if (firstParameterGroup != null) { - headerOneInternal = firstParameterGroup.getHeaderOne(); - } - String headerOne = headerOneInternal; - Integer queryOneInternal = null; - if (firstParameterGroup != null) { - queryOneInternal = firstParameterGroup.getQueryOne(); - } - Integer queryOne = queryOneInternal; - String headerTwoInternal = null; - if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) { - headerTwoInternal = parameterGroupingPostMultiParamGroupsSecondParamGroup.getHeaderTwo(); - } - String headerTwo = headerTwoInternal; - Integer queryTwoInternal = null; - if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) { - queryTwoInternal = parameterGroupingPostMultiParamGroupsSecondParamGroup.getQueryTwo(); - } - Integer queryTwo = queryTwoInternal; - return FluxUtil.withContext(context -> service.postMultiParamGroups(this.client.getHost(), headerOne, queryOne, - headerTwo, queryTwo, accept, context)); + return FluxUtil.withContext(context -> postMultiParamGroupsWithResponseAsync(firstParameterGroup, + parameterGroupingPostMultiParamGroupsSecondParamGroup, context)); } /** @@ -753,26 +671,8 @@ public void postMultiParamGroups() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postSharedParameterGroupObjectWithResponseAsync(FirstParameterGroup firstParameterGroup) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (firstParameterGroup != null) { - firstParameterGroup.validate(); - } - final String accept = "application/json"; - String headerOneInternal = null; - if (firstParameterGroup != null) { - headerOneInternal = firstParameterGroup.getHeaderOne(); - } - String headerOne = headerOneInternal; - Integer queryOneInternal = null; - if (firstParameterGroup != null) { - queryOneInternal = firstParameterGroup.getQueryOne(); - } - Integer queryOne = queryOneInternal; - return FluxUtil.withContext(context -> service.postSharedParameterGroupObject(this.client.getHost(), headerOne, - queryOne, accept, context)); + return FluxUtil + .withContext(context -> postSharedParameterGroupObjectWithResponseAsync(firstParameterGroup, context)); } /** @@ -904,22 +804,7 @@ public void postSharedParameterGroupObject() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> groupWithConstantWithResponseAsync(Grouper grouper) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (grouper != null) { - grouper.validate(); - } - final String groupedConstant = "foo"; - final String accept = "application/json"; - String groupedParameterInternal = null; - if (grouper != null) { - groupedParameterInternal = grouper.getGroupedParameter(); - } - String groupedParameter = groupedParameterInternal; - return FluxUtil.withContext(context -> service.groupWithConstant(this.client.getHost(), groupedConstant, - groupedParameter, accept, context)); + return FluxUtil.withContext(context -> groupWithConstantWithResponseAsync(grouper, context)); } /** diff --git a/azure-tests/src/main/java/fixtures/azurereport/AutoRestReportServiceForAzure.java b/azure-tests/src/main/java/fixtures/azurereport/AutoRestReportServiceForAzure.java index aae0e28cd0..f84f7a5f28 100644 --- a/azure-tests/src/main/java/fixtures/azurereport/AutoRestReportServiceForAzure.java +++ b/azure-tests/src/main/java/fixtures/azurereport/AutoRestReportServiceForAzure.java @@ -140,11 +140,7 @@ Mono>> getReport(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getReportWithResponseAsync(String qualifier) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getReport(this.getHost(), qualifier, accept, context)); + return FluxUtil.withContext(context -> getReportWithResponseAsync(qualifier, context)); } /** diff --git a/azure-tests/src/main/java/fixtures/azurespecials/ApiVersionDefaults.java b/azure-tests/src/main/java/fixtures/azurespecials/ApiVersionDefaults.java index ad05e3a9c0..463489ae0b 100644 --- a/azure-tests/src/main/java/fixtures/azurespecials/ApiVersionDefaults.java +++ b/azure-tests/src/main/java/fixtures/azurespecials/ApiVersionDefaults.java @@ -88,13 +88,7 @@ Mono> getSwaggerGlobalValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMethodGlobalValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMethodGlobalValid(this.client.getHost(), - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getMethodGlobalValidWithResponseAsync(context)); } /** @@ -178,13 +172,7 @@ public void getMethodGlobalValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMethodGlobalNotProvidedValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMethodGlobalNotProvidedValid(this.client.getHost(), - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getMethodGlobalNotProvidedValidWithResponseAsync(context)); } /** @@ -269,13 +257,7 @@ public void getMethodGlobalNotProvidedValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getPathGlobalValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getPathGlobalValid(this.client.getHost(), this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getPathGlobalValidWithResponseAsync(context)); } /** @@ -359,13 +341,7 @@ public void getPathGlobalValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSwaggerGlobalValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSwaggerGlobalValid(this.client.getHost(), - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getSwaggerGlobalValidWithResponseAsync(context)); } /** diff --git a/azure-tests/src/main/java/fixtures/azurespecials/ApiVersionLocals.java b/azure-tests/src/main/java/fixtures/azurespecials/ApiVersionLocals.java index 939b122b09..2f8649d485 100644 --- a/azure-tests/src/main/java/fixtures/azurespecials/ApiVersionLocals.java +++ b/azure-tests/src/main/java/fixtures/azurespecials/ApiVersionLocals.java @@ -88,14 +88,7 @@ Mono> getSwaggerLocalValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMethodLocalValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String apiVersion = "2.0"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getMethodLocalValid(this.client.getHost(), apiVersion, accept, context)); + return FluxUtil.withContext(context -> getMethodLocalValidWithResponseAsync(context)); } /** @@ -183,13 +176,7 @@ public void getMethodLocalValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMethodLocalNullWithResponseAsync(String apiVersion) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getMethodLocalNull(this.client.getHost(), apiVersion, accept, context)); + return FluxUtil.withContext(context -> getMethodLocalNullWithResponseAsync(apiVersion, context)); } /** @@ -310,14 +297,7 @@ public void getMethodLocalNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getPathLocalValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String apiVersion = "2.0"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getPathLocalValid(this.client.getHost(), apiVersion, accept, context)); + return FluxUtil.withContext(context -> getPathLocalValidWithResponseAsync(context)); } /** @@ -402,14 +382,7 @@ public void getPathLocalValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSwaggerLocalValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String apiVersion = "2.0"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getSwaggerLocalValid(this.client.getHost(), apiVersion, accept, context)); + return FluxUtil.withContext(context -> getSwaggerLocalValidWithResponseAsync(context)); } /** diff --git a/azure-tests/src/main/java/fixtures/azurespecials/Headers.java b/azure-tests/src/main/java/fixtures/azurespecials/Headers.java index c672b63653..59079048c4 100644 --- a/azure-tests/src/main/java/fixtures/azurespecials/Headers.java +++ b/azure-tests/src/main/java/fixtures/azurespecials/Headers.java @@ -112,17 +112,7 @@ Mono> customNamedRequestIdHeadNoCustomHeaders(@HostParam("$hos @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customNamedRequestIdWithResponseAsync(String fooClientRequestId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (fooClientRequestId == null) { - return Mono - .error(new IllegalArgumentException("Parameter fooClientRequestId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.customNamedRequestId(this.client.getHost(), fooClientRequestId, accept, context)); + return FluxUtil.withContext(context -> customNamedRequestIdWithResponseAsync(fooClientRequestId, context)); } /** @@ -219,17 +209,8 @@ public void customNamedRequestId(String fooClientRequestId) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customNamedRequestIdNoCustomHeadersWithResponseAsync(String fooClientRequestId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (fooClientRequestId == null) { - return Mono - .error(new IllegalArgumentException("Parameter fooClientRequestId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.customNamedRequestIdNoCustomHeaders(this.client.getHost(), - fooClientRequestId, accept, context)); + return FluxUtil + .withContext(context -> customNamedRequestIdNoCustomHeadersWithResponseAsync(fooClientRequestId, context)); } /** @@ -286,20 +267,8 @@ public Response customNamedRequestIdNoCustomHeadersWithResponse(String foo public Mono> customNamedRequestIdParamGroupingWithResponseAsync( HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (headerCustomNamedRequestIdParamGroupingParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter headerCustomNamedRequestIdParamGroupingParameters is required and cannot be null.")); - } else { - headerCustomNamedRequestIdParamGroupingParameters.validate(); - } - final String accept = "application/json"; - String fooClientRequestId = headerCustomNamedRequestIdParamGroupingParameters.getFooClientRequestId(); - return FluxUtil.withContext(context -> service.customNamedRequestIdParamGrouping(this.client.getHost(), - fooClientRequestId, accept, context)); + return FluxUtil.withContext(context -> customNamedRequestIdParamGroupingWithResponseAsync( + headerCustomNamedRequestIdParamGroupingParameters, context)); } /** @@ -417,21 +386,8 @@ public void customNamedRequestIdParamGrouping( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customNamedRequestIdParamGroupingNoCustomHeadersWithResponseAsync( HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (headerCustomNamedRequestIdParamGroupingParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter headerCustomNamedRequestIdParamGroupingParameters is required and cannot be null.")); - } else { - headerCustomNamedRequestIdParamGroupingParameters.validate(); - } - final String accept = "application/json"; - String fooClientRequestId = headerCustomNamedRequestIdParamGroupingParameters.getFooClientRequestId(); - return FluxUtil - .withContext(context -> service.customNamedRequestIdParamGroupingNoCustomHeaders(this.client.getHost(), - fooClientRequestId, accept, context)); + return FluxUtil.withContext(context -> customNamedRequestIdParamGroupingNoCustomHeadersWithResponseAsync( + headerCustomNamedRequestIdParamGroupingParameters, context)); } /** @@ -496,17 +452,7 @@ public Response customNamedRequestIdParamGroupingNoCustomHeadersWithRespon @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customNamedRequestIdHeadWithResponseAsync(String fooClientRequestId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (fooClientRequestId == null) { - return Mono - .error(new IllegalArgumentException("Parameter fooClientRequestId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.customNamedRequestIdHead(this.client.getHost(), fooClientRequestId, accept, context)); + return FluxUtil.withContext(context -> customNamedRequestIdHeadWithResponseAsync(fooClientRequestId, context)); } /** @@ -606,17 +552,8 @@ public boolean customNamedRequestIdHead(String fooClientRequestId) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customNamedRequestIdHeadNoCustomHeadersWithResponseAsync(String fooClientRequestId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (fooClientRequestId == null) { - return Mono - .error(new IllegalArgumentException("Parameter fooClientRequestId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.customNamedRequestIdHeadNoCustomHeaders(this.client.getHost(), - fooClientRequestId, accept, context)); + return FluxUtil.withContext( + context -> customNamedRequestIdHeadNoCustomHeadersWithResponseAsync(fooClientRequestId, context)); } /** diff --git a/azure-tests/src/main/java/fixtures/azurespecials/Odatas.java b/azure-tests/src/main/java/fixtures/azurespecials/Odatas.java index 3ce2930919..552e0639ca 100644 --- a/azure-tests/src/main/java/fixtures/azurespecials/Odatas.java +++ b/azure-tests/src/main/java/fixtures/azurespecials/Odatas.java @@ -73,13 +73,7 @@ Mono> getWithFilter(@HostParam("$host") String host, @QueryParam( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithFilterWithResponseAsync(String filter, Integer top, String orderby) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getWithFilter(this.client.getHost(), filter, top, orderby, accept, context)); + return FluxUtil.withContext(context -> getWithFilterWithResponseAsync(filter, top, orderby, context)); } /** diff --git a/azure-tests/src/main/java/fixtures/azurespecials/SkipUrlEncodings.java b/azure-tests/src/main/java/fixtures/azurespecials/SkipUrlEncodings.java index ea61dfd3ef..f0989b5678 100644 --- a/azure-tests/src/main/java/fixtures/azurespecials/SkipUrlEncodings.java +++ b/azure-tests/src/main/java/fixtures/azurespecials/SkipUrlEncodings.java @@ -112,17 +112,7 @@ Mono> getSwaggerQueryValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMethodPathValidWithResponseAsync(String unencodedPathParam) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (unencodedPathParam == null) { - return Mono - .error(new IllegalArgumentException("Parameter unencodedPathParam is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getMethodPathValid(this.client.getHost(), unencodedPathParam, accept, context)); + return FluxUtil.withContext(context -> getMethodPathValidWithResponseAsync(unencodedPathParam, context)); } /** @@ -221,17 +211,7 @@ public void getMethodPathValid(String unencodedPathParam) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getPathValidWithResponseAsync(String unencodedPathParam) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (unencodedPathParam == null) { - return Mono - .error(new IllegalArgumentException("Parameter unencodedPathParam is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getPathValid(this.client.getHost(), unencodedPathParam, accept, context)); + return FluxUtil.withContext(context -> getPathValidWithResponseAsync(unencodedPathParam, context)); } /** @@ -328,14 +308,7 @@ public void getPathValid(String unencodedPathParam) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSwaggerPathValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String unencodedPathParam = "path1/path2/path3"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getSwaggerPathValid(this.client.getHost(), unencodedPathParam, accept, context)); + return FluxUtil.withContext(context -> getSwaggerPathValidWithResponseAsync(context)); } /** @@ -424,15 +397,7 @@ public void getSwaggerPathValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMethodQueryValidWithResponseAsync(String q1) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (q1 == null) { - return Mono.error(new IllegalArgumentException("Parameter q1 is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMethodQueryValid(this.client.getHost(), q1, accept, context)); + return FluxUtil.withContext(context -> getMethodQueryValidWithResponseAsync(q1, context)); } /** @@ -531,12 +496,7 @@ public void getMethodQueryValid(String q1) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMethodQueryNullWithResponseAsync(String q1) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMethodQueryNull(this.client.getHost(), q1, accept, context)); + return FluxUtil.withContext(context -> getMethodQueryNullWithResponseAsync(q1, context)); } /** @@ -654,15 +614,7 @@ public void getMethodQueryNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getPathQueryValidWithResponseAsync(String q1) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (q1 == null) { - return Mono.error(new IllegalArgumentException("Parameter q1 is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getPathQueryValid(this.client.getHost(), q1, accept, context)); + return FluxUtil.withContext(context -> getPathQueryValidWithResponseAsync(q1, context)); } /** @@ -759,14 +711,7 @@ public void getPathQueryValid(String q1) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSwaggerQueryValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String q1 = "value1&q2=value2&q3=value3"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getSwaggerQueryValid(this.client.getHost(), q1, accept, context)); + return FluxUtil.withContext(context -> getSwaggerQueryValidWithResponseAsync(context)); } /** diff --git a/azure-tests/src/main/java/fixtures/azurespecials/SubscriptionInCredentials.java b/azure-tests/src/main/java/fixtures/azurespecials/SubscriptionInCredentials.java index 2550b97204..1d051076cc 100644 --- a/azure-tests/src/main/java/fixtures/azurespecials/SubscriptionInCredentials.java +++ b/azure-tests/src/main/java/fixtures/azurespecials/SubscriptionInCredentials.java @@ -96,17 +96,7 @@ Mono> postSwaggerGlobalValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postMethodGlobalValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postMethodGlobalValid(this.client.getHost(), - this.client.getSubscriptionId(), accept, context)); + return FluxUtil.withContext(context -> postMethodGlobalValidWithResponseAsync(context)); } /** @@ -198,17 +188,7 @@ public void postMethodGlobalValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postMethodGlobalNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postMethodGlobalNull(this.client.getHost(), - this.client.getSubscriptionId(), accept, context)); + return FluxUtil.withContext(context -> postMethodGlobalNullWithResponseAsync(context)); } /** @@ -300,17 +280,7 @@ public void postMethodGlobalNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postMethodGlobalNotProvidedValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postMethodGlobalNotProvidedValid(this.client.getHost(), - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> postMethodGlobalNotProvidedValidWithResponseAsync(context)); } /** @@ -403,17 +373,7 @@ public void postMethodGlobalNotProvidedValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postPathGlobalValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postPathGlobalValid(this.client.getHost(), - this.client.getSubscriptionId(), accept, context)); + return FluxUtil.withContext(context -> postPathGlobalValidWithResponseAsync(context)); } /** @@ -505,17 +465,7 @@ public void postPathGlobalValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postSwaggerGlobalValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postSwaggerGlobalValid(this.client.getHost(), - this.client.getSubscriptionId(), accept, context)); + return FluxUtil.withContext(context -> postSwaggerGlobalValidWithResponseAsync(context)); } /** diff --git a/azure-tests/src/main/java/fixtures/azurespecials/SubscriptionInMethods.java b/azure-tests/src/main/java/fixtures/azurespecials/SubscriptionInMethods.java index 38207da66e..fa5978a18b 100644 --- a/azure-tests/src/main/java/fixtures/azurespecials/SubscriptionInMethods.java +++ b/azure-tests/src/main/java/fixtures/azurespecials/SubscriptionInMethods.java @@ -90,16 +90,7 @@ Mono> postSwaggerLocalValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postMethodLocalValidWithResponseAsync(String subscriptionId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postMethodLocalValid(this.client.getHost(), subscriptionId, accept, context)); + return FluxUtil.withContext(context -> postMethodLocalValidWithResponseAsync(subscriptionId, context)); } /** @@ -200,16 +191,7 @@ public void postMethodLocalValid(String subscriptionId) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postMethodLocalNullWithResponseAsync(String subscriptionId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postMethodLocalNull(this.client.getHost(), subscriptionId, accept, context)); + return FluxUtil.withContext(context -> postMethodLocalNullWithResponseAsync(subscriptionId, context)); } /** @@ -314,16 +296,7 @@ public void postMethodLocalNull(String subscriptionId) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postPathLocalValidWithResponseAsync(String subscriptionId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.postPathLocalValid(this.client.getHost(), subscriptionId, accept, context)); + return FluxUtil.withContext(context -> postPathLocalValidWithResponseAsync(subscriptionId, context)); } /** @@ -423,16 +396,7 @@ public void postPathLocalValid(String subscriptionId) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postSwaggerLocalValidWithResponseAsync(String subscriptionId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postSwaggerLocalValid(this.client.getHost(), subscriptionId, accept, context)); + return FluxUtil.withContext(context -> postSwaggerLocalValidWithResponseAsync(subscriptionId, context)); } /** diff --git a/azure-tests/src/main/java/fixtures/azurespecials/XMsClientRequestIds.java b/azure-tests/src/main/java/fixtures/azurespecials/XMsClientRequestIds.java index 21e8550987..4d05b53c24 100644 --- a/azure-tests/src/main/java/fixtures/azurespecials/XMsClientRequestIds.java +++ b/azure-tests/src/main/java/fixtures/azurespecials/XMsClientRequestIds.java @@ -76,11 +76,7 @@ Mono> paramGet(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.get(this.client.getHost(), context)); + return FluxUtil.withContext(context -> getWithResponseAsync(context)); } /** @@ -169,17 +165,7 @@ public void get() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramGetWithResponseAsync(String xMsClientRequestId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (xMsClientRequestId == null) { - return Mono - .error(new IllegalArgumentException("Parameter xMsClientRequestId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramGet(this.client.getHost(), xMsClientRequestId, accept, context)); + return FluxUtil.withContext(context -> paramGetWithResponseAsync(xMsClientRequestId, context)); } /** diff --git a/azure-tests/src/main/java/fixtures/subscriptionidapiversion/Groups.java b/azure-tests/src/main/java/fixtures/subscriptionidapiversion/Groups.java index 5839caa821..82e495efcd 100644 --- a/azure-tests/src/main/java/fixtures/subscriptionidapiversion/Groups.java +++ b/azure-tests/src/main/java/fixtures/subscriptionidapiversion/Groups.java @@ -74,21 +74,7 @@ Mono> getSampleResourceGroup(@HostParam("$host") S */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSampleResourceGroupWithResponseAsync(String resourceGroupName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSampleResourceGroup(this.client.getHost(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext(context -> getSampleResourceGroupWithResponseAsync(resourceGroupName, context)); } /** diff --git a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/ArraysImpl.java b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/ArraysImpl.java index dacbfc384a..36f8d94e07 100644 --- a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/ArraysImpl.java +++ b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/ArraysImpl.java @@ -96,8 +96,7 @@ Mono> getNotProvided(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -179,8 +178,7 @@ public ArrayWrapper getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(ArrayWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -271,8 +269,7 @@ public void putValid(ArrayWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -354,8 +351,7 @@ public ArrayWrapper getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(ArrayWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(complexBody, context)); } /** @@ -441,8 +437,7 @@ public void putEmpty(ArrayWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/BasicsImpl.java b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/BasicsImpl.java index 1e29d741c1..5eb88e41f9 100644 --- a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/BasicsImpl.java +++ b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/BasicsImpl.java @@ -102,8 +102,7 @@ Mono> getNotProvided(@HostParam("$host") String host, @HeaderPar */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -185,9 +184,7 @@ public Basic getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Basic complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), this.client.getApiVersion(), - complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -273,8 +270,7 @@ public void putValid(Basic complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** @@ -354,8 +350,7 @@ public Basic getInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -435,8 +430,7 @@ public Basic getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -517,8 +511,7 @@ public Basic getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/DictionariesImpl.java b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/DictionariesImpl.java index 3b7c4f125a..e92145208b 100644 --- a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/DictionariesImpl.java +++ b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/DictionariesImpl.java @@ -104,8 +104,7 @@ Mono> getNotProvided(@HostParam("$host") String host */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -188,8 +187,7 @@ public DictionaryWrapper getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(DictionaryWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -280,8 +278,7 @@ public void putValid(DictionaryWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -363,8 +360,7 @@ public DictionaryWrapper getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(DictionaryWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(complexBody, context)); } /** @@ -450,8 +446,7 @@ public void putEmpty(DictionaryWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -532,8 +527,7 @@ public DictionaryWrapper getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/FlattencomplexesImpl.java b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/FlattencomplexesImpl.java index 27b1b4816d..74d070e9cd 100644 --- a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/FlattencomplexesImpl.java +++ b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/FlattencomplexesImpl.java @@ -69,8 +69,7 @@ Mono> getValid(@HostParam("$host") String host, @HeaderPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** diff --git a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/InheritancesImpl.java b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/InheritancesImpl.java index 16c33b9f84..3e9a3efbde 100644 --- a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/InheritancesImpl.java +++ b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/InheritancesImpl.java @@ -77,8 +77,7 @@ Mono> putValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -161,8 +160,7 @@ public Siamese getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Siamese complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PolymorphicrecursivesImpl.java b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PolymorphicrecursivesImpl.java index 8620ab2dd2..04e0ad6f12 100644 --- a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PolymorphicrecursivesImpl.java +++ b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PolymorphicrecursivesImpl.java @@ -78,8 +78,7 @@ Mono> putValid(@HostParam("$host") String host, @BodyParam("appli */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -215,8 +214,7 @@ public Fish getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Fish complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PolymorphismsImpl.java b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PolymorphismsImpl.java index 1844bb4b54..9a95ebcb0a 100644 --- a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PolymorphismsImpl.java +++ b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PolymorphismsImpl.java @@ -122,8 +122,7 @@ Mono> putValidMissingRequired(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -236,8 +235,7 @@ public Fish getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Fish complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -483,8 +481,7 @@ public void putValid(Fish complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDotSyntaxWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDotSyntax(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDotSyntaxWithResponseAsync(context)); } /** @@ -566,9 +563,7 @@ public DotFish getDotSyntax() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComposedWithDiscriminatorWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getComposedWithDiscriminator(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComposedWithDiscriminatorWithResponseAsync(context)); } /** @@ -659,9 +654,7 @@ public DotFishMarket getComposedWithDiscriminator() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComposedWithoutDiscriminatorWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getComposedWithoutDiscriminator(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComposedWithoutDiscriminatorWithResponseAsync(context)); } /** @@ -752,8 +745,7 @@ public DotFishMarket getComposedWithoutDiscriminator() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComplicatedWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplicated(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplicatedWithResponseAsync(context)); } /** @@ -839,9 +831,7 @@ public Salmon getComplicated() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putComplicatedWithResponseAsync(Salmon complexBody) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putComplicated(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putComplicatedWithResponseAsync(complexBody, context)); } /** @@ -928,9 +918,7 @@ public void putComplicated(Salmon complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMissingDiscriminatorWithResponseAsync(Salmon complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putMissingDiscriminator(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putMissingDiscriminatorWithResponseAsync(complexBody, context)); } /** @@ -1046,9 +1034,7 @@ public Salmon putMissingDiscriminator(Salmon complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidMissingRequiredWithResponseAsync(Fish complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putValidMissingRequired(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidMissingRequiredWithResponseAsync(complexBody, context)); } /** diff --git a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PrimitivesImpl.java b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PrimitivesImpl.java index 59b2ea9290..b649590ac9 100644 --- a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PrimitivesImpl.java +++ b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/PrimitivesImpl.java @@ -219,8 +219,7 @@ Mono> putByte(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getIntWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInt(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getIntWithResponseAsync(context)); } /** @@ -302,8 +301,7 @@ public IntWrapper getInt() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putIntWithResponseAsync(IntWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putInt(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putIntWithResponseAsync(complexBody, context)); } /** @@ -388,8 +386,7 @@ public void putInt(IntWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLongWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLong(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLongWithResponseAsync(context)); } /** @@ -470,8 +467,7 @@ public LongWrapper getLong() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putLongWithResponseAsync(LongWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putLong(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putLongWithResponseAsync(complexBody, context)); } /** @@ -556,8 +552,7 @@ public void putLong(LongWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFloatWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFloat(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFloatWithResponseAsync(context)); } /** @@ -638,8 +633,7 @@ public FloatWrapper getFloat() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFloatWithResponseAsync(FloatWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFloat(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putFloatWithResponseAsync(complexBody, context)); } /** @@ -725,8 +719,7 @@ public void putFloat(FloatWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDoubleWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDouble(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDoubleWithResponseAsync(context)); } /** @@ -808,8 +801,7 @@ public DoubleWrapper getDouble() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDoubleWithResponseAsync(DoubleWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDouble(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDoubleWithResponseAsync(complexBody, context)); } /** @@ -894,8 +886,7 @@ public void putDouble(DoubleWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBoolWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBool(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBoolWithResponseAsync(context)); } /** @@ -976,8 +967,7 @@ public BooleanWrapper getBool() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBoolWithResponseAsync(BooleanWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putBool(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putBoolWithResponseAsync(complexBody, context)); } /** @@ -1063,8 +1053,7 @@ public void putBool(BooleanWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getStringWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringWithResponseAsync(context)); } /** @@ -1146,8 +1135,7 @@ public StringWrapper getString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putStringWithResponseAsync(StringWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putString(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putStringWithResponseAsync(complexBody, context)); } /** @@ -1232,8 +1220,7 @@ public void putString(StringWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDate(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateWithResponseAsync(context)); } /** @@ -1314,8 +1301,7 @@ public DateWrapper getDate() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateWithResponseAsync(DateWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDate(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateWithResponseAsync(complexBody, context)); } /** @@ -1401,8 +1387,7 @@ public void putDate(DateWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateTimeWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeWithResponseAsync(context)); } /** @@ -1484,9 +1469,7 @@ public DatetimeWrapper getDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeWithResponseAsync(DatetimeWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTime(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeWithResponseAsync(complexBody, context)); } /** @@ -1572,8 +1555,7 @@ public void putDateTime(DatetimeWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateTimeRfc1123WithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeRfc1123(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeRfc1123WithResponseAsync(context)); } /** @@ -1655,9 +1637,7 @@ public Datetimerfc1123Wrapper getDateTimeRfc1123() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeRfc1123WithResponseAsync(Datetimerfc1123Wrapper complexBody) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTimeRfc1123(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeRfc1123WithResponseAsync(complexBody, context)); } /** @@ -1744,8 +1724,7 @@ public void putDateTimeRfc1123(Datetimerfc1123Wrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDurationWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDuration(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDurationWithResponseAsync(context)); } /** @@ -1827,9 +1806,7 @@ public DurationWrapper getDuration() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDurationWithResponseAsync(DurationWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDuration(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDurationWithResponseAsync(complexBody, context)); } /** @@ -1914,8 +1891,7 @@ public void putDuration(DurationWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getByteWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getByte(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getByteWithResponseAsync(context)); } /** @@ -1996,8 +1972,7 @@ public ByteWrapper getByte() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putByteWithResponseAsync(ByteWrapper complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putByte(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putByteWithResponseAsync(complexBody, context)); } /** diff --git a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/ReadonlypropertiesImpl.java b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/ReadonlypropertiesImpl.java index 77576f1096..7b7a299978 100644 --- a/customization-tests/src/main/java/fixtures/bodycomplex/implementation/ReadonlypropertiesImpl.java +++ b/customization-tests/src/main/java/fixtures/bodycomplex/implementation/ReadonlypropertiesImpl.java @@ -79,8 +79,7 @@ Mono> putValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -162,8 +161,7 @@ public ReadonlyObj getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(ReadonlyObj complexBody) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/fluentgen/src/main/java/com/azure/autorest/fluent/model/clientmodel/fluentmodel/method/FluentActionMethod.java b/fluentgen/src/main/java/com/azure/autorest/fluent/model/clientmodel/fluentmodel/method/FluentActionMethod.java index 9119583065..adb6d28f7d 100644 --- a/fluentgen/src/main/java/com/azure/autorest/fluent/model/clientmodel/fluentmodel/method/FluentActionMethod.java +++ b/fluentgen/src/main/java/com/azure/autorest/fluent/model/clientmodel/fluentmodel/method/FluentActionMethod.java @@ -21,6 +21,7 @@ import com.azure.autorest.template.ClientMethodTemplate; import com.azure.autorest.template.prototype.MethodTemplate; +import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -54,7 +55,7 @@ public FluentActionMethod(FluentResourceModel model, FluentMethodType type, // remove path parameters from input parameter, as they are provided by the variables of resource model ClientMethod method = collectionMethod.getInnerClientMethod(); - List parameters = method.getMethodInputParameters(); + List parameters = new ArrayList<>(method.getMethodInputParameters()); ResourceLocalVariables resourceLocalVariables = new ResourceLocalVariables(collectionMethod.getInnerClientMethod()); parameters.removeAll(resourceLocalVariables.getLocalVariablesMap().entrySet().stream() .filter(e -> e.getValue().getParameterLocation() == RequestParameterLocation.PATH) diff --git a/fluentgen/src/main/java/com/azure/autorest/fluent/template/FluentClientMethodTemplate.java b/fluentgen/src/main/java/com/azure/autorest/fluent/template/FluentClientMethodTemplate.java index a08b0953f4..556d95b737 100644 --- a/fluentgen/src/main/java/com/azure/autorest/fluent/template/FluentClientMethodTemplate.java +++ b/fluentgen/src/main/java/com/azure/autorest/fluent/template/FluentClientMethodTemplate.java @@ -38,7 +38,7 @@ protected void generatePagedAsyncSinglePage(ClientMethod clientMethod, JavaType addValidations(function, clientMethod.getRequiredNullableParameterExpressions(), clientMethod.getValidateExpressions(), settings); addOptionalAndConstantVariables(function, clientMethod, restAPIMethod.getParameters(), settings); applyParameterTransformations(function, clientMethod, settings); - convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters(), clientMethod.getClientReference(), settings); + convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters()); if (mergeContextParameter) { function.line(String.format("context = %s.mergeContext(context);", clientMethod.getClientReference())); } @@ -117,7 +117,7 @@ protected void generatePagedAsyncSinglePage(ClientMethod clientMethod, JavaType addValidations(function, clientMethod.getRequiredNullableParameterExpressions(), clientMethod.getValidateExpressions(), settings); addOptionalAndConstantVariables(function, clientMethod, restAPIMethod.getParameters(), settings); applyParameterTransformations(function, clientMethod, settings); - convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters(), clientMethod.getClientReference(), settings); + convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters()); if (mergeContextParameter) { function.line(String.format("context = %s.mergeContext(context);", clientMethod.getClientReference())); } @@ -134,7 +134,8 @@ protected void generatePagedAsyncSinglePage(ClientMethod clientMethod, JavaType IType classType = clientMethod.getMethodPageDetails().getLroIntermediateType(); function.line(String.format("return Mono.zip(mono, %s.<%s, %s>getLroResult(mono, %s.getHttpPipeline(), %s.class, %s.class, %s).last().flatMap(%s::getLroFinalResultOrError));", - clientMethod.getClientReference(), classType.toString(), classType.toString(), clientMethod.getClientReference(), classType.toString(), classType.toString(), contextParam, clientMethod.getClientReference())); + clientMethod.getClientReference(), classType.toString(), classType, clientMethod.getClientReference(), + classType, classType, contextParam, clientMethod.getClientReference())); }); function.line("})"); } @@ -149,7 +150,9 @@ protected void generatePagedAsyncSinglePage(ClientMethod clientMethod, JavaType IType classType = clientMethod.getMethodPageDetails().getLroIntermediateType(); function.line(String.format("return Mono.zip(mono, %s.<%s, %s>getLroResult(mono, %s.getHttpPipeline(), %s.class, %s.class, %s).last().flatMap(%s::getLroFinalResultOrError))", - clientMethod.getClientReference(), classType.toString(), classType.toString(), clientMethod.getClientReference(), classType.toString(), classType.toString(), contextParam, clientMethod.getClientReference())); + clientMethod.getClientReference(), classType.toString(), classType, clientMethod.getClientReference(), + classType, + classType, contextParam, clientMethod.getClientReference())); } } function.indent(() -> { @@ -197,14 +200,14 @@ protected void generatePagedAsyncSinglePage(ClientMethod clientMethod, JavaType @Override protected void generateSimpleAsyncRestResponse(ClientMethod clientMethod, JavaType typeBlock, ProxyMethod restAPIMethod, JavaSettings settings) { boolean addContextParameter = !contextInParameters(clientMethod); - boolean mergeContextParameter = contextInParameters(clientMethod); + boolean mergeContextParameter = !addContextParameter; typeBlock.annotation("ServiceMethod(returns = ReturnType.SINGLE)"); writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), function -> { addValidations(function, clientMethod.getRequiredNullableParameterExpressions(), clientMethod.getValidateExpressions(), settings); addOptionalAndConstantVariables(function, clientMethod, restAPIMethod.getParameters(), settings); applyParameterTransformations(function, clientMethod, settings); - convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters(), clientMethod.getClientReference(), settings); + convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters()); String restAPIMethodArgumentList = String.join(", ", clientMethod.getProxyMethodArguments(settings)); String serviceMethodCall = String.format("service.%s(%s)", restAPIMethod.getName(), restAPIMethodArgumentList); diff --git a/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java b/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java index c64836aefa..fbb5043719 100644 --- a/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java +++ b/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java @@ -372,6 +372,7 @@ private List createClientMethods(Operation operation, boolean isPr .type(ClientMethodType.SimpleAsyncRestResponse) .groupedParameterRequired(false) .methodVisibility(simpleAsyncMethodVisibility) + .hasWithContextOverload(simpleAsyncMethodVisibilityWithContext != NOT_GENERATE) .build()); builder.methodVisibility(simpleAsyncMethodVisibilityWithContext); @@ -834,18 +835,20 @@ private static void createSimpleClientMethods(Operation operation, boolean isPro String methodName = isSync ? methodNamer.getSimpleRestResponseMethodName() : methodNamer.getSimpleAsyncRestResponseMethodName(); ClientMethodType methodType = isSync ? ClientMethodType.SimpleSyncRestResponse : ClientMethodType.SimpleAsyncRestResponse; + JavaVisibility withContextVisibility = visibilityFunction.methodVisibility(true, defaultOverloadType, true); builder.parameters(parameters) .returnValue(responseReturnValue) .onlyRequiredParameters(false) .name(methodName) .type(methodType) .groupedParameterRequired(false) + .hasWithContextOverload(withContextVisibility != NOT_GENERATE) .methodVisibility(visibilityFunction.methodVisibility(true, defaultOverloadType, false)); // Always generate an overload of WithResponse with non-required parameters without Context. // It is only for sync proxy method, and is usually filtered out in methodVisibility function. methods.add(builder.build()); - builder.methodVisibility(visibilityFunction.methodVisibility(true, defaultOverloadType, true)); + builder.methodVisibility(withContextVisibility); addClientMethodWithContext(methods, builder, parameters, contextParameter); // Repeat the same but for simple returns. @@ -1508,9 +1511,10 @@ protected static void addClientMethodWithContext(List methods, Bui } methods.add(builder - .parameters(updatedParams) // update builder parameters to include context - .onlyRequiredParameters(false) - .build()); + .parameters(updatedParams) // update builder parameters to include context + .onlyRequiredParameters(false) + .hasWithContextOverload(false) // WithContext overload doesn't have a withContext overload + .build()); // reset the parameters to original params builder.parameters(parameters); } diff --git a/javagen/src/main/java/com/azure/autorest/model/clientmodel/ClientMethod.java b/javagen/src/main/java/com/azure/autorest/model/clientmodel/ClientMethod.java index e501a044f8..ca582faef6 100644 --- a/javagen/src/main/java/com/azure/autorest/model/clientmodel/ClientMethod.java +++ b/javagen/src/main/java/com/azure/autorest/model/clientmodel/ClientMethod.java @@ -18,7 +18,6 @@ import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Objects; @@ -29,38 +28,35 @@ * A ClientMethod that exists on a ServiceClient or MethodGroupClient that eventually will call a ProxyMethod. */ public class ClientMethod { - private static final List KNOWN_POLLING_STRATEGIES = Arrays.asList( - "DefaultPollingStrategy", - "ChainedPollingStrategy", - "OperationResourcePollingStrategy", - "LocationPollingStrategy", - "StatusCheckPollingStrategy", - "SyncDefaultPollingStrategy", - "SyncChainedPollingStrategy", - "SyncOperationResourcePollingStrategy", - "SyncLocationPollingStrategy", - "SyncStatusCheckPollingStrategy"); + private static final List KNOWN_POLLING_STRATEGIES = Arrays.asList("DefaultPollingStrategy", + "ChainedPollingStrategy", "OperationResourcePollingStrategy", "LocationPollingStrategy", + "StatusCheckPollingStrategy", "SyncDefaultPollingStrategy", "SyncChainedPollingStrategy", + "SyncOperationResourcePollingStrategy", "SyncLocationPollingStrategy", "SyncStatusCheckPollingStrategy"); + private final String crossLanguageDefinitionId; /** * The description of this ClientMethod. */ - private String description; + private final String description; /** * The return value of this ClientMethod. */ - private ReturnValue returnValue; + private final ReturnValue returnValue; /** * The name of this ClientMethod. */ - private String name; + private final String name; /** * The parameters of this ClientMethod. */ - private List parameters; + private final List parameters; + private final List methodParameters; + private final List methodRequiredParameters; + /** - * Whether or not this ClientMethod has omitted optional parameters. + * Whether this ClientMethod has omitted optional parameters. */ - private boolean onlyRequiredParameters; + private final boolean onlyRequiredParameters; /** * The type of this ClientMethod. */ @@ -68,56 +64,62 @@ public class ClientMethod { /** * The RestAPIMethod that this ClientMethod eventually calls. */ - private ProxyMethod proxyMethod; + private final ProxyMethod proxyMethod; /** * The expressions (parameters and service client properties) that need to be validated in this ClientMethod. */ - private Map validateExpressions; + private final Map validateExpressions; /** * The reference to the service client. */ - private String clientReference; + private final String clientReference; /** * The parameter expressions which are required. */ - private List requiredNullableParameterExpressions; + private final List requiredNullableParameterExpressions; /** * The parameter that needs to transformed before pagination. */ - private boolean isGroupedParameterRequired; + private final boolean isGroupedParameterRequired; /** * The type name of groupedParameter. */ - private String groupedParameterTypeName; + private final String groupedParameterTypeName; /** * The pagination information if this is a paged method. */ - private MethodPageDetails methodPageDetails; + private final MethodPageDetails methodPageDetails; /** * The parameter transformations before calling ProxyMethod. */ - private List methodTransformationDetails; + private final List methodTransformationDetails; - private JavaVisibility methodVisibility; + private final JavaVisibility methodVisibility; - private JavaVisibility methodVisibilityInWrapperClient; + private final JavaVisibility methodVisibilityInWrapperClient; private final ImplementationDetails implementationDetails; - private MethodPollingDetails methodPollingDetails; + private final MethodPollingDetails methodPollingDetails; + + private final ExternalDocumentation externalDocumentation; - private ExternalDocumentation externalDocumentation; + private final boolean hasWithContextOverload; + private final String parametersDeclaration; + private final String argumentList; /** * Create a new ClientMethod with the provided properties. + * * @param description The description of this ClientMethod. * @param returnValue The return value of this ClientMethod. * @param name The name of this ClientMethod. * @param parameters The parameters of this ClientMethod. - * @param onlyRequiredParameters Whether or not this ClientMethod has omitted optional parameters. + * @param onlyRequiredParameters Whether this ClientMethod has omitted optional parameters. * @param type The type of this ClientMethod. * @param proxyMethod The ProxyMethod that this ClientMethod eventually calls. - * @param validateExpressions The expressions (parameters and service client properties) that need to be validated in this ClientMethod. + * @param validateExpressions The expressions (parameters and service client properties) that need to be validated + * in this ClientMethod. * @param clientReference The reference to the service client. * @param requiredNullableParameterExpressions The parameter expressions which are required. * @param isGroupedParameterRequired The parameter that needs to transformed before pagination. @@ -125,20 +127,28 @@ public class ClientMethod { * @param methodPageDetails The pagination information if this is a paged method. * @param methodTransformationDetails The parameter transformations before calling ProxyMethod. * @param externalDocumentation The external documentation. + * @param hasWithContextOverload Whether this method has a corresponding {@code Context}-based overload. */ protected ClientMethod(String description, ReturnValue returnValue, String name, - List parameters, boolean onlyRequiredParameters, - ClientMethodType type, ProxyMethod proxyMethod, Map validateExpressions, - String clientReference, List requiredNullableParameterExpressions, - boolean isGroupedParameterRequired, String groupedParameterTypeName, - MethodPageDetails methodPageDetails, - List methodTransformationDetails, - JavaVisibility methodVisibility, JavaVisibility methodVisibilityInWrapperClient, ImplementationDetails implementationDetails, - MethodPollingDetails methodPollingDetails, ExternalDocumentation externalDocumentation, String crossLanguageDefinitionId) { + List parameters, boolean onlyRequiredParameters, ClientMethodType type, + ProxyMethod proxyMethod, Map validateExpressions, String clientReference, + List requiredNullableParameterExpressions, boolean isGroupedParameterRequired, + String groupedParameterTypeName, MethodPageDetails methodPageDetails, + List methodTransformationDetails, JavaVisibility methodVisibility, + JavaVisibility methodVisibilityInWrapperClient, ImplementationDetails implementationDetails, + MethodPollingDetails methodPollingDetails, ExternalDocumentation externalDocumentation, + String crossLanguageDefinitionId, boolean hasWithContextOverload) { this.description = description; this.returnValue = returnValue; this.name = name; - this.parameters = parameters; + this.parameters = List.copyOf(parameters); + this.methodParameters = parameters.stream() + .filter(parameter -> !parameter.isFromClient() && parameter.getName() != null && !parameter.getName().trim().isEmpty()) + .sorted((p1, p2) -> Boolean.compare(!p1.isRequired(), !p2.isRequired())) + .collect(Collectors.toUnmodifiableList()); + this.methodRequiredParameters = methodParameters.stream() + .filter(param -> !param.isConstant() && param.isRequired()) + .collect(Collectors.toUnmodifiableList()); this.onlyRequiredParameters = onlyRequiredParameters; this.type = type; this.proxyMethod = proxyMethod; @@ -155,30 +165,34 @@ protected ClientMethod(String description, ReturnValue returnValue, String name, this.externalDocumentation = externalDocumentation; this.methodVisibilityInWrapperClient = methodVisibilityInWrapperClient; this.crossLanguageDefinitionId = crossLanguageDefinitionId; + this.hasWithContextOverload = hasWithContextOverload; + this.parametersDeclaration = getMethodInputParameters().stream().map(ClientMethodParameter::getDeclaration) + .collect(Collectors.joining(", ")); + this.argumentList = getMethodParameters().stream().map(ClientMethodParameter::getName) + .collect(Collectors.joining(", ")); } @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; ClientMethod that = (ClientMethod) o; return onlyRequiredParameters == that.onlyRequiredParameters - && isGroupedParameterRequired == that.isGroupedParameterRequired - && Objects.equals(returnValue.getType(), that.returnValue.getType()) - && Objects.equals(name, that.name) - && Objects.equals(getParametersDeclaration(), that.getParametersDeclaration()) - && type == that.type - && Objects.equals(requiredNullableParameterExpressions, that.requiredNullableParameterExpressions) - && Objects.equals(groupedParameterTypeName, that.groupedParameterTypeName) - && Objects.equals(methodTransformationDetails, that.methodTransformationDetails) - && methodVisibility == that.methodVisibility; + && isGroupedParameterRequired == that.isGroupedParameterRequired && Objects.equals(returnValue.getType(), + that.returnValue.getType()) && Objects.equals(name, that.name) && Objects.equals(getParametersDeclaration(), + that.getParametersDeclaration()) && type == that.type && Objects.equals( + requiredNullableParameterExpressions, that.requiredNullableParameterExpressions) && Objects.equals( + groupedParameterTypeName, that.groupedParameterTypeName) && Objects.equals(methodTransformationDetails, + that.methodTransformationDetails) && methodVisibility == that.methodVisibility; } @Override public int hashCode() { return Objects.hash(returnValue.getType(), name, getParametersDeclaration(), onlyRequiredParameters, type, - requiredNullableParameterExpressions, isGroupedParameterRequired, groupedParameterTypeName, - methodTransformationDetails, methodVisibility); + requiredNullableParameterExpressions, isGroupedParameterRequired, groupedParameterTypeName, + methodTransformationDetails, methodVisibility); } public String getCrossLanguageDefinitionId() { @@ -225,51 +239,43 @@ public final String getClientReference() { * Get the comma-separated list of parameter declarations for this ClientMethod. */ public final String getParametersDeclaration() { - List methodParameters = onlyRequiredParameters ? getMethodRequiredParameters() : getMethodParameters(); - return methodParameters.stream().map(ClientMethodParameter::getDeclaration).collect(Collectors.joining(", ")); + return parametersDeclaration; } /** * Get the comma-separated list of parameter names for this ClientMethod. */ public final String getArgumentList() { - return getMethodParameters().stream().map(ClientMethodParameter::getName).collect(Collectors.joining(", ")); + return argumentList; } public final String getArgumentListWithoutRequestOptions() { - return getMethodParameters().stream().map(ClientMethodParameter::getName) - .map(name -> name.equals("requestOptions") ? "null" : name).collect(Collectors.joining(", ")); + return getMethodParameters().stream() + .map(ClientMethodParameter::getName) + .map(name -> name.equals("requestOptions") ? "null" : name) + .collect(Collectors.joining(", ")); } /** * The full declaration of this ClientMethod. */ public final String getDeclaration() { - return String.format("%1$s %2$s(%3$s)", getReturnValue().getType(), getName(), getParametersDeclaration()); + return getReturnValue().getType() + " " + getName() + "(" + getParametersDeclaration() + ")"; } /** * Get the input parameters of the client method, taking configure of onlyRequiredParameters. */ public final List getMethodInputParameters() { - return getOnlyRequiredParameters() ? getMethodRequiredParameters() : getMethodParameters(); + return onlyRequiredParameters ? getMethodRequiredParameters() : getMethodParameters(); } public final List getMethodParameters() { - return getParameters().stream().filter(parameter -> parameter != null && !parameter.isFromClient() && - parameter.getName() != null && !parameter.getName().trim().isEmpty()) - .sorted((p1, p2) -> Boolean.compare(!p1.isRequired(), !p2.isRequired())) - .collect(Collectors.toList()); - } - - private final List getMethodNonConstantParameters() { - return getMethodParameters().stream().filter(parameter -> !parameter.isConstant()) - .sorted((p1, p2) -> Boolean.compare(!p1.isRequired(), !p2.isRequired())) - .collect(Collectors.toList()); + return methodParameters; } public final List getMethodRequiredParameters() { - return getMethodNonConstantParameters().stream().filter(ClientMethodParameter::isRequired).collect(Collectors.toList()); + return methodRequiredParameters; } public final List getRequiredNullableParameterExpressions() { @@ -305,16 +311,25 @@ public final List getProxyMethodArguments(JavaSettings settings) { } IType parameterClientType = parameter.getClientType(); - if (parameterClientType != ClassType.BASE_64_URL && parameter.getRequestParameterLocation() != RequestParameterLocation.BODY /*&& parameter.getRequestParameterLocation() != RequestParameterLocation.FormData*/ && (parameterClientType instanceof ArrayType || parameterClientType instanceof ListType)) { + if (parameterClientType != ClassType.BASE_64_URL && parameter.getRequestParameterLocation() + != RequestParameterLocation.BODY /*&& parameter.getRequestParameterLocation() != RequestParameterLocation.FormData*/ + && (parameterClientType instanceof ArrayType || parameterClientType instanceof ListType)) { parameterWireType = ClassType.STRING; } - String parameterWireName = parameterClientType != parameterWireType ? String.format("%1$sConverted", CodeNamer - .toCamelCase(CodeNamer.removeInvalidCharacters(parameterName))) : parameterName; + String parameterWireName = (parameterClientType != parameterWireType) + ? CodeNamer.toCamelCase(CodeNamer.removeInvalidCharacters(parameterName)) + "Converted" + : parameterName; String result; - if (getMethodTransformationDetails().stream().anyMatch(d -> d.getOutParameter().getName().equals(parameterName + "1"))) { - result = getMethodTransformationDetails().stream().filter(d -> d.getOutParameter().getName().equals(parameterName + "1")).findFirst().get().getOutParameter().getName(); + if (getMethodTransformationDetails().stream() + .anyMatch(d -> d.getOutParameter().getName().equals(parameterName + "1"))) { + result = getMethodTransformationDetails().stream() + .filter(d -> d.getOutParameter().getName().equals(parameterName + "1")) + .findFirst() + .get() + .getOutParameter() + .getName(); } else { result = parameterWireName; } @@ -343,10 +358,22 @@ public MethodPollingDetails getMethodPollingDetails() { return methodPollingDetails; } + /** + * Whether this {@link ClientMethod} has a corresponding {@link ClientMethod} that has an equivalent overload that + * contains an additional {@code Context} parameter. + * + * @return whether this method has a corresponding {@code Context}-based overload + */ + public boolean hasWithContextOverload() { + return hasWithContextOverload; + } + /** * Add this ClientMethod's imports to the provided set of imports. + * * @param imports The set of imports to add to. - * @param includeImplementationImports Whether to include imports that are only necessary for method implementations. + * @param includeImplementationImports Whether to include imports that are only necessary for method + * implementations. */ public void addImportsTo(Set imports, boolean includeImplementationImports, JavaSettings settings) { @@ -398,9 +425,8 @@ public void addImportsTo(Set imports, boolean includeImplementationImpor // Add FluxUtil as an import if this is an asynchronous method and the last parameter isn't the Context // parameter. - if (proxyMethod != null && !proxyMethod.isSync() - && (CoreUtils.isNullOrEmpty(parameters) - || parameters.get(parameters.size() - 1) != ClientMethodParameter.CONTEXT_PARAMETER)) { + if (proxyMethod != null && !proxyMethod.isSync() && (CoreUtils.isNullOrEmpty(parameters) + || parameters.get(parameters.size() - 1) != ClientMethodParameter.CONTEXT_PARAMETER)) { imports.add("com.azure.core.util.FluxUtil"); } @@ -416,7 +442,9 @@ public void addImportsTo(Set imports, boolean includeImplementationImpor if (type == ClientMethodType.LongRunningBeginAsync || type == ClientMethodType.LongRunningBeginSync) { if (settings.isFluent()) { - if (((GenericType) this.getReturnValue().getType().getClientType()).getTypeArguments()[0] instanceof GenericType) { + if (((GenericType) this.getReturnValue() + .getType() + .getClientType()).getTypeArguments()[0] instanceof GenericType) { imports.add("com.fasterxml.jackson.core.type.TypeReference"); } } else { @@ -432,7 +460,7 @@ public void addImportsTo(Set imports, boolean includeImplementationImpor if (getMethodPollingDetails() != null) { for (String pollingStrategy : KNOWN_POLLING_STRATEGIES) { if (getMethodPollingDetails().getPollingStrategy().contains(pollingStrategy) - || getMethodPollingDetails().getSyncPollingStrategy().contains(pollingStrategy)) { + || getMethodPollingDetails().getSyncPollingStrategy().contains(pollingStrategy)) { imports.add("com.azure.core.util.polling." + pollingStrategy); } } @@ -440,10 +468,14 @@ public void addImportsTo(Set imports, boolean includeImplementationImpor } } - if (type == ClientMethodType.PagingAsyncSinglePage || type == ClientMethodType.PagingSyncSinglePage && this.getMethodPageDetails() != null) { - if (this.getMethodPageDetails() != null && this.getMethodPageDetails().getLroIntermediateType() != null) { + if (type == ClientMethodType.PagingAsyncSinglePage + || type == ClientMethodType.PagingSyncSinglePage && this.getMethodPageDetails() != null) { + if (this.getMethodPageDetails() != null + && this.getMethodPageDetails().getLroIntermediateType() != null) { // pageable + LRO - this.getMethodPageDetails().getLroIntermediateType().addImportsTo(imports, includeImplementationImports); + this.getMethodPageDetails() + .getLroIntermediateType() + .addImportsTo(imports, includeImplementationImports); } } @@ -463,31 +495,29 @@ public void addImportsTo(Set imports, boolean includeImplementationImpor } public static ClientMethod getAsyncSendRequestClientMethod(boolean isInMethodGroup) { - return new Builder() - .name("sendRequestAsync") - .description("Sends the {@code httpRequest}.") - .clientReference(isInMethodGroup ? "this.client" : "this") - .methodVisibility(JavaVisibility.Public) - .onlyRequiredParameters(false) - .type(ClientMethodType.SendRequestAsync) - .parameters(Collections.singletonList(ClientMethodParameter.HTTP_REQUEST_PARAMETER)) - .returnValue(new ReturnValue("the response body on successful completion of {@link Mono}", - GenericType.Mono(GenericType.Response(ClassType.BINARY_DATA)))) - .build(); + return new Builder().name("sendRequestAsync") + .description("Sends the {@code httpRequest}.") + .clientReference(isInMethodGroup ? "this.client" : "this") + .methodVisibility(JavaVisibility.Public) + .onlyRequiredParameters(false) + .type(ClientMethodType.SendRequestAsync) + .parameters(ClientMethodParameter.HTTP_REQUEST_PARAMETER) + .returnValue(new ReturnValue("the response body on successful completion of {@link Mono}", + GenericType.Mono(GenericType.Response(ClassType.BINARY_DATA)))) + .build(); } public static ClientMethod getSyncSendRequestClientMethod(boolean isInMethodGroup) { - return new Builder() - .name("sendRequest") - .description("Sends the {@code httpRequest}.") - .clientReference(isInMethodGroup ? "this.client" : "this") - .methodVisibility(JavaVisibility.Public) - .onlyRequiredParameters(false) - .type(ClientMethodType.SendRequestSync) - .parameters(Arrays.asList(ClientMethodParameter.HTTP_REQUEST_PARAMETER, ClientMethodParameter.CONTEXT_PARAMETER)) - .returnValue(new ReturnValue("the response body along with {@link Response}", - GenericType.Response(ClassType.BINARY_DATA))) - .build(); + return new Builder().name("sendRequest") + .description("Sends the {@code httpRequest}.") + .clientReference(isInMethodGroup ? "this.client" : "this") + .methodVisibility(JavaVisibility.Public) + .onlyRequiredParameters(false) + .type(ClientMethodType.SendRequestSync) + .parameters(ClientMethodParameter.HTTP_REQUEST_PARAMETER, ClientMethodParameter.CONTEXT_PARAMETER) + .returnValue(new ReturnValue("the response body along with {@link Response}", + GenericType.Response(ClassType.BINARY_DATA))) + .build(); } public static class Builder { @@ -511,6 +541,7 @@ public static class Builder { protected MethodPollingDetails methodPollingDetails; protected ExternalDocumentation externalDocumentation; protected String crossLanguageDefinitionId; + protected boolean hasWithContextOverload; public Builder setCrossLanguageDefinitionId(String crossLanguageDefinitionId) { this.crossLanguageDefinitionId = crossLanguageDefinitionId; @@ -519,6 +550,7 @@ public Builder setCrossLanguageDefinitionId(String crossLanguageDefinitionId) { /** * Sets the description of this ClientMethod. + * * @param description the description of this ClientMethod * @return the Builder itself */ @@ -529,6 +561,7 @@ public Builder description(String description) { /** * Sets the return value of this ClientMethod. + * * @param returnValue the return value of this ClientMethod * @return the Builder itself */ @@ -539,6 +572,7 @@ public Builder returnValue(ReturnValue returnValue) { /** * Sets the name of this ClientMethod. + * * @param name the name of this ClientMethod * @return the Builder itself */ @@ -549,6 +583,7 @@ public Builder name(String name) { /** * Sets the parameters of this ClientMethod. + * * @param parameters the parameters of this ClientMethod * @return the Builder itself */ @@ -557,9 +592,15 @@ public Builder parameters(List parameters) { return this; } + private Builder parameters(ClientMethodParameter... parameters) { + this.parameters = CoreUtils.isNullOrEmpty(parameters) ? null : Arrays.asList(parameters); + return this; + } + /** - * Sets whether or not this ClientMethod has omitted optional parameters. - * @param onlyRequiredParameters whether or not this ClientMethod has omitted optional parameters + * Sets whether this ClientMethod has omitted optional parameters. + * + * @param onlyRequiredParameters whether this ClientMethod has omitted optional parameters * @return the Builder itself */ public Builder onlyRequiredParameters(boolean onlyRequiredParameters) { @@ -569,6 +610,7 @@ public Builder onlyRequiredParameters(boolean onlyRequiredParameters) { /** * Sets the type of this ClientMethod. + * * @param type the type of this ClientMethod * @return the Builder itself */ @@ -579,6 +621,7 @@ public Builder type(ClientMethodType type) { /** * Sets the RestAPIMethod that this ClientMethod eventually calls. + * * @param proxyMethod the RestAPIMethod that this ClientMethod eventually calls * @return the Builder itself */ @@ -588,8 +631,11 @@ public Builder proxyMethod(ProxyMethod proxyMethod) { } /** - * Sets the expressions ( (parameters and service client properties) that need to be validated in this ClientMethod. - * @param validateExpressions the expressions (parameters and service client properties) that need to be validated in this ClientMethod + * Sets the expressions ( (parameters and service client properties) that need to be validated in this + * ClientMethod. + * + * @param validateExpressions the expressions (parameters and service client properties) that need to be + * validated in this ClientMethod * @return the Builder itself */ public Builder validateExpressions(Map validateExpressions) { @@ -599,6 +645,7 @@ public Builder validateExpressions(Map validateExpressions) { /** * Sets the reference to the service client. + * * @param clientReference the reference to the service client * @return the Builder itself */ @@ -609,6 +656,7 @@ public Builder clientReference(String clientReference) { /** * Sets the parameter expressions which are required. + * * @param requiredNullableParameterExpressions the parameter expressions which are required * @return the Builder itself */ @@ -619,6 +667,7 @@ public Builder requiredNullableParameterExpressions(List requiredNullabl /** * Sets the parameter that needs to transformed before pagination. + * * @param isGroupedParameterRequired the parameter that needs to transformed before pagination * @return the Builder itself */ @@ -629,6 +678,7 @@ public Builder groupedParameterRequired(boolean isGroupedParameterRequired) { /** * Sets the type name of groupedParameter. + * * @param groupedParameterTypeName the type name of groupedParameter * @return the Builder itself */ @@ -639,6 +689,7 @@ public Builder groupedParameterTypeName(String groupedParameterTypeName) { /** * Sets the pagination information if this is a paged method. + * * @param methodPageDetails the pagination information if this is a paged method * @return the Builder itself */ @@ -649,6 +700,7 @@ public Builder methodPageDetails(MethodPageDetails methodPageDetails) { /** * Sets the parameter transformations before calling ProxyMethod. + * * @param methodTransformationDetails the parameter transformations before calling ProxyMethod * @return the Builder itself */ @@ -659,6 +711,7 @@ public Builder methodTransformationDetails(List meth /** * Sets the parameter method visibility. + * * @param methodVisibility the method visibility, default is Public. * @return the Builder itself */ @@ -669,6 +722,7 @@ public Builder methodVisibility(JavaVisibility methodVisibility) { /** * Sets the parameter method visibility in wrapper client. + * * @param methodVisibilityInWrapperClient the method visibility in wrapper client, default is Public. * @return the Builder itself */ @@ -679,6 +733,7 @@ public Builder methodVisibilityInWrapperClient(JavaVisibility methodVisibilityIn /** * Sets the polling information if this is a long running method. + * * @param methodPollingDetails the polling information * @return the Builder itself */ @@ -689,6 +744,7 @@ public Builder methodPollingDetails(MethodPollingDetails methodPollingDetails) { /** * Sets the implementation details for the method. + * * @param implementationDetails the implementation details. * @return the Builder itself */ @@ -699,6 +755,7 @@ public Builder implementationDetails(ImplementationDetails implementationDetails /** * Sets method documentation + * * @param externalDocumentation method level documentation * @return the Builder itself */ @@ -707,31 +764,31 @@ public Builder methodDocumentation(ExternalDocumentation externalDocumentation) return this; } + /** + * Whether this {@link ClientMethod} has a corresponding {@link ClientMethod} that has an additional + * {@code Context} parameter. + *

+ * When this is true, when this method generates its client method it will call into the {@code Context}-based + * overload instead of generating a method body. This helps to avoid generating duplicate method bodies that + * only differ by the presence of a {@code Context} parameter. + * + * @param hasWithContextOverload whether this method has a corresponding {@code Context}-based overload + * @return the Builder itself + */ + public Builder hasWithContextOverload(boolean hasWithContextOverload) { + this.hasWithContextOverload = hasWithContextOverload; + return this; + } + /** * @return an immutable ClientMethod instance with the configurations on this builder. */ public ClientMethod build() { - return new ClientMethod( - description, - returnValue, - name, - parameters, - onlyRequiredParameters, - type, - proxyMethod, - validateExpressions, - clientReference, - requiredNullableParameterExpressions, - isGroupedParameterRequired, - groupedParameterTypeName, - methodPageDetails, - methodTransformationDetails, - methodVisibility, - methodVisibilityInWrapperClient, - implementationDetails, - methodPollingDetails, - externalDocumentation, - crossLanguageDefinitionId); + return new ClientMethod(description, returnValue, name, parameters, onlyRequiredParameters, type, + proxyMethod, validateExpressions, clientReference, requiredNullableParameterExpressions, + isGroupedParameterRequired, groupedParameterTypeName, methodPageDetails, methodTransformationDetails, + methodVisibility, methodVisibilityInWrapperClient, implementationDetails, methodPollingDetails, + externalDocumentation, crossLanguageDefinitionId, hasWithContextOverload); } } } diff --git a/javagen/src/main/java/com/azure/autorest/model/clientmodel/ProxyMethod.java b/javagen/src/main/java/com/azure/autorest/model/clientmodel/ProxyMethod.java index 2efb63bd5b..b0b905224a 100644 --- a/javagen/src/main/java/com/azure/autorest/model/clientmodel/ProxyMethod.java +++ b/javagen/src/main/java/com/azure/autorest/model/clientmodel/ProxyMethod.java @@ -10,9 +10,9 @@ import com.azure.core.http.ContentType; import com.azure.core.http.HttpMethod; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; @@ -20,14 +20,6 @@ * A method within a Proxy. */ public class ProxyMethod { - - private static final Map EXCEPTION_TYPE_MAP = new HashMap<>() {{ - put(ClassType.CLIENT_AUTHENTICATION_EXCEPTION, HttpExceptionType.CLIENT_AUTHENTICATION); - put(ClassType.RESOURCE_EXISTS_EXCEPTION, HttpExceptionType.RESOURCE_EXISTS); - put(ClassType.RESOURCE_NOT_FOUND_EXCEPTION, HttpExceptionType.RESOURCE_NOT_FOUND); - put(ClassType.RESOURCE_MODIFIED_EXCEPTION, HttpExceptionType.RESOURCE_MODIFIED); - }}; - /** * Get the Content-Type of the request. */ @@ -112,19 +104,16 @@ public class ProxyMethod { private final boolean customHeaderIgnored; protected ProxyMethod(String requestContentType, IType returnType, HttpMethod httpMethod, String baseUrl, - String urlPath, List responseExpectedStatusCodes, - ClassType unexpectedResponseExceptionType, - Map> unexpectedResponseExceptionTypes, - String name, List parameters, - List allParameters, String description, - IType returnValueWireType, IType responseBodyType, IType rawResponseBodyType, - boolean isResumable, Set responseContentTypes, - String operationId, Map examples, + String urlPath, List responseExpectedStatusCodes, ClassType unexpectedResponseExceptionType, + Map> unexpectedResponseExceptionTypes, String name, + List parameters, List allParameters, String description, + IType returnValueWireType, IType responseBodyType, IType rawResponseBodyType, boolean isResumable, + Set responseContentTypes, String operationId, Map examples, List specialHeaders) { this(requestContentType, returnType, httpMethod, baseUrl, urlPath, responseExpectedStatusCodes, unexpectedResponseExceptionType, unexpectedResponseExceptionTypes, name, parameters, allParameters, - description, returnValueWireType, responseBodyType, rawResponseBodyType, isResumable, - responseContentTypes, operationId, examples, specialHeaders, false, name, false); + description, returnValueWireType, responseBodyType, rawResponseBodyType, isResumable, responseContentTypes, + operationId, examples, specialHeaders, false, name, false); } /** @@ -151,14 +140,11 @@ protected ProxyMethod(String requestContentType, IType returnType, HttpMethod ht * @param baseName the base name of the REST method. */ protected ProxyMethod(String requestContentType, IType returnType, HttpMethod httpMethod, String baseUrl, - String urlPath, List responseExpectedStatusCodes, - ClassType unexpectedResponseExceptionType, - Map> unexpectedResponseExceptionTypes, - String name, List parameters, - List allParameters, String description, - IType returnValueWireType, IType responseBodyType, IType rawResponseBodyType, - boolean isResumable, Set responseContentTypes, - String operationId, Map examples, + String urlPath, List responseExpectedStatusCodes, ClassType unexpectedResponseExceptionType, + Map> unexpectedResponseExceptionTypes, String name, + List parameters, List allParameters, String description, + IType returnValueWireType, IType responseBodyType, IType rawResponseBodyType, boolean isResumable, + Set responseContentTypes, String operationId, Map examples, List specialHeaders, boolean isSync, String baseName, boolean customHeaderIgnored) { this.requestContentType = requestContentType; this.returnType = returnType; @@ -316,8 +302,7 @@ public ProxyMethod toSync() { .map(this::mapToSyncParam) .collect(Collectors.toList()); - this.syncProxy = new ProxyMethod.Builder() - .parameters(syncParams) + this.syncProxy = new ProxyMethod.Builder().parameters(syncParams) .httpMethod(this.getHttpMethod()) .name(this.getName() + "Sync") .baseName(this.getName()) @@ -362,16 +347,18 @@ private IType mapToSyncType(IType type) { if (genericType.getName().equals("Mono")) { if (genericType.getTypeArguments()[0] instanceof GenericType) { GenericType innerGenericType = (GenericType) genericType.getTypeArguments()[0]; - if (innerGenericType.getName().equals("ResponseBase") && innerGenericType.getTypeArguments()[1] == GenericType.FLUX_BYTE_BUFFER) { + if (innerGenericType.getName().equals("ResponseBase") + && innerGenericType.getTypeArguments()[1] == GenericType.FLUX_BYTE_BUFFER) { return GenericType.RestResponse(innerGenericType.getTypeArguments()[0], - JavaSettings.getInstance().isInputStreamForBinary() - ? ClassType.INPUT_STREAM : ClassType.BINARY_DATA); + JavaSettings.getInstance().isInputStreamForBinary() + ? ClassType.INPUT_STREAM + : ClassType.BINARY_DATA); } } if (genericType.getTypeArguments()[0] == ClassType.STREAM_RESPONSE) { - return JavaSettings.getInstance().isInputStreamForBinary() - ? GenericType.Response(ClassType.INPUT_STREAM) : GenericType.Response(ClassType.BINARY_DATA); + return JavaSettings.getInstance().isInputStreamForBinary() ? GenericType.Response( + ClassType.INPUT_STREAM) : GenericType.Response(ClassType.BINARY_DATA); } return genericType.getTypeArguments()[0]; } @@ -389,7 +376,6 @@ private IType mapToSyncType(IType type) { return type; } - /** * Add this property's imports to the provided set of imports. * @@ -407,14 +393,14 @@ public void addImportsTo(Set imports, boolean includeImplementationImpor } if (getUnexpectedResponseExceptionTypes() != null) { Annotation.UNEXPECTED_RESPONSE_EXCEPTION_TYPE.addImportsTo(imports); - getUnexpectedResponseExceptionTypes().keySet().forEach(e -> e.addImportsTo(imports, includeImplementationImports)); + getUnexpectedResponseExceptionTypes().keySet() + .forEach(e -> e.addImportsTo(imports, includeImplementationImports)); } if (isResumable()) { imports.add("com.azure.core.annotation.ResumeOperation"); } - imports.add(String.format("%1$s.annotation.%2$s", - ExternalPackage.CORE.getPackageName(), - CodeNamer.toPascalCase(getHttpMethod().toString().toLowerCase()))); + imports.add(String.format("%1$s.annotation.%2$s", ExternalPackage.CORE.getPackageName(), + CodeNamer.toPascalCase(getHttpMethod().toString().toLowerCase()))); if (settings.isFluent()) { Annotation.HEADERS.addImportsTo(imports); @@ -439,9 +425,22 @@ public void addImportsTo(Set imports, boolean includeImplementationImpor } public HttpExceptionType getHttpExceptionType(ClassType classType) { - return EXCEPTION_TYPE_MAP.get(classType); - } + if (classType == null) { + return null; + } + + if (Objects.equals(ClassType.CLIENT_AUTHENTICATION_EXCEPTION, classType)) { + return HttpExceptionType.CLIENT_AUTHENTICATION; + } else if (Objects.equals(ClassType.RESOURCE_EXISTS_EXCEPTION, classType)) { + return HttpExceptionType.RESOURCE_EXISTS; + } else if (Objects.equals(ClassType.RESOURCE_NOT_FOUND_EXCEPTION, classType)) { + return HttpExceptionType.RESOURCE_NOT_FOUND; + } else if (Objects.equals(ClassType.RESOURCE_MODIFIED_EXCEPTION, classType)) { + return HttpExceptionType.RESOURCE_MODIFIED; + } + return null; + } public static class Builder { protected String requestContentType; @@ -552,7 +551,8 @@ public Builder unexpectedResponseExceptionType(ClassType unexpectedResponseExcep * unexpected response status code * @return the Builder itself */ - public Builder unexpectedResponseExceptionTypes(Map> unexpectedResponseExceptionTypes) { + public Builder unexpectedResponseExceptionTypes( + Map> unexpectedResponseExceptionTypes) { this.unexpectedResponseExceptionTypes = unexpectedResponseExceptionTypes; return this; } @@ -646,9 +646,9 @@ public Builder rawResponseBodyType(IType rawResponseBodyType) { } /** - * Sets whether or not this method resumes polling of an LRO. + * Sets whether this method resumes polling of an LRO. * - * @param isResumable whether or not this method resumes polling of an LRO + * @param isResumable whether this method resumes polling of an LRO * @return the Builder itself */ public Builder isResumable(boolean isResumable) { @@ -657,7 +657,7 @@ public Builder isResumable(boolean isResumable) { } /** - * Sets the metia-types in response. + * Sets the media-types in response. * * @param responseContentTypes the media-types in response * @return the Builder itself @@ -714,28 +714,10 @@ public Builder customHeaderIgnored(boolean customHeaderIgnored) { * @return an immutable ProxyMethod instance with the configurations on this builder. */ public ProxyMethod build() { - return new ProxyMethod(requestContentType, - returnType, - httpMethod, - baseUrl, - urlPath, - responseExpectedStatusCodes, - unexpectedResponseExceptionType, - unexpectedResponseExceptionTypes, - name, - parameters, - allParameters, - description, - returnValueWireType, - responseBodyType, - rawResponseBodyType, - isResumable, - responseContentTypes, - operationId, - examples, - specialHeaders, - isSync, - baseName, + return new ProxyMethod(requestContentType, returnType, httpMethod, baseUrl, urlPath, + responseExpectedStatusCodes, unexpectedResponseExceptionType, unexpectedResponseExceptionTypes, name, + parameters, allParameters, description, returnValueWireType, responseBodyType, rawResponseBodyType, + isResumable, responseContentTypes, operationId, examples, specialHeaders, isSync, baseName, customHeaderIgnored); } } diff --git a/javagen/src/main/java/com/azure/autorest/model/javamodel/JavaBlock.java b/javagen/src/main/java/com/azure/autorest/model/javamodel/JavaBlock.java index 84334c2f59..1e5c255fdc 100644 --- a/javagen/src/main/java/com/azure/autorest/model/javamodel/JavaBlock.java +++ b/javagen/src/main/java/com/azure/autorest/model/javamodel/JavaBlock.java @@ -28,6 +28,10 @@ public final void text(String text) { contents.text(text); } + public final void line(String text) { + contents.line(text); + } + public final void line(String text, Object... formattedArguments) { contents.line(text, formattedArguments); } diff --git a/javagen/src/main/java/com/azure/autorest/template/ClientMethodTemplate.java b/javagen/src/main/java/com/azure/autorest/template/ClientMethodTemplate.java index c00f96e6e1..b3b63265b0 100644 --- a/javagen/src/main/java/com/azure/autorest/template/ClientMethodTemplate.java +++ b/javagen/src/main/java/com/azure/autorest/template/ClientMethodTemplate.java @@ -81,7 +81,8 @@ protected static void addValidations(JavaBlock function, List expression for (String expressionToCheck : expressionsToCheckSet) { // TODO (alzimmer): Need to discuss if this can be changed to the more appropriate NullPointerException. - String exceptionExpression = String.format("new IllegalArgumentException(\"Parameter %s is required and cannot be null.\")", expressionToCheck); + String exceptionExpression = "new IllegalArgumentException(\"Parameter " + expressionToCheck + + " is required and cannot be null.\")"; // TODO (alzimmer): Determine if the assumption being made here are always true. // 1. Assumes that the expression is nullable. @@ -90,12 +91,12 @@ protected static void addValidations(JavaBlock function, List expression JavaIfBlock nullCheck = function.ifBlock(expressionToCheck + " == null", ifBlock -> { if (JavaSettings.getInstance().isSyncStackEnabled()) { if (settings.isUseClientLogger()) { - ifBlock.line("throw LOGGER.atError().log(%s);", exceptionExpression); + ifBlock.line("throw LOGGER.atError().log(" + exceptionExpression + ");"); } else { - ifBlock.line("throw %s;", exceptionExpression); + ifBlock.line("throw " + exceptionExpression + ";"); } } else { - ifBlock.methodReturn(String.format("Mono.error(%s)", exceptionExpression)); + ifBlock.methodReturn("Mono.error(" + exceptionExpression + ")"); } }); @@ -256,10 +257,8 @@ protected static void applyParameterTransformations(JavaBlock function, ClientMe ? transformation.getOutParameter().getName() + "Internal" : transformation.getOutParameter().getName(); if (conditionalAssignment) { - function.line("%s %s = null;", - transformation.getOutParameter().getClientType(), - outParameterName); - function.line("if (%s) {", nullCheck); + function.line(transformation.getOutParameter().getClientType() + " " + outParameterName + " = null;"); + function.line("if (" + nullCheck + ") {"); function.increaseIndent(); } @@ -280,8 +279,8 @@ protected static void applyParameterTransformations(JavaBlock function, ClientMe for (ParameterMapping mapping : transformation.getParameterMappings()) { String inputPath; if (mapping.getInputParameterProperty() != null) { - inputPath = String.format("%s.%s()", mapping.getInputParameter().getName(), - CodeNamer.getModelNamer().modelPropertyGetterName(mapping.getInputParameterProperty())); + inputPath = mapping.getInputParameter().getName() + "." + + CodeNamer.getModelNamer().modelPropertyGetterName(mapping.getInputParameterProperty()) + "()"; } else { inputPath = mapping.getInputParameter().getName(); } @@ -294,7 +293,7 @@ protected static void applyParameterTransformations(JavaBlock function, ClientMe if (mapping.getOutputParameterPropertyName() != null) { getMapping = String.format(".%s(%s)", CodeNamer.getModelNamer().modelPropertySetterName(mapping.getOutputParameterPropertyName()), inputPath); } else { - getMapping = String.format(" = %s", inputPath); + getMapping = " = " + inputPath; } function.line("%s%s%s;", @@ -311,10 +310,8 @@ protected static void applyParameterTransformations(JavaBlock function, ClientMe if (clientMethod.getParameters().stream().anyMatch(param -> param.getName().equals(transformation.getOutParameter().getName()))) { name = name + "Local"; } - function.line(String.format("%s %s = %s;", - transformation.getOutParameter().getClientType(), - name, - outParameterName)); + function.line(transformation.getOutParameter().getClientType() + " " + name + " = " + + outParameterName + ";"); } } } @@ -325,12 +322,9 @@ protected static void applyParameterTransformations(JavaBlock function, ClientMe * @param function The client method code block. * @param clientMethod The client method. * @param autoRestMethodRetrofitParameters Rest API method parameters. - * @param methodClientReference Client method client reference (can be removed as it is metadata on ClientMethod). - * @param settings AutoRest generation settings. */ protected static void convertClientTypesToWireTypes(JavaBlock function, ClientMethod clientMethod, - List autoRestMethodRetrofitParameters, String methodClientReference, - JavaSettings settings) { + List autoRestMethodRetrofitParameters) { for (ProxyMethodParameter parameter : autoRestMethodRetrofitParameters) { IType parameterWireType = parameter.getWireType(); @@ -368,12 +362,12 @@ protected static void convertClientTypesToWireTypes(JavaBlock function, ClientMe if (parameterClientType == ArrayType.BYTE_ARRAY) { String expression = "null"; if (!alwaysNull) { - expression = String.format("%s(%s)", - parameterWireType == ClassType.STRING ? "Base64Util.encodeToString" : "Base64Url.encode", - parameterName); + String methodCall = (parameterWireType == ClassType.STRING) + ? "Base64Util.encodeToString" : "Base64Url.encode"; + expression = methodCall + "(" + parameterName + ")"; } - function.line("%s %s = %s;", parameterWireType, parameterWireName, expression); + function.line(parameterWireType + " " + parameterWireName + " = " + expression + ";"); addedConversion = true; } else if (parameterClientType instanceof IterableType) { boolean alreadyNullChecked = clientMethod.getRequiredNullableParameterExpressions() @@ -513,11 +507,8 @@ private static boolean addSpecialHeadersToRequestOptions(JavaBlock function, Cli if (contentTypeRequestHeaders) { final String contentType = clientMethod.getProxyMethod().getRequestContentType(); function.line("requestOptionsLocal.addRequestCallback(requestLocal -> {"); - function.indent(() -> { - function.ifBlock("requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null", ifBlock -> { - function.line(String.format("requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, \"%1$s\");", contentType)); - }); - }); + function.indent(() -> function.ifBlock("requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null", + ifBlock -> function.line("requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, \"" + contentType + "\");"))); function.line("});"); } @@ -526,11 +517,8 @@ private static boolean addSpecialHeadersToRequestOptions(JavaBlock function, Cli private static void requestOptionsSetHeaderIfAbsent(JavaBlock function, String expression, String headerName) { function.line("requestOptionsLocal.addRequestCallback(requestLocal -> {"); - function.indent(() -> { - function.ifBlock(String.format("requestLocal.getHeaders().get(HttpHeaderName.fromString(\"%1$s\")) == null", headerName), ifBlock -> { - function.line(String.format("requestLocal.getHeaders().set(HttpHeaderName.fromString(\"%1$s\"), %2$s);", headerName, expression)); - }); - }); + function.indent(() -> function.ifBlock("requestLocal.getHeaders().get(HttpHeaderName.fromString(\"" + headerName + "\")) == null", + ifBlock -> function.line("requestLocal.getHeaders().set(HttpHeaderName.fromString(\"" + headerName + "\"), " + expression + ");"))); function.line("});"); } @@ -562,9 +550,9 @@ public final void write(ClientMethod clientMethod, JavaType typeBlock) { case PagingSync: if (settings.isSyncStackEnabled()) { if (settings.isDataPlaneClient()) { - generateProtocolPagingPlainSync(clientMethod, typeBlock, restAPIMethod, settings); + generateProtocolPagingPlainSync(clientMethod, typeBlock, settings); } else { - generatePagingPlainSync(clientMethod, typeBlock, restAPIMethod, settings); + generatePagingPlainSync(clientMethod, typeBlock, settings); } } else { if (settings.isDataPlaneClient()) { @@ -620,7 +608,7 @@ public final void write(ClientMethod clientMethod, JavaType typeBlock) { generateLongRunningBeginSync(clientMethod, typeBlock, restAPIMethod, settings); } } else { - generateLongRunningBeginSyncOverAsync(clientMethod, typeBlock, restAPIMethod, settings); + generateLongRunningBeginSyncOverAsync(clientMethod, typeBlock); } break; @@ -630,9 +618,9 @@ public final void write(ClientMethod clientMethod, JavaType typeBlock) { case SimpleSync: if (settings.isSyncStackEnabled()) { - generateSimpleSyncMethod(clientMethod, typeBlock, restAPIMethod, settings); + generateSimpleSyncMethod(clientMethod, typeBlock); } else { - generateSimplePlainSyncMethod(clientMethod, typeBlock, restAPIMethod, settings); + generateSimplePlainSyncMethod(clientMethod, typeBlock); } break; case SimpleSyncRestResponse: @@ -652,10 +640,10 @@ public final void write(ClientMethod clientMethod, JavaType typeBlock) { break; case SendRequestAsync: - generateSendRequestAsync(clientMethod, typeBlock, settings); + generateSendRequestAsync(clientMethod, typeBlock); break; case SendRequestSync: - generateSendRequestSync(clientMethod, typeBlock, settings); + generateSendRequestSync(clientMethod, typeBlock); break; } } @@ -664,7 +652,7 @@ protected void generateProtocolPagingSync(ClientMethod clientMethod, JavaType ty generatePagingSync(clientMethod, typeBlock, restAPIMethod, settings); } - protected void generateProtocolPagingPlainSync(ClientMethod clientMethod, JavaType typeBlock, ProxyMethod restAPIMethod, JavaSettings settings) { + protected void generateProtocolPagingPlainSync(ClientMethod clientMethod, JavaType typeBlock, JavaSettings settings) { addServiceMethodAnnotation(typeBlock, ReturnType.COLLECTION); if (clientMethod.getMethodPageDetails().nonNullNextLink()) { writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), function -> { @@ -689,19 +677,11 @@ protected void generateProtocolPagingPlainSync(ClientMethod clientMethod, JavaTy }); } else { writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), function -> { - if (clientMethod.getParameters() - .stream() - .noneMatch(p -> p.getClientType() == ClassType.CONTEXT)) { - } addOptionalVariables(function, clientMethod); function.line("return new PagedIterable<>("); - function.indent(() -> { - function.line("%s);", this.getPagingSinglePageExpression( - clientMethod, - clientMethod.getProxyMethod().getPagingSinglePageMethodName(), - clientMethod.getArgumentList(), - settings)); - }); + function.indent(() -> function.line(this.getPagingSinglePageExpression(clientMethod, + clientMethod.getProxyMethod().getPagingSinglePageMethodName(), clientMethod.getArgumentList(), + settings) + ");")); }); } } @@ -731,7 +711,7 @@ private void generatePagedSinglePage(ClientMethod clientMethod, JavaType typeBlo addValidations(function, clientMethod.getRequiredNullableParameterExpressions(), clientMethod.getValidateExpressions(), settings); addOptionalAndConstantVariables(function, clientMethod, restAPIMethod.getParameters(), settings); applyParameterTransformations(function, clientMethod, settings); - convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters(), clientMethod.getClientReference(), settings); + convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters()); boolean requestOptionsLocal = false; if (settings.isDataPlaneClient()) { @@ -776,7 +756,7 @@ protected void generatePagingSync(ClientMethod clientMethod, JavaType typeBlock, }); } - protected void generatePagingPlainSync(ClientMethod clientMethod, JavaType typeBlock, ProxyMethod restAPIMethod, JavaSettings settings) { + protected void generatePagingPlainSync(ClientMethod clientMethod, JavaType typeBlock, JavaSettings settings) { addServiceMethodAnnotation(typeBlock, ReturnType.COLLECTION); if (clientMethod.getMethodPageDetails().nonNullNextLink()) { writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), function -> { @@ -832,13 +812,9 @@ protected void generatePagingPlainSync(ClientMethod clientMethod, JavaType typeB String effectiveFirstPageArgs = firstPageArgs; addOptionalVariables(function, clientMethod); function.line("return new PagedIterable<>("); - function.indent(() -> { - function.line("%s);", this.getPagingSinglePageExpression( - clientMethod, - clientMethod.getProxyMethod().getPagingSinglePageMethodName(), - effectiveFirstPageArgs, - settings)); - }); + function.indent(() -> function.line(this.getPagingSinglePageExpression(clientMethod, + clientMethod.getProxyMethod().getPagingSinglePageMethodName(), effectiveFirstPageArgs, settings) + + ");")); }); } } @@ -854,29 +830,21 @@ protected void generatePagingAsync(ClientMethod clientMethod, JavaType typeBlock } function.line("return new PagedFlux<>("); function.indent(() -> { - function.line("%s,", this.getPagingSinglePageExpression( - clientMethod, - clientMethod.getProxyMethod().getPagingAsyncSinglePageMethodName(), - clientMethod.getArgumentList(), - settings)); - function.line("%s);", this.getPagingNextPageExpression( - clientMethod, - clientMethod.getMethodPageDetails().getNextMethod().getProxyMethod().getPagingAsyncSinglePageMethodName(), - clientMethod.getMethodPageDetails().getNextMethod().getArgumentList(), - settings)); + function.line(this.getPagingSinglePageExpression(clientMethod, + clientMethod.getProxyMethod().getPagingAsyncSinglePageMethodName(), + clientMethod.getArgumentList(), settings) + ","); + function.line(this.getPagingNextPageExpression(clientMethod, + clientMethod.getMethodPageDetails().getNextMethod().getProxyMethod().getPagingAsyncSinglePageMethodName(), + clientMethod.getMethodPageDetails().getNextMethod().getArgumentList(), settings) + ");"); }); }); } else { writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), function -> { addOptionalVariables(function, clientMethod); function.line("return new PagedFlux<>("); - function.indent(() -> { - function.line("%s);", this.getPagingSinglePageExpression( - clientMethod, - clientMethod.getProxyMethod().getPagingAsyncSinglePageMethodName(), - clientMethod.getArgumentList(), - settings)); - }); + function.indent(() -> function.line(this.getPagingSinglePageExpression(clientMethod, + clientMethod.getProxyMethod().getPagingAsyncSinglePageMethodName(), clientMethod.getArgumentList(), + settings) + ");")); }); } } @@ -892,7 +860,7 @@ protected void generateResumable(ClientMethod clientMethod, JavaType typeBlock, typeBlock.publicMethod(clientMethod.getDeclaration(), function -> { ProxyMethodParameter parameter = restAPIMethod.getParameters().get(0); addValidations(function, clientMethod.getRequiredNullableParameterExpressions(), clientMethod.getValidateExpressions(), settings); - function.methodReturn(String.format("service.%s(%s)", restAPIMethod.getName(), parameter.getName())); + function.methodReturn("service." + restAPIMethod.getName() + "(" + parameter.getName() + ")"); }); } @@ -917,7 +885,7 @@ protected void generateSimpleAsync(ClientMethod clientMethod, JavaType typeBlock })); } - private void generateSimpleSyncMethod(ClientMethod clientMethod, JavaType typeBlock, ProxyMethod restAPIMethod, JavaSettings settings) { + private void generateSimpleSyncMethod(ClientMethod clientMethod, JavaType typeBlock) { addServiceMethodAnnotation(typeBlock, ReturnType.SINGLE); writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), (function -> { addOptionalVariables(function, clientMethod); @@ -946,8 +914,7 @@ private void generateSimpleSyncMethod(ClientMethod clientMethod, JavaType typeBl })); } - private void generateSimplePlainSyncMethod(ClientMethod clientMethod, JavaType typeBlock, ProxyMethod restAPIMethod, - JavaSettings settings) { + private void generateSimplePlainSyncMethod(ClientMethod clientMethod, JavaType typeBlock) { addServiceMethodAnnotation(typeBlock, ReturnType.SINGLE); writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), (function -> { addOptionalVariables(function, clientMethod); @@ -998,9 +965,7 @@ protected void generateSyncMethod(ClientMethod clientMethod, JavaType typeBlock, if (returnType instanceof PrimitiveType) { function.line("%s value = %s(%s).block();", returnType.asNullable(), effectiveAsyncMethodName, clientMethod.getArgumentList()); - function.ifBlock("value != null", ifAction -> { - ifAction.methodReturn("value"); - }).elseBlock(elseAction -> { + function.ifBlock("value != null", ifAction -> ifAction.methodReturn("value")).elseBlock(elseAction -> { if (settings.isUseClientLogger()) { elseAction.line("throw LOGGER.atError().log(new NullPointerException());"); } else { @@ -1050,7 +1015,7 @@ protected void generatePlainSyncMethod(ClientMethod clientMethod, JavaType typeB addValidations(function, clientMethod.getRequiredNullableParameterExpressions(), clientMethod.getValidateExpressions(), settings); addOptionalAndConstantVariables(function, clientMethod, restAPIMethod.getParameters(), settings); applyParameterTransformations(function, clientMethod, settings); - convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters(), clientMethod.getClientReference(), settings); + convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters()); boolean requestOptionsLocal = false; if (settings.isDataPlaneClient()) { @@ -1074,9 +1039,7 @@ protected void generatePlainSyncMethod(ClientMethod clientMethod, JavaType typeB if (returnType instanceof PrimitiveType) { function.line("%s value = %s(%s);", returnType.asNullable(), effectiveProxyMethodName, clientMethod.getArgumentList()); - function.ifBlock("value != null", ifAction -> { - ifAction.methodReturn("value"); - }).elseBlock(elseAction -> { + function.ifBlock("value != null", ifAction -> ifAction.methodReturn("value")).elseBlock(elseAction -> { if (settings.isUseClientLogger()) { elseAction.line("throw LOGGER.atError().log(new NullPointerException());"); } else { @@ -1136,7 +1099,7 @@ public static void generateJavadoc(ClientMethod clientMethod, JavaJavadocComment protected static String parameterDescriptionOrDefault(ClientMethodParameter parameter) { String paramJavadoc = parameter.getDescription(); if (CoreUtils.isNullOrEmpty(paramJavadoc)) { - paramJavadoc = String.format("The %1$s parameter", parameter.getName()); + paramJavadoc = "The " + parameter.getName() + " parameter"; } return paramJavadoc; } @@ -1145,10 +1108,22 @@ protected void generatePagedAsyncSinglePage(ClientMethod clientMethod, JavaType addServiceMethodAnnotation(typeBlock, ReturnType.SINGLE); writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), function -> { + if (clientMethod.hasWithContextOverload()) { + String arguments = clientMethod.getArgumentList(); + arguments = CoreUtils.isNullOrEmpty(arguments) ? "context" : arguments + ", context"; + + // If this PagedResponse method doesn't have a Context parameter, call into the overload that does. + // Doing this prevents duplicating validation and setup logic, which in some cases can reduce out + // hundreds of lines of code. + String methodCall = clientMethod.getProxyMethod().getPagingAsyncSinglePageMethodName() + "(" + arguments + ")"; + function.methodReturn("FluxUtil.withContext(context -> " + methodCall +")"); + return; + } + addValidations(function, clientMethod.getRequiredNullableParameterExpressions(), clientMethod.getValidateExpressions(), settings); addOptionalAndConstantVariables(function, clientMethod, restAPIMethod.getParameters(), settings); applyParameterTransformations(function, clientMethod, settings); - convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters(), clientMethod.getClientReference(), settings); + convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters()); boolean requestOptionsLocal = false; if (settings.isDataPlaneClient()) { @@ -1157,10 +1132,9 @@ protected void generatePagedAsyncSinglePage(ClientMethod clientMethod, JavaType String serviceMethodCall = checkAndReplaceParamNameCollision(clientMethod, restAPIMethod, requestOptionsLocal, settings); if (contextInParameters(clientMethod)) { - function.line(String.format("return %s", serviceMethodCall)); + function.line("return " + serviceMethodCall); } else { - function.line(String.format("return FluxUtil.withContext(context -> %s)", - serviceMethodCall)); + function.line("return FluxUtil.withContext(context -> " + serviceMethodCall + ")"); } function.indent(() -> { function.line(".map(res -> new PagedResponseBase<>("); @@ -1216,11 +1190,8 @@ private static boolean responseTypeHasDeserializedHeaders(IType type) { // whether the class is an extension of ResponseBase. if (type instanceof ClassType) { return true; - } else if (type instanceof GenericType && "ResponseBase".equals(((GenericType) type).getName())) { - return true; - } else { - return false; - } + } else + return type instanceof GenericType && "ResponseBase".equals(((GenericType) type).getName()); } private static String checkAndReplaceParamNameCollision(ClientMethod clientMethod, ProxyMethod restAPIMethod, @@ -1277,13 +1248,26 @@ private static String checkAndReplaceParamNameCollision(ClientMethod clientMetho return builder.append(')').toString(); } - protected void generateSimpleAsyncRestResponse(ClientMethod clientMethod, JavaType typeBlock, ProxyMethod restAPIMethod, JavaSettings settings) { + protected void generateSimpleAsyncRestResponse(ClientMethod clientMethod, JavaType typeBlock, + ProxyMethod restAPIMethod, JavaSettings settings) { addServiceMethodAnnotation(typeBlock, ReturnType.SINGLE); writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), function -> { + if (clientMethod.hasWithContextOverload()) { + String arguments = clientMethod.getArgumentList(); + arguments = CoreUtils.isNullOrEmpty(arguments) ? "context" : arguments + ", context"; + + // If this RestResponse method doesn't have a Context parameter, call into the overload that does. + // Doing this prevents duplicating validation and setup logic, which in some cases can reduce out + // hundreds of lines of code. + String methodCall = clientMethod.getProxyMethod().getSimpleAsyncRestResponseMethodName() + "(" + arguments + ")"; + function.methodReturn("FluxUtil.withContext(context -> " + methodCall +")"); + return; + } + addValidations(function, clientMethod.getRequiredNullableParameterExpressions(), clientMethod.getValidateExpressions(), settings); addOptionalAndConstantVariables(function, clientMethod, restAPIMethod.getParameters(), settings); applyParameterTransformations(function, clientMethod, settings); - convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters(), clientMethod.getClientReference(), settings); + convertClientTypesToWireTypes(function, clientMethod, restAPIMethod.getParameters()); boolean requestOptionsLocal = false; if (settings.isDataPlaneClient()) { @@ -1294,7 +1278,7 @@ protected void generateSimpleAsyncRestResponse(ClientMethod clientMethod, JavaTy if (contextInParameters(clientMethod)) { function.methodReturn(serviceMethodCall); } else { - function.methodReturn(String.format("FluxUtil.withContext(context -> %s)", serviceMethodCall)); + function.methodReturn("FluxUtil.withContext(context -> " + serviceMethodCall + ")"); } }); } @@ -1364,11 +1348,8 @@ protected void generateLongRunningBeginAsync(ClientMethod clientMethod, JavaType * * @param clientMethod client method * @param typeBlock type block - * @param restAPIMethod proxy method - * @param settings java settings */ - protected void generateLongRunningBeginSyncOverAsync(ClientMethod clientMethod, JavaType typeBlock, - ProxyMethod restAPIMethod, JavaSettings settings) { + protected void generateLongRunningBeginSyncOverAsync(ClientMethod clientMethod, JavaType typeBlock) { typeBlock.annotation("ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)"); writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), function -> { addOptionalVariables(function, clientMethod); @@ -1570,7 +1551,7 @@ private String getSyncPollingStrategy(ClientMethod clientMethod, String contextP .replace(".setEndpoint(null)", ""); } - protected void generateSendRequestAsync(ClientMethod clientMethod, JavaType typeBlock, JavaSettings settings) { + protected void generateSendRequestAsync(ClientMethod clientMethod, JavaType typeBlock) { addServiceMethodAnnotation(typeBlock, ReturnType.SINGLE); writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), function -> { function.line("return FluxUtil.withContext(context -> %1$s.getHttpPipeline().send(%2$s, context)", @@ -1582,11 +1563,10 @@ protected void generateSendRequestAsync(ClientMethod clientMethod, JavaType type }); } - protected void generateSendRequestSync(ClientMethod clientMethod, JavaType typeBlock, JavaSettings settings) { + protected void generateSendRequestSync(ClientMethod clientMethod, JavaType typeBlock) { addServiceMethodAnnotation(typeBlock, ReturnType.SINGLE); - writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), function -> { - function.methodReturn("this.sendRequestAsync(httpRequest).contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly())).block()"); - }); + writeMethod(typeBlock, clientMethod.getMethodVisibility(), clientMethod.getDeclaration(), function -> + function.methodReturn("this.sendRequestAsync(httpRequest).contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly())).block()")); } private static String getServiceVersionValue(ClientMethod clientMethod) { diff --git a/javagen/src/main/java/com/azure/autorest/template/MethodGroupTemplate.java b/javagen/src/main/java/com/azure/autorest/template/MethodGroupTemplate.java index 0acefab308..fb6003f817 100644 --- a/javagen/src/main/java/com/azure/autorest/template/MethodGroupTemplate.java +++ b/javagen/src/main/java/com/azure/autorest/template/MethodGroupTemplate.java @@ -37,7 +37,7 @@ public static MethodGroupTemplate getInstance() { public final void write(MethodGroupClient methodGroupClient, JavaFile javaFile) { JavaSettings settings = JavaSettings.getInstance(); - Set imports = new HashSet(); + Set imports = new HashSet<>(); if (settings.isUseClientLogger()) { ClassType.CLIENT_LOGGER.addImportsTo(imports, false); } @@ -67,7 +67,7 @@ public final void write(MethodGroupClient methodGroupClient, JavaFile javaFile) final boolean hasProxy = methodGroupClient.getProxy() != null; if (hasProxy) { - classBlock.javadocComment(String.format("The proxy service used to perform REST calls.")); + classBlock.javadocComment("The proxy service used to perform REST calls."); classBlock.privateFinalMemberVariable(methodGroupClient.getProxy().getName(), "service"); } diff --git a/javagen/src/main/java/com/azure/autorest/util/MethodNamer.java b/javagen/src/main/java/com/azure/autorest/util/MethodNamer.java index 0e011ffc9b..ef36148d00 100644 --- a/javagen/src/main/java/com/azure/autorest/util/MethodNamer.java +++ b/javagen/src/main/java/com/azure/autorest/util/MethodNamer.java @@ -26,17 +26,27 @@ public static String getSimpleRestResponseMethodName(String baseName) { } public static String getLroBeginAsyncMethodName(String baseName) { - return "begin" + CodeNamer.toPascalCase(baseName) + "Async"; + return getLroBeginAsyncMethodNameInternal(CodeNamer.toPascalCase(baseName)); + } + + private static String getLroBeginAsyncMethodNameInternal(String formattedName) { + return "begin" + formattedName + "Async"; } public static String getLroBeginMethodName(String baseName) { - return "begin" + CodeNamer.toPascalCase(baseName); + return getLroBeginMethodNameInternal(CodeNamer.toPascalCase(baseName)); + } + + private static String getLroBeginMethodNameInternal(String formattedName) { + return "begin" + formattedName; } private final String baseName; + private final String pascalName; public MethodNamer(String baseName) { this.baseName = baseName; + this.pascalName = CodeNamer.toPascalCase(baseName); } public String getMethodName() { @@ -64,18 +74,18 @@ public String getSimpleRestResponseMethodName() { } public String getLroBeginAsyncMethodName() { - return getLroBeginAsyncMethodName(this.getMethodName()); + return getLroBeginAsyncMethodNameInternal(pascalName); } public String getLroBeginMethodName() { - return getLroBeginMethodName(this.getMethodName()); + return getLroBeginMethodNameInternal(pascalName); } public String getLroModelBeginMethodName() { - return "begin" + CodeNamer.toPascalCase(this.getMethodName()) + "WithModel"; + return "begin" + pascalName + "WithModel"; } public String getLroModelBeginAsyncMethodName() { - return "begin" + CodeNamer.toPascalCase(this.getMethodName()) + "WithModel" + "Async"; + return "begin" + pascalName + "WithModelAsync"; } } diff --git a/vanilla-tests/src/main/java/fixtures/additionalproperties/Pets.java b/vanilla-tests/src/main/java/fixtures/additionalproperties/Pets.java index 812f5d83cb..107e3bdf05 100644 --- a/vanilla-tests/src/main/java/fixtures/additionalproperties/Pets.java +++ b/vanilla-tests/src/main/java/fixtures/additionalproperties/Pets.java @@ -112,19 +112,7 @@ Mono> createAPInPropertiesWithAPString(@ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createAPTrueWithResponseAsync(PetAPTrue createParameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (createParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter createParameters is required and cannot be null.")); - } else { - createParameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createAPTrue(this.client.getHost(), createParameters, accept, context)); + return FluxUtil.withContext(context -> createAPTrueWithResponseAsync(createParameters, context)); } /** @@ -223,19 +211,7 @@ public PetAPTrue createAPTrue(PetAPTrue createParameters) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createCatAPTrueWithResponseAsync(CatAPTrue createParameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (createParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter createParameters is required and cannot be null.")); - } else { - createParameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createCatAPTrue(this.client.getHost(), createParameters, accept, context)); + return FluxUtil.withContext(context -> createCatAPTrueWithResponseAsync(createParameters, context)); } /** @@ -334,19 +310,7 @@ public CatAPTrue createCatAPTrue(CatAPTrue createParameters) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createAPObjectWithResponseAsync(PetAPObject createParameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (createParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter createParameters is required and cannot be null.")); - } else { - createParameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createAPObject(this.client.getHost(), createParameters, accept, context)); + return FluxUtil.withContext(context -> createAPObjectWithResponseAsync(createParameters, context)); } /** @@ -445,19 +409,7 @@ public PetAPObject createAPObject(PetAPObject createParameters) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createAPStringWithResponseAsync(PetAPString createParameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (createParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter createParameters is required and cannot be null.")); - } else { - createParameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createAPString(this.client.getHost(), createParameters, accept, context)); + return FluxUtil.withContext(context -> createAPStringWithResponseAsync(createParameters, context)); } /** @@ -556,19 +508,7 @@ public PetAPString createAPString(PetAPString createParameters) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createAPInPropertiesWithResponseAsync(PetAPInProperties createParameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (createParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter createParameters is required and cannot be null.")); - } else { - createParameters.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createAPInProperties(this.client.getHost(), createParameters, accept, context)); + return FluxUtil.withContext(context -> createAPInPropertiesWithResponseAsync(createParameters, context)); } /** @@ -670,19 +610,8 @@ public PetAPInProperties createAPInProperties(PetAPInProperties createParameters @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createAPInPropertiesWithAPStringWithResponseAsync(PetAPInPropertiesWithAPString createParameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (createParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter createParameters is required and cannot be null.")); - } else { - createParameters.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createAPInPropertiesWithAPString(this.client.getHost(), - createParameters, accept, context)); + return FluxUtil + .withContext(context -> createAPInPropertiesWithAPStringWithResponseAsync(createParameters, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodyarray/Arrays.java b/vanilla-tests/src/main/java/fixtures/bodyarray/Arrays.java index c7facf8c36..d4c4916c95 100644 --- a/vanilla-tests/src/main/java/fixtures/bodyarray/Arrays.java +++ b/vanilla-tests/src/main/java/fixtures/bodyarray/Arrays.java @@ -512,12 +512,7 @@ Mono> putDictionaryValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -600,12 +595,7 @@ public List getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** @@ -688,12 +678,7 @@ public List getInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -778,15 +763,7 @@ public List getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(arrayBody, context)); } /** @@ -879,12 +856,7 @@ public void putEmpty(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getBooleanTfftWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBooleanTfft(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBooleanTfftWithResponseAsync(context)); } /** @@ -970,16 +942,7 @@ public List getBooleanTfft() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBooleanTfftWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putBooleanTfft(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putBooleanTfftWithResponseAsync(arrayBody, context)); } /** @@ -1072,12 +1035,7 @@ public void putBooleanTfft(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getBooleanInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBooleanInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBooleanInvalidNullWithResponseAsync(context)); } /** @@ -1162,12 +1120,7 @@ public List getBooleanInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getBooleanInvalidStringWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBooleanInvalidString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBooleanInvalidStringWithResponseAsync(context)); } /** @@ -1251,12 +1204,7 @@ public List getBooleanInvalidString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getIntegerValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getIntegerValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getIntegerValidWithResponseAsync(context)); } /** @@ -1341,16 +1289,7 @@ public List getIntegerValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putIntegerValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putIntegerValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putIntegerValidWithResponseAsync(arrayBody, context)); } /** @@ -1442,12 +1381,7 @@ public void putIntegerValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getIntInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getIntInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getIntInvalidNullWithResponseAsync(context)); } /** @@ -1531,12 +1465,7 @@ public List getIntInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getIntInvalidStringWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getIntInvalidString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getIntInvalidStringWithResponseAsync(context)); } /** @@ -1620,12 +1549,7 @@ public List getIntInvalidString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getLongValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLongValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLongValidWithResponseAsync(context)); } /** @@ -1710,15 +1634,7 @@ public List getLongValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putLongValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putLongValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putLongValidWithResponseAsync(arrayBody, context)); } /** @@ -1810,12 +1726,7 @@ public void putLongValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getLongInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLongInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLongInvalidNullWithResponseAsync(context)); } /** @@ -1898,12 +1809,7 @@ public List getLongInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getLongInvalidStringWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLongInvalidString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLongInvalidStringWithResponseAsync(context)); } /** @@ -1987,12 +1893,7 @@ public List getLongInvalidString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getFloatValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFloatValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFloatValidWithResponseAsync(context)); } /** @@ -2078,16 +1979,7 @@ public List getFloatValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFloatValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putFloatValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putFloatValidWithResponseAsync(arrayBody, context)); } /** @@ -2180,12 +2072,7 @@ public void putFloatValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getFloatInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFloatInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFloatInvalidNullWithResponseAsync(context)); } /** @@ -2270,12 +2157,7 @@ public List getFloatInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getFloatInvalidStringWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFloatInvalidString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFloatInvalidStringWithResponseAsync(context)); } /** @@ -2360,12 +2242,7 @@ public List getFloatInvalidString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDoubleValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDoubleValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDoubleValidWithResponseAsync(context)); } /** @@ -2451,16 +2328,7 @@ public List getDoubleValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDoubleValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDoubleValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putDoubleValidWithResponseAsync(arrayBody, context)); } /** @@ -2553,12 +2421,7 @@ public void putDoubleValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDoubleInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDoubleInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDoubleInvalidNullWithResponseAsync(context)); } /** @@ -2643,12 +2506,7 @@ public List getDoubleInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDoubleInvalidStringWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDoubleInvalidString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDoubleInvalidStringWithResponseAsync(context)); } /** @@ -2733,12 +2591,7 @@ public List getDoubleInvalidString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getStringValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getStringValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringValidWithResponseAsync(context)); } /** @@ -2824,16 +2677,7 @@ public List getStringValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putStringValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putStringValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putStringValidWithResponseAsync(arrayBody, context)); } /** @@ -2926,12 +2770,7 @@ public void putStringValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getEnumValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEnumValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEnumValidWithResponseAsync(context)); } /** @@ -3017,15 +2856,7 @@ public List getEnumValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEnumValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEnumValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putEnumValidWithResponseAsync(arrayBody, context)); } /** @@ -3118,12 +2949,7 @@ public void putEnumValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getStringEnumValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getStringEnumValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringEnumValidWithResponseAsync(context)); } /** @@ -3209,16 +3035,7 @@ public List getStringEnumValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putStringEnumValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putStringEnumValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putStringEnumValidWithResponseAsync(arrayBody, context)); } /** @@ -3311,12 +3128,7 @@ public void putStringEnumValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getStringWithNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getStringWithNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringWithNullWithResponseAsync(context)); } /** @@ -3401,12 +3213,7 @@ public List getStringWithNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getStringWithInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getStringWithInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringWithInvalidWithResponseAsync(context)); } /** @@ -3492,12 +3299,7 @@ public List getStringWithInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getUuidValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUuidValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUuidValidWithResponseAsync(context)); } /** @@ -3593,15 +3395,7 @@ public List getUuidValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUuidValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putUuidValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putUuidValidWithResponseAsync(arrayBody, context)); } /** @@ -3699,12 +3493,7 @@ public void putUuidValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getUuidInvalidCharsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUuidInvalidChars(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUuidInvalidCharsWithResponseAsync(context)); } /** @@ -3791,12 +3580,7 @@ public List getUuidInvalidChars() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateValidWithResponseAsync(context)); } /** @@ -3882,15 +3666,7 @@ public List getDateValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDateValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putDateValidWithResponseAsync(arrayBody, context)); } /** @@ -3983,12 +3759,7 @@ public void putDateValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateInvalidNullWithResponseAsync(context)); } /** @@ -4073,12 +3844,7 @@ public List getDateInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateInvalidCharsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateInvalidChars(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateInvalidCharsWithResponseAsync(context)); } /** @@ -4163,12 +3929,7 @@ public List getDateInvalidChars() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateTimeValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeValidWithResponseAsync(context)); } /** @@ -4257,16 +4018,7 @@ public List getDateTimeValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTimeValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeValidWithResponseAsync(arrayBody, context)); } /** @@ -4359,12 +4111,7 @@ public void putDateTimeValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateTimeInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeInvalidNullWithResponseAsync(context)); } /** @@ -4449,12 +4196,7 @@ public List getDateTimeInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateTimeInvalidCharsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeInvalidChars(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeInvalidCharsWithResponseAsync(context)); } /** @@ -4540,12 +4282,7 @@ public List getDateTimeInvalidChars() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateTimeRfc1123ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeRfc1123Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeRfc1123ValidWithResponseAsync(context)); } /** @@ -4641,18 +4378,7 @@ public List getDateTimeRfc1123Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeRfc1123ValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - List arrayBodyConverted - = arrayBody.stream().map(el -> new DateTimeRfc1123(el)).collect(java.util.stream.Collectors.toList()); - return FluxUtil.withContext( - context -> service.putDateTimeRfc1123Valid(this.client.getHost(), arrayBodyConverted, accept, context)); + return FluxUtil.withContext(context -> putDateTimeRfc1123ValidWithResponseAsync(arrayBody, context)); } /** @@ -4753,12 +4479,7 @@ public void putDateTimeRfc1123Valid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDurationValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDurationValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDurationValidWithResponseAsync(context)); } /** @@ -4844,16 +4565,7 @@ public List getDurationValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDurationValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDurationValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putDurationValidWithResponseAsync(arrayBody, context)); } /** @@ -4946,12 +4658,7 @@ public void putDurationValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getByteValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getByteValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getByteValidWithResponseAsync(context)); } /** @@ -5040,15 +4747,7 @@ public List getByteValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putByteValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putByteValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putByteValidWithResponseAsync(arrayBody, context)); } /** @@ -5141,12 +4840,7 @@ public void putByteValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getByteInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getByteInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getByteInvalidNullWithResponseAsync(context)); } /** @@ -5234,12 +4928,7 @@ public List getByteInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getBase64UrlWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBase64Url(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBase64UrlWithResponseAsync(context)); } /** @@ -5332,12 +5021,7 @@ public List getBase64Url() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getComplexNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplexNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexNullWithResponseAsync(context)); } /** @@ -5420,12 +5104,7 @@ public List getComplexNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getComplexEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplexEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexEmptyWithResponseAsync(context)); } /** @@ -5509,12 +5188,7 @@ public List getComplexEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getComplexItemNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplexItemNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexItemNullWithResponseAsync(context)); } /** @@ -5602,12 +5276,7 @@ public List getComplexItemNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getComplexItemEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplexItemEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexItemEmptyWithResponseAsync(context)); } /** @@ -5696,12 +5365,7 @@ public List getComplexItemEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getComplexValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplexValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexValidWithResponseAsync(context)); } /** @@ -5797,18 +5461,7 @@ public List getComplexValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putComplexValidWithResponseAsync(List arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } else { - arrayBody.forEach(e -> e.validate()); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putComplexValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putComplexValidWithResponseAsync(arrayBody, context)); } /** @@ -5907,12 +5560,7 @@ public void putComplexValid(List arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getArrayNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getArrayNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getArrayNullWithResponseAsync(context)); } /** @@ -5995,12 +5643,7 @@ public List> getArrayNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getArrayEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getArrayEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getArrayEmptyWithResponseAsync(context)); } /** @@ -6084,12 +5727,7 @@ public List> getArrayEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getArrayItemNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getArrayItemNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getArrayItemNullWithResponseAsync(context)); } /** @@ -6176,12 +5814,7 @@ public List> getArrayItemNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getArrayItemEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getArrayItemEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getArrayItemEmptyWithResponseAsync(context)); } /** @@ -6268,12 +5901,7 @@ public List> getArrayItemEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getArrayValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getArrayValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getArrayValidWithResponseAsync(context)); } /** @@ -6362,16 +5990,7 @@ public List> getArrayValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putArrayValidWithResponseAsync(List> arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putArrayValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putArrayValidWithResponseAsync(arrayBody, context)); } /** @@ -6464,12 +6083,7 @@ public void putArrayValid(List> arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getDictionaryNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDictionaryNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDictionaryNullWithResponseAsync(context)); } /** @@ -6554,12 +6168,7 @@ public List> getDictionaryNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getDictionaryEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDictionaryEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDictionaryEmptyWithResponseAsync(context)); } /** @@ -6648,12 +6257,7 @@ public List> getDictionaryEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getDictionaryItemNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDictionaryItemNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDictionaryItemNullWithResponseAsync(context)); } /** @@ -6750,12 +6354,7 @@ public List> getDictionaryItemNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getDictionaryItemEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDictionaryItemEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDictionaryItemEmptyWithResponseAsync(context)); } /** @@ -6852,12 +6451,7 @@ public List> getDictionaryItemEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getDictionaryValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDictionaryValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDictionaryValidWithResponseAsync(context)); } /** @@ -6959,16 +6553,7 @@ public List> getDictionaryValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDictionaryValidWithResponseAsync(List> arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDictionaryValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putDictionaryValidWithResponseAsync(arrayBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodyboolean/Bools.java b/vanilla-tests/src/main/java/fixtures/bodyboolean/Bools.java index ec2d7c92f1..3759c9f2e4 100644 --- a/vanilla-tests/src/main/java/fixtures/bodyboolean/Bools.java +++ b/vanilla-tests/src/main/java/fixtures/bodyboolean/Bools.java @@ -99,12 +99,7 @@ Mono> getInvalid(@HostParam("$host") String host, @HeaderParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getTrueWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTrue(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getTrueWithResponseAsync(context)); } /** @@ -187,13 +182,7 @@ public boolean getTrue() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putTrueWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final boolean boolBody = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putTrue(this.client.getHost(), boolBody, accept, context)); + return FluxUtil.withContext(context -> putTrueWithResponseAsync(context)); } /** @@ -276,12 +265,7 @@ public void putTrue() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFalseWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFalse(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFalseWithResponseAsync(context)); } /** @@ -364,13 +348,7 @@ public boolean getFalse() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFalseWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final boolean boolBody = false; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFalse(this.client.getHost(), boolBody, accept, context)); + return FluxUtil.withContext(context -> putFalseWithResponseAsync(context)); } /** @@ -453,12 +431,7 @@ public void putFalse() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -541,12 +514,7 @@ public boolean getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodyboolean/quirks/Bools.java b/vanilla-tests/src/main/java/fixtures/bodyboolean/quirks/Bools.java index 51cf88dc63..417d2db0a4 100644 --- a/vanilla-tests/src/main/java/fixtures/bodyboolean/quirks/Bools.java +++ b/vanilla-tests/src/main/java/fixtures/bodyboolean/quirks/Bools.java @@ -99,12 +99,7 @@ Mono> getInvalid(@HostParam("$host") String host, @HeaderParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getTrueWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTrue(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getTrueWithResponseAsync(context)); } /** @@ -189,12 +184,7 @@ public boolean getTrue() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putTrueWithResponseAsync(boolean boolBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putTrue(this.client.getHost(), boolBody, accept, context)); + return FluxUtil.withContext(context -> putTrueWithResponseAsync(boolBody, context)); } /** @@ -283,12 +273,7 @@ public void putTrue(boolean boolBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFalseWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFalse(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFalseWithResponseAsync(context)); } /** @@ -373,12 +358,7 @@ public boolean getFalse() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFalseWithResponseAsync(boolean boolBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFalse(this.client.getHost(), boolBody, accept, context)); + return FluxUtil.withContext(context -> putFalseWithResponseAsync(boolBody, context)); } /** @@ -467,12 +447,7 @@ public void putFalse(boolean boolBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -555,12 +530,7 @@ public boolean getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodybyte/ByteOperations.java b/vanilla-tests/src/main/java/fixtures/bodybyte/ByteOperations.java index bae0f27003..56d3dd711f 100644 --- a/vanilla-tests/src/main/java/fixtures/bodybyte/ByteOperations.java +++ b/vanilla-tests/src/main/java/fixtures/bodybyte/ByteOperations.java @@ -94,12 +94,7 @@ Mono> getInvalid(@HostParam("$host") String host, @HeaderParam( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -182,12 +177,7 @@ public byte[] getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -271,12 +261,7 @@ public byte[] getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonAsciiWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNonAscii(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNonAsciiWithResponseAsync(context)); } /** @@ -362,15 +347,7 @@ public byte[] getNonAscii() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNonAsciiWithResponseAsync(byte[] byteBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (byteBody == null) { - return Mono.error(new IllegalArgumentException("Parameter byteBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putNonAscii(this.client.getHost(), byteBody, accept, context)); + return FluxUtil.withContext(context -> putNonAsciiWithResponseAsync(byteBody, context)); } /** @@ -462,12 +439,7 @@ public void putNonAscii(byte[] byteBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodycomplex/Arrays.java b/vanilla-tests/src/main/java/fixtures/bodycomplex/Arrays.java index 8699fc5007..a856843912 100644 --- a/vanilla-tests/src/main/java/fixtures/bodycomplex/Arrays.java +++ b/vanilla-tests/src/main/java/fixtures/bodycomplex/Arrays.java @@ -96,12 +96,7 @@ Mono> getNotProvided(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -187,17 +182,7 @@ public ArrayWrapper getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(ArrayWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -297,12 +282,7 @@ public void putValid(ArrayWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -388,17 +368,7 @@ public ArrayWrapper getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(ArrayWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(complexBody, context)); } /** @@ -493,12 +463,7 @@ public void putEmpty(ArrayWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodycomplex/Basics.java b/vanilla-tests/src/main/java/fixtures/bodycomplex/Basics.java index 5604bb5c9b..78245935f3 100644 --- a/vanilla-tests/src/main/java/fixtures/bodycomplex/Basics.java +++ b/vanilla-tests/src/main/java/fixtures/bodycomplex/Basics.java @@ -102,12 +102,7 @@ Mono> getNotProvided(@HostParam("$host") String host, @HeaderPar */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -193,18 +188,7 @@ public Basic getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Basic complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), this.client.getApiVersion(), - complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -299,12 +283,7 @@ public void putValid(Basic complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** @@ -388,12 +367,7 @@ public Basic getInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -477,12 +451,7 @@ public Basic getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -567,12 +536,7 @@ public Basic getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodycomplex/Dictionaries.java b/vanilla-tests/src/main/java/fixtures/bodycomplex/Dictionaries.java index 419acfa20b..3d00dccfa6 100644 --- a/vanilla-tests/src/main/java/fixtures/bodycomplex/Dictionaries.java +++ b/vanilla-tests/src/main/java/fixtures/bodycomplex/Dictionaries.java @@ -104,12 +104,7 @@ Mono> getNotProvided(@HostParam("$host") String host */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -196,17 +191,7 @@ public DictionaryWrapper getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(DictionaryWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -306,12 +291,7 @@ public void putValid(DictionaryWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -397,17 +377,7 @@ public DictionaryWrapper getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(DictionaryWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(complexBody, context)); } /** @@ -502,12 +472,7 @@ public void putEmpty(DictionaryWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -592,12 +557,7 @@ public DictionaryWrapper getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodycomplex/Flattencomplexes.java b/vanilla-tests/src/main/java/fixtures/bodycomplex/Flattencomplexes.java index 7f4c4b2988..7bf7ea1ee0 100644 --- a/vanilla-tests/src/main/java/fixtures/bodycomplex/Flattencomplexes.java +++ b/vanilla-tests/src/main/java/fixtures/bodycomplex/Flattencomplexes.java @@ -69,12 +69,7 @@ Mono> getValid(@HostParam("$host") String host, @HeaderPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodycomplex/Inheritances.java b/vanilla-tests/src/main/java/fixtures/bodycomplex/Inheritances.java index ab2738da97..0ec92da840 100644 --- a/vanilla-tests/src/main/java/fixtures/bodycomplex/Inheritances.java +++ b/vanilla-tests/src/main/java/fixtures/bodycomplex/Inheritances.java @@ -77,12 +77,7 @@ Mono> putValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -169,17 +164,7 @@ public Siamese getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Siamese complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodycomplex/Polymorphicrecursives.java b/vanilla-tests/src/main/java/fixtures/bodycomplex/Polymorphicrecursives.java index bfdce5a58b..6bc4df8ea9 100644 --- a/vanilla-tests/src/main/java/fixtures/bodycomplex/Polymorphicrecursives.java +++ b/vanilla-tests/src/main/java/fixtures/bodycomplex/Polymorphicrecursives.java @@ -78,12 +78,7 @@ Mono> putValid(@HostParam("$host") String host, @BodyParam("appli */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -223,17 +218,7 @@ public Fish getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodycomplex/Polymorphisms.java b/vanilla-tests/src/main/java/fixtures/bodycomplex/Polymorphisms.java index 02be016ada..32b60c0b11 100644 --- a/vanilla-tests/src/main/java/fixtures/bodycomplex/Polymorphisms.java +++ b/vanilla-tests/src/main/java/fixtures/bodycomplex/Polymorphisms.java @@ -122,12 +122,7 @@ Mono> putValidMissingRequired(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -244,17 +239,7 @@ public Fish getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -509,12 +494,7 @@ public void putValid(Fish complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDotSyntaxWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDotSyntax(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDotSyntaxWithResponseAsync(context)); } /** @@ -600,13 +580,7 @@ public DotFish getDotSyntax() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComposedWithDiscriminatorWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getComposedWithDiscriminator(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComposedWithDiscriminatorWithResponseAsync(context)); } /** @@ -701,13 +675,7 @@ public DotFishMarket getComposedWithDiscriminator() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComposedWithoutDiscriminatorWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getComposedWithoutDiscriminator(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComposedWithoutDiscriminatorWithResponseAsync(context)); } /** @@ -802,12 +770,7 @@ public DotFishMarket getComposedWithoutDiscriminator() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComplicatedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplicated(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplicatedWithResponseAsync(context)); } /** @@ -897,18 +860,7 @@ public Salmon getComplicated() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putComplicatedWithResponseAsync(Salmon complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putComplicated(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putComplicatedWithResponseAsync(complexBody, context)); } /** @@ -1004,18 +956,7 @@ public void putComplicated(Salmon complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMissingDiscriminatorWithResponseAsync(Salmon complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putMissingDiscriminator(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putMissingDiscriminatorWithResponseAsync(complexBody, context)); } /** @@ -1140,18 +1081,7 @@ public Salmon putMissingDiscriminator(Salmon complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidMissingRequiredWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putValidMissingRequired(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidMissingRequiredWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodycomplex/Primitives.java b/vanilla-tests/src/main/java/fixtures/bodycomplex/Primitives.java index e12ac1e831..536273fa15 100644 --- a/vanilla-tests/src/main/java/fixtures/bodycomplex/Primitives.java +++ b/vanilla-tests/src/main/java/fixtures/bodycomplex/Primitives.java @@ -219,12 +219,7 @@ Mono> putByte(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getIntWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInt(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getIntWithResponseAsync(context)); } /** @@ -310,17 +305,7 @@ public IntWrapper getInt() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putIntWithResponseAsync(IntWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putInt(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putIntWithResponseAsync(complexBody, context)); } /** @@ -414,12 +399,7 @@ public void putInt(IntWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLongWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLong(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLongWithResponseAsync(context)); } /** @@ -504,17 +484,7 @@ public LongWrapper getLong() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putLongWithResponseAsync(LongWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putLong(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putLongWithResponseAsync(complexBody, context)); } /** @@ -608,12 +578,7 @@ public void putLong(LongWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFloatWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFloat(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFloatWithResponseAsync(context)); } /** @@ -698,17 +663,7 @@ public FloatWrapper getFloat() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFloatWithResponseAsync(FloatWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFloat(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putFloatWithResponseAsync(complexBody, context)); } /** @@ -803,12 +758,7 @@ public void putFloat(FloatWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDoubleWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDouble(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDoubleWithResponseAsync(context)); } /** @@ -894,17 +844,7 @@ public DoubleWrapper getDouble() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDoubleWithResponseAsync(DoubleWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDouble(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDoubleWithResponseAsync(complexBody, context)); } /** @@ -998,12 +938,7 @@ public void putDouble(DoubleWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBoolWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBool(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBoolWithResponseAsync(context)); } /** @@ -1088,17 +1023,7 @@ public BooleanWrapper getBool() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBoolWithResponseAsync(BooleanWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putBool(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putBoolWithResponseAsync(complexBody, context)); } /** @@ -1193,12 +1118,7 @@ public void putBool(BooleanWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getStringWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringWithResponseAsync(context)); } /** @@ -1284,17 +1204,7 @@ public StringWrapper getString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putStringWithResponseAsync(StringWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putString(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putStringWithResponseAsync(complexBody, context)); } /** @@ -1388,12 +1298,7 @@ public void putString(StringWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDate(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateWithResponseAsync(context)); } /** @@ -1478,17 +1383,7 @@ public DateWrapper getDate() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateWithResponseAsync(DateWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDate(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateWithResponseAsync(complexBody, context)); } /** @@ -1583,12 +1478,7 @@ public void putDate(DateWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeWithResponseAsync(context)); } /** @@ -1674,18 +1564,7 @@ public DatetimeWrapper getDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeWithResponseAsync(DatetimeWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTime(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeWithResponseAsync(complexBody, context)); } /** @@ -1780,12 +1659,7 @@ public void putDateTime(DatetimeWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateTimeRfc1123WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeRfc1123(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeRfc1123WithResponseAsync(context)); } /** @@ -1871,18 +1745,7 @@ public Datetimerfc1123Wrapper getDateTimeRfc1123() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeRfc1123WithResponseAsync(Datetimerfc1123Wrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTimeRfc1123(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeRfc1123WithResponseAsync(complexBody, context)); } /** @@ -1978,12 +1841,7 @@ public void putDateTimeRfc1123(Datetimerfc1123Wrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDurationWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDuration(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDurationWithResponseAsync(context)); } /** @@ -2069,18 +1927,7 @@ public DurationWrapper getDuration() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDurationWithResponseAsync(DurationWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDuration(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDurationWithResponseAsync(complexBody, context)); } /** @@ -2174,12 +2021,7 @@ public void putDuration(DurationWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getByteWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getByte(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getByteWithResponseAsync(context)); } /** @@ -2264,17 +2106,7 @@ public ByteWrapper getByte() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putByteWithResponseAsync(ByteWrapper complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putByte(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putByteWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodycomplex/Readonlyproperties.java b/vanilla-tests/src/main/java/fixtures/bodycomplex/Readonlyproperties.java index 58eb65c96a..0aaf1928c1 100644 --- a/vanilla-tests/src/main/java/fixtures/bodycomplex/Readonlyproperties.java +++ b/vanilla-tests/src/main/java/fixtures/bodycomplex/Readonlyproperties.java @@ -79,12 +79,7 @@ Mono> putValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -170,17 +165,7 @@ public ReadonlyObj getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(ReadonlyObj complexBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - return Mono.error(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodydate/DateOperations.java b/vanilla-tests/src/main/java/fixtures/bodydate/DateOperations.java index 0b47e486f8..68cfee9e87 100644 --- a/vanilla-tests/src/main/java/fixtures/bodydate/DateOperations.java +++ b/vanilla-tests/src/main/java/fixtures/bodydate/DateOperations.java @@ -113,12 +113,7 @@ Mono> getMinDate(@HostParam("$host") String host, @HeaderPar */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -201,12 +196,7 @@ public LocalDate getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidDateWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalidDate(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidDateWithResponseAsync(context)); } /** @@ -289,12 +279,7 @@ public LocalDate getInvalidDate() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getOverflowDateWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getOverflowDate(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getOverflowDateWithResponseAsync(context)); } /** @@ -377,12 +362,7 @@ public LocalDate getOverflowDate() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUnderflowDateWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUnderflowDate(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUnderflowDateWithResponseAsync(context)); } /** @@ -467,15 +447,7 @@ public LocalDate getUnderflowDate() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMaxDateWithResponseAsync(LocalDate dateBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (dateBody == null) { - return Mono.error(new IllegalArgumentException("Parameter dateBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putMaxDate(this.client.getHost(), dateBody, accept, context)); + return FluxUtil.withContext(context -> putMaxDateWithResponseAsync(dateBody, context)); } /** @@ -567,12 +539,7 @@ public void putMaxDate(LocalDate dateBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMaxDateWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMaxDate(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getMaxDateWithResponseAsync(context)); } /** @@ -657,15 +624,7 @@ public LocalDate getMaxDate() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMinDateWithResponseAsync(LocalDate dateBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (dateBody == null) { - return Mono.error(new IllegalArgumentException("Parameter dateBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putMinDate(this.client.getHost(), dateBody, accept, context)); + return FluxUtil.withContext(context -> putMinDateWithResponseAsync(dateBody, context)); } /** @@ -757,12 +716,7 @@ public void putMinDate(LocalDate dateBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMinDateWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMinDate(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getMinDateWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodydatetime/DatetimeOperations.java b/vanilla-tests/src/main/java/fixtures/bodydatetime/DatetimeOperations.java index ead2f6b833..9df02b9e99 100644 --- a/vanilla-tests/src/main/java/fixtures/bodydatetime/DatetimeOperations.java +++ b/vanilla-tests/src/main/java/fixtures/bodydatetime/DatetimeOperations.java @@ -220,12 +220,7 @@ Mono> getLocalNoOffsetMinDateTime(@HostParam("$host") S */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -308,12 +303,7 @@ public OffsetDateTime getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** @@ -396,12 +386,7 @@ public OffsetDateTime getInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getOverflowWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getOverflow(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getOverflowWithResponseAsync(context)); } /** @@ -484,12 +469,7 @@ public OffsetDateTime getOverflow() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUnderflowWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUnderflow(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUnderflowWithResponseAsync(context)); } /** @@ -574,16 +554,7 @@ public OffsetDateTime getUnderflow() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUtcMaxDateTimeWithResponseAsync(OffsetDateTime datetimeBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (datetimeBody == null) { - return Mono.error(new IllegalArgumentException("Parameter datetimeBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putUtcMaxDateTime(this.client.getHost(), datetimeBody, accept, context)); + return FluxUtil.withContext(context -> putUtcMaxDateTimeWithResponseAsync(datetimeBody, context)); } /** @@ -679,16 +650,7 @@ public void putUtcMaxDateTime(OffsetDateTime datetimeBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUtcMaxDateTime7DigitsWithResponseAsync(OffsetDateTime datetimeBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (datetimeBody == null) { - return Mono.error(new IllegalArgumentException("Parameter datetimeBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putUtcMaxDateTime7Digits(this.client.getHost(), datetimeBody, accept, context)); + return FluxUtil.withContext(context -> putUtcMaxDateTime7DigitsWithResponseAsync(datetimeBody, context)); } /** @@ -792,13 +754,7 @@ public void putUtcMaxDateTime7Digits(OffsetDateTime datetimeBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUtcLowercaseMaxDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getUtcLowercaseMaxDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUtcLowercaseMaxDateTimeWithResponseAsync(context)); } /** @@ -883,13 +839,7 @@ public OffsetDateTime getUtcLowercaseMaxDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUtcUppercaseMaxDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getUtcUppercaseMaxDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUtcUppercaseMaxDateTimeWithResponseAsync(context)); } /** @@ -975,13 +925,7 @@ public OffsetDateTime getUtcUppercaseMaxDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUtcUppercaseMaxDateTime7DigitsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getUtcUppercaseMaxDateTime7Digits(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUtcUppercaseMaxDateTime7DigitsWithResponseAsync(context)); } /** @@ -1077,16 +1021,8 @@ public OffsetDateTime getUtcUppercaseMaxDateTime7Digits() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putLocalPositiveOffsetMaxDateTimeWithResponseAsync(OffsetDateTime datetimeBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (datetimeBody == null) { - return Mono.error(new IllegalArgumentException("Parameter datetimeBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putLocalPositiveOffsetMaxDateTime(this.client.getHost(), datetimeBody, accept, context)); + return FluxUtil + .withContext(context -> putLocalPositiveOffsetMaxDateTimeWithResponseAsync(datetimeBody, context)); } /** @@ -1181,13 +1117,7 @@ public void putLocalPositiveOffsetMaxDateTime(OffsetDateTime datetimeBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLocalPositiveOffsetLowercaseMaxDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getLocalPositiveOffsetLowercaseMaxDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLocalPositiveOffsetLowercaseMaxDateTimeWithResponseAsync(context)); } /** @@ -1276,13 +1206,7 @@ public OffsetDateTime getLocalPositiveOffsetLowercaseMaxDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLocalPositiveOffsetUppercaseMaxDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getLocalPositiveOffsetUppercaseMaxDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLocalPositiveOffsetUppercaseMaxDateTimeWithResponseAsync(context)); } /** @@ -1372,16 +1296,8 @@ public OffsetDateTime getLocalPositiveOffsetUppercaseMaxDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putLocalNegativeOffsetMaxDateTimeWithResponseAsync(OffsetDateTime datetimeBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (datetimeBody == null) { - return Mono.error(new IllegalArgumentException("Parameter datetimeBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putLocalNegativeOffsetMaxDateTime(this.client.getHost(), datetimeBody, accept, context)); + return FluxUtil + .withContext(context -> putLocalNegativeOffsetMaxDateTimeWithResponseAsync(datetimeBody, context)); } /** @@ -1476,13 +1392,7 @@ public void putLocalNegativeOffsetMaxDateTime(OffsetDateTime datetimeBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLocalNegativeOffsetUppercaseMaxDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getLocalNegativeOffsetUppercaseMaxDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLocalNegativeOffsetUppercaseMaxDateTimeWithResponseAsync(context)); } /** @@ -1571,13 +1481,7 @@ public OffsetDateTime getLocalNegativeOffsetUppercaseMaxDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLocalNegativeOffsetLowercaseMaxDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getLocalNegativeOffsetLowercaseMaxDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLocalNegativeOffsetLowercaseMaxDateTimeWithResponseAsync(context)); } /** @@ -1667,16 +1571,7 @@ public OffsetDateTime getLocalNegativeOffsetLowercaseMaxDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUtcMinDateTimeWithResponseAsync(OffsetDateTime datetimeBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (datetimeBody == null) { - return Mono.error(new IllegalArgumentException("Parameter datetimeBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putUtcMinDateTime(this.client.getHost(), datetimeBody, accept, context)); + return FluxUtil.withContext(context -> putUtcMinDateTimeWithResponseAsync(datetimeBody, context)); } /** @@ -1769,12 +1664,7 @@ public void putUtcMinDateTime(OffsetDateTime datetimeBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUtcMinDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUtcMinDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUtcMinDateTimeWithResponseAsync(context)); } /** @@ -1860,16 +1750,8 @@ public OffsetDateTime getUtcMinDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putLocalPositiveOffsetMinDateTimeWithResponseAsync(OffsetDateTime datetimeBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (datetimeBody == null) { - return Mono.error(new IllegalArgumentException("Parameter datetimeBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putLocalPositiveOffsetMinDateTime(this.client.getHost(), datetimeBody, accept, context)); + return FluxUtil + .withContext(context -> putLocalPositiveOffsetMinDateTimeWithResponseAsync(datetimeBody, context)); } /** @@ -1964,13 +1846,7 @@ public void putLocalPositiveOffsetMinDateTime(OffsetDateTime datetimeBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLocalPositiveOffsetMinDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getLocalPositiveOffsetMinDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLocalPositiveOffsetMinDateTimeWithResponseAsync(context)); } /** @@ -2057,16 +1933,8 @@ public OffsetDateTime getLocalPositiveOffsetMinDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putLocalNegativeOffsetMinDateTimeWithResponseAsync(OffsetDateTime datetimeBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (datetimeBody == null) { - return Mono.error(new IllegalArgumentException("Parameter datetimeBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putLocalNegativeOffsetMinDateTime(this.client.getHost(), datetimeBody, accept, context)); + return FluxUtil + .withContext(context -> putLocalNegativeOffsetMinDateTimeWithResponseAsync(datetimeBody, context)); } /** @@ -2161,13 +2029,7 @@ public void putLocalNegativeOffsetMinDateTime(OffsetDateTime datetimeBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLocalNegativeOffsetMinDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getLocalNegativeOffsetMinDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLocalNegativeOffsetMinDateTimeWithResponseAsync(context)); } /** @@ -2253,13 +2115,7 @@ public OffsetDateTime getLocalNegativeOffsetMinDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLocalNoOffsetMinDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getLocalNoOffsetMinDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLocalNoOffsetMinDateTimeWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodydatetimerfc1123/Datetimerfc1123s.java b/vanilla-tests/src/main/java/fixtures/bodydatetimerfc1123/Datetimerfc1123s.java index 18aeab4284..5b44b7fc45 100644 --- a/vanilla-tests/src/main/java/fixtures/bodydatetimerfc1123/Datetimerfc1123s.java +++ b/vanilla-tests/src/main/java/fixtures/bodydatetimerfc1123/Datetimerfc1123s.java @@ -130,12 +130,7 @@ Mono> getUtcMinDateTime(@HostParam("$host") String host */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -218,12 +213,7 @@ public OffsetDateTime getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** @@ -306,12 +296,7 @@ public OffsetDateTime getInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getOverflowWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getOverflow(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getOverflowWithResponseAsync(context)); } /** @@ -394,12 +379,7 @@ public OffsetDateTime getOverflow() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUnderflowWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUnderflow(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUnderflowWithResponseAsync(context)); } /** @@ -484,17 +464,7 @@ public OffsetDateTime getUnderflow() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUtcMaxDateTimeWithResponseAsync(OffsetDateTime datetimeBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (datetimeBody == null) { - return Mono.error(new IllegalArgumentException("Parameter datetimeBody is required and cannot be null.")); - } - final String accept = "application/json"; - DateTimeRfc1123 datetimeBodyConverted = new DateTimeRfc1123(datetimeBody); - return FluxUtil.withContext( - context -> service.putUtcMaxDateTime(this.client.getHost(), datetimeBodyConverted, accept, context)); + return FluxUtil.withContext(context -> putUtcMaxDateTimeWithResponseAsync(datetimeBody, context)); } /** @@ -588,13 +558,7 @@ public void putUtcMaxDateTime(OffsetDateTime datetimeBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUtcLowercaseMaxDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getUtcLowercaseMaxDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUtcLowercaseMaxDateTimeWithResponseAsync(context)); } /** @@ -679,13 +643,7 @@ public OffsetDateTime getUtcLowercaseMaxDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUtcUppercaseMaxDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getUtcUppercaseMaxDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUtcUppercaseMaxDateTimeWithResponseAsync(context)); } /** @@ -771,17 +729,7 @@ public OffsetDateTime getUtcUppercaseMaxDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUtcMinDateTimeWithResponseAsync(OffsetDateTime datetimeBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (datetimeBody == null) { - return Mono.error(new IllegalArgumentException("Parameter datetimeBody is required and cannot be null.")); - } - final String accept = "application/json"; - DateTimeRfc1123 datetimeBodyConverted = new DateTimeRfc1123(datetimeBody); - return FluxUtil.withContext( - context -> service.putUtcMinDateTime(this.client.getHost(), datetimeBodyConverted, accept, context)); + return FluxUtil.withContext(context -> putUtcMinDateTimeWithResponseAsync(datetimeBody, context)); } /** @@ -875,12 +823,7 @@ public void putUtcMinDateTime(OffsetDateTime datetimeBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUtcMinDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUtcMinDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUtcMinDateTimeWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodydictionary/implementation/DictionariesImpl.java b/vanilla-tests/src/main/java/fixtures/bodydictionary/implementation/DictionariesImpl.java index 5771b28097..27fda27f87 100644 --- a/vanilla-tests/src/main/java/fixtures/bodydictionary/implementation/DictionariesImpl.java +++ b/vanilla-tests/src/main/java/fixtures/bodydictionary/implementation/DictionariesImpl.java @@ -484,12 +484,7 @@ Mono> putDictionaryValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -572,12 +567,7 @@ public Map getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -662,15 +652,7 @@ public Map getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(arrayBody, context)); } /** @@ -762,12 +744,7 @@ public void putEmpty(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getNullValueWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNullValue(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullValueWithResponseAsync(context)); } /** @@ -850,12 +827,7 @@ public Map getNullValue() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getNullKeyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNullKey(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullKeyWithResponseAsync(context)); } /** @@ -938,12 +910,7 @@ public Map getNullKey() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getEmptyStringKeyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmptyStringKey(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyStringKeyWithResponseAsync(context)); } /** @@ -1026,12 +993,7 @@ public Map getEmptyStringKey() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** @@ -1115,12 +1077,7 @@ public Map getInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getBooleanTfftWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBooleanTfft(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBooleanTfftWithResponseAsync(context)); } /** @@ -1208,16 +1165,7 @@ public Map getBooleanTfft() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBooleanTfftWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putBooleanTfft(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putBooleanTfftWithResponseAsync(arrayBody, context)); } /** @@ -1310,12 +1258,7 @@ public void putBooleanTfft(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getBooleanInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBooleanInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBooleanInvalidNullWithResponseAsync(context)); } /** @@ -1400,12 +1343,7 @@ public Map getBooleanInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getBooleanInvalidStringWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBooleanInvalidString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBooleanInvalidStringWithResponseAsync(context)); } /** @@ -1492,12 +1430,7 @@ public Map getBooleanInvalidString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getIntegerValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getIntegerValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getIntegerValidWithResponseAsync(context)); } /** @@ -1583,16 +1516,7 @@ public Map getIntegerValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putIntegerValidWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putIntegerValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putIntegerValidWithResponseAsync(arrayBody, context)); } /** @@ -1685,12 +1609,7 @@ public void putIntegerValid(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getIntInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getIntInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getIntInvalidNullWithResponseAsync(context)); } /** @@ -1775,12 +1694,7 @@ public Map getIntInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getIntInvalidStringWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getIntInvalidString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getIntInvalidStringWithResponseAsync(context)); } /** @@ -1865,12 +1779,7 @@ public Map getIntInvalidString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getLongValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLongValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLongValidWithResponseAsync(context)); } /** @@ -1956,15 +1865,7 @@ public Map getLongValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putLongValidWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putLongValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putLongValidWithResponseAsync(arrayBody, context)); } /** @@ -2057,12 +1958,7 @@ public void putLongValid(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getLongInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLongInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLongInvalidNullWithResponseAsync(context)); } /** @@ -2147,12 +2043,7 @@ public Map getLongInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getLongInvalidStringWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLongInvalidString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLongInvalidStringWithResponseAsync(context)); } /** @@ -2237,12 +2128,7 @@ public Map getLongInvalidString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getFloatValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFloatValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFloatValidWithResponseAsync(context)); } /** @@ -2328,16 +2214,7 @@ public Map getFloatValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFloatValidWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putFloatValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putFloatValidWithResponseAsync(arrayBody, context)); } /** @@ -2430,12 +2307,7 @@ public void putFloatValid(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getFloatInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFloatInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFloatInvalidNullWithResponseAsync(context)); } /** @@ -2520,12 +2392,7 @@ public Map getFloatInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getFloatInvalidStringWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFloatInvalidString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFloatInvalidStringWithResponseAsync(context)); } /** @@ -2610,12 +2477,7 @@ public Map getFloatInvalidString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDoubleValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDoubleValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDoubleValidWithResponseAsync(context)); } /** @@ -2701,16 +2563,7 @@ public Map getDoubleValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDoubleValidWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDoubleValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putDoubleValidWithResponseAsync(arrayBody, context)); } /** @@ -2803,12 +2656,7 @@ public void putDoubleValid(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDoubleInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDoubleInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDoubleInvalidNullWithResponseAsync(context)); } /** @@ -2893,12 +2741,7 @@ public Map getDoubleInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDoubleInvalidStringWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDoubleInvalidString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDoubleInvalidStringWithResponseAsync(context)); } /** @@ -2983,12 +2826,7 @@ public Map getDoubleInvalidString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getStringValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getStringValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringValidWithResponseAsync(context)); } /** @@ -3074,16 +2912,7 @@ public Map getStringValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putStringValidWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putStringValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putStringValidWithResponseAsync(arrayBody, context)); } /** @@ -3176,12 +3005,7 @@ public void putStringValid(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getStringWithNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getStringWithNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringWithNullWithResponseAsync(context)); } /** @@ -3266,12 +3090,7 @@ public Map getStringWithNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getStringWithInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getStringWithInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringWithInvalidWithResponseAsync(context)); } /** @@ -3356,12 +3175,7 @@ public Map getStringWithInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateValidWithResponseAsync(context)); } /** @@ -3450,15 +3264,7 @@ public Map getDateValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateValidWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDateValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putDateValidWithResponseAsync(arrayBody, context)); } /** @@ -3551,12 +3357,7 @@ public void putDateValid(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateInvalidNullWithResponseAsync(context)); } /** @@ -3643,12 +3444,7 @@ public Map getDateInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateInvalidCharsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateInvalidChars(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateInvalidCharsWithResponseAsync(context)); } /** @@ -3734,12 +3530,7 @@ public Map getDateInvalidChars() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateTimeValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeValidWithResponseAsync(context)); } /** @@ -3835,16 +3626,7 @@ public Map getDateTimeValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeValidWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTimeValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeValidWithResponseAsync(arrayBody, context)); } /** @@ -3943,12 +3725,7 @@ public void putDateTimeValid(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateTimeInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeInvalidNullWithResponseAsync(context)); } /** @@ -4033,12 +3810,7 @@ public Map getDateTimeInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateTimeInvalidCharsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeInvalidChars(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeInvalidCharsWithResponseAsync(context)); } /** @@ -4126,12 +3898,7 @@ public Map getDateTimeInvalidChars() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDateTimeRfc1123ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeRfc1123Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeRfc1123ValidWithResponseAsync(context)); } /** @@ -4227,19 +3994,7 @@ public Map getDateTimeRfc1123Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeRfc1123ValidWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - Map arrayBodyConverted = arrayBody.entrySet() - .stream() - .collect(java.util.stream.Collectors.toMap(Map.Entry::getKey, el -> new DateTimeRfc1123(el.getValue()))); - return FluxUtil.withContext( - context -> service.putDateTimeRfc1123Valid(this.client.getHost(), arrayBodyConverted, accept, context)); + return FluxUtil.withContext(context -> putDateTimeRfc1123ValidWithResponseAsync(arrayBody, context)); } /** @@ -4341,12 +4096,7 @@ public void putDateTimeRfc1123Valid(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDurationValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDurationValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDurationValidWithResponseAsync(context)); } /** @@ -4434,16 +4184,7 @@ public Map getDurationValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDurationValidWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDurationValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putDurationValidWithResponseAsync(arrayBody, context)); } /** @@ -4537,12 +4278,7 @@ public void putDurationValid(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getByteValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getByteValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getByteValidWithResponseAsync(context)); } /** @@ -4638,15 +4374,7 @@ public Map getByteValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putByteValidWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putByteValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putByteValidWithResponseAsync(arrayBody, context)); } /** @@ -4744,12 +4472,7 @@ public void putByteValid(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getByteInvalidNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getByteInvalidNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getByteInvalidNullWithResponseAsync(context)); } /** @@ -4838,12 +4561,7 @@ public Map getByteInvalidNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getBase64UrlWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBase64Url(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBase64UrlWithResponseAsync(context)); } /** @@ -4937,12 +4655,7 @@ public Map getBase64Url() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getComplexNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplexNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexNullWithResponseAsync(context)); } /** @@ -5026,12 +4739,7 @@ public Map getComplexNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getComplexEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplexEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexEmptyWithResponseAsync(context)); } /** @@ -5116,12 +4824,7 @@ public Map getComplexEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getComplexItemNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplexItemNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexItemNullWithResponseAsync(context)); } /** @@ -5216,12 +4919,7 @@ public Map getComplexItemNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getComplexItemEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplexItemEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexItemEmptyWithResponseAsync(context)); } /** @@ -5316,12 +5014,7 @@ public Map getComplexItemEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getComplexValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplexValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexValidWithResponseAsync(context)); } /** @@ -5417,22 +5110,7 @@ public Map getComplexValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putComplexValidWithResponseAsync(Map arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } else { - arrayBody.values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putComplexValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putComplexValidWithResponseAsync(arrayBody, context)); } /** @@ -5535,12 +5213,7 @@ public void putComplexValid(Map arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getArrayNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getArrayNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getArrayNullWithResponseAsync(context)); } /** @@ -5623,12 +5296,7 @@ public Map> getArrayNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getArrayEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getArrayEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getArrayEmptyWithResponseAsync(context)); } /** @@ -5712,12 +5380,7 @@ public Map> getArrayEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getArrayItemNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getArrayItemNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getArrayItemNullWithResponseAsync(context)); } /** @@ -5805,12 +5468,7 @@ public Map> getArrayItemNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getArrayItemEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getArrayItemEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getArrayItemEmptyWithResponseAsync(context)); } /** @@ -5898,12 +5556,7 @@ public Map> getArrayItemEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getArrayValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getArrayValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getArrayValidWithResponseAsync(context)); } /** @@ -5992,16 +5645,7 @@ public Map> getArrayValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putArrayValidWithResponseAsync(Map> arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putArrayValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putArrayValidWithResponseAsync(arrayBody, context)); } /** @@ -6094,12 +5738,7 @@ public void putArrayValid(Map> arrayBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getDictionaryNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDictionaryNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDictionaryNullWithResponseAsync(context)); } /** @@ -6184,12 +5823,7 @@ public Map> getDictionaryNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getDictionaryEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDictionaryEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDictionaryEmptyWithResponseAsync(context)); } /** @@ -6278,12 +5912,7 @@ public Map> getDictionaryEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getDictionaryItemNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDictionaryItemNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDictionaryItemNullWithResponseAsync(context)); } /** @@ -6382,12 +6011,7 @@ public Map> getDictionaryItemNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getDictionaryItemEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDictionaryItemEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDictionaryItemEmptyWithResponseAsync(context)); } /** @@ -6484,12 +6108,7 @@ public Map> getDictionaryItemEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>>> getDictionaryValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDictionaryValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDictionaryValidWithResponseAsync(context)); } /** @@ -6591,16 +6210,7 @@ public Map> getDictionaryValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDictionaryValidWithResponseAsync(Map> arrayBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayBody == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDictionaryValid(this.client.getHost(), arrayBody, accept, context)); + return FluxUtil.withContext(context -> putDictionaryValidWithResponseAsync(arrayBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodyduration/DurationOperations.java b/vanilla-tests/src/main/java/fixtures/bodyduration/DurationOperations.java index 8be753cf38..3834e11712 100644 --- a/vanilla-tests/src/main/java/fixtures/bodyduration/DurationOperations.java +++ b/vanilla-tests/src/main/java/fixtures/bodyduration/DurationOperations.java @@ -90,12 +90,7 @@ Mono> getInvalid(@HostParam("$host") String host, @HeaderPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -180,16 +175,7 @@ public Duration getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putPositiveDurationWithResponseAsync(Duration durationBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (durationBody == null) { - return Mono.error(new IllegalArgumentException("Parameter durationBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putPositiveDuration(this.client.getHost(), durationBody, accept, context)); + return FluxUtil.withContext(context -> putPositiveDurationWithResponseAsync(durationBody, context)); } /** @@ -281,12 +267,7 @@ public void putPositiveDuration(Duration durationBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getPositiveDurationWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getPositiveDuration(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getPositiveDurationWithResponseAsync(context)); } /** @@ -369,12 +350,7 @@ public Duration getPositiveDuration() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodyfile/Files.java b/vanilla-tests/src/main/java/fixtures/bodyfile/Files.java index 6e7fa3fe9d..e2fc28bb42 100644 --- a/vanilla-tests/src/main/java/fixtures/bodyfile/Files.java +++ b/vanilla-tests/src/main/java/fixtures/bodyfile/Files.java @@ -80,12 +80,7 @@ Mono> getEmptyFile(@HostParam("$host") String host, @Header */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFileWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "image/png, application/json"; - return FluxUtil.withContext(context -> service.getFile(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFileWithResponseAsync(context)); } /** @@ -168,12 +163,7 @@ public BinaryData getFile() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFileLargeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "image/png, application/json"; - return FluxUtil.withContext(context -> service.getFileLarge(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFileLargeWithResponseAsync(context)); } /** @@ -256,12 +246,7 @@ public BinaryData getFileLarge() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyFileWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "image/png, application/json"; - return FluxUtil.withContext(context -> service.getEmptyFile(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyFileWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodyformdataurlencoded/Formdataurlencodeds.java b/vanilla-tests/src/main/java/fixtures/bodyformdataurlencoded/Formdataurlencodeds.java index f01cd81b64..e96988d5c9 100644 --- a/vanilla-tests/src/main/java/fixtures/bodyformdataurlencoded/Formdataurlencodeds.java +++ b/vanilla-tests/src/main/java/fixtures/bodyformdataurlencoded/Formdataurlencodeds.java @@ -90,18 +90,8 @@ Mono> partialConstantBody(@HostParam("$host") String host, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updatePetWithFormWithResponseAsync(int petId, PetType petType, PetFood petFood, int petAge, String name, String status) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (petType == null) { - return Mono.error(new IllegalArgumentException("Parameter petType is required and cannot be null.")); - } - if (petFood == null) { - return Mono.error(new IllegalArgumentException("Parameter petFood is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.updatePetWithForm(this.client.getHost(), petId, petType, petFood, - petAge, name, status, context)); + return FluxUtil.withContext( + context -> updatePetWithFormWithResponseAsync(petId, petType, petFood, petAge, name, status, context)); } /** @@ -268,19 +258,8 @@ public void updatePetWithForm(int petId, PetType petType, PetFood petFood, int p */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> partialConstantBodyWithResponseAsync(String serviceParam, String accessToken) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (serviceParam == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceParam is required and cannot be null.")); - } - if (accessToken == null) { - return Mono.error(new IllegalArgumentException("Parameter accessToken is required and cannot be null.")); - } - final String grantType = "access_token"; - return FluxUtil.withContext(context -> service.partialConstantBody(this.client.getHost(), grantType, - serviceParam, accessToken, context)); + return FluxUtil + .withContext(context -> partialConstantBodyWithResponseAsync(serviceParam, accessToken, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodyinteger/Ints.java b/vanilla-tests/src/main/java/fixtures/bodyinteger/Ints.java index f68cd2132b..8b3b450a1f 100644 --- a/vanilla-tests/src/main/java/fixtures/bodyinteger/Ints.java +++ b/vanilla-tests/src/main/java/fixtures/bodyinteger/Ints.java @@ -152,12 +152,7 @@ Mono> getNullUnixTime(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -240,12 +235,7 @@ public int getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** @@ -328,12 +318,7 @@ public int getInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getOverflowInt32WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getOverflowInt32(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getOverflowInt32WithResponseAsync(context)); } /** @@ -416,12 +401,7 @@ public int getOverflowInt32() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUnderflowInt32WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUnderflowInt32(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUnderflowInt32WithResponseAsync(context)); } /** @@ -504,12 +484,7 @@ public int getUnderflowInt32() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getOverflowInt64WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getOverflowInt64(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getOverflowInt64WithResponseAsync(context)); } /** @@ -592,12 +567,7 @@ public long getOverflowInt64() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUnderflowInt64WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUnderflowInt64(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUnderflowInt64WithResponseAsync(context)); } /** @@ -682,12 +652,7 @@ public long getUnderflowInt64() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMax32WithResponseAsync(int intBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putMax32(this.client.getHost(), intBody, accept, context)); + return FluxUtil.withContext(context -> putMax32WithResponseAsync(intBody, context)); } /** @@ -778,12 +743,7 @@ public void putMax32(int intBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMax64WithResponseAsync(long intBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putMax64(this.client.getHost(), intBody, accept, context)); + return FluxUtil.withContext(context -> putMax64WithResponseAsync(intBody, context)); } /** @@ -874,12 +834,7 @@ public void putMax64(long intBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMin32WithResponseAsync(int intBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putMin32(this.client.getHost(), intBody, accept, context)); + return FluxUtil.withContext(context -> putMin32WithResponseAsync(intBody, context)); } /** @@ -970,12 +925,7 @@ public void putMin32(int intBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMin64WithResponseAsync(long intBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putMin64(this.client.getHost(), intBody, accept, context)); + return FluxUtil.withContext(context -> putMin64WithResponseAsync(intBody, context)); } /** @@ -1064,12 +1014,7 @@ public void putMin64(long intBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUnixTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUnixTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUnixTimeWithResponseAsync(context)); } /** @@ -1154,17 +1099,7 @@ public OffsetDateTime getUnixTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUnixTimeDateWithResponseAsync(OffsetDateTime intBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (intBody == null) { - return Mono.error(new IllegalArgumentException("Parameter intBody is required and cannot be null.")); - } - final String accept = "application/json"; - long intBodyConverted = intBody.toEpochSecond(); - return FluxUtil - .withContext(context -> service.putUnixTimeDate(this.client.getHost(), intBodyConverted, accept, context)); + return FluxUtil.withContext(context -> putUnixTimeDateWithResponseAsync(intBody, context)); } /** @@ -1257,12 +1192,7 @@ public void putUnixTimeDate(OffsetDateTime intBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidUnixTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalidUnixTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidUnixTimeWithResponseAsync(context)); } /** @@ -1345,12 +1275,7 @@ public OffsetDateTime getInvalidUnixTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullUnixTimeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNullUnixTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullUnixTimeWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodynumber/Numbers.java b/vanilla-tests/src/main/java/fixtures/bodynumber/Numbers.java index ab438d1885..ae81fd79ce 100644 --- a/vanilla-tests/src/main/java/fixtures/bodynumber/Numbers.java +++ b/vanilla-tests/src/main/java/fixtures/bodynumber/Numbers.java @@ -212,12 +212,7 @@ Mono> getSmallDecimal(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -300,12 +295,7 @@ public float getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidFloatWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalidFloat(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidFloatWithResponseAsync(context)); } /** @@ -388,12 +378,7 @@ public float getInvalidFloat() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidDoubleWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalidDouble(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidDoubleWithResponseAsync(context)); } /** @@ -476,12 +461,7 @@ public double getInvalidDouble() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidDecimalWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalidDecimal(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidDecimalWithResponseAsync(context)); } /** @@ -566,12 +546,7 @@ public BigDecimal getInvalidDecimal() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBigFloatWithResponseAsync(float numberBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putBigFloat(this.client.getHost(), numberBody, accept, context)); + return FluxUtil.withContext(context -> putBigFloatWithResponseAsync(numberBody, context)); } /** @@ -660,12 +635,7 @@ public void putBigFloat(float numberBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBigFloatWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBigFloat(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBigFloatWithResponseAsync(context)); } /** @@ -750,13 +720,7 @@ public float getBigFloat() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBigDoubleWithResponseAsync(double numberBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putBigDouble(this.client.getHost(), numberBody, accept, context)); + return FluxUtil.withContext(context -> putBigDoubleWithResponseAsync(numberBody, context)); } /** @@ -845,12 +809,7 @@ public void putBigDouble(double numberBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBigDoubleWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBigDouble(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBigDoubleWithResponseAsync(context)); } /** @@ -933,14 +892,7 @@ public double getBigDouble() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBigDoublePositiveDecimalWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final double numberBody = 9.999999999E7; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putBigDoublePositiveDecimal(this.client.getHost(), numberBody, accept, context)); + return FluxUtil.withContext(context -> putBigDoublePositiveDecimalWithResponseAsync(context)); } /** @@ -1023,13 +975,7 @@ public void putBigDoublePositiveDecimal() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBigDoublePositiveDecimalWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBigDoublePositiveDecimal(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBigDoublePositiveDecimalWithResponseAsync(context)); } /** @@ -1112,14 +1058,7 @@ public double getBigDoublePositiveDecimal() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBigDoubleNegativeDecimalWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final double numberBody = -9.999999999E7; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putBigDoubleNegativeDecimal(this.client.getHost(), numberBody, accept, context)); + return FluxUtil.withContext(context -> putBigDoubleNegativeDecimalWithResponseAsync(context)); } /** @@ -1202,13 +1141,7 @@ public void putBigDoubleNegativeDecimal() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBigDoubleNegativeDecimalWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBigDoubleNegativeDecimal(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBigDoubleNegativeDecimalWithResponseAsync(context)); } /** @@ -1293,16 +1226,7 @@ public double getBigDoubleNegativeDecimal() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBigDecimalWithResponseAsync(BigDecimal numberBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (numberBody == null) { - return Mono.error(new IllegalArgumentException("Parameter numberBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putBigDecimal(this.client.getHost(), numberBody, accept, context)); + return FluxUtil.withContext(context -> putBigDecimalWithResponseAsync(numberBody, context)); } /** @@ -1394,12 +1318,7 @@ public void putBigDecimal(BigDecimal numberBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBigDecimalWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBigDecimal(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBigDecimalWithResponseAsync(context)); } /** @@ -1482,14 +1401,7 @@ public BigDecimal getBigDecimal() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBigDecimalPositiveDecimalWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final BigDecimal numberBody = new BigDecimal("9.999999999E7"); - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putBigDecimalPositiveDecimal(this.client.getHost(), numberBody, accept, context)); + return FluxUtil.withContext(context -> putBigDecimalPositiveDecimalWithResponseAsync(context)); } /** @@ -1572,13 +1484,7 @@ public void putBigDecimalPositiveDecimal() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBigDecimalPositiveDecimalWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBigDecimalPositiveDecimal(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBigDecimalPositiveDecimalWithResponseAsync(context)); } /** @@ -1661,14 +1567,7 @@ public BigDecimal getBigDecimalPositiveDecimal() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBigDecimalNegativeDecimalWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final BigDecimal numberBody = new BigDecimal("-9.999999999E7"); - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putBigDecimalNegativeDecimal(this.client.getHost(), numberBody, accept, context)); + return FluxUtil.withContext(context -> putBigDecimalNegativeDecimalWithResponseAsync(context)); } /** @@ -1751,13 +1650,7 @@ public void putBigDecimalNegativeDecimal() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBigDecimalNegativeDecimalWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBigDecimalNegativeDecimal(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBigDecimalNegativeDecimalWithResponseAsync(context)); } /** @@ -1842,13 +1735,7 @@ public BigDecimal getBigDecimalNegativeDecimal() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putSmallFloatWithResponseAsync(float numberBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putSmallFloat(this.client.getHost(), numberBody, accept, context)); + return FluxUtil.withContext(context -> putSmallFloatWithResponseAsync(numberBody, context)); } /** @@ -1937,12 +1824,7 @@ public void putSmallFloat(float numberBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSmallFloatWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSmallFloat(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getSmallFloatWithResponseAsync(context)); } /** @@ -2027,13 +1909,7 @@ public double getSmallFloat() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putSmallDoubleWithResponseAsync(double numberBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putSmallDouble(this.client.getHost(), numberBody, accept, context)); + return FluxUtil.withContext(context -> putSmallDoubleWithResponseAsync(numberBody, context)); } /** @@ -2122,12 +1998,7 @@ public void putSmallDouble(double numberBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSmallDoubleWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSmallDouble(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getSmallDoubleWithResponseAsync(context)); } /** @@ -2212,16 +2083,7 @@ public double getSmallDouble() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putSmallDecimalWithResponseAsync(BigDecimal numberBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (numberBody == null) { - return Mono.error(new IllegalArgumentException("Parameter numberBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putSmallDecimal(this.client.getHost(), numberBody, accept, context)); + return FluxUtil.withContext(context -> putSmallDecimalWithResponseAsync(numberBody, context)); } /** @@ -2313,12 +2175,7 @@ public void putSmallDecimal(BigDecimal numberBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSmallDecimalWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSmallDecimal(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getSmallDecimalWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java b/vanilla-tests/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java index 6be5343125..cded6dfe72 100644 --- a/vanilla-tests/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java +++ b/vanilla-tests/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java @@ -105,12 +105,7 @@ Mono> putReferencedConstant(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotExpandableWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotExpandable(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotExpandableWithResponseAsync(context)); } /** @@ -199,16 +194,7 @@ public Colors getNotExpandable() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNotExpandableWithResponseAsync(Colors stringBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (stringBody == null) { - return Mono.error(new IllegalArgumentException("Parameter stringBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putNotExpandable(this.client.getHost(), stringBody, accept, context)); + return FluxUtil.withContext(context -> putNotExpandableWithResponseAsync(stringBody, context)); } /** @@ -301,12 +287,7 @@ public void putNotExpandable(Colors stringBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getReferencedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getReferenced(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getReferencedWithResponseAsync(context)); } /** @@ -395,16 +376,7 @@ public Colors getReferenced() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putReferencedWithResponseAsync(Colors enumStringBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (enumStringBody == null) { - return Mono.error(new IllegalArgumentException("Parameter enumStringBody is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putReferenced(this.client.getHost(), enumStringBody, accept, context)); + return FluxUtil.withContext(context -> putReferencedWithResponseAsync(enumStringBody, context)); } /** @@ -497,12 +469,7 @@ public void putReferenced(Colors enumStringBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getReferencedConstantWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getReferencedConstant(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getReferencedConstantWithResponseAsync(context)); } /** @@ -588,18 +555,7 @@ public RefColorConstant getReferencedConstant() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putReferencedConstantWithResponseAsync(RefColorConstant enumStringBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (enumStringBody == null) { - return Mono.error(new IllegalArgumentException("Parameter enumStringBody is required and cannot be null.")); - } else { - enumStringBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putReferencedConstant(this.client.getHost(), enumStringBody, accept, context)); + return FluxUtil.withContext(context -> putReferencedConstantWithResponseAsync(enumStringBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/bodystring/implementation/StringOperationsImpl.java b/vanilla-tests/src/main/java/fixtures/bodystring/implementation/StringOperationsImpl.java index 2dc516a0da..46806c7f00 100644 --- a/vanilla-tests/src/main/java/fixtures/bodystring/implementation/StringOperationsImpl.java +++ b/vanilla-tests/src/main/java/fixtures/bodystring/implementation/StringOperationsImpl.java @@ -147,12 +147,7 @@ Mono> getNullBase64UrlEncoded(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -237,12 +232,7 @@ public String getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNullWithResponseAsync(String stringBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putNull(this.client.getHost(), stringBody, accept, context)); + return FluxUtil.withContext(context -> putNullWithResponseAsync(stringBody, context)); } /** @@ -356,12 +346,7 @@ public void putNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -444,13 +429,7 @@ public String getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String stringBody = ""; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), stringBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(context)); } /** @@ -534,12 +513,7 @@ public void putEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMbcsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMbcs(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getMbcsWithResponseAsync(context)); } /** @@ -626,13 +600,7 @@ public String getMbcs() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMbcsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String stringBody = "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putMbcs(this.client.getHost(), stringBody, accept, context)); + return FluxUtil.withContext(context -> putMbcsWithResponseAsync(context)); } /** @@ -718,12 +686,7 @@ public void putMbcs() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWhitespaceWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getWhitespace(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWhitespaceWithResponseAsync(context)); } /** @@ -821,14 +784,7 @@ public String getWhitespace() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWhitespaceWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String stringBody = " Now is the time for all good men to come to the aid of their country "; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putWhitespace(this.client.getHost(), stringBody, accept, context)); + return FluxUtil.withContext(context -> putWhitespaceWithResponseAsync(context)); } /** @@ -917,12 +873,7 @@ public void putWhitespace() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** @@ -1006,12 +957,7 @@ public String getNotProvided() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBase64EncodedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBase64Encoded(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBase64EncodedWithResponseAsync(context)); } /** @@ -1094,12 +1040,7 @@ public byte[] getBase64Encoded() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBase64UrlEncodedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBase64UrlEncoded(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBase64UrlEncodedWithResponseAsync(context)); } /** @@ -1184,17 +1125,7 @@ public byte[] getBase64UrlEncoded() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBase64UrlEncodedWithResponseAsync(byte[] stringBody) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (stringBody == null) { - return Mono.error(new IllegalArgumentException("Parameter stringBody is required and cannot be null.")); - } - final String accept = "application/json"; - Base64Url stringBodyConverted = Base64Url.encode(stringBody); - return FluxUtil.withContext( - context -> service.putBase64UrlEncoded(this.client.getHost(), stringBodyConverted, accept, context)); + return FluxUtil.withContext(context -> putBase64UrlEncodedWithResponseAsync(stringBody, context)); } /** @@ -1288,12 +1219,7 @@ public void putBase64UrlEncoded(byte[] stringBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullBase64UrlEncodedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNullBase64UrlEncoded(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullBase64UrlEncodedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/constants/Contants.java b/vanilla-tests/src/main/java/fixtures/constants/Contants.java index 11f0f270a4..0655ab4654 100644 --- a/vanilla-tests/src/main/java/fixtures/constants/Contants.java +++ b/vanilla-tests/src/main/java/fixtures/constants/Contants.java @@ -181,12 +181,8 @@ Mono> putClientConstants(@HostParam("$host") String host, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNoModelAsStringNoRequiredTwoValueNoDefaultWithResponseAsync( NoModelAsStringNoRequiredTwoValueNoDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putNoModelAsStringNoRequiredTwoValueNoDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putNoModelAsStringNoRequiredTwoValueNoDefaultWithResponseAsync(input, context)); } /** @@ -307,12 +303,8 @@ public void putNoModelAsStringNoRequiredTwoValueNoDefault() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNoModelAsStringNoRequiredTwoValueDefaultWithResponseAsync( NoModelAsStringNoRequiredTwoValueDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putNoModelAsStringNoRequiredTwoValueDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putNoModelAsStringNoRequiredTwoValueDefaultWithResponseAsync(input, context)); } /** @@ -430,13 +422,7 @@ public void putNoModelAsStringNoRequiredTwoValueDefault() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNoModelAsStringNoRequiredOneValueNoDefaultWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String input = "value1"; - return FluxUtil.withContext( - context -> service.putNoModelAsStringNoRequiredOneValueNoDefault(this.client.getHost(), input, context)); + return FluxUtil.withContext(context -> putNoModelAsStringNoRequiredOneValueNoDefaultWithResponseAsync(context)); } /** @@ -518,13 +504,7 @@ public void putNoModelAsStringNoRequiredOneValueNoDefault() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNoModelAsStringNoRequiredOneValueDefaultWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String input = "value1"; - return FluxUtil.withContext( - context -> service.putNoModelAsStringNoRequiredOneValueDefault(this.client.getHost(), input, context)); + return FluxUtil.withContext(context -> putNoModelAsStringNoRequiredOneValueDefaultWithResponseAsync(context)); } /** @@ -609,15 +589,8 @@ public void putNoModelAsStringNoRequiredOneValueDefault() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNoModelAsStringRequiredTwoValueNoDefaultWithResponseAsync( NoModelAsStringRequiredTwoValueNoDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (input == null) { - return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putNoModelAsStringRequiredTwoValueNoDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putNoModelAsStringRequiredTwoValueNoDefaultWithResponseAsync(input, context)); } /** @@ -716,15 +689,8 @@ public void putNoModelAsStringRequiredTwoValueNoDefault(NoModelAsStringRequiredT @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNoModelAsStringRequiredTwoValueDefaultWithResponseAsync(NoModelAsStringRequiredTwoValueDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (input == null) { - return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putNoModelAsStringRequiredTwoValueDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putNoModelAsStringRequiredTwoValueDefaultWithResponseAsync(input, context)); } /** @@ -820,13 +786,7 @@ public void putNoModelAsStringRequiredTwoValueDefault(NoModelAsStringRequiredTwo */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNoModelAsStringRequiredOneValueNoDefaultWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String input = "value1"; - return FluxUtil.withContext( - context -> service.putNoModelAsStringRequiredOneValueNoDefault(this.client.getHost(), input, context)); + return FluxUtil.withContext(context -> putNoModelAsStringRequiredOneValueNoDefaultWithResponseAsync(context)); } /** @@ -908,13 +868,7 @@ public void putNoModelAsStringRequiredOneValueNoDefault() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNoModelAsStringRequiredOneValueDefaultWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String input = "value1"; - return FluxUtil.withContext( - context -> service.putNoModelAsStringRequiredOneValueDefault(this.client.getHost(), input, context)); + return FluxUtil.withContext(context -> putNoModelAsStringRequiredOneValueDefaultWithResponseAsync(context)); } /** @@ -999,12 +953,8 @@ public void putNoModelAsStringRequiredOneValueDefault() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelAsStringNoRequiredTwoValueNoDefaultWithResponseAsync( ModelAsStringNoRequiredTwoValueNoDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putModelAsStringNoRequiredTwoValueNoDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putModelAsStringNoRequiredTwoValueNoDefaultWithResponseAsync(input, context)); } /** @@ -1125,12 +1075,8 @@ public void putModelAsStringNoRequiredTwoValueNoDefault() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelAsStringNoRequiredTwoValueDefaultWithResponseAsync(ModelAsStringNoRequiredTwoValueDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putModelAsStringNoRequiredTwoValueDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putModelAsStringNoRequiredTwoValueDefaultWithResponseAsync(input, context)); } /** @@ -1251,12 +1197,8 @@ public void putModelAsStringNoRequiredTwoValueDefault() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelAsStringNoRequiredOneValueNoDefaultWithResponseAsync( ModelAsStringNoRequiredOneValueNoDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putModelAsStringNoRequiredOneValueNoDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putModelAsStringNoRequiredOneValueNoDefaultWithResponseAsync(input, context)); } /** @@ -1377,12 +1319,8 @@ public void putModelAsStringNoRequiredOneValueNoDefault() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelAsStringNoRequiredOneValueDefaultWithResponseAsync(ModelAsStringNoRequiredOneValueDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putModelAsStringNoRequiredOneValueDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putModelAsStringNoRequiredOneValueDefaultWithResponseAsync(input, context)); } /** @@ -1503,15 +1441,8 @@ public void putModelAsStringNoRequiredOneValueDefault() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelAsStringRequiredTwoValueNoDefaultWithResponseAsync(ModelAsStringRequiredTwoValueNoDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (input == null) { - return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putModelAsStringRequiredTwoValueNoDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putModelAsStringRequiredTwoValueNoDefaultWithResponseAsync(input, context)); } /** @@ -1610,15 +1541,8 @@ public void putModelAsStringRequiredTwoValueNoDefault(ModelAsStringRequiredTwoVa @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelAsStringRequiredTwoValueDefaultWithResponseAsync(ModelAsStringRequiredTwoValueDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (input == null) { - return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putModelAsStringRequiredTwoValueDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putModelAsStringRequiredTwoValueDefaultWithResponseAsync(input, context)); } /** @@ -1716,15 +1640,8 @@ public void putModelAsStringRequiredTwoValueDefault(ModelAsStringRequiredTwoValu @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelAsStringRequiredOneValueNoDefaultWithResponseAsync(ModelAsStringRequiredOneValueNoDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (input == null) { - return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putModelAsStringRequiredOneValueNoDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putModelAsStringRequiredOneValueNoDefaultWithResponseAsync(input, context)); } /** @@ -1823,15 +1740,8 @@ public void putModelAsStringRequiredOneValueNoDefault(ModelAsStringRequiredOneVa @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelAsStringRequiredOneValueDefaultWithResponseAsync(ModelAsStringRequiredOneValueDefaultOpEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (input == null) { - return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); - } - return FluxUtil.withContext( - context -> service.putModelAsStringRequiredOneValueDefault(this.client.getHost(), input, context)); + return FluxUtil + .withContext(context -> putModelAsStringRequiredOneValueDefaultWithResponseAsync(input, context)); } /** @@ -1926,12 +1836,7 @@ public void putModelAsStringRequiredOneValueDefault(ModelAsStringRequiredOneValu */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putClientConstantsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.putClientConstants(this.client.getHost(), - this.client.isHeaderConstant(), this.client.getQueryConstant(), this.client.getPathConstant(), context)); + return FluxUtil.withContext(context -> putClientConstantsWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/custombaseuri/Paths.java b/vanilla-tests/src/main/java/fixtures/custombaseuri/Paths.java index b0279429d8..7108f35b3a 100644 --- a/vanilla-tests/src/main/java/fixtures/custombaseuri/Paths.java +++ b/vanilla-tests/src/main/java/fixtures/custombaseuri/Paths.java @@ -69,15 +69,7 @@ Mono> getEmpty(@HostParam("accountName") String accountName, @Hos */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync(String accountName) { - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(accountName, this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(accountName, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/custombaseuri/moreoptions/Paths.java b/vanilla-tests/src/main/java/fixtures/custombaseuri/moreoptions/Paths.java index 8583d70994..0a98a5bcc2 100644 --- a/vanilla-tests/src/main/java/fixtures/custombaseuri/moreoptions/Paths.java +++ b/vanilla-tests/src/main/java/fixtures/custombaseuri/moreoptions/Paths.java @@ -77,26 +77,7 @@ Mono> getEmpty(@HostParam("vault") String vault, @HostParam("secr @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync(String vault, String secret, String keyName, String keyVersion) { - if (vault == null) { - return Mono.error(new IllegalArgumentException("Parameter vault is required and cannot be null.")); - } - if (secret == null) { - return Mono.error(new IllegalArgumentException("Parameter secret is required and cannot be null.")); - } - if (this.client.getDnsSuffix() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getDnsSuffix() is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(vault, secret, this.client.getDnsSuffix(), keyName, - this.client.getSubscriptionId(), keyVersion, accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(vault, secret, keyName, keyVersion, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/customhttpexceptionmapping/HeadExceptions.java b/vanilla-tests/src/main/java/fixtures/customhttpexceptionmapping/HeadExceptions.java index 2cde11fcbf..31afc0b149 100644 --- a/vanilla-tests/src/main/java/fixtures/customhttpexceptionmapping/HeadExceptions.java +++ b/vanilla-tests/src/main/java/fixtures/customhttpexceptionmapping/HeadExceptions.java @@ -81,11 +81,7 @@ public interface HeadExceptionsService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.head200(this.client.getHost(), context)); + return FluxUtil.withContext(context -> head200WithResponseAsync(context)); } /** @@ -172,11 +168,7 @@ public void head200() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head204WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.head204(this.client.getHost(), context)); + return FluxUtil.withContext(context -> head204WithResponseAsync(context)); } /** @@ -263,11 +255,7 @@ public void head204() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head404WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.head404(this.client.getHost(), context)); + return FluxUtil.withContext(context -> head404WithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/discriminatorenum/EnumDiscriminator.java b/vanilla-tests/src/main/java/fixtures/discriminatorenum/EnumDiscriminator.java index 6c61d91829..3f6644d141 100644 --- a/vanilla-tests/src/main/java/fixtures/discriminatorenum/EnumDiscriminator.java +++ b/vanilla-tests/src/main/java/fixtures/discriminatorenum/EnumDiscriminator.java @@ -136,11 +136,7 @@ Mono> getExtensibleModel(@HostParam("$host") String host, @HeaderP */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getExtensibleModelWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getExtensibleModel(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getExtensibleModelWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/discriminatorflattening/MetricAlerts.java b/vanilla-tests/src/main/java/fixtures/discriminatorflattening/MetricAlerts.java index 3cbfeb9efb..02c1a086c2 100644 --- a/vanilla-tests/src/main/java/fixtures/discriminatorflattening/MetricAlerts.java +++ b/vanilla-tests/src/main/java/fixtures/discriminatorflattening/MetricAlerts.java @@ -69,12 +69,7 @@ Mono> get(@HostParam("$host") String host, @Header */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/discriminatorflattening/clientflatten/MetricAlerts.java b/vanilla-tests/src/main/java/fixtures/discriminatorflattening/clientflatten/MetricAlerts.java index 0f19fbe970..4d721d3f9e 100644 --- a/vanilla-tests/src/main/java/fixtures/discriminatorflattening/clientflatten/MetricAlerts.java +++ b/vanilla-tests/src/main/java/fixtures/discriminatorflattening/clientflatten/MetricAlerts.java @@ -69,12 +69,7 @@ Mono> get(@HostParam("$host") String host, @Header */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/discriminatorflattening/noflatten/MetricAlerts.java b/vanilla-tests/src/main/java/fixtures/discriminatorflattening/noflatten/MetricAlerts.java index 277e4dcf29..7e9f8d848e 100644 --- a/vanilla-tests/src/main/java/fixtures/discriminatorflattening/noflatten/MetricAlerts.java +++ b/vanilla-tests/src/main/java/fixtures/discriminatorflattening/noflatten/MetricAlerts.java @@ -69,12 +69,7 @@ Mono> get(@HostParam("$host") String host, @Header */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/discriminatorflattening/requirexmsflattened/MetricAlerts.java b/vanilla-tests/src/main/java/fixtures/discriminatorflattening/requirexmsflattened/MetricAlerts.java index e75a734fb0..c090caf137 100644 --- a/vanilla-tests/src/main/java/fixtures/discriminatorflattening/requirexmsflattened/MetricAlerts.java +++ b/vanilla-tests/src/main/java/fixtures/discriminatorflattening/requirexmsflattened/MetricAlerts.java @@ -69,12 +69,7 @@ Mono> get(@HostParam("$host") String host, @Header */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/discriminatorsetter/EnumDiscriminator.java b/vanilla-tests/src/main/java/fixtures/discriminatorsetter/EnumDiscriminator.java index b1031a603b..35e01974c8 100644 --- a/vanilla-tests/src/main/java/fixtures/discriminatorsetter/EnumDiscriminator.java +++ b/vanilla-tests/src/main/java/fixtures/discriminatorsetter/EnumDiscriminator.java @@ -136,11 +136,7 @@ Mono> getExtensibleModel(@HostParam("$host") String host, @HeaderP */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getExtensibleModelWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getExtensibleModel(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getExtensibleModelWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/extensibleenums/Pets.java b/vanilla-tests/src/main/java/fixtures/extensibleenums/Pets.java index 704df30ff1..24d4b34323 100644 --- a/vanilla-tests/src/main/java/fixtures/extensibleenums/Pets.java +++ b/vanilla-tests/src/main/java/fixtures/extensibleenums/Pets.java @@ -79,15 +79,7 @@ Mono> addPet(@HostParam("$host") String host, @BodyParam("applicat */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getByPetIdWithResponseAsync(String petId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (petId == null) { - return Mono.error(new IllegalArgumentException("Parameter petId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getByPetId(this.client.getHost(), petId, accept, context)); + return FluxUtil.withContext(context -> getByPetIdWithResponseAsync(petId, context)); } /** @@ -182,15 +174,7 @@ public Pet getByPetId(String petId) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addPetWithResponseAsync(Pet petParam) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (petParam != null) { - petParam.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.addPet(this.client.getHost(), petParam, accept, context)); + return FluxUtil.withContext(context -> addPetWithResponseAsync(petParam, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/head/HttpSuccess.java b/vanilla-tests/src/main/java/fixtures/head/HttpSuccess.java index fa06f04b28..e727cf00e2 100644 --- a/vanilla-tests/src/main/java/fixtures/head/HttpSuccess.java +++ b/vanilla-tests/src/main/java/fixtures/head/HttpSuccess.java @@ -76,11 +76,7 @@ public interface HttpSuccessService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.head200(this.client.getHost(), context)); + return FluxUtil.withContext(context -> head200WithResponseAsync(context)); } /** @@ -162,11 +158,7 @@ public boolean head200() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head204WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.head204(this.client.getHost(), context)); + return FluxUtil.withContext(context -> head204WithResponseAsync(context)); } /** @@ -248,11 +240,7 @@ public boolean head204() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head404WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.head404(this.client.getHost(), context)); + return FluxUtil.withContext(context -> head404WithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/header/Headers.java b/vanilla-tests/src/main/java/fixtures/header/Headers.java index 3c353ea47f..c06d01d6f9 100644 --- a/vanilla-tests/src/main/java/fixtures/header/Headers.java +++ b/vanilla-tests/src/main/java/fixtures/header/Headers.java @@ -344,16 +344,7 @@ Mono> customRequestId(@HostParam("$host") String host, @HeaderPar */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramExistingKeyWithResponseAsync(String userAgent) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (userAgent == null) { - return Mono.error(new IllegalArgumentException("Parameter userAgent is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramExistingKey(this.client.getHost(), userAgent, accept, context)); + return FluxUtil.withContext(context -> paramExistingKeyWithResponseAsync(userAgent, context)); } /** @@ -446,12 +437,7 @@ public void paramExistingKey(String userAgent) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseExistingKeyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseExistingKey(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> responseExistingKeyWithResponseAsync(context)); } /** @@ -536,13 +522,7 @@ public void responseExistingKey() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseExistingKeyNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseExistingKeyNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> responseExistingKeyNoCustomHeadersWithResponseAsync(context)); } /** @@ -590,16 +570,7 @@ public Response responseExistingKeyNoCustomHeadersWithResponse(Context con */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramProtectedKeyWithResponseAsync(String contentType) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramProtectedKey(this.client.getHost(), contentType, accept, context)); + return FluxUtil.withContext(context -> paramProtectedKeyWithResponseAsync(contentType, context)); } /** @@ -692,12 +663,7 @@ public void paramProtectedKey(String contentType) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseProtectedKeyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseProtectedKey(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> responseProtectedKeyWithResponseAsync(context)); } /** @@ -782,13 +748,7 @@ public void responseProtectedKey() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseProtectedKeyNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseProtectedKeyNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> responseProtectedKeyNoCustomHeadersWithResponseAsync(context)); } /** @@ -837,16 +797,7 @@ public Response responseProtectedKeyNoCustomHeadersWithResponse(Context co */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramIntegerWithResponseAsync(String scenario, int value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramInteger(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramIntegerWithResponseAsync(scenario, value, context)); } /** @@ -946,16 +897,7 @@ public void paramInteger(String scenario, int value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseIntegerWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseInteger(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseIntegerWithResponseAsync(scenario, context)); } /** @@ -1053,16 +995,7 @@ public void responseInteger(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseIntegerNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseIntegerNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseIntegerNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -1117,16 +1050,7 @@ public Response responseIntegerNoCustomHeadersWithResponse(String scenario */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramLongWithResponseAsync(String scenario, long value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramLong(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramLongWithResponseAsync(scenario, value, context)); } /** @@ -1231,15 +1155,7 @@ public void paramLong(String scenario, long value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseLongWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseLong(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseLongWithResponseAsync(scenario, context)); } /** @@ -1336,16 +1252,7 @@ public void responseLong(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseLongNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseLongNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseLongNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -1400,16 +1307,7 @@ public Response responseLongNoCustomHeadersWithResponse(String scenario, C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramFloatWithResponseAsync(String scenario, float value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramFloat(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramFloatWithResponseAsync(scenario, value, context)); } /** @@ -1514,15 +1412,7 @@ public void paramFloat(String scenario, float value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseFloatWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseFloat(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseFloatWithResponseAsync(scenario, context)); } /** @@ -1619,16 +1509,7 @@ public void responseFloat(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseFloatNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseFloatNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseFloatNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -1683,16 +1564,7 @@ public Response responseFloatNoCustomHeadersWithResponse(String scenario, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDoubleWithResponseAsync(String scenario, double value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDouble(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDoubleWithResponseAsync(scenario, value, context)); } /** @@ -1797,16 +1669,7 @@ public void paramDouble(String scenario, double value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDoubleWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDouble(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDoubleWithResponseAsync(scenario, context)); } /** @@ -1904,16 +1767,7 @@ public void responseDouble(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDoubleNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseDoubleNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDoubleNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -1967,16 +1821,7 @@ public Response responseDoubleNoCustomHeadersWithResponse(String scenario, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramBoolWithResponseAsync(String scenario, boolean value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramBool(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramBoolWithResponseAsync(scenario, value, context)); } /** @@ -2076,15 +1921,7 @@ public void paramBool(String scenario, boolean value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseBoolWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseBool(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseBoolWithResponseAsync(scenario, context)); } /** @@ -2181,16 +2018,7 @@ public void responseBool(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseBoolNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseBoolNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseBoolNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -2245,16 +2073,7 @@ public Response responseBoolNoCustomHeadersWithResponse(String scenario, C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramStringWithResponseAsync(String scenario, String value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramString(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramStringWithResponseAsync(scenario, value, context)); } /** @@ -2390,16 +2209,7 @@ public void paramString(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseStringWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseString(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseStringWithResponseAsync(scenario, context)); } /** @@ -2500,16 +2310,7 @@ public void responseString(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseStringNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseStringNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseStringNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -2565,19 +2366,7 @@ public Response responseStringNoCustomHeadersWithResponse(String scenario, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDateWithResponseAsync(String scenario, LocalDate value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDate(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDateWithResponseAsync(scenario, value, context)); } /** @@ -2685,15 +2474,7 @@ public void paramDate(String scenario, LocalDate value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDateWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseDate(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDateWithResponseAsync(scenario, context)); } /** @@ -2790,16 +2571,7 @@ public void responseDate(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDateNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseDateNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDateNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -2854,19 +2626,7 @@ public Response responseDateNoCustomHeadersWithResponse(String scenario, C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDatetimeWithResponseAsync(String scenario, OffsetDateTime value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDatetime(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDatetimeWithResponseAsync(scenario, value, context)); } /** @@ -2974,16 +2734,7 @@ public void paramDatetime(String scenario, OffsetDateTime value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDatetimeWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDatetime(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDatetimeWithResponseAsync(scenario, context)); } /** @@ -3084,16 +2835,7 @@ public void responseDatetime(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDatetimeNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseDatetimeNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDatetimeNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -3150,17 +2892,7 @@ public Response responseDatetimeNoCustomHeadersWithResponse(String scenari */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDatetimeRfc1123WithResponseAsync(String scenario, OffsetDateTime value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - DateTimeRfc1123 valueConverted = value == null ? null : new DateTimeRfc1123(value); - return FluxUtil.withContext( - context -> service.paramDatetimeRfc1123(this.client.getHost(), scenario, valueConverted, accept, context)); + return FluxUtil.withContext(context -> paramDatetimeRfc1123WithResponseAsync(scenario, value, context)); } /** @@ -3304,16 +3036,7 @@ public void paramDatetimeRfc1123(String scenario) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDatetimeRfc1123WithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDatetimeRfc1123(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDatetimeRfc1123WithResponseAsync(scenario, context)); } /** @@ -3414,16 +3137,8 @@ public void responseDatetimeRfc1123(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDatetimeRfc1123NoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseDatetimeRfc1123NoCustomHeaders(this.client.getHost(), - scenario, accept, context)); + return FluxUtil + .withContext(context -> responseDatetimeRfc1123NoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -3479,19 +3194,7 @@ public Response responseDatetimeRfc1123NoCustomHeadersWithResponse(String */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDurationWithResponseAsync(String scenario, Duration value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDuration(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDurationWithResponseAsync(scenario, value, context)); } /** @@ -3594,16 +3297,7 @@ public void paramDuration(String scenario, Duration value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDurationWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDuration(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDurationWithResponseAsync(scenario, context)); } /** @@ -3701,16 +3395,7 @@ public void responseDuration(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDurationNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseDurationNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDurationNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -3764,20 +3449,7 @@ public Response responseDurationNoCustomHeadersWithResponse(String scenari */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramByteWithResponseAsync(String scenario, byte[] value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext( - context -> service.paramByte(this.client.getHost(), scenario, valueConverted, accept, context)); + return FluxUtil.withContext(context -> paramByteWithResponseAsync(scenario, value, context)); } /** @@ -3881,15 +3553,7 @@ public void paramByte(String scenario, byte[] value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseByteWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseByte(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseByteWithResponseAsync(scenario, context)); } /** @@ -3986,16 +3650,7 @@ public void responseByte(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseByteNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseByteNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseByteNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -4049,16 +3704,7 @@ public Response responseByteNoCustomHeadersWithResponse(String scenario, C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramEnumWithResponseAsync(String scenario, GreyscaleColors value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramEnum(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramEnumWithResponseAsync(scenario, value, context)); } /** @@ -4187,15 +3833,7 @@ public void paramEnum(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseEnumWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseEnum(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseEnumWithResponseAsync(scenario, context)); } /** @@ -4292,16 +3930,7 @@ public void responseEnum(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseEnumNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseEnumNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseEnumNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -4352,12 +3981,7 @@ public Response responseEnumNoCustomHeadersWithResponse(String scenario, C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customRequestIdWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.customRequestId(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> customRequestIdWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/headexceptions/HeadExceptions.java b/vanilla-tests/src/main/java/fixtures/headexceptions/HeadExceptions.java index 0946978954..7014607894 100644 --- a/vanilla-tests/src/main/java/fixtures/headexceptions/HeadExceptions.java +++ b/vanilla-tests/src/main/java/fixtures/headexceptions/HeadExceptions.java @@ -76,11 +76,7 @@ public interface HeadExceptionsService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.head200(this.client.getHost(), context)); + return FluxUtil.withContext(context -> head200WithResponseAsync(context)); } /** @@ -161,11 +157,7 @@ public void head200() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head204WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.head204(this.client.getHost(), context)); + return FluxUtil.withContext(context -> head204WithResponseAsync(context)); } /** @@ -246,11 +238,7 @@ public void head204() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head404WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.head404(this.client.getHost(), context)); + return FluxUtil.withContext(context -> head404WithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpClientFailures.java b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpClientFailures.java index 4c0168f944..b0c1f0f4e4 100644 --- a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpClientFailures.java +++ b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpClientFailures.java @@ -198,12 +198,7 @@ Mono> head429(@HostParam("$host") String host, @HeaderParam("Acce */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head400WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head400(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head400WithResponseAsync(context)); } /** @@ -285,12 +280,7 @@ public void head400() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get400WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get400(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get400WithResponseAsync(context)); } /** @@ -372,12 +362,7 @@ public void get400() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> options400WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.options400(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> options400WithResponseAsync(context)); } /** @@ -459,13 +444,7 @@ public void options400() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put400WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put400(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put400WithResponseAsync(context)); } /** @@ -548,13 +527,7 @@ public void put400() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch400WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch400(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch400WithResponseAsync(context)); } /** @@ -637,13 +610,7 @@ public void patch400() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post400WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post400(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post400WithResponseAsync(context)); } /** @@ -726,13 +693,7 @@ public void post400() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete400WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete400(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> delete400WithResponseAsync(context)); } /** @@ -815,12 +776,7 @@ public void delete400() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head401WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head401(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head401WithResponseAsync(context)); } /** @@ -902,12 +858,7 @@ public void head401() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get402WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get402(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get402WithResponseAsync(context)); } /** @@ -989,12 +940,7 @@ public void get402() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> options403WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.options403(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> options403WithResponseAsync(context)); } /** @@ -1076,12 +1022,7 @@ public void options403() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get403WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get403(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get403WithResponseAsync(context)); } /** @@ -1163,13 +1104,7 @@ public void get403() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put404WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put404(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put404WithResponseAsync(context)); } /** @@ -1252,13 +1187,7 @@ public void put404() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch405WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch405(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch405WithResponseAsync(context)); } /** @@ -1341,13 +1270,7 @@ public void patch405() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post406WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post406(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post406WithResponseAsync(context)); } /** @@ -1430,13 +1353,7 @@ public void post406() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete407WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete407(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> delete407WithResponseAsync(context)); } /** @@ -1519,13 +1436,7 @@ public void delete407() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put409WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put409(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put409WithResponseAsync(context)); } /** @@ -1608,12 +1519,7 @@ public void put409() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head410WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head410(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head410WithResponseAsync(context)); } /** @@ -1695,12 +1601,7 @@ public void head410() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get411WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get411(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get411WithResponseAsync(context)); } /** @@ -1782,12 +1683,7 @@ public void get411() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> options412WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.options412(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> options412WithResponseAsync(context)); } /** @@ -1869,12 +1765,7 @@ public void options412() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get412WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get412(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get412WithResponseAsync(context)); } /** @@ -1956,13 +1847,7 @@ public void get412() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put413WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put413(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put413WithResponseAsync(context)); } /** @@ -2045,13 +1930,7 @@ public void put413() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch414WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch414(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch414WithResponseAsync(context)); } /** @@ -2134,13 +2013,7 @@ public void patch414() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post415WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post415(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post415WithResponseAsync(context)); } /** @@ -2223,12 +2096,7 @@ public void post415() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get416WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get416(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get416WithResponseAsync(context)); } /** @@ -2310,13 +2178,7 @@ public void get416() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete417WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete417(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> delete417WithResponseAsync(context)); } /** @@ -2399,12 +2261,7 @@ public void delete417() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head429WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head429(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head429WithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpFailures.java b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpFailures.java index 918fb03ee3..9bb6edf730 100644 --- a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpFailures.java +++ b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpFailures.java @@ -81,12 +81,7 @@ Mono> getNoModelEmpty(@HostParam("$host") String host, @Header */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyErrorWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmptyError(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyErrorWithResponseAsync(context)); } /** @@ -169,12 +164,7 @@ public boolean getEmptyError() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNoModelErrorWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNoModelError(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNoModelErrorWithResponseAsync(context)); } /** @@ -257,12 +247,7 @@ public boolean getNoModelError() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNoModelEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNoModelEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNoModelEmptyWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpRedirects.java b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpRedirects.java index 2f2de92412..5345c7f7c1 100644 --- a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpRedirects.java +++ b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpRedirects.java @@ -279,12 +279,7 @@ Mono> delete307NoCustomHeaders(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head300WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head300(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head300WithResponseAsync(context)); } /** @@ -366,12 +361,7 @@ public void head300() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head300NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head300NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head300NoCustomHeadersWithResponseAsync(context)); } /** @@ -416,12 +406,7 @@ public Response head300NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> get300WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get300(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get300WithResponseAsync(context)); } /** @@ -504,12 +489,7 @@ public List get300() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> get300NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get300NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get300NoCustomHeadersWithResponseAsync(context)); } /** @@ -554,12 +534,7 @@ public Response> get300NoCustomHeadersWithResponse(Context context) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head301WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head301(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head301WithResponseAsync(context)); } /** @@ -641,12 +616,7 @@ public void head301() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head301NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head301NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head301NoCustomHeadersWithResponseAsync(context)); } /** @@ -691,12 +661,7 @@ public Response head301NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get301WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get301(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get301WithResponseAsync(context)); } /** @@ -778,12 +743,7 @@ public void get301() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get301NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get301NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get301NoCustomHeadersWithResponseAsync(context)); } /** @@ -829,13 +789,7 @@ public Response get301NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put301WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put301(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put301WithResponseAsync(context)); } /** @@ -924,14 +878,7 @@ public void put301() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put301NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.put301NoCustomHeaders(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put301NoCustomHeadersWithResponseAsync(context)); } /** @@ -979,12 +926,7 @@ public Response put301NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head302WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head302(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head302WithResponseAsync(context)); } /** @@ -1066,12 +1008,7 @@ public void head302() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head302NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head302NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head302NoCustomHeadersWithResponseAsync(context)); } /** @@ -1116,12 +1053,7 @@ public Response head302NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get302WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get302(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get302WithResponseAsync(context)); } /** @@ -1203,12 +1135,7 @@ public void get302() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get302NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get302NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get302NoCustomHeadersWithResponseAsync(context)); } /** @@ -1254,13 +1181,7 @@ public Response get302NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch302WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch302(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch302WithResponseAsync(context)); } /** @@ -1349,14 +1270,7 @@ public void patch302() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch302NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.patch302NoCustomHeaders(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch302NoCustomHeadersWithResponseAsync(context)); } /** @@ -1405,13 +1319,7 @@ public Response patch302NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post303WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post303(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post303WithResponseAsync(context)); } /** @@ -1500,14 +1408,7 @@ public void post303() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post303NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post303NoCustomHeaders(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post303NoCustomHeadersWithResponseAsync(context)); } /** @@ -1555,12 +1456,7 @@ public Response post303NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head307WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head307(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head307WithResponseAsync(context)); } /** @@ -1642,12 +1538,7 @@ public void head307() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head307NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head307NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head307NoCustomHeadersWithResponseAsync(context)); } /** @@ -1692,12 +1583,7 @@ public Response head307NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get307WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get307(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get307WithResponseAsync(context)); } /** @@ -1779,12 +1665,7 @@ public void get307() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get307NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get307NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get307NoCustomHeadersWithResponseAsync(context)); } /** @@ -1829,12 +1710,7 @@ public Response get307NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> options307WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.options307(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> options307WithResponseAsync(context)); } /** @@ -1916,13 +1792,7 @@ public void options307() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> options307NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.options307NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> options307NoCustomHeadersWithResponseAsync(context)); } /** @@ -1967,13 +1837,7 @@ public Response options307NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put307WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put307(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put307WithResponseAsync(context)); } /** @@ -2056,14 +1920,7 @@ public void put307() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put307NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.put307NoCustomHeaders(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put307NoCustomHeadersWithResponseAsync(context)); } /** @@ -2109,13 +1966,7 @@ public Response put307NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch307WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch307(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch307WithResponseAsync(context)); } /** @@ -2198,14 +2049,7 @@ public void patch307() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch307NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.patch307NoCustomHeaders(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch307NoCustomHeadersWithResponseAsync(context)); } /** @@ -2251,13 +2095,7 @@ public Response patch307NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post307WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post307(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post307WithResponseAsync(context)); } /** @@ -2340,14 +2178,7 @@ public void post307() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post307NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post307NoCustomHeaders(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post307NoCustomHeadersWithResponseAsync(context)); } /** @@ -2393,13 +2224,7 @@ public Response post307NoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete307WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete307(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> delete307WithResponseAsync(context)); } /** @@ -2482,14 +2307,7 @@ public void delete307() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete307NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.delete307NoCustomHeaders(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> delete307NoCustomHeadersWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpRetries.java b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpRetries.java index a5ffc078da..1b657dee0f 100644 --- a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpRetries.java +++ b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpRetries.java @@ -123,12 +123,7 @@ Mono> patch504(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head408WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head408(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head408WithResponseAsync(context)); } /** @@ -210,13 +205,7 @@ public void head408() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put500WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put500(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put500WithResponseAsync(context)); } /** @@ -299,13 +288,7 @@ public void put500() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch500WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch500(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch500WithResponseAsync(context)); } /** @@ -388,12 +371,7 @@ public void patch500() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get502WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get502(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get502WithResponseAsync(context)); } /** @@ -475,12 +453,7 @@ public void get502() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> options502WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.options502(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> options502WithResponseAsync(context)); } /** @@ -563,13 +536,7 @@ public boolean options502() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post503WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post503(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post503WithResponseAsync(context)); } /** @@ -652,13 +619,7 @@ public void post503() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete503WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete503(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> delete503WithResponseAsync(context)); } /** @@ -741,13 +702,7 @@ public void delete503() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put504WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put504(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put504WithResponseAsync(context)); } /** @@ -830,13 +785,7 @@ public void put504() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch504WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch504(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch504WithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpServerFailures.java b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpServerFailures.java index 5b38dcaed9..a14d34b7b3 100644 --- a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpServerFailures.java +++ b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpServerFailures.java @@ -85,12 +85,7 @@ Mono> delete505(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head501WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head501(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head501WithResponseAsync(context)); } /** @@ -172,12 +167,7 @@ public void head501() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get501WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get501(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get501WithResponseAsync(context)); } /** @@ -259,13 +249,7 @@ public void get501() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post505WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post505(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post505WithResponseAsync(context)); } /** @@ -348,13 +332,7 @@ public void post505() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete505WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete505(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> delete505WithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpSuccess.java b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpSuccess.java index c08b1c43c9..dd29ad61a0 100644 --- a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpSuccess.java +++ b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/HttpSuccess.java @@ -183,12 +183,7 @@ Mono> head404(@HostParam("$host") String host, @HeaderParam("A */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head200(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head200WithResponseAsync(context)); } /** @@ -270,12 +265,7 @@ public void head200() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get200(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200WithResponseAsync(context)); } /** @@ -358,12 +348,7 @@ public boolean get200() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> options200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.options200(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> options200WithResponseAsync(context)); } /** @@ -446,13 +431,7 @@ public boolean options200() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put200(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put200WithResponseAsync(context)); } /** @@ -535,13 +514,7 @@ public void put200() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch200(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch200WithResponseAsync(context)); } /** @@ -624,13 +597,7 @@ public void patch200() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post200(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post200WithResponseAsync(context)); } /** @@ -713,13 +680,7 @@ public void post200() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete200(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> delete200WithResponseAsync(context)); } /** @@ -802,13 +763,7 @@ public void delete200() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put201WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put201(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put201WithResponseAsync(context)); } /** @@ -891,13 +846,7 @@ public void put201() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post201WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post201(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post201WithResponseAsync(context)); } /** @@ -980,13 +929,7 @@ public void post201() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put202WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put202(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put202WithResponseAsync(context)); } /** @@ -1069,13 +1012,7 @@ public void put202() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch202WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch202(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch202WithResponseAsync(context)); } /** @@ -1158,13 +1095,7 @@ public void patch202() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post202(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post202WithResponseAsync(context)); } /** @@ -1247,13 +1178,7 @@ public void post202() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete202WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete202(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> delete202WithResponseAsync(context)); } /** @@ -1336,12 +1261,7 @@ public void delete202() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head204WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head204(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head204WithResponseAsync(context)); } /** @@ -1423,13 +1343,7 @@ public void head204() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put204WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put204(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> put204WithResponseAsync(context)); } /** @@ -1512,13 +1426,7 @@ public void put204() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch204WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch204(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> patch204WithResponseAsync(context)); } /** @@ -1601,13 +1509,7 @@ public void patch204() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post204WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post204(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> post204WithResponseAsync(context)); } /** @@ -1690,13 +1592,7 @@ public void post204() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete204WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final Boolean booleanValue = true; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete204(this.client.getHost(), booleanValue, accept, context)); + return FluxUtil.withContext(context -> delete204WithResponseAsync(context)); } /** @@ -1779,12 +1675,7 @@ public void delete204() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> head404WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.head404(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> head404WithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/MultipleResponses.java b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/MultipleResponses.java index a65160dd14..b4489b4808 100644 --- a/vanilla-tests/src/main/java/fixtures/httpinfrastructure/MultipleResponses.java +++ b/vanilla-tests/src/main/java/fixtures/httpinfrastructure/MultipleResponses.java @@ -261,13 +261,7 @@ Mono> get200ModelA202Valid(@HostParam("$host") String host */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200Model204NoModelDefaultError200ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get200Model204NoModelDefaultError200Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200Model204NoModelDefaultError200ValidWithResponseAsync(context)); } /** @@ -352,13 +346,7 @@ public MyException get200Model204NoModelDefaultError200Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200Model204NoModelDefaultError204ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get200Model204NoModelDefaultError204Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200Model204NoModelDefaultError204ValidWithResponseAsync(context)); } /** @@ -443,13 +431,7 @@ public MyException get200Model204NoModelDefaultError204Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200Model204NoModelDefaultError201InvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get200Model204NoModelDefaultError201Invalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200Model204NoModelDefaultError201InvalidWithResponseAsync(context)); } /** @@ -534,13 +516,7 @@ public MyException get200Model204NoModelDefaultError201Invalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200Model204NoModelDefaultError202NoneWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get200Model204NoModelDefaultError202None(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200Model204NoModelDefaultError202NoneWithResponseAsync(context)); } /** @@ -625,13 +601,7 @@ public MyException get200Model204NoModelDefaultError202None() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200Model204NoModelDefaultError400ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get200Model204NoModelDefaultError400Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200Model204NoModelDefaultError400ValidWithResponseAsync(context)); } /** @@ -716,13 +686,7 @@ public MyException get200Model204NoModelDefaultError400Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200Model201ModelDefaultError200ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get200Model201ModelDefaultError200Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200Model201ModelDefaultError200ValidWithResponseAsync(context)); } /** @@ -807,13 +771,7 @@ public MyException get200Model201ModelDefaultError200Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200Model201ModelDefaultError201ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get200Model201ModelDefaultError201Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200Model201ModelDefaultError201ValidWithResponseAsync(context)); } /** @@ -898,13 +856,7 @@ public MyException get200Model201ModelDefaultError201Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200Model201ModelDefaultError400ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get200Model201ModelDefaultError400Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200Model201ModelDefaultError400ValidWithResponseAsync(context)); } /** @@ -989,13 +941,8 @@ public MyException get200Model201ModelDefaultError400Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200ModelA201ModelC404ModelDDefaultError200ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .get200ModelA201ModelC404ModelDDefaultError200Valid(this.client.getHost(), accept, context)); + return FluxUtil + .withContext(context -> get200ModelA201ModelC404ModelDDefaultError200ValidWithResponseAsync(context)); } /** @@ -1080,13 +1027,8 @@ public Object get200ModelA201ModelC404ModelDDefaultError200Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200ModelA201ModelC404ModelDDefaultError201ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .get200ModelA201ModelC404ModelDDefaultError201Valid(this.client.getHost(), accept, context)); + return FluxUtil + .withContext(context -> get200ModelA201ModelC404ModelDDefaultError201ValidWithResponseAsync(context)); } /** @@ -1171,13 +1113,8 @@ public Object get200ModelA201ModelC404ModelDDefaultError201Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200ModelA201ModelC404ModelDDefaultError404ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .get200ModelA201ModelC404ModelDDefaultError404Valid(this.client.getHost(), accept, context)); + return FluxUtil + .withContext(context -> get200ModelA201ModelC404ModelDDefaultError404ValidWithResponseAsync(context)); } /** @@ -1262,13 +1199,8 @@ public Object get200ModelA201ModelC404ModelDDefaultError404Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200ModelA201ModelC404ModelDDefaultError400ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .get200ModelA201ModelC404ModelDDefaultError400Valid(this.client.getHost(), accept, context)); + return FluxUtil + .withContext(context -> get200ModelA201ModelC404ModelDDefaultError400ValidWithResponseAsync(context)); } /** @@ -1353,13 +1285,7 @@ public Object get200ModelA201ModelC404ModelDDefaultError400Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get202None204NoneDefaultError202NoneWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get202None204NoneDefaultError202None(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get202None204NoneDefaultError202NoneWithResponseAsync(context)); } /** @@ -1441,13 +1367,7 @@ public void get202None204NoneDefaultError202None() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get202None204NoneDefaultError204NoneWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get202None204NoneDefaultError204None(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get202None204NoneDefaultError204NoneWithResponseAsync(context)); } /** @@ -1529,13 +1449,7 @@ public void get202None204NoneDefaultError204None() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get202None204NoneDefaultError400ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get202None204NoneDefaultError400Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get202None204NoneDefaultError400ValidWithResponseAsync(context)); } /** @@ -1617,12 +1531,7 @@ public void get202None204NoneDefaultError400Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get202None204NoneDefaultNone202InvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil - .withContext(context -> service.get202None204NoneDefaultNone202Invalid(this.client.getHost(), context)); + return FluxUtil.withContext(context -> get202None204NoneDefaultNone202InvalidWithResponseAsync(context)); } /** @@ -1703,12 +1612,7 @@ public void get202None204NoneDefaultNone202Invalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get202None204NoneDefaultNone204NoneWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil - .withContext(context -> service.get202None204NoneDefaultNone204None(this.client.getHost(), context)); + return FluxUtil.withContext(context -> get202None204NoneDefaultNone204NoneWithResponseAsync(context)); } /** @@ -1789,12 +1693,7 @@ public void get202None204NoneDefaultNone204None() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get202None204NoneDefaultNone400NoneWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil - .withContext(context -> service.get202None204NoneDefaultNone400None(this.client.getHost(), context)); + return FluxUtil.withContext(context -> get202None204NoneDefaultNone400NoneWithResponseAsync(context)); } /** @@ -1875,12 +1774,7 @@ public void get202None204NoneDefaultNone400None() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get202None204NoneDefaultNone400InvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil - .withContext(context -> service.get202None204NoneDefaultNone400Invalid(this.client.getHost(), context)); + return FluxUtil.withContext(context -> get202None204NoneDefaultNone400InvalidWithResponseAsync(context)); } /** @@ -1961,13 +1855,7 @@ public void get202None204NoneDefaultNone400Invalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultModelA200ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getDefaultModelA200Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDefaultModelA200ValidWithResponseAsync(context)); } /** @@ -2050,12 +1938,7 @@ public MyException getDefaultModelA200Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultModelA200NoneWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefaultModelA200None(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDefaultModelA200NoneWithResponseAsync(context)); } /** @@ -2138,13 +2021,7 @@ public MyException getDefaultModelA200None() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultModelA400ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getDefaultModelA400Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDefaultModelA400ValidWithResponseAsync(context)); } /** @@ -2226,12 +2103,7 @@ public void getDefaultModelA400Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultModelA400NoneWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefaultModelA400None(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDefaultModelA400NoneWithResponseAsync(context)); } /** @@ -2313,11 +2185,7 @@ public void getDefaultModelA400None() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultNone200InvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.getDefaultNone200Invalid(this.client.getHost(), context)); + return FluxUtil.withContext(context -> getDefaultNone200InvalidWithResponseAsync(context)); } /** @@ -2398,11 +2266,7 @@ public void getDefaultNone200Invalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultNone200NoneWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.getDefaultNone200None(this.client.getHost(), context)); + return FluxUtil.withContext(context -> getDefaultNone200NoneWithResponseAsync(context)); } /** @@ -2483,11 +2347,7 @@ public void getDefaultNone200None() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultNone400InvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.getDefaultNone400Invalid(this.client.getHost(), context)); + return FluxUtil.withContext(context -> getDefaultNone400InvalidWithResponseAsync(context)); } /** @@ -2568,11 +2428,7 @@ public void getDefaultNone400Invalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultNone400NoneWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.getDefaultNone400None(this.client.getHost(), context)); + return FluxUtil.withContext(context -> getDefaultNone400NoneWithResponseAsync(context)); } /** @@ -2654,12 +2510,7 @@ public void getDefaultNone400None() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200ModelA200NoneWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get200ModelA200None(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200ModelA200NoneWithResponseAsync(context)); } /** @@ -2747,12 +2598,7 @@ public MyException get200ModelA200None() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200ModelA200ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get200ModelA200Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200ModelA200ValidWithResponseAsync(context)); } /** @@ -2835,12 +2681,7 @@ public MyException get200ModelA200Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200ModelA200InvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get200ModelA200Invalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200ModelA200InvalidWithResponseAsync(context)); } /** @@ -2923,12 +2764,7 @@ public MyException get200ModelA200Invalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200ModelA400NoneWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get200ModelA400None(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200ModelA400NoneWithResponseAsync(context)); } /** @@ -3011,12 +2847,7 @@ public MyException get200ModelA400None() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200ModelA400ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get200ModelA400Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200ModelA400ValidWithResponseAsync(context)); } /** @@ -3099,12 +2930,7 @@ public MyException get200ModelA400Valid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200ModelA400InvalidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get200ModelA400Invalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200ModelA400InvalidWithResponseAsync(context)); } /** @@ -3187,12 +3013,7 @@ public MyException get200ModelA400Invalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> get200ModelA202ValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get200ModelA202Valid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> get200ModelA202ValidWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/inheritance/passdiscriminator/MetricAlerts.java b/vanilla-tests/src/main/java/fixtures/inheritance/passdiscriminator/MetricAlerts.java index 4f63dbb113..70b95d7149 100644 --- a/vanilla-tests/src/main/java/fixtures/inheritance/passdiscriminator/MetricAlerts.java +++ b/vanilla-tests/src/main/java/fixtures/inheritance/passdiscriminator/MetricAlerts.java @@ -69,12 +69,7 @@ Mono> get(@HostParam("$host") String host, @Header */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/lro/LRORetrys.java b/vanilla-tests/src/main/java/fixtures/lro/LRORetrys.java index e53bd5363e..5c0242f033 100644 --- a/vanilla-tests/src/main/java/fixtures/lro/LRORetrys.java +++ b/vanilla-tests/src/main/java/fixtures/lro/LRORetrys.java @@ -165,16 +165,7 @@ Mono> postAsyncRelativeRetrySucceededNoCustomHeaders(@HostParam(" */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put201CreatingSucceeded200WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.put201CreatingSucceeded200(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> put201CreatingSucceeded200WithResponseAsync(product, context)); } /** @@ -325,16 +316,7 @@ public SyncPoller beginPut201CreatingSucceeded200(Product prod @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetrySucceededWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putAsyncRelativeRetrySucceeded(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncRelativeRetrySucceededWithResponseAsync(product, context)); } /** @@ -487,16 +469,8 @@ public SyncPoller beginPutAsyncRelativeRetrySucceeded(Product */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetrySucceededNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .putAsyncRelativeRetrySucceededNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> putAsyncRelativeRetrySucceededNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -650,13 +624,7 @@ public SyncPoller beginPutAsyncRelativeRetrySucceededNoCustomH @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteProvisioning202Accepted200SucceededWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteProvisioning202Accepted200Succeeded(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteProvisioning202Accepted200SucceededWithResponseAsync(context)); } /** @@ -762,13 +730,8 @@ public SyncPoller beginDeleteProvisioning202Accepted200Succeeded( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteProvisioning202Accepted200SucceededNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .deleteProvisioning202Accepted200SucceededNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil + .withContext(context -> deleteProvisioning202Accepted200SucceededNoCustomHeadersWithResponseAsync(context)); } /** @@ -874,12 +837,7 @@ public SyncPoller beginDeleteProvisioning202Accepted200SucceededN */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete202Retry200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete202Retry200(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete202Retry200WithResponseAsync(context)); } /** @@ -977,13 +935,7 @@ public SyncPoller beginDelete202Retry200(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete202Retry200NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete202Retry200NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete202Retry200NoCustomHeadersWithResponseAsync(context)); } /** @@ -1082,13 +1034,7 @@ public SyncPoller beginDelete202Retry200NoCustomHeaders(Contex @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRelativeRetrySucceededWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteAsyncRelativeRetrySucceeded(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRelativeRetrySucceededWithResponseAsync(context)); } /** @@ -1187,13 +1133,8 @@ public SyncPoller beginDeleteAsyncRelativeRetrySucceeded(Conte */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRelativeRetrySucceededNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .deleteAsyncRelativeRetrySucceededNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil + .withContext(context -> deleteAsyncRelativeRetrySucceededNoCustomHeadersWithResponseAsync(context)); } /** @@ -1294,16 +1235,7 @@ public SyncPoller beginDeleteAsyncRelativeRetrySucceededNoCust */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202Retry200WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.post202Retry200(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202Retry200WithResponseAsync(product, context)); } /** @@ -1445,16 +1377,7 @@ public SyncPoller beginPost202Retry200(Product product, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202Retry200NoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post202Retry200NoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202Retry200NoCustomHeadersWithResponseAsync(product, context)); } /** @@ -1601,16 +1524,7 @@ public SyncPoller beginPost202Retry200NoCustomHeaders(Pr @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRelativeRetrySucceededWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postAsyncRelativeRetrySucceeded(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postAsyncRelativeRetrySucceededWithResponseAsync(product, context)); } /** @@ -1764,16 +1678,8 @@ public SyncPoller beginPostAsyncRelativeRetrySucceeded(P */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRelativeRetrySucceededNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .postAsyncRelativeRetrySucceededNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> postAsyncRelativeRetrySucceededNoCustomHeadersWithResponseAsync(product, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/lro/LROs.java b/vanilla-tests/src/main/java/fixtures/lro/LROs.java index ff5a05571a..913535ccc0 100644 --- a/vanilla-tests/src/main/java/fixtures/lro/LROs.java +++ b/vanilla-tests/src/main/java/fixtures/lro/LROs.java @@ -550,16 +550,7 @@ Mono> postAsyncRetrycanceledNoCustomHeaders(@HostParam("$host") S */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put200SucceededWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put200Succeeded(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> put200SucceededWithResponseAsync(product, context)); } /** @@ -707,16 +698,7 @@ public SyncPoller beginPut200Succeeded(Product product, Contex @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch200SucceededIgnoreHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.patch200SucceededIgnoreHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> patch200SucceededIgnoreHeadersWithResponseAsync(product, context)); } /** @@ -861,16 +843,8 @@ public SyncPoller beginPatch200SucceededIgnoreHeaders(Product */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch200SucceededIgnoreHeadersNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .patch200SucceededIgnoreHeadersNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> patch200SucceededIgnoreHeadersNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -1017,16 +991,7 @@ public SyncPoller beginPatch200SucceededIgnoreHeadersNoCustomH @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch201RetryWithAsyncHeaderWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.patch201RetryWithAsyncHeader(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> patch201RetryWithAsyncHeaderWithResponseAsync(product, context)); } /** @@ -1163,16 +1128,8 @@ public SyncPoller beginPatch201RetryWithAsyncHeader(Product pr */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch201RetryWithAsyncHeaderNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .patch201RetryWithAsyncHeaderNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> patch201RetryWithAsyncHeaderNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -1312,16 +1269,8 @@ public SyncPoller beginPatch201RetryWithAsyncHeaderNoCustomHea @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch202RetryWithAsyncAndLocationHeaderWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch202RetryWithAsyncAndLocationHeader(this.client.getHost(), - product, accept, context)); + return FluxUtil + .withContext(context -> patch202RetryWithAsyncAndLocationHeaderWithResponseAsync(product, context)); } /** @@ -1460,16 +1409,8 @@ public SyncPoller beginPatch202RetryWithAsyncAndLocationHeader @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patch202RetryWithAsyncAndLocationHeaderNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .patch202RetryWithAsyncAndLocationHeaderNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext( + context -> patch202RetryWithAsyncAndLocationHeaderNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -1611,16 +1552,7 @@ public SyncPoller beginPatch202RetryWithAsyncAndLocationHeader */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put201SucceededWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put201Succeeded(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> put201SucceededWithResponseAsync(product, context)); } /** @@ -1759,12 +1691,7 @@ public SyncPoller beginPut201Succeeded(Product product, Contex */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> post202ListWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post202List(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> post202ListWithResponseAsync(context)); } /** @@ -1861,13 +1788,7 @@ public SyncPoller, List> beginPost202List(Context context */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> post202ListNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.post202ListNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> post202ListNoCustomHeadersWithResponseAsync(context)); } /** @@ -1966,16 +1887,7 @@ public SyncPoller, List> beginPost202ListNoCustomHeaders( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put200SucceededNoStateWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put200SucceededNoState(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> put200SucceededNoStateWithResponseAsync(product, context)); } /** @@ -2117,15 +2029,7 @@ public SyncPoller beginPut200SucceededNoState(Product product, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put202Retry200WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put202Retry200(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> put202Retry200WithResponseAsync(product, context)); } /** @@ -2267,16 +2171,7 @@ public SyncPoller beginPut202Retry200(Product product, Context */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put201CreatingSucceeded200WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.put201CreatingSucceeded200(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> put201CreatingSucceeded200WithResponseAsync(product, context)); } /** @@ -2426,16 +2321,7 @@ public SyncPoller beginPut201CreatingSucceeded200(Product prod */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put200UpdatingSucceeded204WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.put200UpdatingSucceeded204(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> put200UpdatingSucceeded204WithResponseAsync(product, context)); } /** @@ -2585,16 +2471,7 @@ public SyncPoller beginPut200UpdatingSucceeded204(Product prod */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put201CreatingFailed200WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put201CreatingFailed200(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> put201CreatingFailed200WithResponseAsync(product, context)); } /** @@ -2744,16 +2621,7 @@ public SyncPoller beginPut201CreatingFailed200(Product product */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put200Acceptedcanceled200WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put200Acceptedcanceled200(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> put200Acceptedcanceled200WithResponseAsync(product, context)); } /** @@ -2903,16 +2771,7 @@ public SyncPoller beginPut200Acceptedcanceled200(Product produ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNoHeaderInRetryWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putNoHeaderInRetry(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putNoHeaderInRetryWithResponseAsync(product, context)); } /** @@ -3055,16 +2914,7 @@ public SyncPoller beginPutNoHeaderInRetry(Product product, Con */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNoHeaderInRetryNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putNoHeaderInRetryNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putNoHeaderInRetryNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -3211,16 +3061,7 @@ public SyncPoller beginPutNoHeaderInRetryNoCustomHeaders(Produ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRetrySucceededWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putAsyncRetrySucceeded(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncRetrySucceededWithResponseAsync(product, context)); } /** @@ -3371,16 +3212,8 @@ public SyncPoller beginPutAsyncRetrySucceeded(Product product, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRetrySucceededNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putAsyncRetrySucceededNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> putAsyncRetrySucceededNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -3535,16 +3368,7 @@ public SyncPoller beginPutAsyncRetrySucceededNoCustomHeaders(P @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncNoRetrySucceededWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putAsyncNoRetrySucceeded(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncNoRetrySucceededWithResponseAsync(product, context)); } /** @@ -3695,16 +3519,8 @@ public SyncPoller beginPutAsyncNoRetrySucceeded(Product produc */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncNoRetrySucceededNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAsyncNoRetrySucceededNoCustomHeaders(this.client.getHost(), - product, accept, context)); + return FluxUtil + .withContext(context -> putAsyncNoRetrySucceededNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -3859,16 +3675,7 @@ public SyncPoller beginPutAsyncNoRetrySucceededNoCustomHeaders @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRetryFailedWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putAsyncRetryFailed(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncRetryFailedWithResponseAsync(product, context)); } /** @@ -4019,16 +3826,7 @@ public SyncPoller beginPutAsyncRetryFailed(Product product, Co */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRetryFailedNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putAsyncRetryFailedNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncRetryFailedNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -4182,16 +3980,7 @@ public SyncPoller beginPutAsyncRetryFailedNoCustomHeaders(Prod @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncNoRetrycanceledWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putAsyncNoRetrycanceled(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncNoRetrycanceledWithResponseAsync(product, context)); } /** @@ -4342,16 +4131,8 @@ public SyncPoller beginPutAsyncNoRetrycanceled(Product product */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncNoRetrycanceledNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putAsyncNoRetrycanceledNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> putAsyncNoRetrycanceledNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -4505,16 +4286,7 @@ public SyncPoller beginPutAsyncNoRetrycanceledNoCustomHeaders( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncNoHeaderInRetryWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putAsyncNoHeaderInRetry(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncNoHeaderInRetryWithResponseAsync(product, context)); } /** @@ -4657,16 +4429,8 @@ public SyncPoller beginPutAsyncNoHeaderInRetry(Product product */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncNoHeaderInRetryNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putAsyncNoHeaderInRetryNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> putAsyncNoHeaderInRetryNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -4811,15 +4575,7 @@ public SyncPoller beginPutAsyncNoHeaderInRetryNoCustomHeaders( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNonResourceWithResponseAsync(Sku sku) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (sku != null) { - sku.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putNonResource(this.client.getHost(), sku, accept, context)); + return FluxUtil.withContext(context -> putNonResourceWithResponseAsync(sku, context)); } /** @@ -4952,16 +4708,7 @@ public SyncPoller beginPutNonResource(Sku sku, Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncNonResourceWithResponseAsync(Sku sku) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (sku != null) { - sku.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putAsyncNonResource(this.client.getHost(), sku, accept, context)); + return FluxUtil.withContext(context -> putAsyncNonResourceWithResponseAsync(sku, context)); } /** @@ -5094,15 +4841,7 @@ public SyncPoller beginPutAsyncNonResource(Sku sku, Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putSubResourceWithResponseAsync(SubProduct product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putSubResource(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putSubResourceWithResponseAsync(product, context)); } /** @@ -5235,16 +4974,7 @@ public SyncPoller beginPutSubResource(SubProduct product */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncSubResourceWithResponseAsync(SubProduct product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putAsyncSubResource(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncSubResourceWithResponseAsync(product, context)); } /** @@ -5379,13 +5109,7 @@ public SyncPoller beginPutAsyncSubResource(SubProduct pr @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteProvisioning202Accepted200SucceededWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteProvisioning202Accepted200Succeeded(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteProvisioning202Accepted200SucceededWithResponseAsync(context)); } /** @@ -5490,14 +5214,9 @@ public SyncPoller beginDeleteProvisioning202Accepted200Succeeded( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteProvisioning202Accepted200SucceededNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .deleteProvisioning202Accepted200SucceededNoCustomHeaders(this.client.getHost(), accept, context)); + public Mono> deleteProvisioning202Accepted200SucceededNoCustomHeadersWithResponseAsync() { + return FluxUtil + .withContext(context -> deleteProvisioning202Accepted200SucceededNoCustomHeadersWithResponseAsync(context)); } /** @@ -5605,13 +5324,7 @@ public SyncPoller beginDeleteProvisioning202Accepted200SucceededN @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteProvisioning202DeletingFailed200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteProvisioning202DeletingFailed200(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteProvisioning202DeletingFailed200WithResponseAsync(context)); } /** @@ -5717,13 +5430,8 @@ public SyncPoller beginDeleteProvisioning202DeletingFailed200(Con */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteProvisioning202DeletingFailed200NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .deleteProvisioning202DeletingFailed200NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil + .withContext(context -> deleteProvisioning202DeletingFailed200NoCustomHeadersWithResponseAsync(context)); } /** @@ -5830,13 +5538,7 @@ public SyncPoller beginDeleteProvisioning202DeletingFailed200NoCu @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteProvisioning202Deletingcanceled200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteProvisioning202Deletingcanceled200(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteProvisioning202Deletingcanceled200WithResponseAsync(context)); } /** @@ -5942,13 +5644,8 @@ public SyncPoller beginDeleteProvisioning202Deletingcanceled200(C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteProvisioning202Deletingcanceled200NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .deleteProvisioning202Deletingcanceled200NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil + .withContext(context -> deleteProvisioning202Deletingcanceled200NoCustomHeadersWithResponseAsync(context)); } /** @@ -6053,12 +5750,7 @@ public SyncPoller beginDeleteProvisioning202Deletingcanceled200No */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete204SucceededWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete204Succeeded(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete204SucceededWithResponseAsync(context)); } /** @@ -6150,12 +5842,7 @@ public SyncPoller beginDelete204Succeeded(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete202Retry200WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete202Retry200(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete202Retry200WithResponseAsync(context)); } /** @@ -6253,13 +5940,7 @@ public SyncPoller beginDelete202Retry200(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete202Retry200NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete202Retry200NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete202Retry200NoCustomHeadersWithResponseAsync(context)); } /** @@ -6357,12 +6038,7 @@ public SyncPoller beginDelete202Retry200NoCustomHeaders(Context c */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete202NoRetry204WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete202NoRetry204(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete202NoRetry204WithResponseAsync(context)); } /** @@ -6460,13 +6136,7 @@ public SyncPoller beginDelete202NoRetry204(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete202NoRetry204NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete202NoRetry204NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete202NoRetry204NoCustomHeadersWithResponseAsync(context)); } /** @@ -6565,12 +6235,7 @@ public SyncPoller beginDelete202NoRetry204NoCustomHeaders(Context */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteNoHeaderInRetryWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteNoHeaderInRetry(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteNoHeaderInRetryWithResponseAsync(context)); } /** @@ -6668,13 +6333,7 @@ public SyncPoller beginDeleteNoHeaderInRetry(Context context) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteNoHeaderInRetryNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteNoHeaderInRetryNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteNoHeaderInRetryNoCustomHeadersWithResponseAsync(context)); } /** @@ -6774,13 +6433,7 @@ public SyncPoller beginDeleteNoHeaderInRetryNoCustomHeaders(Co @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncNoHeaderInRetryWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteAsyncNoHeaderInRetry(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncNoHeaderInRetryWithResponseAsync(context)); } /** @@ -6878,13 +6531,7 @@ public SyncPoller beginDeleteAsyncNoHeaderInRetry(Context cont */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncNoHeaderInRetryNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteAsyncNoHeaderInRetryNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncNoHeaderInRetryNoCustomHeadersWithResponseAsync(context)); } /** @@ -6983,13 +6630,7 @@ public SyncPoller beginDeleteAsyncNoHeaderInRetryNoCustomHeade */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRetrySucceededWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteAsyncRetrySucceeded(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRetrySucceededWithResponseAsync(context)); } /** @@ -7087,13 +6728,7 @@ public SyncPoller beginDeleteAsyncRetrySucceeded(Context conte */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRetrySucceededNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteAsyncRetrySucceededNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRetrySucceededNoCustomHeadersWithResponseAsync(context)); } /** @@ -7193,13 +6828,7 @@ public SyncPoller beginDeleteAsyncRetrySucceededNoCustomHeader @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncNoRetrySucceededWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteAsyncNoRetrySucceeded(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncNoRetrySucceededWithResponseAsync(context)); } /** @@ -7298,13 +6927,7 @@ public SyncPoller beginDeleteAsyncNoRetrySucceeded(Context con */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncNoRetrySucceededNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteAsyncNoRetrySucceededNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncNoRetrySucceededNoCustomHeadersWithResponseAsync(context)); } /** @@ -7403,12 +7026,7 @@ public SyncPoller beginDeleteAsyncNoRetrySucceededNoCustomHead */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRetryFailedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteAsyncRetryFailed(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRetryFailedWithResponseAsync(context)); } /** @@ -7506,13 +7124,7 @@ public SyncPoller beginDeleteAsyncRetryFailed(Context context) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRetryFailedNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteAsyncRetryFailedNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRetryFailedNoCustomHeadersWithResponseAsync(context)); } /** @@ -7611,13 +7223,7 @@ public SyncPoller beginDeleteAsyncRetryFailedNoCustomHeaders(C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRetrycanceledWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteAsyncRetrycanceled(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRetrycanceledWithResponseAsync(context)); } /** @@ -7715,13 +7321,7 @@ public SyncPoller beginDeleteAsyncRetrycanceled(Context contex */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRetrycanceledNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteAsyncRetrycanceledNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRetrycanceledNoCustomHeadersWithResponseAsync(context)); } /** @@ -7820,12 +7420,7 @@ public SyncPoller beginDeleteAsyncRetrycanceledNoCustomHeaders */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post200WithPayloadWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post200WithPayload(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> post200WithPayloadWithResponseAsync(context)); } /** @@ -7924,16 +7519,7 @@ public SyncPoller beginPost200WithPayload(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202Retry200WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.post202Retry200(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202Retry200WithResponseAsync(product, context)); } /** @@ -8075,16 +7661,7 @@ public SyncPoller beginPost202Retry200(Product product, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202Retry200NoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post202Retry200NoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202Retry200NoCustomHeadersWithResponseAsync(product, context)); } /** @@ -8230,16 +7807,7 @@ public SyncPoller beginPost202Retry200NoCustomHeaders(Pr @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202NoRetry204WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.post202NoRetry204(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202NoRetry204WithResponseAsync(product, context)); } /** @@ -8381,16 +7949,7 @@ public SyncPoller beginPost202NoRetry204(Product product, Cont */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202NoRetry204NoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post202NoRetry204NoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202NoRetry204NoCustomHeadersWithResponseAsync(product, context)); } /** @@ -8532,13 +8091,7 @@ public SyncPoller beginPost202NoRetry204NoCustomHeaders(Produc */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postDoubleHeadersFinalLocationGetWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.postDoubleHeadersFinalLocationGet(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> postDoubleHeadersFinalLocationGetWithResponseAsync(context)); } /** @@ -8636,13 +8189,7 @@ public SyncPoller beginPostDoubleHeadersFinalLocationGet(Conte */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postDoubleHeadersFinalAzureHeaderGetWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postDoubleHeadersFinalAzureHeaderGet(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> postDoubleHeadersFinalAzureHeaderGetWithResponseAsync(context)); } /** @@ -8742,13 +8289,7 @@ public SyncPoller beginPostDoubleHeadersFinalAzureHeaderGet(Co */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postDoubleHeadersFinalAzureHeaderGetDefaultWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postDoubleHeadersFinalAzureHeaderGetDefault(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> postDoubleHeadersFinalAzureHeaderGetDefaultWithResponseAsync(context)); } /** @@ -8856,16 +8397,7 @@ public SyncPoller beginPostDoubleHeadersFinalAzureHeaderGetDef @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRetrySucceededWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.postAsyncRetrySucceeded(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postAsyncRetrySucceededWithResponseAsync(product, context)); } /** @@ -9016,16 +8548,8 @@ public SyncPoller beginPostAsyncRetrySucceeded(Product product */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRetrySucceededNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postAsyncRetrySucceededNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> postAsyncRetrySucceededNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -9180,16 +8704,7 @@ public SyncPoller beginPostAsyncRetrySucceededNoCustomHeaders( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncNoRetrySucceededWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.postAsyncNoRetrySucceeded(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postAsyncNoRetrySucceededWithResponseAsync(product, context)); } /** @@ -9340,16 +8855,8 @@ public SyncPoller beginPostAsyncNoRetrySucceeded(Product produ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncNoRetrySucceededNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postAsyncNoRetrySucceededNoCustomHeaders(this.client.getHost(), - product, accept, context)); + return FluxUtil + .withContext(context -> postAsyncNoRetrySucceededNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -9505,16 +9012,7 @@ public SyncPoller beginPostAsyncNoRetrySucceededNoCustomHeader @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRetryFailedWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.postAsyncRetryFailed(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postAsyncRetryFailedWithResponseAsync(product, context)); } /** @@ -9665,16 +9163,7 @@ public SyncPoller beginPostAsyncRetryFailed(Product prod */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRetryFailedNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postAsyncRetryFailedNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postAsyncRetryFailedNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -9829,16 +9318,7 @@ public SyncPoller beginPostAsyncRetryFailedNoCustomHeade @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRetrycanceledWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.postAsyncRetrycanceled(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postAsyncRetrycanceledWithResponseAsync(product, context)); } /** @@ -9989,16 +9469,8 @@ public SyncPoller beginPostAsyncRetrycanceled(Product pr */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRetrycanceledNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postAsyncRetrycanceledNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> postAsyncRetrycanceledNoCustomHeadersWithResponseAsync(product, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/lro/LROsCustomHeaders.java b/vanilla-tests/src/main/java/fixtures/lro/LROsCustomHeaders.java index 9971a76d86..fd7059df87 100644 --- a/vanilla-tests/src/main/java/fixtures/lro/LROsCustomHeaders.java +++ b/vanilla-tests/src/main/java/fixtures/lro/LROsCustomHeaders.java @@ -127,16 +127,7 @@ Mono> postAsyncRetrySucceededNoCustomHeaders(@HostParam("$host") @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRetrySucceededWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putAsyncRetrySucceeded(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncRetrySucceededWithResponseAsync(product, context)); } /** @@ -295,16 +286,8 @@ public SyncPoller beginPutAsyncRetrySucceeded(Product product, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRetrySucceededNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putAsyncRetrySucceededNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> putAsyncRetrySucceededNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -466,16 +449,7 @@ public SyncPoller beginPutAsyncRetrySucceededNoCustomHeaders(P */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put201CreatingSucceeded200WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.put201CreatingSucceeded200(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> put201CreatingSucceeded200WithResponseAsync(product, context)); } /** @@ -633,16 +607,7 @@ public SyncPoller beginPut201CreatingSucceeded200(Product prod @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202Retry200WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.post202Retry200(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202Retry200WithResponseAsync(product, context)); } /** @@ -792,16 +757,7 @@ public SyncPoller beginPost202Retry200(Product product, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202Retry200NoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post202Retry200NoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202Retry200NoCustomHeadersWithResponseAsync(product, context)); } /** @@ -956,16 +912,7 @@ public SyncPoller beginPost202Retry200NoCustomHeaders(Pr @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRetrySucceededWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.postAsyncRetrySucceeded(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postAsyncRetrySucceededWithResponseAsync(product, context)); } /** @@ -1124,16 +1071,8 @@ public SyncPoller beginPostAsyncRetrySucceeded(Product p */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRetrySucceededNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postAsyncRetrySucceededNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> postAsyncRetrySucceededNoCustomHeadersWithResponseAsync(product, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/lro/LrosaDs.java b/vanilla-tests/src/main/java/fixtures/lro/LrosaDs.java index 475f7806a8..e5d3d6bf76 100644 --- a/vanilla-tests/src/main/java/fixtures/lro/LrosaDs.java +++ b/vanilla-tests/src/main/java/fixtures/lro/LrosaDs.java @@ -383,15 +383,7 @@ Mono> postAsyncRelativeRetryInvalidJsonPollingNoCustomHeaders(@Ho */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNonRetry400WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putNonRetry400(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putNonRetry400WithResponseAsync(product, context)); } /** @@ -524,16 +516,7 @@ public SyncPoller beginPutNonRetry400(Product product, Context */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNonRetry201Creating400WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putNonRetry201Creating400(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putNonRetry201Creating400WithResponseAsync(product, context)); } /** @@ -667,16 +650,7 @@ public SyncPoller beginPutNonRetry201Creating400(Product produ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNonRetry201Creating400InvalidJsonWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putNonRetry201Creating400InvalidJson(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putNonRetry201Creating400InvalidJsonWithResponseAsync(product, context)); } /** @@ -816,16 +790,7 @@ public SyncPoller beginPutNonRetry201Creating400InvalidJson(Pr @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetry400WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putAsyncRelativeRetry400(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncRelativeRetry400WithResponseAsync(product, context)); } /** @@ -968,16 +933,8 @@ public SyncPoller beginPutAsyncRelativeRetry400(Product produc */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetry400NoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAsyncRelativeRetry400NoCustomHeaders(this.client.getHost(), - product, accept, context)); + return FluxUtil + .withContext(context -> putAsyncRelativeRetry400NoCustomHeadersWithResponseAsync(product, context)); } /** @@ -1120,12 +1077,7 @@ public SyncPoller beginPutAsyncRelativeRetry400NoCustomHeaders */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteNonRetry400WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteNonRetry400(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteNonRetry400WithResponseAsync(context)); } /** @@ -1217,13 +1169,7 @@ public SyncPoller beginDeleteNonRetry400(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteNonRetry400NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteNonRetry400NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteNonRetry400NoCustomHeadersWithResponseAsync(context)); } /** @@ -1315,12 +1261,7 @@ public SyncPoller beginDeleteNonRetry400NoCustomHeaders(Contex */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete202NonRetry400WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete202NonRetry400(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete202NonRetry400WithResponseAsync(context)); } /** @@ -1412,13 +1353,7 @@ public SyncPoller beginDelete202NonRetry400(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete202NonRetry400NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.delete202NonRetry400NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete202NonRetry400NoCustomHeadersWithResponseAsync(context)); } /** @@ -1513,13 +1448,7 @@ public SyncPoller beginDelete202NonRetry400NoCustomHeaders(Con @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRelativeRetry400WithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteAsyncRelativeRetry400(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRelativeRetry400WithResponseAsync(context)); } /** @@ -1618,13 +1547,7 @@ public SyncPoller beginDeleteAsyncRelativeRetry400(Context con */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRelativeRetry400NoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteAsyncRelativeRetry400NoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRelativeRetry400NoCustomHeadersWithResponseAsync(context)); } /** @@ -1724,16 +1647,7 @@ public SyncPoller beginDeleteAsyncRelativeRetry400NoCustomHead */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postNonRetry400WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.postNonRetry400(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postNonRetry400WithResponseAsync(product, context)); } /** @@ -1867,16 +1781,7 @@ public SyncPoller beginPostNonRetry400(Product product, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postNonRetry400NoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postNonRetry400NoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postNonRetry400NoCustomHeadersWithResponseAsync(product, context)); } /** @@ -2014,16 +1919,7 @@ public SyncPoller beginPostNonRetry400NoCustomHeaders(Pr @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202NonRetry400WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.post202NonRetry400(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202NonRetry400WithResponseAsync(product, context)); } /** @@ -2158,16 +2054,7 @@ public SyncPoller beginPost202NonRetry400(Product produc */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202NonRetry400NoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post202NonRetry400NoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202NonRetry400NoCustomHeadersWithResponseAsync(product, context)); } /** @@ -2306,16 +2193,7 @@ public SyncPoller beginPost202NonRetry400NoCustomHeaders @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRelativeRetry400WithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.postAsyncRelativeRetry400(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postAsyncRelativeRetry400WithResponseAsync(product, context)); } /** @@ -2458,16 +2336,8 @@ public SyncPoller beginPostAsyncRelativeRetry400(Product */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRelativeRetry400NoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postAsyncRelativeRetry400NoCustomHeaders(this.client.getHost(), - product, accept, context)); + return FluxUtil + .withContext(context -> postAsyncRelativeRetry400NoCustomHeadersWithResponseAsync(product, context)); } /** @@ -2613,16 +2483,8 @@ public SyncPoller beginPostAsyncRelativeRetry400NoCustom */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putError201NoProvisioningStatePayloadWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putError201NoProvisioningStatePayload(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> putError201NoProvisioningStatePayloadWithResponseAsync(product, context)); } /** @@ -2763,16 +2625,7 @@ public SyncPoller beginPutError201NoProvisioningStatePayload(P @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetryNoStatusWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putAsyncRelativeRetryNoStatus(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncRelativeRetryNoStatusWithResponseAsync(product, context)); } /** @@ -2925,16 +2778,8 @@ public SyncPoller beginPutAsyncRelativeRetryNoStatus(Product p */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetryNoStatusNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .putAsyncRelativeRetryNoStatusNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> putAsyncRelativeRetryNoStatusNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -3090,16 +2935,7 @@ public SyncPoller beginPutAsyncRelativeRetryNoStatusNoCustomHe @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetryNoStatusPayloadWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putAsyncRelativeRetryNoStatusPayload(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncRelativeRetryNoStatusPayloadWithResponseAsync(product, context)); } /** @@ -3254,16 +3090,8 @@ public SyncPoller beginPutAsyncRelativeRetryNoStatusPayload(Pr @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetryNoStatusPayloadNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .putAsyncRelativeRetryNoStatusPayloadNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext( + context -> putAsyncRelativeRetryNoStatusPayloadNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -3415,12 +3243,7 @@ public SyncPoller beginPutAsyncRelativeRetryNoStatusPayloadNoC */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete204SucceededWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete204Succeeded(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete204SucceededWithResponseAsync(context)); } /** @@ -3513,13 +3336,7 @@ public SyncPoller beginDelete204Succeeded(Context context) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRelativeRetryNoStatusWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteAsyncRelativeRetryNoStatus(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRelativeRetryNoStatusWithResponseAsync(context)); } /** @@ -3618,13 +3435,8 @@ public SyncPoller beginDeleteAsyncRelativeRetryNoStatus(Contex */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRelativeRetryNoStatusNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteAsyncRelativeRetryNoStatusNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil + .withContext(context -> deleteAsyncRelativeRetryNoStatusNoCustomHeadersWithResponseAsync(context)); } /** @@ -3725,16 +3537,7 @@ public SyncPoller beginDeleteAsyncRelativeRetryNoStatusNoCusto @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202NoLocationWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.post202NoLocation(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202NoLocationWithResponseAsync(product, context)); } /** @@ -3868,16 +3671,7 @@ public SyncPoller beginPost202NoLocation(Product product */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202NoLocationNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post202NoLocationNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202NoLocationNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -4017,16 +3811,7 @@ public SyncPoller beginPost202NoLocationNoCustomHeaders( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRelativeRetryNoPayloadWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postAsyncRelativeRetryNoPayload(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postAsyncRelativeRetryNoPayloadWithResponseAsync(product, context)); } /** @@ -4180,16 +3965,8 @@ public SyncPoller beginPostAsyncRelativeRetryNoPayload(P */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRelativeRetryNoPayloadNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .postAsyncRelativeRetryNoPayloadNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil + .withContext(context -> postAsyncRelativeRetryNoPayloadNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -4343,16 +4120,7 @@ public SyncPoller beginPostAsyncRelativeRetryNoPayloadNo */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put200InvalidJsonWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put200InvalidJson(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> put200InvalidJsonWithResponseAsync(product, context)); } /** @@ -4487,16 +4255,7 @@ public SyncPoller beginPut200InvalidJson(Product product, Cont @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetryInvalidHeaderWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putAsyncRelativeRetryInvalidHeader(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> putAsyncRelativeRetryInvalidHeaderWithResponseAsync(product, context)); } /** @@ -4641,16 +4400,8 @@ public SyncPoller beginPutAsyncRelativeRetryInvalidHeader(Prod */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetryInvalidHeaderNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .putAsyncRelativeRetryInvalidHeaderNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext( + context -> putAsyncRelativeRetryInvalidHeaderNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -4800,16 +4551,8 @@ public SyncPoller beginPutAsyncRelativeRetryInvalidHeaderNoCus @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetryInvalidJsonPollingWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAsyncRelativeRetryInvalidJsonPolling(this.client.getHost(), - product, accept, context)); + return FluxUtil + .withContext(context -> putAsyncRelativeRetryInvalidJsonPollingWithResponseAsync(product, context)); } /** @@ -4964,16 +4707,8 @@ public SyncPoller beginPutAsyncRelativeRetryInvalidJsonPolling @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAsyncRelativeRetryInvalidJsonPollingNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .putAsyncRelativeRetryInvalidJsonPollingNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext( + context -> putAsyncRelativeRetryInvalidJsonPollingNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -5128,13 +4863,7 @@ public SyncPoller beginPutAsyncRelativeRetryInvalidJsonPolling @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete202RetryInvalidHeaderWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete202RetryInvalidHeader(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete202RetryInvalidHeaderWithResponseAsync(context)); } /** @@ -5233,13 +4962,7 @@ public SyncPoller beginDelete202RetryInvalidHeader(Context con */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delete202RetryInvalidHeaderNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.delete202RetryInvalidHeaderNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> delete202RetryInvalidHeaderNoCustomHeadersWithResponseAsync(context)); } /** @@ -5339,13 +5062,7 @@ public SyncPoller beginDelete202RetryInvalidHeaderNoCustomHead @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRelativeRetryInvalidHeaderWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteAsyncRelativeRetryInvalidHeader(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRelativeRetryInvalidHeaderWithResponseAsync(context)); } /** @@ -5445,13 +5162,8 @@ public SyncPoller beginDeleteAsyncRelativeRetryInvalidHeader(C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRelativeRetryInvalidHeaderNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .deleteAsyncRelativeRetryInvalidHeaderNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil + .withContext(context -> deleteAsyncRelativeRetryInvalidHeaderNoCustomHeadersWithResponseAsync(context)); } /** @@ -5552,13 +5264,7 @@ public SyncPoller beginDeleteAsyncRelativeRetryInvalidHeaderNo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRelativeRetryInvalidJsonPollingWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteAsyncRelativeRetryInvalidJsonPolling(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> deleteAsyncRelativeRetryInvalidJsonPollingWithResponseAsync(context)); } /** @@ -5658,13 +5364,8 @@ public SyncPoller beginDeleteAsyncRelativeRetryInvalidJsonPoll */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteAsyncRelativeRetryInvalidJsonPollingNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .deleteAsyncRelativeRetryInvalidJsonPollingNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext( + context -> deleteAsyncRelativeRetryInvalidJsonPollingNoCustomHeadersWithResponseAsync(context)); } /** @@ -5770,16 +5471,7 @@ public SyncPoller beginDeleteAsyncRelativeRetryInvalidJsonPoll @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202RetryInvalidHeaderWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.post202RetryInvalidHeader(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> post202RetryInvalidHeaderWithResponseAsync(product, context)); } /** @@ -5922,16 +5614,8 @@ public SyncPoller beginPost202RetryInvalidHeader(Product */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> post202RetryInvalidHeaderNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post202RetryInvalidHeaderNoCustomHeaders(this.client.getHost(), - product, accept, context)); + return FluxUtil + .withContext(context -> post202RetryInvalidHeaderNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -6079,16 +5763,7 @@ public SyncPoller beginPost202RetryInvalidHeaderNoCustom @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRelativeRetryInvalidHeaderWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postAsyncRelativeRetryInvalidHeader(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext(context -> postAsyncRelativeRetryInvalidHeaderWithResponseAsync(product, context)); } /** @@ -6235,16 +5910,8 @@ public SyncPoller beginPostAsyncRelativeRetryInvalidHead */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRelativeRetryInvalidHeaderNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .postAsyncRelativeRetryInvalidHeaderNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext( + context -> postAsyncRelativeRetryInvalidHeaderNoCustomHeadersWithResponseAsync(product, context)); } /** @@ -6395,16 +6062,8 @@ public SyncPoller beginPostAsyncRelativeRetryInvalidHead @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRelativeRetryInvalidJsonPollingWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postAsyncRelativeRetryInvalidJsonPolling(this.client.getHost(), - product, accept, context)); + return FluxUtil + .withContext(context -> postAsyncRelativeRetryInvalidJsonPollingWithResponseAsync(product, context)); } /** @@ -6560,16 +6219,8 @@ public SyncPoller beginPostAsyncRelativeRetryInvalidJson @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postAsyncRelativeRetryInvalidJsonPollingNoCustomHeadersWithResponseAsync(Product product) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (product != null) { - product.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service - .postAsyncRelativeRetryInvalidJsonPollingNoCustomHeaders(this.client.getHost(), product, accept, context)); + return FluxUtil.withContext( + context -> postAsyncRelativeRetryInvalidJsonPollingNoCustomHeadersWithResponseAsync(product, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/mediatypes/MediaTypesClient.java b/vanilla-tests/src/main/java/fixtures/mediatypes/MediaTypesClient.java index 012a6fb79b..fb61a06576 100644 --- a/vanilla-tests/src/main/java/fixtures/mediatypes/MediaTypesClient.java +++ b/vanilla-tests/src/main/java/fixtures/mediatypes/MediaTypesClient.java @@ -258,15 +258,8 @@ Mono> putTextAndJsonBody(@HostParam("$host") String host, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> analyzeBodyWithResponseAsync(ContentType contentType, Flux input, Long contentLength) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.analyzeBody(this.getHost(), contentType, input, contentLength, accept, context)); + return FluxUtil + .withContext(context -> analyzeBodyWithResponseAsync(contentType, input, contentLength, context)); } /** @@ -411,15 +404,8 @@ public String analyzeBody(ContentType contentType) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> analyzeBodyWithResponseAsync(ContentType contentType, BinaryData input, Long contentLength) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.analyzeBody(this.getHost(), contentType, input, contentLength, accept, context)); + return FluxUtil + .withContext(context -> analyzeBodyWithResponseAsync(contentType, input, contentLength, context)); } /** @@ -528,17 +514,7 @@ public String analyzeBody(ContentType contentType, BinaryData input, Long conten */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> analyzeBodyWithResponseAsync(String source) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - SourcePath inputInternal = null; - if (source != null) { - inputInternal = new SourcePath(); - inputInternal.setSource(source); - } - SourcePath input = inputInternal; - return FluxUtil.withContext(context -> service.analyzeBody(this.getHost(), input, accept, context)); + return FluxUtil.withContext(context -> analyzeBodyWithResponseAsync(source, context)); } /** @@ -664,14 +640,8 @@ public String analyzeBody() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> analyzeBodyNoAcceptHeaderWithResponseAsync(ContentType contentType, Flux input, Long contentLength) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } return FluxUtil.withContext( - context -> service.analyzeBodyNoAcceptHeader(this.getHost(), contentType, input, contentLength, context)); + context -> analyzeBodyNoAcceptHeaderWithResponseAsync(contentType, input, contentLength, context)); } /** @@ -814,14 +784,8 @@ public void analyzeBodyNoAcceptHeader(ContentType contentType) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> analyzeBodyNoAcceptHeaderWithResponseAsync(ContentType contentType, BinaryData input, Long contentLength) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } return FluxUtil.withContext( - context -> service.analyzeBodyNoAcceptHeader(this.getHost(), contentType, input, contentLength, context)); + context -> analyzeBodyNoAcceptHeaderWithResponseAsync(contentType, input, contentLength, context)); } /** @@ -928,16 +892,7 @@ public void analyzeBodyNoAcceptHeader(ContentType contentType, BinaryData input, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> analyzeBodyNoAcceptHeaderWithResponseAsync(String source) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - SourcePath inputInternal = null; - if (source != null) { - inputInternal = new SourcePath(); - inputInternal.setSource(source); - } - SourcePath input = inputInternal; - return FluxUtil.withContext(context -> service.analyzeBodyNoAcceptHeader(this.getHost(), input, context)); + return FluxUtil.withContext(context -> analyzeBodyNoAcceptHeaderWithResponseAsync(source, context)); } /** @@ -1057,11 +1012,7 @@ public void analyzeBodyNoAcceptHeader() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> contentTypeWithEncodingWithResponseAsync(String input) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.contentTypeWithEncoding(this.getHost(), input, accept, context)); + return FluxUtil.withContext(context -> contentTypeWithEncodingWithResponseAsync(input, context)); } /** @@ -1183,18 +1134,8 @@ public String contentTypeWithEncoding() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> binaryBodyWithTwoContentTypesWithResponseAsync(ContentType1 contentType, Flux message, long contentLength) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } - if (message == null) { - return Mono.error(new IllegalArgumentException("Parameter message is required and cannot be null.")); - } - final String accept = "text/plain"; - return FluxUtil.withContext(context -> service.binaryBodyWithTwoContentTypes(this.getHost(), contentType, - message, contentLength, accept, context)); + return FluxUtil.withContext( + context -> binaryBodyWithTwoContentTypesWithResponseAsync(contentType, message, contentLength, context)); } /** @@ -1318,18 +1259,8 @@ public String binaryBodyWithTwoContentTypes(ContentType1 contentType, Flux> binaryBodyWithTwoContentTypesWithResponseAsync(ContentType1 contentType, BinaryData message, long contentLength) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } - if (message == null) { - return Mono.error(new IllegalArgumentException("Parameter message is required and cannot be null.")); - } - final String accept = "text/plain"; - return FluxUtil.withContext(context -> service.binaryBodyWithTwoContentTypes(this.getHost(), contentType, - message, contentLength, accept, context)); + return FluxUtil.withContext( + context -> binaryBodyWithTwoContentTypesWithResponseAsync(contentType, message, contentLength, context)); } /** @@ -1452,18 +1383,8 @@ public String binaryBodyWithTwoContentTypes(ContentType1 contentType, BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Mono> binaryBodyWithThreeContentTypesWithResponseAsync(ContentType2 contentType, Flux message, long contentLength) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } - if (message == null) { - return Mono.error(new IllegalArgumentException("Parameter message is required and cannot be null.")); - } - final String accept = "text/plain"; - return FluxUtil.withContext(context -> service.binaryBodyWithThreeContentTypes(this.getHost(), contentType, - message, contentLength, accept, context)); + return FluxUtil.withContext( + context -> binaryBodyWithThreeContentTypesWithResponseAsync(contentType, message, contentLength, context)); } /** @@ -1588,18 +1509,8 @@ public String binaryBodyWithThreeContentTypes(ContentType2 contentType, Flux> binaryBodyWithThreeContentTypesWithResponseAsync(ContentType2 contentType, BinaryData message, long contentLength) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } - if (message == null) { - return Mono.error(new IllegalArgumentException("Parameter message is required and cannot be null.")); - } - final String accept = "text/plain"; - return FluxUtil.withContext(context -> service.binaryBodyWithThreeContentTypes(this.getHost(), contentType, - message, contentLength, accept, context)); + return FluxUtil.withContext( + context -> binaryBodyWithThreeContentTypesWithResponseAsync(contentType, message, contentLength, context)); } /** @@ -1722,15 +1633,7 @@ public String binaryBodyWithThreeContentTypes(ContentType2 contentType, BinaryDa */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> bodyThreeTypesWithResponseAsync(Flux message, long contentLength) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (message == null) { - return Mono.error(new IllegalArgumentException("Parameter message is required and cannot be null.")); - } - final String accept = "text/plain"; - return FluxUtil - .withContext(context -> service.bodyThreeTypes(this.getHost(), message, contentLength, accept, context)); + return FluxUtil.withContext(context -> bodyThreeTypesWithResponseAsync(message, contentLength, context)); } /** @@ -1844,15 +1747,7 @@ public String bodyThreeTypes(Flux message, long contentLength) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> bodyThreeTypesWithResponseAsync(BinaryData message, long contentLength) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (message == null) { - return Mono.error(new IllegalArgumentException("Parameter message is required and cannot be null.")); - } - final String accept = "text/plain"; - return FluxUtil - .withContext(context -> service.bodyThreeTypes(this.getHost(), message, contentLength, accept, context)); + return FluxUtil.withContext(context -> bodyThreeTypesWithResponseAsync(message, contentLength, context)); } /** @@ -1965,14 +1860,7 @@ public String bodyThreeTypes(BinaryData message, long contentLength) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> bodyThreeTypesWithResponseAsync(String message) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (message == null) { - return Mono.error(new IllegalArgumentException("Parameter message is required and cannot be null.")); - } - final String accept = "text/plain"; - return FluxUtil.withContext(context -> service.bodyThreeTypes(this.getHost(), message, accept, context)); + return FluxUtil.withContext(context -> bodyThreeTypesWithResponseAsync(message, context)); } /** @@ -2078,14 +1966,7 @@ public String bodyThreeTypes(String message) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> bodyThreeTypesWithResponseAsync(Object message) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (message == null) { - return Mono.error(new IllegalArgumentException("Parameter message is required and cannot be null.")); - } - final String accept = "text/plain"; - return FluxUtil.withContext(context -> service.bodyThreeTypes(this.getHost(), message, accept, context)); + return FluxUtil.withContext(context -> bodyThreeTypesWithResponseAsync(message, context)); } /** @@ -2190,18 +2071,7 @@ public String bodyThreeTypes(Object message) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putTextAndJsonBodyWithResponseAsync(ContentType3 contentType, String message) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } - if (message == null) { - return Mono.error(new IllegalArgumentException("Parameter message is required and cannot be null.")); - } - final String accept = "text/plain"; - return FluxUtil - .withContext(context -> service.putTextAndJsonBody(this.getHost(), contentType, message, accept, context)); + return FluxUtil.withContext(context -> putTextAndJsonBodyWithResponseAsync(contentType, message, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/modelflattening/AutoRestResourceFlatteningTestService.java b/vanilla-tests/src/main/java/fixtures/modelflattening/AutoRestResourceFlatteningTestService.java index fbbd241817..379fee1f3c 100644 --- a/vanilla-tests/src/main/java/fixtures/modelflattening/AutoRestResourceFlatteningTestService.java +++ b/vanilla-tests/src/main/java/fixtures/modelflattening/AutoRestResourceFlatteningTestService.java @@ -218,14 +218,7 @@ Mono> putSimpleProductWithGrouping(@HostParam("$host") S */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putArrayWithResponseAsync(List resourceArray) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (resourceArray != null) { - resourceArray.forEach(e -> e.validate()); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putArray(this.getHost(), resourceArray, accept, context)); + return FluxUtil.withContext(context -> putArrayWithResponseAsync(resourceArray, context)); } /** @@ -341,11 +334,7 @@ public void putArray() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getArrayWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getArray(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getArrayWithResponseAsync(context)); } /** @@ -430,14 +419,7 @@ public List getArray() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWrappedArrayWithResponseAsync(List resourceArray) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (resourceArray != null) { - resourceArray.forEach(e -> e.validate()); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putWrappedArray(this.getHost(), resourceArray, accept, context)); + return FluxUtil.withContext(context -> putWrappedArrayWithResponseAsync(resourceArray, context)); } /** @@ -561,11 +543,7 @@ public void putWrappedArray() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getWrappedArrayWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getWrappedArray(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWrappedArrayWithResponseAsync(context)); } /** @@ -654,19 +632,7 @@ public List getWrappedArray() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDictionaryWithResponseAsync(Map resourceDictionary) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (resourceDictionary != null) { - resourceDictionary.values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDictionary(this.getHost(), resourceDictionary, accept, context)); + return FluxUtil.withContext(context -> putDictionaryWithResponseAsync(resourceDictionary, context)); } /** @@ -787,11 +753,7 @@ public void putDictionary() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getDictionaryWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDictionary(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDictionaryWithResponseAsync(context)); } /** @@ -875,15 +837,7 @@ public Map getDictionary() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putResourceCollectionWithResponseAsync(ResourceCollection resourceComplexObject) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (resourceComplexObject != null) { - resourceComplexObject.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putResourceCollection(this.getHost(), resourceComplexObject, accept, context)); + return FluxUtil.withContext(context -> putResourceCollectionWithResponseAsync(resourceComplexObject, context)); } /** @@ -1001,11 +955,7 @@ public void putResourceCollection() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getResourceCollectionWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getResourceCollection(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getResourceCollectionWithResponseAsync(context)); } /** @@ -1090,15 +1040,7 @@ public ResourceCollection getResourceCollection() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putSimpleProductWithResponseAsync(SimpleProduct simpleBodyProduct) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (simpleBodyProduct != null) { - simpleBodyProduct.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putSimpleProduct(this.getHost(), simpleBodyProduct, accept, context)); + return FluxUtil.withContext(context -> putSimpleProductWithResponseAsync(simpleBodyProduct, context)); } /** @@ -1228,30 +1170,8 @@ public SimpleProduct putSimpleProduct() { public Mono> postFlattenedSimpleProductWithResponseAsync(String productId, String description, String maxProductDisplayName, SimpleProductPropertiesMaxProductCapacity capacity, String genericValue, String odataValue) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (productId == null) { - return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); - } - final String accept = "application/json"; - SimpleProduct simpleBodyProductInternal = null; - if (description != null - || maxProductDisplayName != null - || capacity != null - || genericValue != null - || odataValue != null) { - simpleBodyProductInternal = new SimpleProduct(); - simpleBodyProductInternal.setProductId(productId); - simpleBodyProductInternal.setDescription(description); - simpleBodyProductInternal.setMaxProductDisplayName(maxProductDisplayName); - simpleBodyProductInternal.setCapacity(capacity); - simpleBodyProductInternal.setGenericValue(genericValue); - simpleBodyProductInternal.setOdataValue(odataValue); - } - SimpleProduct simpleBodyProduct = simpleBodyProductInternal; - return FluxUtil.withContext( - context -> service.postFlattenedSimpleProduct(this.getHost(), simpleBodyProduct, accept, context)); + return FluxUtil.withContext(context -> postFlattenedSimpleProductWithResponseAsync(productId, description, + maxProductDisplayName, capacity, genericValue, odataValue, context)); } /** @@ -1446,26 +1366,8 @@ public SimpleProduct postFlattenedSimpleProduct(String productId) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putSimpleProductWithGroupingWithResponseAsync(FlattenParameterGroup flattenParameterGroup) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (flattenParameterGroup == null) { - return Mono - .error(new IllegalArgumentException("Parameter flattenParameterGroup is required and cannot be null.")); - } else { - flattenParameterGroup.validate(); - } - final String accept = "application/json"; - String name = flattenParameterGroup.getName(); - SimpleProduct simpleBodyProduct = new SimpleProduct(); - simpleBodyProduct.setProductId(flattenParameterGroup.getProductId()); - simpleBodyProduct.setDescription(flattenParameterGroup.getDescription()); - simpleBodyProduct.setMaxProductDisplayName(flattenParameterGroup.getMaxProductDisplayName()); - simpleBodyProduct.setCapacity(flattenParameterGroup.getCapacity()); - simpleBodyProduct.setGenericValue(flattenParameterGroup.getGenericValue()); - simpleBodyProduct.setOdataValue(flattenParameterGroup.getOdataValue()); - return FluxUtil.withContext( - context -> service.putSimpleProductWithGrouping(this.getHost(), name, simpleBodyProduct, accept, context)); + return FluxUtil + .withContext(context -> putSimpleProductWithGroupingWithResponseAsync(flattenParameterGroup, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/multipleinheritance/MultipleInheritanceServiceClient.java b/vanilla-tests/src/main/java/fixtures/multipleinheritance/MultipleInheritanceServiceClient.java index 6fba51ff22..7bbfb073ab 100644 --- a/vanilla-tests/src/main/java/fixtures/multipleinheritance/MultipleInheritanceServiceClient.java +++ b/vanilla-tests/src/main/java/fixtures/multipleinheritance/MultipleInheritanceServiceClient.java @@ -198,11 +198,7 @@ Mono> putKitten(@HostParam("$host") String host, @BodyParam("ap */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getHorseWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getHorse(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getHorseWithResponseAsync(context)); } /** @@ -287,16 +283,7 @@ public Horse getHorse() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putHorseWithResponseAsync(Horse horse) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (horse == null) { - return Mono.error(new IllegalArgumentException("Parameter horse is required and cannot be null.")); - } else { - horse.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putHorse(this.getHost(), horse, accept, context)); + return FluxUtil.withContext(context -> putHorseWithResponseAsync(horse, context)); } /** @@ -390,11 +377,7 @@ public String putHorse(Horse horse) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getPetWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getPet(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getPetWithResponseAsync(context)); } /** @@ -478,16 +461,7 @@ public Pet getPet() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putPetWithResponseAsync(Pet pet) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (pet == null) { - return Mono.error(new IllegalArgumentException("Parameter pet is required and cannot be null.")); - } else { - pet.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putPet(this.getHost(), pet, accept, context)); + return FluxUtil.withContext(context -> putPetWithResponseAsync(pet, context)); } /** @@ -582,11 +556,7 @@ public String putPet(Pet pet) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFelineWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFeline(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFelineWithResponseAsync(context)); } /** @@ -671,16 +641,7 @@ public Feline getFeline() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFelineWithResponseAsync(Feline feline) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (feline == null) { - return Mono.error(new IllegalArgumentException("Parameter feline is required and cannot be null.")); - } else { - feline.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFeline(this.getHost(), feline, accept, context)); + return FluxUtil.withContext(context -> putFelineWithResponseAsync(feline, context)); } /** @@ -775,11 +736,7 @@ public String putFeline(Feline feline) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getCatWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCat(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getCatWithResponseAsync(context)); } /** @@ -866,16 +823,7 @@ public Cat getCat() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putCatWithResponseAsync(Cat cat) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (cat == null) { - return Mono.error(new IllegalArgumentException("Parameter cat is required and cannot be null.")); - } else { - cat.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putCat(this.getHost(), cat, accept, context)); + return FluxUtil.withContext(context -> putCatWithResponseAsync(cat, context)); } /** @@ -970,11 +918,7 @@ public String putCat(Cat cat) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getKittenWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getKitten(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getKittenWithResponseAsync(context)); } /** @@ -1062,16 +1006,7 @@ public Kitten getKitten() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putKittenWithResponseAsync(Kitten kitten) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (kitten == null) { - return Mono.error(new IllegalArgumentException("Parameter kitten is required and cannot be null.")); - } else { - kitten.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putKitten(this.getHost(), kitten, accept, context)); + return FluxUtil.withContext(context -> putKittenWithResponseAsync(kitten, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/nonamedresponsetypes/Headers.java b/vanilla-tests/src/main/java/fixtures/nonamedresponsetypes/Headers.java index fb5b3f3a67..02ce8667aa 100644 --- a/vanilla-tests/src/main/java/fixtures/nonamedresponsetypes/Headers.java +++ b/vanilla-tests/src/main/java/fixtures/nonamedresponsetypes/Headers.java @@ -344,16 +344,7 @@ Mono> customRequestId(@HostParam("$host") String host, @HeaderPar */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramExistingKeyWithResponseAsync(String userAgent) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (userAgent == null) { - return Mono.error(new IllegalArgumentException("Parameter userAgent is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramExistingKey(this.client.getHost(), userAgent, accept, context)); + return FluxUtil.withContext(context -> paramExistingKeyWithResponseAsync(userAgent, context)); } /** @@ -446,12 +437,7 @@ public void paramExistingKey(String userAgent) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseExistingKeyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseExistingKey(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> responseExistingKeyWithResponseAsync(context)); } /** @@ -536,13 +522,7 @@ public void responseExistingKey() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseExistingKeyNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseExistingKeyNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> responseExistingKeyNoCustomHeadersWithResponseAsync(context)); } /** @@ -590,16 +570,7 @@ public Response responseExistingKeyNoCustomHeadersWithResponse(Context con */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramProtectedKeyWithResponseAsync(String contentType) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramProtectedKey(this.client.getHost(), contentType, accept, context)); + return FluxUtil.withContext(context -> paramProtectedKeyWithResponseAsync(contentType, context)); } /** @@ -692,12 +663,7 @@ public void paramProtectedKey(String contentType) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseProtectedKeyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseProtectedKey(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> responseProtectedKeyWithResponseAsync(context)); } /** @@ -782,13 +748,7 @@ public void responseProtectedKey() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseProtectedKeyNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseProtectedKeyNoCustomHeaders(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> responseProtectedKeyNoCustomHeadersWithResponseAsync(context)); } /** @@ -837,16 +797,7 @@ public Response responseProtectedKeyNoCustomHeadersWithResponse(Context co */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramIntegerWithResponseAsync(String scenario, int value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramInteger(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramIntegerWithResponseAsync(scenario, value, context)); } /** @@ -946,16 +897,7 @@ public void paramInteger(String scenario, int value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseIntegerWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseInteger(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseIntegerWithResponseAsync(scenario, context)); } /** @@ -1053,16 +995,7 @@ public void responseInteger(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseIntegerNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseIntegerNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseIntegerNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -1117,16 +1050,7 @@ public Response responseIntegerNoCustomHeadersWithResponse(String scenario */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramLongWithResponseAsync(String scenario, long value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramLong(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramLongWithResponseAsync(scenario, value, context)); } /** @@ -1231,15 +1155,7 @@ public void paramLong(String scenario, long value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseLongWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseLong(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseLongWithResponseAsync(scenario, context)); } /** @@ -1336,16 +1252,7 @@ public void responseLong(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseLongNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseLongNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseLongNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -1400,16 +1307,7 @@ public Response responseLongNoCustomHeadersWithResponse(String scenario, C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramFloatWithResponseAsync(String scenario, float value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramFloat(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramFloatWithResponseAsync(scenario, value, context)); } /** @@ -1514,15 +1412,7 @@ public void paramFloat(String scenario, float value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseFloatWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseFloat(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseFloatWithResponseAsync(scenario, context)); } /** @@ -1619,16 +1509,7 @@ public void responseFloat(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseFloatNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseFloatNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseFloatNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -1683,16 +1564,7 @@ public Response responseFloatNoCustomHeadersWithResponse(String scenario, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDoubleWithResponseAsync(String scenario, double value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDouble(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDoubleWithResponseAsync(scenario, value, context)); } /** @@ -1797,16 +1669,7 @@ public void paramDouble(String scenario, double value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDoubleWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDouble(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDoubleWithResponseAsync(scenario, context)); } /** @@ -1904,16 +1767,7 @@ public void responseDouble(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDoubleNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseDoubleNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDoubleNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -1967,16 +1821,7 @@ public Response responseDoubleNoCustomHeadersWithResponse(String scenario, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramBoolWithResponseAsync(String scenario, boolean value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramBool(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramBoolWithResponseAsync(scenario, value, context)); } /** @@ -2076,15 +1921,7 @@ public void paramBool(String scenario, boolean value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseBoolWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseBool(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseBoolWithResponseAsync(scenario, context)); } /** @@ -2181,16 +2018,7 @@ public void responseBool(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseBoolNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseBoolNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseBoolNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -2245,16 +2073,7 @@ public Response responseBoolNoCustomHeadersWithResponse(String scenario, C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramStringWithResponseAsync(String scenario, String value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramString(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramStringWithResponseAsync(scenario, value, context)); } /** @@ -2390,16 +2209,7 @@ public void paramString(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseStringWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseString(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseStringWithResponseAsync(scenario, context)); } /** @@ -2500,16 +2310,7 @@ public void responseString(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseStringNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseStringNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseStringNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -2565,19 +2366,7 @@ public Response responseStringNoCustomHeadersWithResponse(String scenario, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDateWithResponseAsync(String scenario, LocalDate value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDate(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDateWithResponseAsync(scenario, value, context)); } /** @@ -2685,15 +2474,7 @@ public void paramDate(String scenario, LocalDate value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDateWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseDate(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDateWithResponseAsync(scenario, context)); } /** @@ -2790,16 +2571,7 @@ public void responseDate(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDateNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseDateNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDateNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -2854,19 +2626,7 @@ public Response responseDateNoCustomHeadersWithResponse(String scenario, C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDatetimeWithResponseAsync(String scenario, OffsetDateTime value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDatetime(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDatetimeWithResponseAsync(scenario, value, context)); } /** @@ -2974,16 +2734,7 @@ public void paramDatetime(String scenario, OffsetDateTime value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDatetimeWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDatetime(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDatetimeWithResponseAsync(scenario, context)); } /** @@ -3084,16 +2835,7 @@ public void responseDatetime(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDatetimeNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseDatetimeNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDatetimeNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -3150,17 +2892,7 @@ public Response responseDatetimeNoCustomHeadersWithResponse(String scenari */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDatetimeRfc1123WithResponseAsync(String scenario, OffsetDateTime value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - DateTimeRfc1123 valueConverted = value == null ? null : new DateTimeRfc1123(value); - return FluxUtil.withContext( - context -> service.paramDatetimeRfc1123(this.client.getHost(), scenario, valueConverted, accept, context)); + return FluxUtil.withContext(context -> paramDatetimeRfc1123WithResponseAsync(scenario, value, context)); } /** @@ -3304,16 +3036,7 @@ public void paramDatetimeRfc1123(String scenario) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDatetimeRfc1123WithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDatetimeRfc1123(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDatetimeRfc1123WithResponseAsync(scenario, context)); } /** @@ -3414,16 +3137,8 @@ public void responseDatetimeRfc1123(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDatetimeRfc1123NoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseDatetimeRfc1123NoCustomHeaders(this.client.getHost(), - scenario, accept, context)); + return FluxUtil + .withContext(context -> responseDatetimeRfc1123NoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -3479,19 +3194,7 @@ public Response responseDatetimeRfc1123NoCustomHeadersWithResponse(String */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDurationWithResponseAsync(String scenario, Duration value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDuration(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDurationWithResponseAsync(scenario, value, context)); } /** @@ -3594,16 +3297,7 @@ public void paramDuration(String scenario, Duration value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDurationWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDuration(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDurationWithResponseAsync(scenario, context)); } /** @@ -3701,16 +3395,7 @@ public void responseDuration(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDurationNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseDurationNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDurationNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -3764,20 +3449,7 @@ public Response responseDurationNoCustomHeadersWithResponse(String scenari */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramByteWithResponseAsync(String scenario, byte[] value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext( - context -> service.paramByte(this.client.getHost(), scenario, valueConverted, accept, context)); + return FluxUtil.withContext(context -> paramByteWithResponseAsync(scenario, value, context)); } /** @@ -3881,15 +3553,7 @@ public void paramByte(String scenario, byte[] value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseByteWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseByte(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseByteWithResponseAsync(scenario, context)); } /** @@ -3986,16 +3650,7 @@ public void responseByte(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseByteNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseByteNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseByteNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -4049,16 +3704,7 @@ public Response responseByteNoCustomHeadersWithResponse(String scenario, C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramEnumWithResponseAsync(String scenario, GreyscaleColors value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramEnum(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramEnumWithResponseAsync(scenario, value, context)); } /** @@ -4187,15 +3833,7 @@ public void paramEnum(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseEnumWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseEnum(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseEnumWithResponseAsync(scenario, context)); } /** @@ -4292,16 +3930,7 @@ public void responseEnum(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseEnumNoCustomHeadersWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.responseEnumNoCustomHeaders(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseEnumNoCustomHeadersWithResponseAsync(scenario, context)); } /** @@ -4352,12 +3981,7 @@ public Response responseEnumNoCustomHeadersWithResponse(String scenario, C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customRequestIdWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.customRequestId(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> customRequestIdWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/nonstringenum/implementation/FloatOperationsImpl.java b/vanilla-tests/src/main/java/fixtures/nonstringenum/implementation/FloatOperationsImpl.java index fd36a58640..3156ea2c2a 100644 --- a/vanilla-tests/src/main/java/fixtures/nonstringenum/implementation/FloatOperationsImpl.java +++ b/vanilla-tests/src/main/java/fixtures/nonstringenum/implementation/FloatOperationsImpl.java @@ -79,12 +79,7 @@ Mono> get(@HostParam("$host") String host, @HeaderParam("Acc */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(FloatEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(this.client.getHost(), input, accept, context)); + return FluxUtil.withContext(context -> putWithResponseAsync(input, context)); } /** @@ -200,12 +195,7 @@ public String put() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/nonstringenum/implementation/IntsImpl.java b/vanilla-tests/src/main/java/fixtures/nonstringenum/implementation/IntsImpl.java index 1ff4305bac..8fdd86de5d 100644 --- a/vanilla-tests/src/main/java/fixtures/nonstringenum/implementation/IntsImpl.java +++ b/vanilla-tests/src/main/java/fixtures/nonstringenum/implementation/IntsImpl.java @@ -78,12 +78,7 @@ Mono> get(@HostParam("$host") String host, @HeaderParam("Accep */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(IntEnum input) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(this.client.getHost(), input, accept, context)); + return FluxUtil.withContext(context -> putWithResponseAsync(input, context)); } /** @@ -199,12 +194,7 @@ public String put() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/notypedheadersmethods/Headers.java b/vanilla-tests/src/main/java/fixtures/notypedheadersmethods/Headers.java index 08b1b8fb66..44e8f35746 100644 --- a/vanilla-tests/src/main/java/fixtures/notypedheadersmethods/Headers.java +++ b/vanilla-tests/src/main/java/fixtures/notypedheadersmethods/Headers.java @@ -244,16 +244,7 @@ Mono> customRequestId(@HostParam("$host") String host, @HeaderPar */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramExistingKeyWithResponseAsync(String userAgent) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (userAgent == null) { - return Mono.error(new IllegalArgumentException("Parameter userAgent is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramExistingKey(this.client.getHost(), userAgent, accept, context)); + return FluxUtil.withContext(context -> paramExistingKeyWithResponseAsync(userAgent, context)); } /** @@ -346,12 +337,7 @@ public void paramExistingKey(String userAgent) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseExistingKeyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseExistingKey(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> responseExistingKeyWithResponseAsync(context)); } /** @@ -436,16 +422,7 @@ public void responseExistingKey() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramProtectedKeyWithResponseAsync(String contentType) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (contentType == null) { - return Mono.error(new IllegalArgumentException("Parameter contentType is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramProtectedKey(this.client.getHost(), contentType, accept, context)); + return FluxUtil.withContext(context -> paramProtectedKeyWithResponseAsync(contentType, context)); } /** @@ -538,12 +515,7 @@ public void paramProtectedKey(String contentType) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseProtectedKeyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseProtectedKey(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> responseProtectedKeyWithResponseAsync(context)); } /** @@ -629,16 +601,7 @@ public void responseProtectedKey() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramIntegerWithResponseAsync(String scenario, int value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramInteger(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramIntegerWithResponseAsync(scenario, value, context)); } /** @@ -738,16 +701,7 @@ public void paramInteger(String scenario, int value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseIntegerWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseInteger(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseIntegerWithResponseAsync(scenario, context)); } /** @@ -844,16 +798,7 @@ public void responseInteger(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramLongWithResponseAsync(String scenario, long value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramLong(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramLongWithResponseAsync(scenario, value, context)); } /** @@ -958,15 +903,7 @@ public void paramLong(String scenario, long value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseLongWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseLong(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseLongWithResponseAsync(scenario, context)); } /** @@ -1063,16 +1000,7 @@ public void responseLong(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramFloatWithResponseAsync(String scenario, float value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramFloat(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramFloatWithResponseAsync(scenario, value, context)); } /** @@ -1177,15 +1105,7 @@ public void paramFloat(String scenario, float value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseFloatWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseFloat(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseFloatWithResponseAsync(scenario, context)); } /** @@ -1282,16 +1202,7 @@ public void responseFloat(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDoubleWithResponseAsync(String scenario, double value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDouble(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDoubleWithResponseAsync(scenario, value, context)); } /** @@ -1396,16 +1307,7 @@ public void paramDouble(String scenario, double value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDoubleWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDouble(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDoubleWithResponseAsync(scenario, context)); } /** @@ -1501,16 +1403,7 @@ public void responseDouble(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramBoolWithResponseAsync(String scenario, boolean value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramBool(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramBoolWithResponseAsync(scenario, value, context)); } /** @@ -1610,15 +1503,7 @@ public void paramBool(String scenario, boolean value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseBoolWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseBool(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseBoolWithResponseAsync(scenario, context)); } /** @@ -1715,16 +1600,7 @@ public void responseBool(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramStringWithResponseAsync(String scenario, String value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramString(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramStringWithResponseAsync(scenario, value, context)); } /** @@ -1860,16 +1736,7 @@ public void paramString(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseStringWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseString(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseStringWithResponseAsync(scenario, context)); } /** @@ -1969,19 +1836,7 @@ public void responseString(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDateWithResponseAsync(String scenario, LocalDate value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDate(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDateWithResponseAsync(scenario, value, context)); } /** @@ -2089,15 +1944,7 @@ public void paramDate(String scenario, LocalDate value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDateWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseDate(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDateWithResponseAsync(scenario, context)); } /** @@ -2194,19 +2041,7 @@ public void responseDate(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDatetimeWithResponseAsync(String scenario, OffsetDateTime value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDatetime(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDatetimeWithResponseAsync(scenario, value, context)); } /** @@ -2314,16 +2149,7 @@ public void paramDatetime(String scenario, OffsetDateTime value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDatetimeWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDatetime(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDatetimeWithResponseAsync(scenario, context)); } /** @@ -2424,17 +2250,7 @@ public void responseDatetime(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDatetimeRfc1123WithResponseAsync(String scenario, OffsetDateTime value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - DateTimeRfc1123 valueConverted = value == null ? null : new DateTimeRfc1123(value); - return FluxUtil.withContext( - context -> service.paramDatetimeRfc1123(this.client.getHost(), scenario, valueConverted, accept, context)); + return FluxUtil.withContext(context -> paramDatetimeRfc1123WithResponseAsync(scenario, value, context)); } /** @@ -2577,16 +2393,7 @@ public void paramDatetimeRfc1123(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDatetimeRfc1123WithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDatetimeRfc1123(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDatetimeRfc1123WithResponseAsync(scenario, context)); } /** @@ -2685,19 +2492,7 @@ public void responseDatetimeRfc1123(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramDurationWithResponseAsync(String scenario, Duration value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramDuration(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramDurationWithResponseAsync(scenario, value, context)); } /** @@ -2800,16 +2595,7 @@ public void paramDuration(String scenario, Duration value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseDurationWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.responseDuration(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseDurationWithResponseAsync(scenario, context)); } /** @@ -2905,20 +2691,7 @@ public void responseDuration(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramByteWithResponseAsync(String scenario, byte[] value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } - final String accept = "application/json"; - String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext( - context -> service.paramByte(this.client.getHost(), scenario, valueConverted, accept, context)); + return FluxUtil.withContext(context -> paramByteWithResponseAsync(scenario, value, context)); } /** @@ -3022,15 +2795,7 @@ public void paramByte(String scenario, byte[] value) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseByteWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseByte(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseByteWithResponseAsync(scenario, context)); } /** @@ -3126,16 +2891,7 @@ public void responseByte(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramEnumWithResponseAsync(String scenario, GreyscaleColors value) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramEnum(this.client.getHost(), scenario, value, accept, context)); + return FluxUtil.withContext(context -> paramEnumWithResponseAsync(scenario, value, context)); } /** @@ -3264,15 +3020,7 @@ public void paramEnum(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseEnumWithResponseAsync(String scenario) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (scenario == null) { - return Mono.error(new IllegalArgumentException("Parameter scenario is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseEnum(this.client.getHost(), scenario, accept, context)); + return FluxUtil.withContext(context -> responseEnumWithResponseAsync(scenario, context)); } /** @@ -3365,12 +3113,7 @@ public void responseEnum(String scenario) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customRequestIdWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.customRequestId(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> customRequestIdWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/parameterflattening/AvailabilitySets.java b/vanilla-tests/src/main/java/fixtures/parameterflattening/AvailabilitySets.java index 3e70db5ae6..67f12378d9 100644 --- a/vanilla-tests/src/main/java/fixtures/parameterflattening/AvailabilitySets.java +++ b/vanilla-tests/src/main/java/fixtures/parameterflattening/AvailabilitySets.java @@ -77,25 +77,8 @@ Mono> update(@HostParam("$host") String host, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateWithResponseAsync(String resourceGroupName, String avset, Map availabilitySetUpdateParametersTags) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (avset == null) { - return Mono.error(new IllegalArgumentException("Parameter avset is required and cannot be null.")); - } - if (availabilitySetUpdateParametersTags == null) { - return Mono.error(new IllegalArgumentException( - "Parameter availabilitySetUpdateParametersTags is required and cannot be null.")); - } - AvailabilitySetUpdateParameters tags = new AvailabilitySetUpdateParameters(); - tags.setTags(availabilitySetUpdateParametersTags); - return FluxUtil - .withContext(context -> service.update(this.client.getHost(), resourceGroupName, avset, tags, context)); + return FluxUtil.withContext( + context -> updateWithResponseAsync(resourceGroupName, avset, availabilitySetUpdateParametersTags, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/report/AutoRestReportService.java b/vanilla-tests/src/main/java/fixtures/report/AutoRestReportService.java index a381c8d1b3..eae179dc61 100644 --- a/vanilla-tests/src/main/java/fixtures/report/AutoRestReportService.java +++ b/vanilla-tests/src/main/java/fixtures/report/AutoRestReportService.java @@ -146,11 +146,7 @@ Mono>> getOptionalReport(@HostParam("$host") Strin */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getReportWithResponseAsync(String qualifier) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getReport(this.getHost(), qualifier, accept, context)); + return FluxUtil.withContext(context -> getReportWithResponseAsync(qualifier, context)); } /** @@ -273,11 +269,7 @@ public Map getReport() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getOptionalReportWithResponseAsync(String qualifier) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getOptionalReport(this.getHost(), qualifier, accept, context)); + return FluxUtil.withContext(context -> getOptionalReportWithResponseAsync(qualifier, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/requiredfieldsascotrargstransformation/RequiredFieldsAsCtorArgsTransformation.java b/vanilla-tests/src/main/java/fixtures/requiredfieldsascotrargstransformation/RequiredFieldsAsCtorArgsTransformation.java index b5031fdb23..01bbde164a 100644 --- a/vanilla-tests/src/main/java/fixtures/requiredfieldsascotrargstransformation/RequiredFieldsAsCtorArgsTransformation.java +++ b/vanilla-tests/src/main/java/fixtures/requiredfieldsascotrargstransformation/RequiredFieldsAsCtorArgsTransformation.java @@ -137,11 +137,7 @@ Mono> get(@HostParam("$host") Str */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/requiredoptional/Explicits.java b/vanilla-tests/src/main/java/fixtures/requiredoptional/Explicits.java index 202beb29c9..6ce8d4c24d 100644 --- a/vanilla-tests/src/main/java/fixtures/requiredoptional/Explicits.java +++ b/vanilla-tests/src/main/java/fixtures/requiredoptional/Explicits.java @@ -260,13 +260,8 @@ Mono> postOptionalArrayHeader(@HostParam("$host") String host, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putOptionalBinaryBodyWithResponseAsync(Flux bodyParameter, Long contentLength) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putOptionalBinaryBody(this.client.getHost(), bodyParameter, - contentLength, accept, context)); + return FluxUtil + .withContext(context -> putOptionalBinaryBodyWithResponseAsync(bodyParameter, contentLength, context)); } /** @@ -393,13 +388,8 @@ public void putOptionalBinaryBody() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putOptionalBinaryBodyWithResponseAsync(BinaryData bodyParameter, Long contentLength) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putOptionalBinaryBody(this.client.getHost(), bodyParameter, - contentLength, accept, context)); + return FluxUtil + .withContext(context -> putOptionalBinaryBodyWithResponseAsync(bodyParameter, contentLength, context)); } /** @@ -500,16 +490,8 @@ public void putOptionalBinaryBody(BinaryData bodyParameter, Long contentLength) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRequiredBinaryBodyWithResponseAsync(Flux bodyParameter, long contentLength) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter bodyParameter is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putRequiredBinaryBody(this.client.getHost(), bodyParameter, - contentLength, accept, context)); + return FluxUtil + .withContext(context -> putRequiredBinaryBodyWithResponseAsync(bodyParameter, contentLength, context)); } /** @@ -612,16 +594,8 @@ public void putRequiredBinaryBody(Flux bodyParameter, long contentLe */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRequiredBinaryBodyWithResponseAsync(BinaryData bodyParameter, long contentLength) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter bodyParameter is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putRequiredBinaryBody(this.client.getHost(), bodyParameter, - contentLength, accept, context)); + return FluxUtil + .withContext(context -> putRequiredBinaryBodyWithResponseAsync(bodyParameter, contentLength, context)); } /** @@ -723,13 +697,7 @@ public void putRequiredBinaryBody(BinaryData bodyParameter, long contentLength) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredIntegerParameterWithResponseAsync(int bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postRequiredIntegerParameter(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postRequiredIntegerParameterWithResponseAsync(bodyParameter, context)); } /** @@ -820,13 +788,7 @@ public void postRequiredIntegerParameter(int bodyParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalIntegerParameterWithResponseAsync(Integer bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postOptionalIntegerParameter(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postOptionalIntegerParameterWithResponseAsync(bodyParameter, context)); } /** @@ -943,18 +905,7 @@ public void postOptionalIntegerParameter() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredIntegerPropertyWithResponseAsync(IntWrapper bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter bodyParameter is required and cannot be null.")); - } else { - bodyParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postRequiredIntegerProperty(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postRequiredIntegerPropertyWithResponseAsync(bodyParameter, context)); } /** @@ -1056,16 +1007,7 @@ public void postRequiredIntegerProperty(IntWrapper bodyParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalIntegerPropertyWithResponseAsync(IntOptionalWrapper bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter != null) { - bodyParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postOptionalIntegerProperty(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postOptionalIntegerPropertyWithResponseAsync(bodyParameter, context)); } /** @@ -1186,13 +1128,7 @@ public void postOptionalIntegerProperty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredIntegerHeaderWithResponseAsync(int headerParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postRequiredIntegerHeader(this.client.getHost(), headerParameter, accept, context)); + return FluxUtil.withContext(context -> postRequiredIntegerHeaderWithResponseAsync(headerParameter, context)); } /** @@ -1288,13 +1224,7 @@ public void postRequiredIntegerHeader(int headerParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalIntegerHeaderWithResponseAsync(Integer headerParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postOptionalIntegerHeader(this.client.getHost(), headerParameter, accept, context)); + return FluxUtil.withContext(context -> postOptionalIntegerHeaderWithResponseAsync(headerParameter, context)); } /** @@ -1410,16 +1340,7 @@ public void postOptionalIntegerHeader() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredStringParameterWithResponseAsync(String bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter bodyParameter is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postRequiredStringParameter(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postRequiredStringParameterWithResponseAsync(bodyParameter, context)); } /** @@ -1513,13 +1434,7 @@ public void postRequiredStringParameter(String bodyParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalStringParameterWithResponseAsync(String bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postOptionalStringParameter(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postOptionalStringParameterWithResponseAsync(bodyParameter, context)); } /** @@ -1636,18 +1551,7 @@ public void postOptionalStringParameter() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredStringPropertyWithResponseAsync(StringWrapper bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter bodyParameter is required and cannot be null.")); - } else { - bodyParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postRequiredStringProperty(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postRequiredStringPropertyWithResponseAsync(bodyParameter, context)); } /** @@ -1749,16 +1653,7 @@ public void postRequiredStringProperty(StringWrapper bodyParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalStringPropertyWithResponseAsync(StringOptionalWrapper bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter != null) { - bodyParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postOptionalStringProperty(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postOptionalStringPropertyWithResponseAsync(bodyParameter, context)); } /** @@ -1879,17 +1774,7 @@ public void postOptionalStringProperty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredStringHeaderWithResponseAsync(String headerParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (headerParameter == null) { - return Mono - .error(new IllegalArgumentException("Parameter headerParameter is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postRequiredStringHeader(this.client.getHost(), headerParameter, accept, context)); + return FluxUtil.withContext(context -> postRequiredStringHeaderWithResponseAsync(headerParameter, context)); } /** @@ -1989,13 +1874,7 @@ public void postRequiredStringHeader(String headerParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalStringHeaderWithResponseAsync(String bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postOptionalStringHeader(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postOptionalStringHeaderWithResponseAsync(bodyParameter, context)); } /** @@ -2112,18 +1991,7 @@ public void postOptionalStringHeader() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredClassParameterWithResponseAsync(Product bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter bodyParameter is required and cannot be null.")); - } else { - bodyParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postRequiredClassParameter(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postRequiredClassParameterWithResponseAsync(bodyParameter, context)); } /** @@ -2224,16 +2092,7 @@ public void postRequiredClassParameter(Product bodyParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalClassParameterWithResponseAsync(Product bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter != null) { - bodyParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postOptionalClassParameter(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postOptionalClassParameterWithResponseAsync(bodyParameter, context)); } /** @@ -2353,18 +2212,7 @@ public void postOptionalClassParameter() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredClassPropertyWithResponseAsync(ClassWrapper bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter bodyParameter is required and cannot be null.")); - } else { - bodyParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postRequiredClassProperty(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postRequiredClassPropertyWithResponseAsync(bodyParameter, context)); } /** @@ -2466,16 +2314,7 @@ public void postRequiredClassProperty(ClassWrapper bodyParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalClassPropertyWithResponseAsync(ClassOptionalWrapper bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter != null) { - bodyParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postOptionalClassProperty(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postOptionalClassPropertyWithResponseAsync(bodyParameter, context)); } /** @@ -2595,16 +2434,7 @@ public void postOptionalClassProperty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredArrayParameterWithResponseAsync(List bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter bodyParameter is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postRequiredArrayParameter(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postRequiredArrayParameterWithResponseAsync(bodyParameter, context)); } /** @@ -2699,13 +2529,7 @@ public void postRequiredArrayParameter(List bodyParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalArrayParameterWithResponseAsync(List bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postOptionalArrayParameter(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postOptionalArrayParameterWithResponseAsync(bodyParameter, context)); } /** @@ -2823,18 +2647,7 @@ public void postOptionalArrayParameter() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredArrayPropertyWithResponseAsync(ArrayWrapper bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter bodyParameter is required and cannot be null.")); - } else { - bodyParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postRequiredArrayProperty(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postRequiredArrayPropertyWithResponseAsync(bodyParameter, context)); } /** @@ -2936,16 +2749,7 @@ public void postRequiredArrayProperty(ArrayWrapper bodyParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalArrayPropertyWithResponseAsync(ArrayOptionalWrapper bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bodyParameter != null) { - bodyParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postOptionalArrayProperty(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> postOptionalArrayPropertyWithResponseAsync(bodyParameter, context)); } /** @@ -3066,20 +2870,7 @@ public void postOptionalArrayProperty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRequiredArrayHeaderWithResponseAsync(List headerParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (headerParameter == null) { - return Mono - .error(new IllegalArgumentException("Parameter headerParameter is required and cannot be null.")); - } - final String accept = "application/json"; - String headerParameterConverted = headerParameter.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.postRequiredArrayHeader(this.client.getHost(), - headerParameterConverted, accept, context)); + return FluxUtil.withContext(context -> postRequiredArrayHeaderWithResponseAsync(headerParameter, context)); } /** @@ -3183,18 +2974,7 @@ public void postRequiredArrayHeader(List headerParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postOptionalArrayHeaderWithResponseAsync(List headerParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - String headerParameterConverted = (headerParameter == null) - ? null - : headerParameter.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.postOptionalArrayHeader(this.client.getHost(), - headerParameterConverted, accept, context)); + return FluxUtil.withContext(context -> postOptionalArrayHeaderWithResponseAsync(headerParameter, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/requiredoptional/Implicits.java b/vanilla-tests/src/main/java/fixtures/requiredoptional/Implicits.java index b7dcafcb4e..4616d77354 100644 --- a/vanilla-tests/src/main/java/fixtures/requiredoptional/Implicits.java +++ b/vanilla-tests/src/main/java/fixtures/requiredoptional/Implicits.java @@ -131,16 +131,7 @@ Mono> getOptionalGlobalQuery(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRequiredPathWithResponseAsync(String pathParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (pathParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter pathParameter is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getRequiredPath(this.client.getHost(), pathParameter, accept, context)); + return FluxUtil.withContext(context -> getRequiredPathWithResponseAsync(pathParameter, context)); } /** @@ -234,13 +225,7 @@ public void getRequiredPath(String pathParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putOptionalQueryWithResponseAsync(String queryParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putOptionalQuery(this.client.getHost(), queryParameter, accept, context)); + return FluxUtil.withContext(context -> putOptionalQueryWithResponseAsync(queryParameter, context)); } /** @@ -356,13 +341,7 @@ public void putOptionalQuery() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putOptionalHeaderWithResponseAsync(String queryParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putOptionalHeader(this.client.getHost(), queryParameter, accept, context)); + return FluxUtil.withContext(context -> putOptionalHeaderWithResponseAsync(queryParameter, context)); } /** @@ -478,13 +457,7 @@ public void putOptionalHeader() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putOptionalBodyWithResponseAsync(String bodyParameter) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putOptionalBody(this.client.getHost(), bodyParameter, accept, context)); + return FluxUtil.withContext(context -> putOptionalBodyWithResponseAsync(bodyParameter, context)); } /** @@ -602,13 +575,8 @@ public void putOptionalBody() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putOptionalBinaryBodyWithResponseAsync(Flux bodyParameter, Long contentLength) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putOptionalBinaryBody(this.client.getHost(), bodyParameter, - contentLength, accept, context)); + return FluxUtil + .withContext(context -> putOptionalBinaryBodyWithResponseAsync(bodyParameter, contentLength, context)); } /** @@ -735,13 +703,8 @@ public void putOptionalBinaryBody() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putOptionalBinaryBodyWithResponseAsync(BinaryData bodyParameter, Long contentLength) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putOptionalBinaryBody(this.client.getHost(), bodyParameter, - contentLength, accept, context)); + return FluxUtil + .withContext(context -> putOptionalBinaryBodyWithResponseAsync(bodyParameter, contentLength, context)); } /** @@ -838,17 +801,7 @@ public void putOptionalBinaryBody(BinaryData bodyParameter, Long contentLength) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRequiredGlobalPathWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (this.client.getRequiredGlobalPath() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getRequiredGlobalPath() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getRequiredGlobalPath(this.client.getHost(), - this.client.getRequiredGlobalPath(), accept, context)); + return FluxUtil.withContext(context -> getRequiredGlobalPathWithResponseAsync(context)); } /** @@ -935,17 +888,7 @@ public void getRequiredGlobalPath() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRequiredGlobalQueryWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (this.client.getRequiredGlobalQuery() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getRequiredGlobalQuery() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getRequiredGlobalQuery(this.client.getHost(), - this.client.getRequiredGlobalQuery(), accept, context)); + return FluxUtil.withContext(context -> getRequiredGlobalQueryWithResponseAsync(context)); } /** @@ -1032,13 +975,7 @@ public void getRequiredGlobalQuery() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getOptionalGlobalQueryWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getOptionalGlobalQuery(this.client.getHost(), - this.client.getOptionalGlobalQuery(), accept, context)); + return FluxUtil.withContext(context -> getOptionalGlobalQueryWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/specialheader/Headers.java b/vanilla-tests/src/main/java/fixtures/specialheader/Headers.java index ae0ecf9712..8d4f7aee38 100644 --- a/vanilla-tests/src/main/java/fixtures/specialheader/Headers.java +++ b/vanilla-tests/src/main/java/fixtures/specialheader/Headers.java @@ -117,13 +117,7 @@ Mono> paramRepeatabilityRequestPageableNext( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramRepeatabilityRequestWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.paramRepeatabilityRequest(this.client.getHost(), accept, - CoreUtils.randomUuid().toString(), DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()), context)); + return FluxUtil.withContext(context -> paramRepeatabilityRequestWithResponseAsync(context)); } /** @@ -207,13 +201,7 @@ public Object paramRepeatabilityRequest() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramRepeatabilityRequestPutWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.paramRepeatabilityRequestPut(this.client.getHost(), accept, - CoreUtils.randomUuid().toString(), DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()), context)); + return FluxUtil.withContext(context -> paramRepeatabilityRequestPutWithResponseAsync(context)); } /** @@ -297,13 +285,7 @@ public Object paramRepeatabilityRequestPut() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramRepeatabilityRequestGetWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.paramRepeatabilityRequestGet(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> paramRepeatabilityRequestGetWithResponseAsync(context)); } /** @@ -386,13 +368,7 @@ public Object paramRepeatabilityRequestGet() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> paramRepeatabilityRequestLROWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.paramRepeatabilityRequestLRO(this.client.getHost(), accept, - CoreUtils.randomUuid().toString(), DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()), context)); + return FluxUtil.withContext(context -> paramRepeatabilityRequestLROWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Arrays.java b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Arrays.java index a61b1d1ecc..b35bfd2c67 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Arrays.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Arrays.java @@ -129,12 +129,7 @@ Response getNotProvidedSync(@HostParam("$host") String host, @Head */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -225,18 +220,7 @@ public ArrayWrapper getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(ArrayWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -348,12 +332,7 @@ public void putValid(ArrayWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -444,18 +423,7 @@ public ArrayWrapper getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(ArrayWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(complexBody, context)); } /** @@ -562,12 +530,7 @@ public void putEmpty(ArrayWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Basics.java b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Basics.java index c04d3e199a..63b51bab36 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Basics.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Basics.java @@ -139,12 +139,7 @@ Response getNotProvidedSync(@HostParam("$host") String host, @HeaderParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -235,19 +230,7 @@ public Basic getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Basic complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), this.client.getApiVersion(), - complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -354,12 +337,7 @@ public void putValid(Basic complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** @@ -448,12 +426,7 @@ public Basic getInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -542,12 +515,7 @@ public Basic getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -637,12 +605,7 @@ public Basic getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Dictionaries.java b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Dictionaries.java index 6cd361b8cb..5641f912ff 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Dictionaries.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Dictionaries.java @@ -143,12 +143,7 @@ Response getNotProvidedSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -240,18 +235,7 @@ public DictionaryWrapper getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(DictionaryWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -363,12 +347,7 @@ public void putValid(DictionaryWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -459,18 +438,7 @@ public DictionaryWrapper getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(DictionaryWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(complexBody, context)); } /** @@ -577,12 +545,7 @@ public void putEmpty(DictionaryWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -672,12 +635,7 @@ public DictionaryWrapper getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Flattencomplexes.java b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Flattencomplexes.java index 065bee9ac3..e3dd9233d4 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Flattencomplexes.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Flattencomplexes.java @@ -76,12 +76,7 @@ Response getValidSync(@HostParam("$host") String host, @HeaderParam( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Inheritances.java b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Inheritances.java index c0a30f11df..7c194fba35 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Inheritances.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Inheritances.java @@ -90,12 +90,7 @@ Response putValidSync(@HostParam("$host") String host, @BodyParam("applica */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -187,18 +182,7 @@ public Siamese getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Siamese complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Polymorphicrecursives.java b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Polymorphicrecursives.java index 721407f7dd..c005d335cf 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Polymorphicrecursives.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Polymorphicrecursives.java @@ -91,12 +91,7 @@ Response putValidSync(@HostParam("$host") String host, @BodyParam("applica */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -241,18 +236,7 @@ public Fish getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Polymorphisms.java b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Polymorphisms.java index 8118c83d5e..b5ed6bcb5c 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Polymorphisms.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Polymorphisms.java @@ -177,12 +177,7 @@ Response putValidMissingRequiredSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -304,18 +299,7 @@ public Fish getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -582,12 +566,7 @@ public void putValid(Fish complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDotSyntaxWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDotSyntax(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDotSyntaxWithResponseAsync(context)); } /** @@ -678,13 +657,7 @@ public DotFish getDotSyntax() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComposedWithDiscriminatorWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getComposedWithDiscriminator(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComposedWithDiscriminatorWithResponseAsync(context)); } /** @@ -784,13 +757,7 @@ public DotFishMarket getComposedWithDiscriminator() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComposedWithoutDiscriminatorWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getComposedWithoutDiscriminator(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComposedWithoutDiscriminatorWithResponseAsync(context)); } /** @@ -890,12 +857,7 @@ public DotFishMarket getComposedWithoutDiscriminator() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComplicatedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplicated(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplicatedWithResponseAsync(context)); } /** @@ -990,19 +952,7 @@ public Salmon getComplicated() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putComplicatedWithResponseAsync(Salmon complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putComplicated(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putComplicatedWithResponseAsync(complexBody, context)); } /** @@ -1110,19 +1060,7 @@ public void putComplicated(Salmon complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMissingDiscriminatorWithResponseAsync(Salmon complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putMissingDiscriminator(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putMissingDiscriminatorWithResponseAsync(complexBody, context)); } /** @@ -1259,19 +1197,7 @@ public Salmon putMissingDiscriminator(Salmon complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidMissingRequiredWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putValidMissingRequired(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidMissingRequiredWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Primitives.java b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Primitives.java index 7494847e16..4d629f3b76 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Primitives.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Primitives.java @@ -363,12 +363,7 @@ Response putByteSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getIntWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInt(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getIntWithResponseAsync(context)); } /** @@ -459,18 +454,7 @@ public IntWrapper getInt() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putIntWithResponseAsync(IntWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putInt(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putIntWithResponseAsync(complexBody, context)); } /** @@ -576,12 +560,7 @@ public void putInt(IntWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLongWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLong(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLongWithResponseAsync(context)); } /** @@ -671,18 +650,7 @@ public LongWrapper getLong() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putLongWithResponseAsync(LongWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putLong(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putLongWithResponseAsync(complexBody, context)); } /** @@ -788,12 +756,7 @@ public void putLong(LongWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFloatWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFloat(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFloatWithResponseAsync(context)); } /** @@ -883,18 +846,7 @@ public FloatWrapper getFloat() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFloatWithResponseAsync(FloatWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFloat(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putFloatWithResponseAsync(complexBody, context)); } /** @@ -1001,12 +953,7 @@ public void putFloat(FloatWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDoubleWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDouble(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDoubleWithResponseAsync(context)); } /** @@ -1097,18 +1044,7 @@ public DoubleWrapper getDouble() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDoubleWithResponseAsync(DoubleWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDouble(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDoubleWithResponseAsync(complexBody, context)); } /** @@ -1214,12 +1150,7 @@ public void putDouble(DoubleWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBoolWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBool(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBoolWithResponseAsync(context)); } /** @@ -1309,18 +1240,7 @@ public BooleanWrapper getBool() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBoolWithResponseAsync(BooleanWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putBool(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putBoolWithResponseAsync(complexBody, context)); } /** @@ -1427,12 +1347,7 @@ public void putBool(BooleanWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getStringWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringWithResponseAsync(context)); } /** @@ -1523,18 +1438,7 @@ public StringWrapper getString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putStringWithResponseAsync(StringWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putString(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putStringWithResponseAsync(complexBody, context)); } /** @@ -1640,12 +1544,7 @@ public void putString(StringWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDate(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateWithResponseAsync(context)); } /** @@ -1735,18 +1634,7 @@ public DateWrapper getDate() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateWithResponseAsync(DateWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDate(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateWithResponseAsync(complexBody, context)); } /** @@ -1853,12 +1741,7 @@ public void putDate(DateWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeWithResponseAsync(context)); } /** @@ -1949,19 +1832,7 @@ public DatetimeWrapper getDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeWithResponseAsync(DatetimeWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTime(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeWithResponseAsync(complexBody, context)); } /** @@ -2068,12 +1939,7 @@ public void putDateTime(DatetimeWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateTimeRfc1123WithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeRfc1123(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeRfc1123WithResponseAsync(context)); } /** @@ -2164,19 +2030,7 @@ public Datetimerfc1123Wrapper getDateTimeRfc1123() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeRfc1123WithResponseAsync(Datetimerfc1123Wrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTimeRfc1123(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeRfc1123WithResponseAsync(complexBody, context)); } /** @@ -2284,12 +2138,7 @@ public void putDateTimeRfc1123(Datetimerfc1123Wrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDurationWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDuration(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDurationWithResponseAsync(context)); } /** @@ -2380,19 +2229,7 @@ public DurationWrapper getDuration() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDurationWithResponseAsync(DurationWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDuration(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDurationWithResponseAsync(complexBody, context)); } /** @@ -2498,12 +2335,7 @@ public void putDuration(DurationWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getByteWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getByte(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getByteWithResponseAsync(context)); } /** @@ -2593,18 +2425,7 @@ public ByteWrapper getByte() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putByteWithResponseAsync(ByteWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putByte(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putByteWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Readonlyproperties.java b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Readonlyproperties.java index 9ddd72e0ad..246ada4c68 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Readonlyproperties.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserialization/Readonlyproperties.java @@ -93,12 +93,7 @@ Response putValidSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -189,18 +184,7 @@ public ReadonlyObj getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(ReadonlyObj complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Arrays.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Arrays.java index e54ca6bbbd..85dcb656bc 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Arrays.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Arrays.java @@ -129,12 +129,7 @@ Response getNotProvidedSync(@HostParam("$host") String host, @Head */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -225,18 +220,7 @@ public ArrayWrapper getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(ArrayWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -348,12 +332,7 @@ public void putValid(ArrayWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -444,18 +423,7 @@ public ArrayWrapper getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(ArrayWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(complexBody, context)); } /** @@ -562,12 +530,7 @@ public void putEmpty(ArrayWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Basics.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Basics.java index feb07a62aa..47fafd081e 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Basics.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Basics.java @@ -139,12 +139,7 @@ Response getNotProvidedSync(@HostParam("$host") String host, @HeaderParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -235,19 +230,7 @@ public Basic getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Basic complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), this.client.getApiVersion(), - complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -354,12 +337,7 @@ public void putValid(Basic complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** @@ -448,12 +426,7 @@ public Basic getInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -542,12 +515,7 @@ public Basic getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -637,12 +605,7 @@ public Basic getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Dictionaries.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Dictionaries.java index bf76d8e23b..6b36cea40e 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Dictionaries.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Dictionaries.java @@ -143,12 +143,7 @@ Response getNotProvidedSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -240,18 +235,7 @@ public DictionaryWrapper getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(DictionaryWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -363,12 +347,7 @@ public void putValid(DictionaryWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -459,18 +438,7 @@ public DictionaryWrapper getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(DictionaryWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(complexBody, context)); } /** @@ -577,12 +545,7 @@ public void putEmpty(DictionaryWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -672,12 +635,7 @@ public DictionaryWrapper getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Flattencomplexes.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Flattencomplexes.java index b304ca9542..f375266e2a 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Flattencomplexes.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Flattencomplexes.java @@ -76,12 +76,7 @@ Response getValidSync(@HostParam("$host") String host, @HeaderParam( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Inheritances.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Inheritances.java index f8d5cae5de..db127a32db 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Inheritances.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Inheritances.java @@ -90,12 +90,7 @@ Response putValidSync(@HostParam("$host") String host, @BodyParam("applica */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -187,18 +182,7 @@ public Siamese getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Siamese complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Polymorphicrecursives.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Polymorphicrecursives.java index 37e4121958..1942210e5f 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Polymorphicrecursives.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Polymorphicrecursives.java @@ -91,12 +91,7 @@ Response putValidSync(@HostParam("$host") String host, @BodyParam("applica */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -241,18 +236,7 @@ public Fish getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Polymorphisms.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Polymorphisms.java index 719959d90d..017979073e 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Polymorphisms.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Polymorphisms.java @@ -177,12 +177,7 @@ Response putValidMissingRequiredSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -304,18 +299,7 @@ public Fish getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -582,12 +566,7 @@ public void putValid(Fish complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDotSyntaxWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDotSyntax(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDotSyntaxWithResponseAsync(context)); } /** @@ -678,13 +657,7 @@ public DotFish getDotSyntax() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComposedWithDiscriminatorWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getComposedWithDiscriminator(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComposedWithDiscriminatorWithResponseAsync(context)); } /** @@ -784,13 +757,7 @@ public DotFishMarket getComposedWithDiscriminator() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComposedWithoutDiscriminatorWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getComposedWithoutDiscriminator(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComposedWithoutDiscriminatorWithResponseAsync(context)); } /** @@ -890,12 +857,7 @@ public DotFishMarket getComposedWithoutDiscriminator() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComplicatedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplicated(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplicatedWithResponseAsync(context)); } /** @@ -990,19 +952,7 @@ public Salmon getComplicated() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putComplicatedWithResponseAsync(Salmon complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putComplicated(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putComplicatedWithResponseAsync(complexBody, context)); } /** @@ -1110,19 +1060,7 @@ public void putComplicated(Salmon complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMissingDiscriminatorWithResponseAsync(Salmon complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putMissingDiscriminator(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putMissingDiscriminatorWithResponseAsync(complexBody, context)); } /** @@ -1259,19 +1197,7 @@ public Salmon putMissingDiscriminator(Salmon complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidMissingRequiredWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putValidMissingRequired(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidMissingRequiredWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Primitives.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Primitives.java index 57cb94ccd2..9d4a92063c 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Primitives.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Primitives.java @@ -363,12 +363,7 @@ Response putByteSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getIntWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInt(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getIntWithResponseAsync(context)); } /** @@ -459,18 +454,7 @@ public IntWrapper getInt() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putIntWithResponseAsync(IntWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putInt(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putIntWithResponseAsync(complexBody, context)); } /** @@ -576,12 +560,7 @@ public void putInt(IntWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLongWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLong(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLongWithResponseAsync(context)); } /** @@ -671,18 +650,7 @@ public LongWrapper getLong() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putLongWithResponseAsync(LongWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putLong(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putLongWithResponseAsync(complexBody, context)); } /** @@ -788,12 +756,7 @@ public void putLong(LongWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFloatWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFloat(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFloatWithResponseAsync(context)); } /** @@ -883,18 +846,7 @@ public FloatWrapper getFloat() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFloatWithResponseAsync(FloatWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFloat(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putFloatWithResponseAsync(complexBody, context)); } /** @@ -1001,12 +953,7 @@ public void putFloat(FloatWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDoubleWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDouble(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDoubleWithResponseAsync(context)); } /** @@ -1097,18 +1044,7 @@ public DoubleWrapper getDouble() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDoubleWithResponseAsync(DoubleWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDouble(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDoubleWithResponseAsync(complexBody, context)); } /** @@ -1214,12 +1150,7 @@ public void putDouble(DoubleWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBoolWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBool(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBoolWithResponseAsync(context)); } /** @@ -1309,18 +1240,7 @@ public BooleanWrapper getBool() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBoolWithResponseAsync(BooleanWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putBool(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putBoolWithResponseAsync(complexBody, context)); } /** @@ -1427,12 +1347,7 @@ public void putBool(BooleanWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getStringWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringWithResponseAsync(context)); } /** @@ -1523,18 +1438,7 @@ public StringWrapper getString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putStringWithResponseAsync(StringWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putString(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putStringWithResponseAsync(complexBody, context)); } /** @@ -1640,12 +1544,7 @@ public void putString(StringWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDate(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateWithResponseAsync(context)); } /** @@ -1735,18 +1634,7 @@ public DateWrapper getDate() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateWithResponseAsync(DateWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDate(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateWithResponseAsync(complexBody, context)); } /** @@ -1853,12 +1741,7 @@ public void putDate(DateWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeWithResponseAsync(context)); } /** @@ -1949,19 +1832,7 @@ public DatetimeWrapper getDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeWithResponseAsync(DatetimeWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTime(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeWithResponseAsync(complexBody, context)); } /** @@ -2068,12 +1939,7 @@ public void putDateTime(DatetimeWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateTimeRfc1123WithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeRfc1123(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeRfc1123WithResponseAsync(context)); } /** @@ -2164,19 +2030,7 @@ public Datetimerfc1123Wrapper getDateTimeRfc1123() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeRfc1123WithResponseAsync(Datetimerfc1123Wrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTimeRfc1123(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeRfc1123WithResponseAsync(complexBody, context)); } /** @@ -2284,12 +2138,7 @@ public void putDateTimeRfc1123(Datetimerfc1123Wrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDurationWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDuration(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDurationWithResponseAsync(context)); } /** @@ -2380,19 +2229,7 @@ public DurationWrapper getDuration() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDurationWithResponseAsync(DurationWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDuration(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDurationWithResponseAsync(complexBody, context)); } /** @@ -2498,12 +2335,7 @@ public void putDuration(DurationWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getByteWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getByte(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getByteWithResponseAsync(context)); } /** @@ -2593,18 +2425,7 @@ public ByteWrapper getByte() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putByteWithResponseAsync(ByteWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putByte(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putByteWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Readonlyproperties.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Readonlyproperties.java index dfb8c8b522..70ef56f0c8 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Readonlyproperties.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationctorargs/Readonlyproperties.java @@ -93,12 +93,7 @@ Response putValidSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -189,18 +184,7 @@ public ReadonlyObj getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(ReadonlyObj complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Arrays.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Arrays.java index 33b326633a..f670d698a9 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Arrays.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Arrays.java @@ -129,12 +129,7 @@ Response getNotProvidedSync(@HostParam("$host") String host, @Head */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -225,18 +220,7 @@ public ArrayWrapper getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(ArrayWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -348,12 +332,7 @@ public void putValid(ArrayWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -444,18 +423,7 @@ public ArrayWrapper getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(ArrayWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(complexBody, context)); } /** @@ -562,12 +530,7 @@ public void putEmpty(ArrayWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Basics.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Basics.java index 323ed05d08..4f275f1f17 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Basics.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Basics.java @@ -139,12 +139,7 @@ Response getNotProvidedSync(@HostParam("$host") String host, @HeaderParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -235,19 +230,7 @@ public Basic getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Basic complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), this.client.getApiVersion(), - complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -354,12 +337,7 @@ public void putValid(Basic complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getInvalidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInvalid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getInvalidWithResponseAsync(context)); } /** @@ -448,12 +426,7 @@ public Basic getInvalid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -542,12 +515,7 @@ public Basic getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -637,12 +605,7 @@ public Basic getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Dictionaries.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Dictionaries.java index 7324716e3e..ea0a4efc7c 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Dictionaries.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Dictionaries.java @@ -143,12 +143,7 @@ Response getNotProvidedSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -240,18 +235,7 @@ public DictionaryWrapper getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(DictionaryWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -363,12 +347,7 @@ public void putValid(DictionaryWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWithResponseAsync(context)); } /** @@ -459,18 +438,7 @@ public DictionaryWrapper getEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(DictionaryWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putEmptyWithResponseAsync(complexBody, context)); } /** @@ -577,12 +545,7 @@ public void putEmpty(DictionaryWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNullWithResponseAsync(context)); } /** @@ -672,12 +635,7 @@ public DictionaryWrapper getNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNotProvided(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getNotProvidedWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Flattencomplexes.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Flattencomplexes.java index ec3a79e2d2..86d21a4926 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Flattencomplexes.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Flattencomplexes.java @@ -76,12 +76,7 @@ Response getValidSync(@HostParam("$host") String host, @HeaderParam( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Inheritances.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Inheritances.java index 31376c3c8e..c897bd3d58 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Inheritances.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Inheritances.java @@ -90,12 +90,7 @@ Response putValidSync(@HostParam("$host") String host, @BodyParam("applica */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -187,18 +182,7 @@ public Siamese getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Siamese complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Polymorphicrecursives.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Polymorphicrecursives.java index 86d1103de0..cd3a07d7a5 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Polymorphicrecursives.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Polymorphicrecursives.java @@ -91,12 +91,7 @@ Response putValidSync(@HostParam("$host") String host, @BodyParam("applica */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -241,18 +236,7 @@ public Fish getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Polymorphisms.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Polymorphisms.java index 719967ce1a..5bb7465547 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Polymorphisms.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Polymorphisms.java @@ -177,12 +177,7 @@ Response putValidMissingRequiredSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -304,18 +299,7 @@ public Fish getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** @@ -582,12 +566,7 @@ public void putValid(Fish complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDotSyntaxWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDotSyntax(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDotSyntaxWithResponseAsync(context)); } /** @@ -678,13 +657,7 @@ public DotFish getDotSyntax() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComposedWithDiscriminatorWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getComposedWithDiscriminator(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComposedWithDiscriminatorWithResponseAsync(context)); } /** @@ -784,13 +757,7 @@ public DotFishMarket getComposedWithDiscriminator() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComposedWithoutDiscriminatorWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getComposedWithoutDiscriminator(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComposedWithoutDiscriminatorWithResponseAsync(context)); } /** @@ -890,12 +857,7 @@ public DotFishMarket getComposedWithoutDiscriminator() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComplicatedWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getComplicated(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplicatedWithResponseAsync(context)); } /** @@ -990,19 +952,7 @@ public Salmon getComplicated() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putComplicatedWithResponseAsync(Salmon complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putComplicated(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putComplicatedWithResponseAsync(complexBody, context)); } /** @@ -1110,19 +1060,7 @@ public void putComplicated(Salmon complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMissingDiscriminatorWithResponseAsync(Salmon complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putMissingDiscriminator(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putMissingDiscriminatorWithResponseAsync(complexBody, context)); } /** @@ -1259,19 +1197,7 @@ public Salmon putMissingDiscriminator(Salmon complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidMissingRequiredWithResponseAsync(Fish complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putValidMissingRequired(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidMissingRequiredWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Primitives.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Primitives.java index c4f08930a8..54bca468f7 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Primitives.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Primitives.java @@ -363,12 +363,7 @@ Response putByteSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getIntWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getInt(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getIntWithResponseAsync(context)); } /** @@ -459,18 +454,7 @@ public IntWrapper getInt() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putIntWithResponseAsync(IntWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putInt(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putIntWithResponseAsync(complexBody, context)); } /** @@ -576,12 +560,7 @@ public void putInt(IntWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLongWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLong(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getLongWithResponseAsync(context)); } /** @@ -671,18 +650,7 @@ public LongWrapper getLong() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putLongWithResponseAsync(LongWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putLong(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putLongWithResponseAsync(complexBody, context)); } /** @@ -788,12 +756,7 @@ public void putLong(LongWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFloatWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFloat(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getFloatWithResponseAsync(context)); } /** @@ -883,18 +846,7 @@ public FloatWrapper getFloat() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFloatWithResponseAsync(FloatWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFloat(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putFloatWithResponseAsync(complexBody, context)); } /** @@ -1001,12 +953,7 @@ public void putFloat(FloatWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDoubleWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDouble(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDoubleWithResponseAsync(context)); } /** @@ -1097,18 +1044,7 @@ public DoubleWrapper getDouble() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDoubleWithResponseAsync(DoubleWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDouble(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDoubleWithResponseAsync(complexBody, context)); } /** @@ -1214,12 +1150,7 @@ public void putDouble(DoubleWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBoolWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getBool(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBoolWithResponseAsync(context)); } /** @@ -1309,18 +1240,7 @@ public BooleanWrapper getBool() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBoolWithResponseAsync(BooleanWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putBool(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putBoolWithResponseAsync(complexBody, context)); } /** @@ -1427,12 +1347,7 @@ public void putBool(BooleanWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getStringWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getString(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getStringWithResponseAsync(context)); } /** @@ -1523,18 +1438,7 @@ public StringWrapper getString() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putStringWithResponseAsync(StringWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putString(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putStringWithResponseAsync(complexBody, context)); } /** @@ -1640,12 +1544,7 @@ public void putString(StringWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDate(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateWithResponseAsync(context)); } /** @@ -1735,18 +1634,7 @@ public DateWrapper getDate() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateWithResponseAsync(DateWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDate(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateWithResponseAsync(complexBody, context)); } /** @@ -1853,12 +1741,7 @@ public void putDate(DateWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateTimeWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTime(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeWithResponseAsync(context)); } /** @@ -1949,19 +1832,7 @@ public DatetimeWrapper getDateTime() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeWithResponseAsync(DatetimeWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTime(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeWithResponseAsync(complexBody, context)); } /** @@ -2068,12 +1939,7 @@ public void putDateTime(DatetimeWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDateTimeRfc1123WithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDateTimeRfc1123(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDateTimeRfc1123WithResponseAsync(context)); } /** @@ -2164,19 +2030,7 @@ public Datetimerfc1123Wrapper getDateTimeRfc1123() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDateTimeRfc1123WithResponseAsync(Datetimerfc1123Wrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDateTimeRfc1123(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDateTimeRfc1123WithResponseAsync(complexBody, context)); } /** @@ -2284,12 +2138,7 @@ public void putDateTimeRfc1123(Datetimerfc1123Wrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDurationWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDuration(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getDurationWithResponseAsync(context)); } /** @@ -2380,19 +2229,7 @@ public DurationWrapper getDuration() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDurationWithResponseAsync(DurationWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putDuration(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putDurationWithResponseAsync(complexBody, context)); } /** @@ -2498,12 +2335,7 @@ public void putDuration(DurationWrapper complexBody) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getByteWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getByte(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getByteWithResponseAsync(context)); } /** @@ -2593,18 +2425,7 @@ public ByteWrapper getByte() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putByteWithResponseAsync(ByteWrapper complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putByte(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putByteWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Readonlyproperties.java b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Readonlyproperties.java index 2369464102..ada9cf0c67 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Readonlyproperties.java +++ b/vanilla-tests/src/main/java/fixtures/streamstyleserializationimmutableoutput/Readonlyproperties.java @@ -93,12 +93,7 @@ Response putValidSync(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync() { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getValidWithResponseAsync(context)); } /** @@ -189,18 +184,7 @@ public ReadonlyObj getValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(ReadonlyObj complexBody) { - if (this.client.getHost() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (complexBody == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); - } else { - complexBody.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(this.client.getHost(), complexBody, accept, context)); + return FluxUtil.withContext(context -> putValidWithResponseAsync(complexBody, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/streamstylexmlserialization/Xmls.java b/vanilla-tests/src/main/java/fixtures/streamstylexmlserialization/Xmls.java index 2383c2ff3a..2ea784ce53 100644 --- a/vanilla-tests/src/main/java/fixtures/streamstylexmlserialization/Xmls.java +++ b/vanilla-tests/src/main/java/fixtures/streamstylexmlserialization/Xmls.java @@ -300,12 +300,7 @@ Mono> putUri(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComplexTypeRefNoMetaWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getComplexTypeRefNoMeta(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexTypeRefNoMetaWithResponseAsync(context)); } /** @@ -393,16 +388,7 @@ public RootWithRefAndNoMeta getComplexTypeRefNoMeta() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putComplexTypeRefNoMetaWithResponseAsync(RootWithRefAndNoMeta model) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (model == null) { - return Mono.error(new IllegalArgumentException("Parameter model is required and cannot be null.")); - } else { - model.validate(); - } - return FluxUtil.withContext(context -> service.putComplexTypeRefNoMeta(this.client.getHost(), model, context)); + return FluxUtil.withContext(context -> putComplexTypeRefNoMetaWithResponseAsync(model, context)); } /** @@ -496,13 +482,7 @@ public void putComplexTypeRefNoMeta(RootWithRefAndNoMeta model) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComplexTypeRefWithMetaWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.getComplexTypeRefWithMeta(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexTypeRefWithMetaWithResponseAsync(context)); } /** @@ -588,17 +568,7 @@ public RootWithRefAndMeta getComplexTypeRefWithMeta() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putComplexTypeRefWithMetaWithResponseAsync(RootWithRefAndMeta model) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (model == null) { - return Mono.error(new IllegalArgumentException("Parameter model is required and cannot be null.")); - } else { - model.validate(); - } - return FluxUtil - .withContext(context -> service.putComplexTypeRefWithMeta(this.client.getHost(), model, context)); + return FluxUtil.withContext(context -> putComplexTypeRefWithMetaWithResponseAsync(model, context)); } /** @@ -691,12 +661,7 @@ public void putComplexTypeRefWithMeta(RootWithRefAndMeta model) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSimpleWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getSimple(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getSimpleWithResponseAsync(context)); } /** @@ -781,17 +746,7 @@ public Slideshow getSimple() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putSimpleWithResponseAsync(Slideshow slideshow) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (slideshow == null) { - return Mono.error(new IllegalArgumentException("Parameter slideshow is required and cannot be null.")); - } else { - slideshow.validate(); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.putSimple(this.client.getHost(), slideshow, accept, context)); + return FluxUtil.withContext(context -> putSimpleWithResponseAsync(slideshow, context)); } /** @@ -886,12 +841,7 @@ public void putSimple(Slideshow slideshow) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWrappedListsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getWrappedLists(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWrappedListsWithResponseAsync(context)); } /** @@ -977,18 +927,7 @@ public AppleBarrel getWrappedLists() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWrappedListsWithResponseAsync(AppleBarrel wrappedLists) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (wrappedLists == null) { - return Mono.error(new IllegalArgumentException("Parameter wrappedLists is required and cannot be null.")); - } else { - wrappedLists.validate(); - } - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.putWrappedLists(this.client.getHost(), wrappedLists, accept, context)); + return FluxUtil.withContext(context -> putWrappedListsWithResponseAsync(wrappedLists, context)); } /** @@ -1082,11 +1021,7 @@ public void putWrappedLists(AppleBarrel wrappedLists) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.getHeaders(this.client.getHost(), context)); + return FluxUtil.withContext(context -> getHeadersWithResponseAsync(context)); } /** @@ -1167,11 +1102,7 @@ public void getHeaders() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getHeadersNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.getHeadersNoCustomHeaders(this.client.getHost(), context)); + return FluxUtil.withContext(context -> getHeadersNoCustomHeadersWithResponseAsync(context)); } /** @@ -1215,12 +1146,7 @@ public Response getHeadersNoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyListWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getEmptyList(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyListWithResponseAsync(context)); } /** @@ -1305,16 +1231,7 @@ public Slideshow getEmptyList() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyListWithResponseAsync(Slideshow slideshow) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (slideshow == null) { - return Mono.error(new IllegalArgumentException("Parameter slideshow is required and cannot be null.")); - } else { - slideshow.validate(); - } - return FluxUtil.withContext(context -> service.putEmptyList(this.client.getHost(), slideshow, context)); + return FluxUtil.withContext(context -> putEmptyListWithResponseAsync(slideshow, context)); } /** @@ -1407,12 +1324,7 @@ public void putEmptyList(Slideshow slideshow) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWrappedListsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getEmptyWrappedLists(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWrappedListsWithResponseAsync(context)); } /** @@ -1497,17 +1409,7 @@ public AppleBarrel getEmptyWrappedLists() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWrappedListsWithResponseAsync(AppleBarrel appleBarrel) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (appleBarrel == null) { - return Mono.error(new IllegalArgumentException("Parameter appleBarrel is required and cannot be null.")); - } else { - appleBarrel.validate(); - } - return FluxUtil - .withContext(context -> service.putEmptyWrappedLists(this.client.getHost(), appleBarrel, context)); + return FluxUtil.withContext(context -> putEmptyWrappedListsWithResponseAsync(appleBarrel, context)); } /** @@ -1600,12 +1502,7 @@ public void putEmptyWrappedLists(AppleBarrel appleBarrel) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getRootListWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getRootList(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getRootListWithResponseAsync(context)); } /** @@ -1690,17 +1587,7 @@ public List getRootList() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRootListWithResponseAsync(List bananas) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bananas == null) { - return Mono.error(new IllegalArgumentException("Parameter bananas is required and cannot be null.")); - } else { - bananas.forEach(e -> e.validate()); - } - BananaWrapper bananasConverted = new BananaWrapper(bananas); - return FluxUtil.withContext(context -> service.putRootList(this.client.getHost(), bananasConverted, context)); + return FluxUtil.withContext(context -> putRootListWithResponseAsync(bananas, context)); } /** @@ -1794,12 +1681,7 @@ public void putRootList(List bananas) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getRootListSingleItemWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getRootListSingleItem(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getRootListSingleItemWithResponseAsync(context)); } /** @@ -1884,18 +1766,7 @@ public List getRootListSingleItem() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRootListSingleItemWithResponseAsync(List bananas) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bananas == null) { - return Mono.error(new IllegalArgumentException("Parameter bananas is required and cannot be null.")); - } else { - bananas.forEach(e -> e.validate()); - } - BananaWrapper bananasConverted = new BananaWrapper(bananas); - return FluxUtil - .withContext(context -> service.putRootListSingleItem(this.client.getHost(), bananasConverted, context)); + return FluxUtil.withContext(context -> putRootListSingleItemWithResponseAsync(bananas, context)); } /** @@ -1989,12 +1860,7 @@ public void putRootListSingleItem(List bananas) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getEmptyRootListWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getEmptyRootList(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyRootListWithResponseAsync(context)); } /** @@ -2079,18 +1945,7 @@ public List getEmptyRootList() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyRootListWithResponseAsync(List bananas) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bananas == null) { - return Mono.error(new IllegalArgumentException("Parameter bananas is required and cannot be null.")); - } else { - bananas.forEach(e -> e.validate()); - } - BananaWrapper bananasConverted = new BananaWrapper(bananas); - return FluxUtil - .withContext(context -> service.putEmptyRootList(this.client.getHost(), bananasConverted, context)); + return FluxUtil.withContext(context -> putEmptyRootListWithResponseAsync(bananas, context)); } /** @@ -2185,12 +2040,7 @@ public void putEmptyRootList(List bananas) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyChildElementWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getEmptyChildElement(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyChildElementWithResponseAsync(context)); } /** @@ -2276,16 +2126,7 @@ public Banana getEmptyChildElement() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyChildElementWithResponseAsync(Banana banana) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (banana == null) { - return Mono.error(new IllegalArgumentException("Parameter banana is required and cannot be null.")); - } else { - banana.validate(); - } - return FluxUtil.withContext(context -> service.putEmptyChildElement(this.client.getHost(), banana, context)); + return FluxUtil.withContext(context -> putEmptyChildElementWithResponseAsync(banana, context)); } /** @@ -2378,13 +2219,7 @@ public void putEmptyChildElement(Banana banana) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listContainersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String comp = "list"; - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.listContainers(this.client.getHost(), comp, accept, context)); + return FluxUtil.withContext(context -> listContainersWithResponseAsync(context)); } /** @@ -2468,15 +2303,7 @@ public ListContainersResponse listContainers() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getServicePropertiesWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String comp = "properties"; - final String restype = "service"; - final String accept = "application/xml"; - return FluxUtil.withContext( - context -> service.getServiceProperties(this.client.getHost(), comp, restype, accept, context)); + return FluxUtil.withContext(context -> getServicePropertiesWithResponseAsync(context)); } /** @@ -2563,19 +2390,7 @@ public StorageServiceProperties getServiceProperties() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putServicePropertiesWithResponseAsync(StorageServiceProperties properties) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String comp = "properties"; - final String restype = "service"; - return FluxUtil.withContext( - context -> service.putServiceProperties(this.client.getHost(), comp, restype, properties, context)); + return FluxUtil.withContext(context -> putServicePropertiesWithResponseAsync(properties, context)); } /** @@ -2671,14 +2486,7 @@ public void putServiceProperties(StorageServiceProperties properties) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAclsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String comp = "acl"; - final String restype = "container"; - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAcls(this.client.getHost(), comp, restype, accept, context)); + return FluxUtil.withContext(context -> getAclsWithResponseAsync(context)); } /** @@ -2765,20 +2573,7 @@ public SignedIdentifierWrapper getAcls() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAclsWithResponseAsync(List properties) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.forEach(e -> e.validate()); - } - final String comp = "acl"; - final String restype = "container"; - SignedIdentifierWrapper propertiesConverted = new SignedIdentifierWrapper(properties); - return FluxUtil.withContext( - context -> service.putAcls(this.client.getHost(), comp, restype, propertiesConverted, context)); + return FluxUtil.withContext(context -> putAclsWithResponseAsync(properties, context)); } /** @@ -2874,15 +2669,7 @@ public void putAcls(List properties) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listBlobsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String comp = "list"; - final String restype = "container"; - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.listBlobs(this.client.getHost(), comp, restype, accept, context)); + return FluxUtil.withContext(context -> listBlobsWithResponseAsync(context)); } /** @@ -2969,16 +2756,7 @@ public ListBlobsResponse listBlobs() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> jsonInputWithResponseAsync(JsonInput properties) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - return FluxUtil.withContext(context -> service.jsonInput(this.client.getHost(), properties, context)); + return FluxUtil.withContext(context -> jsonInputWithResponseAsync(properties, context)); } /** @@ -3071,12 +2849,7 @@ public void jsonInput(JsonInput properties) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> jsonOutputWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.jsonOutput(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> jsonOutputWithResponseAsync(context)); } /** @@ -3162,12 +2935,7 @@ public JsonOutput jsonOutput() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getXMsTextWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getXMsText(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getXMsTextWithResponseAsync(context)); } /** @@ -3262,12 +3030,7 @@ public ObjectWithXMsTextProperty getXMsText() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBytesWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getBytes(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBytesWithResponseAsync(context)); } /** @@ -3353,17 +3116,7 @@ public ModelWithByteProperty getBytes() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBinaryWithResponseAsync(ModelWithByteProperty slideshow) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (slideshow == null) { - return Mono.error(new IllegalArgumentException("Parameter slideshow is required and cannot be null.")); - } else { - slideshow.validate(); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.putBinary(this.client.getHost(), slideshow, accept, context)); + return FluxUtil.withContext(context -> putBinaryWithResponseAsync(slideshow, context)); } /** @@ -3457,12 +3210,7 @@ public void putBinary(ModelWithByteProperty slideshow) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUriWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getUri(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUriWithResponseAsync(context)); } /** @@ -3547,17 +3295,7 @@ public ModelWithUrlProperty getUri() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUriWithResponseAsync(ModelWithUrlProperty model) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (model == null) { - return Mono.error(new IllegalArgumentException("Parameter model is required and cannot be null.")); - } else { - model.validate(); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.putUri(this.client.getHost(), model, accept, context)); + return FluxUtil.withContext(context -> putUriWithResponseAsync(model, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/url/PathItems.java b/vanilla-tests/src/main/java/fixtures/url/PathItems.java index e3803c87b0..60a85859ec 100644 --- a/vanilla-tests/src/main/java/fixtures/url/PathItems.java +++ b/vanilla-tests/src/main/java/fixtures/url/PathItems.java @@ -120,26 +120,8 @@ Mono> getLocalPathItemQueryNull(@HostParam("$host") String host, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithValuesWithResponseAsync(String pathItemStringPath, String localStringPath, String pathItemStringQuery, String localStringQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (pathItemStringPath == null) { - return Mono - .error(new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null.")); - } - if (this.client.getGlobalStringPath() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getGlobalStringPath() is required and cannot be null.")); - } - if (localStringPath == null) { - return Mono - .error(new IllegalArgumentException("Parameter localStringPath is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAllWithValues(this.client.getHost(), pathItemStringPath, - pathItemStringQuery, this.client.getGlobalStringPath(), this.client.getGlobalStringQuery(), localStringPath, - localStringQuery, accept, context)); + return FluxUtil.withContext(context -> getAllWithValuesWithResponseAsync(pathItemStringPath, localStringPath, + pathItemStringQuery, localStringQuery, context)); } /** @@ -323,26 +305,8 @@ public void getAllWithValues(String pathItemStringPath, String localStringPath) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getGlobalQueryNullWithResponseAsync(String pathItemStringPath, String localStringPath, String pathItemStringQuery, String localStringQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (pathItemStringPath == null) { - return Mono - .error(new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null.")); - } - if (this.client.getGlobalStringPath() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getGlobalStringPath() is required and cannot be null.")); - } - if (localStringPath == null) { - return Mono - .error(new IllegalArgumentException("Parameter localStringPath is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getGlobalQueryNull(this.client.getHost(), pathItemStringPath, - pathItemStringQuery, this.client.getGlobalStringPath(), this.client.getGlobalStringQuery(), localStringPath, - localStringQuery, accept, context)); + return FluxUtil.withContext(context -> getGlobalQueryNullWithResponseAsync(pathItemStringPath, localStringPath, + pathItemStringQuery, localStringQuery, context)); } /** @@ -526,26 +490,8 @@ public void getGlobalQueryNull(String pathItemStringPath, String localStringPath @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getGlobalAndLocalQueryNullWithResponseAsync(String pathItemStringPath, String localStringPath, String pathItemStringQuery, String localStringQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (pathItemStringPath == null) { - return Mono - .error(new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null.")); - } - if (this.client.getGlobalStringPath() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getGlobalStringPath() is required and cannot be null.")); - } - if (localStringPath == null) { - return Mono - .error(new IllegalArgumentException("Parameter localStringPath is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getGlobalAndLocalQueryNull(this.client.getHost(), - pathItemStringPath, pathItemStringQuery, this.client.getGlobalStringPath(), - this.client.getGlobalStringQuery(), localStringPath, localStringQuery, accept, context)); + return FluxUtil.withContext(context -> getGlobalAndLocalQueryNullWithResponseAsync(pathItemStringPath, + localStringPath, pathItemStringQuery, localStringQuery, context)); } /** @@ -729,26 +675,8 @@ public void getGlobalAndLocalQueryNull(String pathItemStringPath, String localSt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLocalPathItemQueryNullWithResponseAsync(String pathItemStringPath, String localStringPath, String pathItemStringQuery, String localStringQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (pathItemStringPath == null) { - return Mono - .error(new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null.")); - } - if (this.client.getGlobalStringPath() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getGlobalStringPath() is required and cannot be null.")); - } - if (localStringPath == null) { - return Mono - .error(new IllegalArgumentException("Parameter localStringPath is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLocalPathItemQueryNull(this.client.getHost(), - pathItemStringPath, pathItemStringQuery, this.client.getGlobalStringPath(), - this.client.getGlobalStringQuery(), localStringPath, localStringQuery, accept, context)); + return FluxUtil.withContext(context -> getLocalPathItemQueryNullWithResponseAsync(pathItemStringPath, + localStringPath, pathItemStringQuery, localStringQuery, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/url/Paths.java b/vanilla-tests/src/main/java/fixtures/url/Paths.java index 044ecaf626..01099fcc3d 100644 --- a/vanilla-tests/src/main/java/fixtures/url/Paths.java +++ b/vanilla-tests/src/main/java/fixtures/url/Paths.java @@ -235,14 +235,7 @@ Mono> unixTimeUrl(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBooleanTrueWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final boolean boolPath = true; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBooleanTrue(this.client.getHost(), boolPath, accept, context)); + return FluxUtil.withContext(context -> getBooleanTrueWithResponseAsync(context)); } /** @@ -325,14 +318,7 @@ public void getBooleanTrue() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBooleanFalseWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final boolean boolPath = false; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBooleanFalse(this.client.getHost(), boolPath, accept, context)); + return FluxUtil.withContext(context -> getBooleanFalseWithResponseAsync(context)); } /** @@ -415,14 +401,7 @@ public void getBooleanFalse() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getIntOneMillionWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final int intPath = 1000000; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getIntOneMillion(this.client.getHost(), intPath, accept, context)); + return FluxUtil.withContext(context -> getIntOneMillionWithResponseAsync(context)); } /** @@ -505,14 +484,7 @@ public void getIntOneMillion() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getIntNegativeOneMillionWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final int intPath = -1000000; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getIntNegativeOneMillion(this.client.getHost(), intPath, accept, context)); + return FluxUtil.withContext(context -> getIntNegativeOneMillionWithResponseAsync(context)); } /** @@ -595,13 +567,7 @@ public void getIntNegativeOneMillion() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getTenBillionWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final long longPath = 10000000000L; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTenBillion(this.client.getHost(), longPath, accept, context)); + return FluxUtil.withContext(context -> getTenBillionWithResponseAsync(context)); } /** @@ -684,14 +650,7 @@ public void getTenBillion() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNegativeTenBillionWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final long longPath = -10000000000L; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getNegativeTenBillion(this.client.getHost(), longPath, accept, context)); + return FluxUtil.withContext(context -> getNegativeTenBillionWithResponseAsync(context)); } /** @@ -774,14 +733,7 @@ public void getNegativeTenBillion() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatScientificPositiveWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final float floatPath = 103400000000000000000f; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.floatScientificPositive(this.client.getHost(), floatPath, accept, context)); + return FluxUtil.withContext(context -> floatScientificPositiveWithResponseAsync(context)); } /** @@ -864,14 +816,7 @@ public void floatScientificPositive() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatScientificNegativeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final float floatPath = -1.034E-20f; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.floatScientificNegative(this.client.getHost(), floatPath, accept, context)); + return FluxUtil.withContext(context -> floatScientificNegativeWithResponseAsync(context)); } /** @@ -954,14 +899,7 @@ public void floatScientificNegative() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> doubleDecimalPositiveWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final double doublePath = 9999999.999; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.doubleDecimalPositive(this.client.getHost(), doublePath, accept, context)); + return FluxUtil.withContext(context -> doubleDecimalPositiveWithResponseAsync(context)); } /** @@ -1044,14 +982,7 @@ public void doubleDecimalPositive() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> doubleDecimalNegativeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final double doublePath = -9999999.999; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.doubleDecimalNegative(this.client.getHost(), doublePath, accept, context)); + return FluxUtil.withContext(context -> doubleDecimalNegativeWithResponseAsync(context)); } /** @@ -1135,14 +1066,7 @@ public void doubleDecimalNegative() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stringUnicodeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String stringPath = "啊齄丂狛狜隣郎隣兀﨩"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.stringUnicode(this.client.getHost(), stringPath, accept, context)); + return FluxUtil.withContext(context -> stringUnicodeWithResponseAsync(context)); } /** @@ -1227,14 +1151,7 @@ public void stringUnicode() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stringUrlEncodedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String stringPath = "begin!*'();:@ &=+$,/?#[]end"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.stringUrlEncoded(this.client.getHost(), stringPath, accept, context)); + return FluxUtil.withContext(context -> stringUrlEncodedWithResponseAsync(context)); } /** @@ -1320,14 +1237,7 @@ public void stringUrlEncoded() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stringUrlNonEncodedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String stringPath = "begin!*'();:@&=+$,end"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.stringUrlNonEncoded(this.client.getHost(), stringPath, accept, context)); + return FluxUtil.withContext(context -> stringUrlNonEncodedWithResponseAsync(context)); } /** @@ -1420,13 +1330,7 @@ public void stringUrlNonEncoded() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stringEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String stringPath = ""; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.stringEmpty(this.client.getHost(), stringPath, accept, context)); + return FluxUtil.withContext(context -> stringEmptyWithResponseAsync(context)); } /** @@ -1511,15 +1415,7 @@ public void stringEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stringNullWithResponseAsync(String stringPath) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (stringPath == null) { - return Mono.error(new IllegalArgumentException("Parameter stringPath is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.stringNull(this.client.getHost(), stringPath, accept, context)); + return FluxUtil.withContext(context -> stringNullWithResponseAsync(stringPath, context)); } /** @@ -1614,15 +1510,7 @@ public void stringNull(String stringPath) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> enumValidWithResponseAsync(UriColor enumPath) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (enumPath == null) { - return Mono.error(new IllegalArgumentException("Parameter enumPath is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.enumValid(this.client.getHost(), enumPath, accept, context)); + return FluxUtil.withContext(context -> enumValidWithResponseAsync(enumPath, context)); } /** @@ -1718,15 +1606,7 @@ public void enumValid(UriColor enumPath) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> enumNullWithResponseAsync(UriColor enumPath) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (enumPath == null) { - return Mono.error(new IllegalArgumentException("Parameter enumPath is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.enumNull(this.client.getHost(), enumPath, accept, context)); + return FluxUtil.withContext(context -> enumNullWithResponseAsync(enumPath, context)); } /** @@ -1824,17 +1704,7 @@ public void enumNull(UriColor enumPath) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> byteMultiByteWithResponseAsync(byte[] bytePath) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bytePath == null) { - return Mono.error(new IllegalArgumentException("Parameter bytePath is required and cannot be null.")); - } - final String accept = "application/json"; - String bytePathConverted = Base64Util.encodeToString(bytePath); - return FluxUtil - .withContext(context -> service.byteMultiByte(this.client.getHost(), bytePathConverted, accept, context)); + return FluxUtil.withContext(context -> byteMultiByteWithResponseAsync(bytePath, context)); } /** @@ -1928,15 +1798,7 @@ public void byteMultiByte(byte[] bytePath) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> byteEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final byte[] bytePath = "".getBytes(); - final String accept = "application/json"; - String bytePathConverted = Base64Util.encodeToString(bytePath); - return FluxUtil - .withContext(context -> service.byteEmpty(this.client.getHost(), bytePathConverted, accept, context)); + return FluxUtil.withContext(context -> byteEmptyWithResponseAsync(context)); } /** @@ -2022,17 +1884,7 @@ public void byteEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> byteNullWithResponseAsync(byte[] bytePath) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bytePath == null) { - return Mono.error(new IllegalArgumentException("Parameter bytePath is required and cannot be null.")); - } - final String accept = "application/json"; - String bytePathConverted = Base64Util.encodeToString(bytePath); - return FluxUtil - .withContext(context -> service.byteNull(this.client.getHost(), bytePathConverted, accept, context)); + return FluxUtil.withContext(context -> byteNullWithResponseAsync(bytePath, context)); } /** @@ -2125,13 +1977,7 @@ public void byteNull(byte[] bytePath) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> dateValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final LocalDate datePath = LocalDate.parse("2012-01-01"); - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.dateValid(this.client.getHost(), datePath, accept, context)); + return FluxUtil.withContext(context -> dateValidWithResponseAsync(context)); } /** @@ -2217,15 +2063,7 @@ public void dateValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> dateNullWithResponseAsync(LocalDate datePath) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (datePath == null) { - return Mono.error(new IllegalArgumentException("Parameter datePath is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.dateNull(this.client.getHost(), datePath, accept, context)); + return FluxUtil.withContext(context -> dateNullWithResponseAsync(datePath, context)); } /** @@ -2321,14 +2159,7 @@ public void dateNull(LocalDate datePath) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> dateTimeValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final OffsetDateTime dateTimePath = OffsetDateTime.parse("2012-01-01T01:01:01Z"); - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.dateTimeValid(this.client.getHost(), dateTimePath, accept, context)); + return FluxUtil.withContext(context -> dateTimeValidWithResponseAsync(context)); } /** @@ -2414,16 +2245,7 @@ public void dateTimeValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> dateTimeNullWithResponseAsync(OffsetDateTime dateTimePath) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (dateTimePath == null) { - return Mono.error(new IllegalArgumentException("Parameter dateTimePath is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.dateTimeNull(this.client.getHost(), dateTimePath, accept, context)); + return FluxUtil.withContext(context -> dateTimeNullWithResponseAsync(dateTimePath, context)); } /** @@ -2522,17 +2344,7 @@ public void dateTimeNull(OffsetDateTime dateTimePath) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64UrlWithResponseAsync(byte[] base64UrlPath) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (base64UrlPath == null) { - return Mono.error(new IllegalArgumentException("Parameter base64UrlPath is required and cannot be null.")); - } - final String accept = "application/json"; - Base64Url base64UrlPathConverted = Base64Url.encode(base64UrlPath); - return FluxUtil - .withContext(context -> service.base64Url(this.client.getHost(), base64UrlPathConverted, accept, context)); + return FluxUtil.withContext(context -> base64UrlWithResponseAsync(base64UrlPath, context)); } /** @@ -2631,19 +2443,7 @@ public void base64Url(byte[] base64UrlPath) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> arrayCsvInPathWithResponseAsync(List arrayPath) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (arrayPath == null) { - return Mono.error(new IllegalArgumentException("Parameter arrayPath is required and cannot be null.")); - } - final String accept = "application/json"; - String arrayPathConverted = arrayPath.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil - .withContext(context -> service.arrayCsvInPath(this.client.getHost(), arrayPathConverted, accept, context)); + return FluxUtil.withContext(context -> arrayCsvInPathWithResponseAsync(arrayPath, context)); } /** @@ -2755,18 +2555,7 @@ public void arrayCsvInPath(List arrayPath) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimeUrlWithResponseAsync(OffsetDateTime unixTimeUrlPath) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (unixTimeUrlPath == null) { - return Mono - .error(new IllegalArgumentException("Parameter unixTimeUrlPath is required and cannot be null.")); - } - final String accept = "application/json"; - long unixTimeUrlPathConverted = unixTimeUrlPath.toEpochSecond(); - return FluxUtil.withContext( - context -> service.unixTimeUrl(this.client.getHost(), unixTimeUrlPathConverted, accept, context)); + return FluxUtil.withContext(context -> unixTimeUrlWithResponseAsync(unixTimeUrlPath, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/url/Queries.java b/vanilla-tests/src/main/java/fixtures/url/Queries.java index 680f36e6e1..a5c0cfcd93 100644 --- a/vanilla-tests/src/main/java/fixtures/url/Queries.java +++ b/vanilla-tests/src/main/java/fixtures/url/Queries.java @@ -281,14 +281,7 @@ Mono> arrayStringPipesValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBooleanTrueWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final boolean boolQuery = true; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBooleanTrue(this.client.getHost(), boolQuery, accept, context)); + return FluxUtil.withContext(context -> getBooleanTrueWithResponseAsync(context)); } /** @@ -371,14 +364,7 @@ public void getBooleanTrue() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBooleanFalseWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final boolean boolQuery = false; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBooleanFalse(this.client.getHost(), boolQuery, accept, context)); + return FluxUtil.withContext(context -> getBooleanFalseWithResponseAsync(context)); } /** @@ -464,13 +450,7 @@ public void getBooleanFalse() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBooleanNullWithResponseAsync(Boolean boolQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBooleanNull(this.client.getHost(), boolQuery, accept, context)); + return FluxUtil.withContext(context -> getBooleanNullWithResponseAsync(boolQuery, context)); } /** @@ -585,14 +565,7 @@ public void getBooleanNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getIntOneMillionWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final int intQuery = 1000000; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getIntOneMillion(this.client.getHost(), intQuery, accept, context)); + return FluxUtil.withContext(context -> getIntOneMillionWithResponseAsync(context)); } /** @@ -675,14 +648,7 @@ public void getIntOneMillion() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getIntNegativeOneMillionWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final int intQuery = -1000000; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getIntNegativeOneMillion(this.client.getHost(), intQuery, accept, context)); + return FluxUtil.withContext(context -> getIntNegativeOneMillionWithResponseAsync(context)); } /** @@ -768,12 +734,7 @@ public void getIntNegativeOneMillion() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getIntNullWithResponseAsync(Integer intQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getIntNull(this.client.getHost(), intQuery, accept, context)); + return FluxUtil.withContext(context -> getIntNullWithResponseAsync(intQuery, context)); } /** @@ -888,14 +849,7 @@ public void getIntNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getTenBillionWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final long longQuery = 10000000000L; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getTenBillion(this.client.getHost(), longQuery, accept, context)); + return FluxUtil.withContext(context -> getTenBillionWithResponseAsync(context)); } /** @@ -978,14 +932,7 @@ public void getTenBillion() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNegativeTenBillionWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final long longQuery = -10000000000L; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getNegativeTenBillion(this.client.getHost(), longQuery, accept, context)); + return FluxUtil.withContext(context -> getNegativeTenBillionWithResponseAsync(context)); } /** @@ -1071,12 +1018,7 @@ public void getNegativeTenBillion() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLongNullWithResponseAsync(Long longQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLongNull(this.client.getHost(), longQuery, accept, context)); + return FluxUtil.withContext(context -> getLongNullWithResponseAsync(longQuery, context)); } /** @@ -1191,14 +1133,7 @@ public void getLongNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatScientificPositiveWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final float floatQuery = 103400000000000000000f; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.floatScientificPositive(this.client.getHost(), floatQuery, accept, context)); + return FluxUtil.withContext(context -> floatScientificPositiveWithResponseAsync(context)); } /** @@ -1281,14 +1216,7 @@ public void floatScientificPositive() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatScientificNegativeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final float floatQuery = -1.034E-20f; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.floatScientificNegative(this.client.getHost(), floatQuery, accept, context)); + return FluxUtil.withContext(context -> floatScientificNegativeWithResponseAsync(context)); } /** @@ -1374,12 +1302,7 @@ public void floatScientificNegative() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatNullWithResponseAsync(Float floatQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.floatNull(this.client.getHost(), floatQuery, accept, context)); + return FluxUtil.withContext(context -> floatNullWithResponseAsync(floatQuery, context)); } /** @@ -1494,14 +1417,7 @@ public void floatNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> doubleDecimalPositiveWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final double doubleQuery = 9999999.999; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.doubleDecimalPositive(this.client.getHost(), doubleQuery, accept, context)); + return FluxUtil.withContext(context -> doubleDecimalPositiveWithResponseAsync(context)); } /** @@ -1584,14 +1500,7 @@ public void doubleDecimalPositive() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> doubleDecimalNegativeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final double doubleQuery = -9999999.999; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.doubleDecimalNegative(this.client.getHost(), doubleQuery, accept, context)); + return FluxUtil.withContext(context -> doubleDecimalNegativeWithResponseAsync(context)); } /** @@ -1677,12 +1586,7 @@ public void doubleDecimalNegative() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> doubleNullWithResponseAsync(Double doubleQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.doubleNull(this.client.getHost(), doubleQuery, accept, context)); + return FluxUtil.withContext(context -> doubleNullWithResponseAsync(doubleQuery, context)); } /** @@ -1798,14 +1702,7 @@ public void doubleNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stringUnicodeWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String stringQuery = "啊齄丂狛狜隣郎隣兀﨩"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.stringUnicode(this.client.getHost(), stringQuery, accept, context)); + return FluxUtil.withContext(context -> stringUnicodeWithResponseAsync(context)); } /** @@ -1890,14 +1787,7 @@ public void stringUnicode() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stringUrlEncodedWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String stringQuery = "begin!*'();:@ &=+$,/?#[]end"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.stringUrlEncoded(this.client.getHost(), stringQuery, accept, context)); + return FluxUtil.withContext(context -> stringUrlEncodedWithResponseAsync(context)); } /** @@ -1981,14 +1871,7 @@ public void stringUrlEncoded() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stringEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String stringQuery = ""; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.stringEmpty(this.client.getHost(), stringQuery, accept, context)); + return FluxUtil.withContext(context -> stringEmptyWithResponseAsync(context)); } /** @@ -2073,12 +1956,7 @@ public void stringEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stringNullWithResponseAsync(String stringQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.stringNull(this.client.getHost(), stringQuery, accept, context)); + return FluxUtil.withContext(context -> stringNullWithResponseAsync(stringQuery, context)); } /** @@ -2195,12 +2073,7 @@ public void stringNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> enumValidWithResponseAsync(UriColor enumQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.enumValid(this.client.getHost(), enumQuery, accept, context)); + return FluxUtil.withContext(context -> enumValidWithResponseAsync(enumQuery, context)); } /** @@ -2317,12 +2190,7 @@ public void enumValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> enumNullWithResponseAsync(UriColor enumQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.enumNull(this.client.getHost(), enumQuery, accept, context)); + return FluxUtil.withContext(context -> enumNullWithResponseAsync(enumQuery, context)); } /** @@ -2439,14 +2307,7 @@ public void enumNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> byteMultiByteWithResponseAsync(byte[] byteQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - String byteQueryConverted = Base64Util.encodeToString(byteQuery); - return FluxUtil - .withContext(context -> service.byteMultiByte(this.client.getHost(), byteQueryConverted, accept, context)); + return FluxUtil.withContext(context -> byteMultiByteWithResponseAsync(byteQuery, context)); } /** @@ -2562,15 +2423,7 @@ public void byteMultiByte() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> byteEmptyWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final byte[] byteQuery = "".getBytes(); - final String accept = "application/json"; - String byteQueryConverted = Base64Util.encodeToString(byteQuery); - return FluxUtil - .withContext(context -> service.byteEmpty(this.client.getHost(), byteQueryConverted, accept, context)); + return FluxUtil.withContext(context -> byteEmptyWithResponseAsync(context)); } /** @@ -2657,14 +2510,7 @@ public void byteEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> byteNullWithResponseAsync(byte[] byteQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - String byteQueryConverted = Base64Util.encodeToString(byteQuery); - return FluxUtil - .withContext(context -> service.byteNull(this.client.getHost(), byteQueryConverted, accept, context)); + return FluxUtil.withContext(context -> byteNullWithResponseAsync(byteQuery, context)); } /** @@ -2780,13 +2626,7 @@ public void byteNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> dateValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final LocalDate dateQuery = LocalDate.parse("2012-01-01"); - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.dateValid(this.client.getHost(), dateQuery, accept, context)); + return FluxUtil.withContext(context -> dateValidWithResponseAsync(context)); } /** @@ -2872,12 +2712,7 @@ public void dateValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> dateNullWithResponseAsync(LocalDate dateQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.dateNull(this.client.getHost(), dateQuery, accept, context)); + return FluxUtil.withContext(context -> dateNullWithResponseAsync(dateQuery, context)); } /** @@ -2992,14 +2827,7 @@ public void dateNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> dateTimeValidWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final OffsetDateTime dateTimeQuery = OffsetDateTime.parse("2012-01-01T01:01:01Z"); - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.dateTimeValid(this.client.getHost(), dateTimeQuery, accept, context)); + return FluxUtil.withContext(context -> dateTimeValidWithResponseAsync(context)); } /** @@ -3085,13 +2913,7 @@ public void dateTimeValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> dateTimeNullWithResponseAsync(OffsetDateTime dateTimeQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.dateTimeNull(this.client.getHost(), dateTimeQuery, accept, context)); + return FluxUtil.withContext(context -> dateTimeNullWithResponseAsync(dateTimeQuery, context)); } /** @@ -3211,18 +3033,7 @@ public void dateTimeNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> arrayStringCsvValidWithResponseAsync(List arrayQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - String arrayQueryConverted = (arrayQuery == null) - ? null - : arrayQuery.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil.withContext( - context -> service.arrayStringCsvValid(this.client.getHost(), arrayQueryConverted, accept, context)); + return FluxUtil.withContext(context -> arrayStringCsvValidWithResponseAsync(arrayQuery, context)); } /** @@ -3361,18 +3172,7 @@ public void arrayStringCsvValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> arrayStringCsvNullWithResponseAsync(List arrayQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - String arrayQueryConverted = (arrayQuery == null) - ? null - : arrayQuery.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil.withContext( - context -> service.arrayStringCsvNull(this.client.getHost(), arrayQueryConverted, accept, context)); + return FluxUtil.withContext(context -> arrayStringCsvNullWithResponseAsync(arrayQuery, context)); } /** @@ -3495,18 +3295,7 @@ public void arrayStringCsvNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> arrayStringCsvEmptyWithResponseAsync(List arrayQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - String arrayQueryConverted = (arrayQuery == null) - ? null - : arrayQuery.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil.withContext( - context -> service.arrayStringCsvEmpty(this.client.getHost(), arrayQueryConverted, accept, context)); + return FluxUtil.withContext(context -> arrayStringCsvEmptyWithResponseAsync(arrayQuery, context)); } /** @@ -3629,18 +3418,8 @@ public void arrayStringCsvEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> arrayStringNoCollectionFormatEmptyWithResponseAsync(List arrayQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - String arrayQueryConverted = (arrayQuery == null) - ? null - : arrayQuery.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.arrayStringNoCollectionFormatEmpty(this.client.getHost(), - arrayQueryConverted, accept, context)); + return FluxUtil + .withContext(context -> arrayStringNoCollectionFormatEmptyWithResponseAsync(arrayQuery, context)); } /** @@ -3773,18 +3552,7 @@ public void arrayStringNoCollectionFormatEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> arrayStringSsvValidWithResponseAsync(List arrayQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - String arrayQueryConverted = (arrayQuery == null) - ? null - : arrayQuery.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(" ")); - return FluxUtil.withContext( - context -> service.arrayStringSsvValid(this.client.getHost(), arrayQueryConverted, accept, context)); + return FluxUtil.withContext(context -> arrayStringSsvValidWithResponseAsync(arrayQuery, context)); } /** @@ -3925,18 +3693,7 @@ public void arrayStringSsvValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> arrayStringTsvValidWithResponseAsync(List arrayQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - String arrayQueryConverted = (arrayQuery == null) - ? null - : arrayQuery.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining("\t")); - return FluxUtil.withContext( - context -> service.arrayStringTsvValid(this.client.getHost(), arrayQueryConverted, accept, context)); + return FluxUtil.withContext(context -> arrayStringTsvValidWithResponseAsync(arrayQuery, context)); } /** @@ -4077,18 +3834,7 @@ public void arrayStringTsvValid() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> arrayStringPipesValidWithResponseAsync(List arrayQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - String arrayQueryConverted = (arrayQuery == null) - ? null - : arrayQuery.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining("|")); - return FluxUtil.withContext( - context -> service.arrayStringPipesValid(this.client.getHost(), arrayQueryConverted, accept, context)); + return FluxUtil.withContext(context -> arrayStringPipesValidWithResponseAsync(arrayQuery, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/url/multi/Queries.java b/vanilla-tests/src/main/java/fixtures/url/multi/Queries.java index e9606f7c57..796cf11d4e 100644 --- a/vanilla-tests/src/main/java/fixtures/url/multi/Queries.java +++ b/vanilla-tests/src/main/java/fixtures/url/multi/Queries.java @@ -90,16 +90,7 @@ Mono> arrayStringMultiValid(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> arrayStringMultiNullWithResponseAsync(List arrayQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - List arrayQueryConverted = (arrayQuery == null) - ? new ArrayList<>() - : arrayQuery.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil.withContext( - context -> service.arrayStringMultiNull(this.client.getHost(), arrayQueryConverted, accept, context)); + return FluxUtil.withContext(context -> arrayStringMultiNullWithResponseAsync(arrayQuery, context)); } /** @@ -220,16 +211,7 @@ public void arrayStringMultiNull() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> arrayStringMultiEmptyWithResponseAsync(List arrayQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - List arrayQueryConverted = (arrayQuery == null) - ? new ArrayList<>() - : arrayQuery.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil.withContext( - context -> service.arrayStringMultiEmpty(this.client.getHost(), arrayQueryConverted, accept, context)); + return FluxUtil.withContext(context -> arrayStringMultiEmptyWithResponseAsync(arrayQuery, context)); } /** @@ -352,16 +334,7 @@ public void arrayStringMultiEmpty() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> arrayStringMultiValidWithResponseAsync(List arrayQuery) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - List arrayQueryConverted = (arrayQuery == null) - ? new ArrayList<>() - : arrayQuery.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil.withContext( - context -> service.arrayStringMultiValid(this.client.getHost(), arrayQueryConverted, accept, context)); + return FluxUtil.withContext(context -> arrayStringMultiValidWithResponseAsync(arrayQuery, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/validation/AutoRestValidationTest.java b/vanilla-tests/src/main/java/fixtures/validation/AutoRestValidationTest.java index 750e1225c4..633c419069 100644 --- a/vanilla-tests/src/main/java/fixtures/validation/AutoRestValidationTest.java +++ b/vanilla-tests/src/main/java/fixtures/validation/AutoRestValidationTest.java @@ -206,20 +206,8 @@ Mono> postWithConstantInBody(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validationOfMethodParametersWithResponseAsync(String resourceGroupName, int id) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (this.getSubscriptionId() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.validationOfMethodParameters(this.getHost(), - this.getSubscriptionId(), resourceGroupName, id, this.getApiVersion(), accept, context)); + return FluxUtil + .withContext(context -> validationOfMethodParametersWithResponseAsync(resourceGroupName, id, context)); } /** @@ -330,23 +318,7 @@ public Product validationOfMethodParameters(String resourceGroupName, int id) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validationOfBodyWithResponseAsync(String resourceGroupName, int id, Product body) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (this.getSubscriptionId() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.validationOfBody(this.getHost(), this.getSubscriptionId(), - resourceGroupName, id, this.getApiVersion(), body, accept, context)); + return FluxUtil.withContext(context -> validationOfBodyWithResponseAsync(resourceGroupName, id, body, context)); } /** @@ -494,11 +466,7 @@ public Product validationOfBody(String resourceGroupName, int id) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithConstantInPathWithResponseAsync() { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - final String constantParam = "constant"; - return FluxUtil.withContext(context -> service.getWithConstantInPath(this.getHost(), constantParam, context)); + return FluxUtil.withContext(context -> getWithConstantInPathWithResponseAsync(context)); } /** @@ -581,16 +549,7 @@ public void getWithConstantInPath() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postWithConstantInBodyWithResponseAsync(Product body) { - if (this.getHost() == null) { - return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String constantParam = "constant"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postWithConstantInBody(this.getHost(), constantParam, body, accept, context)); + return FluxUtil.withContext(context -> postWithConstantInBodyWithResponseAsync(body, context)); } /** diff --git a/vanilla-tests/src/main/java/fixtures/xmlservice/Xmls.java b/vanilla-tests/src/main/java/fixtures/xmlservice/Xmls.java index f7082fe00f..b9e224ca78 100644 --- a/vanilla-tests/src/main/java/fixtures/xmlservice/Xmls.java +++ b/vanilla-tests/src/main/java/fixtures/xmlservice/Xmls.java @@ -300,12 +300,7 @@ Mono> putUri(@HostParam("$host") String host, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComplexTypeRefNoMetaWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getComplexTypeRefNoMeta(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexTypeRefNoMetaWithResponseAsync(context)); } /** @@ -393,16 +388,7 @@ public RootWithRefAndNoMeta getComplexTypeRefNoMeta() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putComplexTypeRefNoMetaWithResponseAsync(RootWithRefAndNoMeta model) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (model == null) { - return Mono.error(new IllegalArgumentException("Parameter model is required and cannot be null.")); - } else { - model.validate(); - } - return FluxUtil.withContext(context -> service.putComplexTypeRefNoMeta(this.client.getHost(), model, context)); + return FluxUtil.withContext(context -> putComplexTypeRefNoMetaWithResponseAsync(model, context)); } /** @@ -496,13 +482,7 @@ public void putComplexTypeRefNoMeta(RootWithRefAndNoMeta model) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getComplexTypeRefWithMetaWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.getComplexTypeRefWithMeta(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getComplexTypeRefWithMetaWithResponseAsync(context)); } /** @@ -588,17 +568,7 @@ public RootWithRefAndMeta getComplexTypeRefWithMeta() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putComplexTypeRefWithMetaWithResponseAsync(RootWithRefAndMeta model) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (model == null) { - return Mono.error(new IllegalArgumentException("Parameter model is required and cannot be null.")); - } else { - model.validate(); - } - return FluxUtil - .withContext(context -> service.putComplexTypeRefWithMeta(this.client.getHost(), model, context)); + return FluxUtil.withContext(context -> putComplexTypeRefWithMetaWithResponseAsync(model, context)); } /** @@ -691,12 +661,7 @@ public void putComplexTypeRefWithMeta(RootWithRefAndMeta model) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSimpleWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getSimple(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getSimpleWithResponseAsync(context)); } /** @@ -781,17 +746,7 @@ public Slideshow getSimple() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putSimpleWithResponseAsync(Slideshow slideshow) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (slideshow == null) { - return Mono.error(new IllegalArgumentException("Parameter slideshow is required and cannot be null.")); - } else { - slideshow.validate(); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.putSimple(this.client.getHost(), slideshow, accept, context)); + return FluxUtil.withContext(context -> putSimpleWithResponseAsync(slideshow, context)); } /** @@ -886,12 +841,7 @@ public void putSimple(Slideshow slideshow) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWrappedListsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getWrappedLists(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getWrappedListsWithResponseAsync(context)); } /** @@ -977,18 +927,7 @@ public AppleBarrel getWrappedLists() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWrappedListsWithResponseAsync(AppleBarrel wrappedLists) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (wrappedLists == null) { - return Mono.error(new IllegalArgumentException("Parameter wrappedLists is required and cannot be null.")); - } else { - wrappedLists.validate(); - } - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.putWrappedLists(this.client.getHost(), wrappedLists, accept, context)); + return FluxUtil.withContext(context -> putWrappedListsWithResponseAsync(wrappedLists, context)); } /** @@ -1082,11 +1021,7 @@ public void putWrappedLists(AppleBarrel wrappedLists) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.getHeaders(this.client.getHost(), context)); + return FluxUtil.withContext(context -> getHeadersWithResponseAsync(context)); } /** @@ -1167,11 +1102,7 @@ public void getHeaders() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getHeadersNoCustomHeadersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - return FluxUtil.withContext(context -> service.getHeadersNoCustomHeaders(this.client.getHost(), context)); + return FluxUtil.withContext(context -> getHeadersNoCustomHeadersWithResponseAsync(context)); } /** @@ -1215,12 +1146,7 @@ public Response getHeadersNoCustomHeadersWithResponse(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyListWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getEmptyList(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyListWithResponseAsync(context)); } /** @@ -1305,16 +1231,7 @@ public Slideshow getEmptyList() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyListWithResponseAsync(Slideshow slideshow) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (slideshow == null) { - return Mono.error(new IllegalArgumentException("Parameter slideshow is required and cannot be null.")); - } else { - slideshow.validate(); - } - return FluxUtil.withContext(context -> service.putEmptyList(this.client.getHost(), slideshow, context)); + return FluxUtil.withContext(context -> putEmptyListWithResponseAsync(slideshow, context)); } /** @@ -1407,12 +1324,7 @@ public void putEmptyList(Slideshow slideshow) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWrappedListsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getEmptyWrappedLists(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyWrappedListsWithResponseAsync(context)); } /** @@ -1497,17 +1409,7 @@ public AppleBarrel getEmptyWrappedLists() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWrappedListsWithResponseAsync(AppleBarrel appleBarrel) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (appleBarrel == null) { - return Mono.error(new IllegalArgumentException("Parameter appleBarrel is required and cannot be null.")); - } else { - appleBarrel.validate(); - } - return FluxUtil - .withContext(context -> service.putEmptyWrappedLists(this.client.getHost(), appleBarrel, context)); + return FluxUtil.withContext(context -> putEmptyWrappedListsWithResponseAsync(appleBarrel, context)); } /** @@ -1600,12 +1502,7 @@ public void putEmptyWrappedLists(AppleBarrel appleBarrel) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getRootListWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getRootList(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getRootListWithResponseAsync(context)); } /** @@ -1690,17 +1587,7 @@ public List getRootList() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRootListWithResponseAsync(List bananas) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bananas == null) { - return Mono.error(new IllegalArgumentException("Parameter bananas is required and cannot be null.")); - } else { - bananas.forEach(e -> e.validate()); - } - BananaWrapper bananasConverted = new BananaWrapper(bananas); - return FluxUtil.withContext(context -> service.putRootList(this.client.getHost(), bananasConverted, context)); + return FluxUtil.withContext(context -> putRootListWithResponseAsync(bananas, context)); } /** @@ -1794,12 +1681,7 @@ public void putRootList(List bananas) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getRootListSingleItemWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getRootListSingleItem(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getRootListSingleItemWithResponseAsync(context)); } /** @@ -1884,18 +1766,7 @@ public List getRootListSingleItem() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRootListSingleItemWithResponseAsync(List bananas) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bananas == null) { - return Mono.error(new IllegalArgumentException("Parameter bananas is required and cannot be null.")); - } else { - bananas.forEach(e -> e.validate()); - } - BananaWrapper bananasConverted = new BananaWrapper(bananas); - return FluxUtil - .withContext(context -> service.putRootListSingleItem(this.client.getHost(), bananasConverted, context)); + return FluxUtil.withContext(context -> putRootListSingleItemWithResponseAsync(bananas, context)); } /** @@ -1989,12 +1860,7 @@ public void putRootListSingleItem(List bananas) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> getEmptyRootListWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getEmptyRootList(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyRootListWithResponseAsync(context)); } /** @@ -2079,18 +1945,7 @@ public List getEmptyRootList() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyRootListWithResponseAsync(List bananas) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (bananas == null) { - return Mono.error(new IllegalArgumentException("Parameter bananas is required and cannot be null.")); - } else { - bananas.forEach(e -> e.validate()); - } - BananaWrapper bananasConverted = new BananaWrapper(bananas); - return FluxUtil - .withContext(context -> service.putEmptyRootList(this.client.getHost(), bananasConverted, context)); + return FluxUtil.withContext(context -> putEmptyRootListWithResponseAsync(bananas, context)); } /** @@ -2185,12 +2040,7 @@ public void putEmptyRootList(List bananas) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyChildElementWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getEmptyChildElement(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getEmptyChildElementWithResponseAsync(context)); } /** @@ -2276,16 +2126,7 @@ public Banana getEmptyChildElement() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyChildElementWithResponseAsync(Banana banana) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (banana == null) { - return Mono.error(new IllegalArgumentException("Parameter banana is required and cannot be null.")); - } else { - banana.validate(); - } - return FluxUtil.withContext(context -> service.putEmptyChildElement(this.client.getHost(), banana, context)); + return FluxUtil.withContext(context -> putEmptyChildElementWithResponseAsync(banana, context)); } /** @@ -2378,13 +2219,7 @@ public void putEmptyChildElement(Banana banana) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listContainersWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String comp = "list"; - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.listContainers(this.client.getHost(), comp, accept, context)); + return FluxUtil.withContext(context -> listContainersWithResponseAsync(context)); } /** @@ -2468,15 +2303,7 @@ public ListContainersResponse listContainers() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getServicePropertiesWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String comp = "properties"; - final String restype = "service"; - final String accept = "application/xml"; - return FluxUtil.withContext( - context -> service.getServiceProperties(this.client.getHost(), comp, restype, accept, context)); + return FluxUtil.withContext(context -> getServicePropertiesWithResponseAsync(context)); } /** @@ -2563,19 +2390,7 @@ public StorageServiceProperties getServiceProperties() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putServicePropertiesWithResponseAsync(StorageServiceProperties properties) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String comp = "properties"; - final String restype = "service"; - return FluxUtil.withContext( - context -> service.putServiceProperties(this.client.getHost(), comp, restype, properties, context)); + return FluxUtil.withContext(context -> putServicePropertiesWithResponseAsync(properties, context)); } /** @@ -2671,14 +2486,7 @@ public void putServiceProperties(StorageServiceProperties properties) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAclsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String comp = "acl"; - final String restype = "container"; - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getAcls(this.client.getHost(), comp, restype, accept, context)); + return FluxUtil.withContext(context -> getAclsWithResponseAsync(context)); } /** @@ -2765,20 +2573,7 @@ public SignedIdentifierWrapper getAcls() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAclsWithResponseAsync(List properties) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.forEach(e -> e.validate()); - } - final String comp = "acl"; - final String restype = "container"; - SignedIdentifierWrapper propertiesConverted = new SignedIdentifierWrapper(properties); - return FluxUtil.withContext( - context -> service.putAcls(this.client.getHost(), comp, restype, propertiesConverted, context)); + return FluxUtil.withContext(context -> putAclsWithResponseAsync(properties, context)); } /** @@ -2874,15 +2669,7 @@ public void putAcls(List properties) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listBlobsWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String comp = "list"; - final String restype = "container"; - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.listBlobs(this.client.getHost(), comp, restype, accept, context)); + return FluxUtil.withContext(context -> listBlobsWithResponseAsync(context)); } /** @@ -2969,16 +2756,7 @@ public ListBlobsResponse listBlobs() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> jsonInputWithResponseAsync(JsonInput properties) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - return FluxUtil.withContext(context -> service.jsonInput(this.client.getHost(), properties, context)); + return FluxUtil.withContext(context -> jsonInputWithResponseAsync(properties, context)); } /** @@ -3071,12 +2849,7 @@ public void jsonInput(JsonInput properties) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> jsonOutputWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.jsonOutput(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> jsonOutputWithResponseAsync(context)); } /** @@ -3162,12 +2935,7 @@ public JsonOutput jsonOutput() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getXMsTextWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getXMsText(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getXMsTextWithResponseAsync(context)); } /** @@ -3262,12 +3030,7 @@ public ObjectWithXMsTextProperty getXMsText() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBytesWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getBytes(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getBytesWithResponseAsync(context)); } /** @@ -3353,17 +3116,7 @@ public ModelWithByteProperty getBytes() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBinaryWithResponseAsync(ModelWithByteProperty slideshow) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (slideshow == null) { - return Mono.error(new IllegalArgumentException("Parameter slideshow is required and cannot be null.")); - } else { - slideshow.validate(); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.putBinary(this.client.getHost(), slideshow, accept, context)); + return FluxUtil.withContext(context -> putBinaryWithResponseAsync(slideshow, context)); } /** @@ -3457,12 +3210,7 @@ public void putBinary(ModelWithByteProperty slideshow) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUriWithResponseAsync() { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.getUri(this.client.getHost(), accept, context)); + return FluxUtil.withContext(context -> getUriWithResponseAsync(context)); } /** @@ -3547,17 +3295,7 @@ public ModelWithUrlProperty getUri() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUriWithResponseAsync(ModelWithUrlProperty model) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (model == null) { - return Mono.error(new IllegalArgumentException("Parameter model is required and cannot be null.")); - } else { - model.validate(); - } - final String accept = "application/xml"; - return FluxUtil.withContext(context -> service.putUri(this.client.getHost(), model, accept, context)); + return FluxUtil.withContext(context -> putUriWithResponseAsync(model, context)); } /**