diff --git a/AutoRest/Generators/Python/Azure.Python/Templates/AzureLongRunningMethodTemplate.cshtml b/AutoRest/Generators/Python/Azure.Python/Templates/AzureLongRunningMethodTemplate.cshtml index d7911a1260236..78533cd451225 100644 --- a/AutoRest/Generators/Python/Azure.Python/Templates/AzureLongRunningMethodTemplate.cshtml +++ b/AutoRest/Generators/Python/Azure.Python/Templates/AzureLongRunningMethodTemplate.cshtml @@ -64,32 +64,17 @@ { @:body_content = upload_gen(@parameter.Name) break; - } - } + } } - else if (Model.RequestBody.IsRequired) - { - - if (Model.RequestBody.Type is CompositeType) - { - @:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString())) - } - else - { + } + else if (Model.RequestBody.IsRequired) + { @:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())') - } - } - else - { + } + else + { @:if @Model.RequestBody.Name is not None: - if (Model.RequestBody.Type is CompositeType) - { - @:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString())) - } - else - { @:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())') - } @:else: @:body_content = None } diff --git a/AutoRest/Generators/Python/Azure.Python/Templates/AzurePagingMethodTemplate.cshtml b/AutoRest/Generators/Python/Azure.Python/Templates/AzurePagingMethodTemplate.cshtml index 496b19a0bee76..9e3ddbbf618ec 100644 --- a/AutoRest/Generators/Python/Azure.Python/Templates/AzurePagingMethodTemplate.cshtml +++ b/AutoRest/Generators/Python/Azure.Python/Templates/AzurePagingMethodTemplate.cshtml @@ -59,27 +59,13 @@ { @:# Construct body if (Model.RequestBody.IsRequired) - { - if (Model.RequestBody.Type is CompositeType) - { - @:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString())) - } - else - { + { @:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())') - } - } - else - { + } + else + { @:if @Model.RequestBody.Name is not None: - if (Model.RequestBody.Type is CompositeType) - { - @:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString())) - } - else - { @:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())') - } @:else: @:body_content = None } diff --git a/AutoRest/Generators/Python/Python/Templates/MethodTemplate.cshtml b/AutoRest/Generators/Python/Python/Templates/MethodTemplate.cshtml index a97a9c8921c19..6cd57e9b0253d 100644 --- a/AutoRest/Generators/Python/Python/Templates/MethodTemplate.cshtml +++ b/AutoRest/Generators/Python/Python/Templates/MethodTemplate.cshtml @@ -64,31 +64,17 @@ { @:body_content = self._client.stream_upload(@parameter.Name, callback) break; - } - } - } - else if (Model.RequestBody.IsRequired) - { - if (Model.RequestBody.Type is CompositeType) - { - @:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString())) - } - else - { + } + } + } + else if (Model.RequestBody.IsRequired) + { @:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())') - } - } - else - { + } + else + { @:if @Model.RequestBody.Name is not None: - if (Model.RequestBody.Type is CompositeType) - { - @:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString())) - } - else - { @:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())') - } @:else: @:body_content = None }