diff --git a/src/client/Python/msrest/msrest/serialization.py b/src/client/Python/msrest/msrest/serialization.py index 9dbae75a67..450cf4b242 100644 --- a/src/client/Python/msrest/msrest/serialization.py +++ b/src/client/Python/msrest/msrest/serialization.py @@ -603,6 +603,8 @@ def serialize_date(attr, **kwargs): :param Date attr: Object to be serialized. :rtype: str """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) return t @@ -613,6 +615,8 @@ def serialize_duration(attr, **kwargs): :param TimeDelta attr: Object to be serialized. :rtype: str """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod diff --git a/src/generator/AutoRest.Python.Azure.Tests/AcceptanceTests/parameter_tests.py b/src/generator/AutoRest.Python.Azure.Tests/AcceptanceTests/parameter_tests.py index 31232f6118..60f98a1fa2 100644 --- a/src/generator/AutoRest.Python.Azure.Tests/AcceptanceTests/parameter_tests.py +++ b/src/generator/AutoRest.Python.Azure.Tests/AcceptanceTests/parameter_tests.py @@ -136,17 +136,17 @@ def test_azure_special_parameters(self): client.api_version_default.get_method_global_valid() client.api_version_default.get_path_global_valid() client.api_version_default.get_swagger_global_valid() - client.api_version_local.get_method_local_valid(validApiVersion) - client.api_version_local.get_method_local_null(None) - client.api_version_local.get_path_local_valid(validApiVersion) - client.api_version_local.get_swagger_local_valid(validApiVersion) + client.api_version_local.get_method_local_valid() + client.api_version_local.get_method_local_null() + client.api_version_local.get_path_local_valid() + client.api_version_local.get_swagger_local_valid() client.skip_url_encoding.get_method_path_valid(unencodedPath) client.skip_url_encoding.get_path_path_valid(unencodedPath) - client.skip_url_encoding.get_swagger_path_valid(unencodedPath) + client.skip_url_encoding.get_swagger_path_valid() client.skip_url_encoding.get_method_query_valid(unencodedQuery) client.skip_url_encoding.get_path_query_valid(unencodedQuery) - client.skip_url_encoding.get_swagger_query_valid(unencodedQuery) + client.skip_url_encoding.get_swagger_query_valid() client.skip_url_encoding.get_method_query_null() client.skip_url_encoding.get_method_query_null(None) diff --git a/src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/operations/api_version_local_operations.py b/src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/operations/api_version_local_operations.py index a089d753b7..06e636b8b2 100644 --- a/src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/operations/api_version_local_operations.py +++ b/src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/operations/api_version_local_operations.py @@ -22,6 +22,7 @@ class ApiVersionLocalOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. + :ivar api_version: This should appear as a method parameter, use value '2.0'. Constant value: "2.0". """ def __init__(self, client, config, serializer, deserializer): @@ -29,17 +30,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2.0" self.config = config def get_method_local_valid( - self, api_version="2.0", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. - :param api_version: This should appear as a method parameter, use - value '2.0' - :type api_version: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -54,7 +53,7 @@ def get_method_local_valid( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -124,13 +123,10 @@ def get_method_local_null( return client_raw_response def get_path_local_valid( - self, api_version="2.0", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. - :param api_version: This should appear as a method parameter, use - value '2.0' - :type api_version: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -145,7 +141,7 @@ def get_path_local_valid( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -169,13 +165,10 @@ def get_path_local_valid( return client_raw_response def get_swagger_local_valid( - self, api_version="2.0", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. - :param api_version: The api version, which appears in the query, the - value is always '2.0' - :type api_version: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -190,7 +183,7 @@ def get_swagger_local_valid( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} diff --git a/src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/operations/skip_url_encoding_operations.py b/src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/operations/skip_url_encoding_operations.py index 4bd4a66bd4..afb71c0614 100644 --- a/src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/operations/skip_url_encoding_operations.py +++ b/src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/operations/skip_url_encoding_operations.py @@ -22,6 +22,8 @@ class SkipUrlEncodingOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. + :ivar unencoded_path_param: An unencoded path parameter with value 'path1/path2/path3'. Constant value: "path1/path2/path3". + :ivar q1: An unencoded query parameter with value 'value1&q2=value2&q3=value3'. Constant value: "value1&q2=value2&q3=value3". """ def __init__(self, client, config, serializer, deserializer): @@ -29,6 +31,8 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.unencoded_path_param = "path1/path2/path3" + self.q1 = "value1&q2=value2&q3=value3" self.config = config @@ -129,13 +133,10 @@ def get_path_path_valid( return client_raw_response def get_swagger_path_valid( - self, unencoded_path_param="path1/path2/path3", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get method with unencoded path parameter with value 'path1/path2/path3'. - :param unencoded_path_param: An unencoded path parameter with value - 'path1/path2/path3' - :type unencoded_path_param: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -148,7 +149,7 @@ def get_swagger_path_valid( # Construct URL url = '/azurespecials/skipUrlEncoding/swagger/path/valid/{unencodedPathParam}' path_format_arguments = { - 'unencodedPathParam': self._serialize.url("unencoded_path_param", unencoded_path_param, 'str', skip_quote=True) + 'unencodedPathParam': self._serialize.url("self.unencoded_path_param", self.unencoded_path_param, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -311,13 +312,10 @@ def get_path_query_valid( return client_raw_response def get_swagger_query_valid( - self, q1="value1&q2=value2&q3=value3", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. - :param q1: An unencoded query parameter with value - 'value1&q2=value2&q3=value3' - :type q1: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -332,7 +330,7 @@ def get_swagger_query_valid( # Construct parameters query_parameters = {} - query_parameters['q1'] = self._serialize.query("q1", q1, 'str', skip_quote=True) + query_parameters['q1'] = self._serialize.query("self.q1", self.q1, 'str', skip_quote=True) # Construct headers header_parameters = {} diff --git a/src/generator/AutoRest.Python.Azure/TemplateModels/AzureMethodGroupTemplateModel.cs b/src/generator/AutoRest.Python.Azure/TemplateModels/AzureMethodGroupTemplateModel.cs index bea5f0fefb..64825f1d97 100644 --- a/src/generator/AutoRest.Python.Azure/TemplateModels/AzureMethodGroupTemplateModel.cs +++ b/src/generator/AutoRest.Python.Azure/TemplateModels/AzureMethodGroupTemplateModel.cs @@ -14,7 +14,6 @@ public class AzureMethodGroupTemplateModel : MethodGroupTemplateModel public AzureMethodGroupTemplateModel(ServiceClient serviceClient, string methodGroupName) : base(serviceClient, methodGroupName) { - MethodGroupType = methodGroupName + "Operations"; // Clear base initialized MethodTemplateModels and re-populate with // AzureMethodTemplateModel MethodTemplateModels.Clear(); diff --git a/src/generator/AutoRest.Python.Azure/TemplateModels/AzureServiceClientTemplateModel.cs b/src/generator/AutoRest.Python.Azure/TemplateModels/AzureServiceClientTemplateModel.cs index e34e3ba223..5d5f51b540 100644 --- a/src/generator/AutoRest.Python.Azure/TemplateModels/AzureServiceClientTemplateModel.cs +++ b/src/generator/AutoRest.Python.Azure/TemplateModels/AzureServiceClientTemplateModel.cs @@ -20,8 +20,8 @@ public AzureServiceClientTemplateModel(ServiceClient serviceClient) : base(servi .ForEach(m => MethodTemplateModels.Add(new AzureMethodTemplateModel(m, serviceClient))); // Removing all models that contain the extension "x-ms-external", as they will be // generated in python client runtime for azure - "ms-rest-azure". - ModelTemplateModels.RemoveAll(m => m.Extensions.ContainsKey(AzureExtensions.PageableExtension)); - ModelTemplateModels.RemoveAll(m => m.Extensions.ContainsKey(AzureExtensions.ExternalExtension)); + ModelTemplateModels.RemoveAll(m => m.Extensions.ContainsKey(AzureExtensions.PageableExtension) && (bool)m.Extensions[AzureExtensions.PageableExtension]); + ModelTemplateModels.RemoveAll(m => m.Extensions.ContainsKey(AzureExtensions.ExternalExtension) && (bool)m.Extensions[AzureExtensions.ExternalExtension]); HasAnyModel = false; if (serviceClient.ModelTypes.Any()) @@ -39,7 +39,7 @@ public AzureServiceClientTemplateModel(ServiceClient serviceClient) : base(servi public bool HasAnyLongRunOperation { - get { return MethodTemplateModels.Any(m => m.Extensions.ContainsKey(AzureExtensions.LongRunningExtension)); } + get { return MethodTemplateModels.Any(m => m.Extensions.ContainsKey(AzureExtensions.LongRunningExtension) && (bool)m.Extensions[AzureExtensions.LongRunningExtension]); } } public bool HasAnyCloudErrors diff --git a/src/generator/AutoRest.Python.Azure/Templates/AzureLongRunningMethodTemplate.cshtml b/src/generator/AutoRest.Python.Azure/Templates/AzureLongRunningMethodTemplate.cshtml index 36bb816d88..59b1626d4e 100644 --- a/src/generator/AutoRest.Python.Azure/Templates/AzureLongRunningMethodTemplate.cshtml +++ b/src/generator/AutoRest.Python.Azure/Templates/AzureLongRunningMethodTemplate.cshtml @@ -30,6 +30,14 @@ @if (Model.InputParameterTransformation.Any()) { @EmptyLine +} +@if (Model.ConstantParameters.Any()) +{ + foreach (var parameter in Model.ConstantParameters) + { + @:@(parameter.Name) = @(parameter.DefaultValue) + } +@EmptyLine } # Construct URL url = '@(Model.Url)' diff --git a/src/generator/AutoRest.Python.Azure/Templates/AzureMethodGroupTemplate.cshtml b/src/generator/AutoRest.Python.Azure/Templates/AzureMethodGroupTemplate.cshtml index cc9a940969..cfc6c6209d 100644 --- a/src/generator/AutoRest.Python.Azure/Templates/AzureMethodGroupTemplate.cshtml +++ b/src/generator/AutoRest.Python.Azure/Templates/AzureMethodGroupTemplate.cshtml @@ -34,6 +34,10 @@ class @(Model.MethodGroupType)(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. +@foreach(var property in Model.ConstantProperties) +{ + @:@Model.GetPropertyDocumentationString(property) +} """ @EmptyLine def __init__(self, client, config, serializer, deserializer): @@ -41,6 +45,10 @@ class @(Model.MethodGroupType)(object): self._client = client self._serialize = serializer self._deserialize = deserializer +@foreach(var property in Model.ConstantProperties) +{ + @:@property.Name = @property.DefaultValue +} @EmptyLine self.config = config @foreach (var method in Model.MethodTemplateModels) diff --git a/src/generator/AutoRest.Python.Azure/Templates/AzurePagingMethodTemplate.cshtml b/src/generator/AutoRest.Python.Azure/Templates/AzurePagingMethodTemplate.cshtml index d008e7b87e..f2f73687d2 100644 --- a/src/generator/AutoRest.Python.Azure/Templates/AzurePagingMethodTemplate.cshtml +++ b/src/generator/AutoRest.Python.Azure/Templates/AzurePagingMethodTemplate.cshtml @@ -23,6 +23,14 @@ @if (Model.InputParameterTransformation.Any()) { @EmptyLine +} +@if (Model.ConstantParameters.Any()) +{ + foreach (var parameter in Model.ConstantParameters) + { + @:@(parameter.Name) = @(parameter.DefaultValue) + } +@EmptyLine } def internal_paging(next_link=None, raw=False): @EmptyLine diff --git a/src/generator/AutoRest.Python.Azure/Templates/AzureServiceClientTemplate.cshtml b/src/generator/AutoRest.Python.Azure/Templates/AzureServiceClientTemplate.cshtml index bab430827b..c4e959f0ab 100644 --- a/src/generator/AutoRest.Python.Azure/Templates/AzureServiceClientTemplate.cshtml +++ b/src/generator/AutoRest.Python.Azure/Templates/AzureServiceClientTemplate.cshtml @@ -54,6 +54,11 @@ class @(Model.Name)Configuration(AzureConfiguration): @: @ParameterWrapComment(string.Empty, ServiceClientTemplateModel.GetPropertyDocumentationString(property)) @: @ParameterWrapComment(string.Empty, ":type " + property.Name + ": " + Model.GetPropertyDocumentationType(property.Type)) } +@foreach(var property in Model.ConstantProperties) +{ +@: @ParameterWrapComment(string.Empty, ServiceClientTemplateModel.GetPropertyDocumentationString(property)) +@: @ParameterWrapComment(string.Empty, ":type " + property.Name + ": " + Model.GetPropertyDocumentationType(property.Type)) +} @if (!Model.IsCustomBaseUri) { @@ -89,6 +94,10 @@ else { @:self.@(property.Name) = @(property.Name) } + foreach (var property in Model.ConstantProperties) + { + @:self.@(property.Name) = @(property.DefaultValue) + } } @EmptyLine @EmptyLine diff --git a/src/generator/AutoRest.Python.Tests/AcceptanceTests/complex_tests.py b/src/generator/AutoRest.Python.Tests/AcceptanceTests/complex_tests.py index 39d3ea51d1..3d5836f54a 100644 --- a/src/generator/AutoRest.Python.Tests/AcceptanceTests/complex_tests.py +++ b/src/generator/AutoRest.Python.Tests/AcceptanceTests/complex_tests.py @@ -62,7 +62,7 @@ def dst(self,dt): class ComplexTests(unittest.TestCase): def test_complex(self): - client = AutoRestComplexTestService(base_url="http://localhost:3000",api_version="2015-01-01") + client = AutoRestComplexTestService(base_url="http://localhost:3000") # GET basic/valid basic_result = client.basic_operations.get_valid() diff --git a/src/generator/AutoRest.Python.Tests/AcceptanceTests/url_tests.py b/src/generator/AutoRest.Python.Tests/AcceptanceTests/url_tests.py index fda491f81c..6c77dc8e4f 100644 --- a/src/generator/AutoRest.Python.Tests/AcceptanceTests/url_tests.py +++ b/src/generator/AutoRest.Python.Tests/AcceptanceTests/url_tests.py @@ -72,22 +72,22 @@ def test_url_path(self): with self.assertRaises(ValidationError): self.client.paths.date_time_null(None) - self.client.paths.date_time_valid(isodate.parse_datetime("2012-01-01T01:01:01Z")) - self.client.paths.date_valid(isodate.parse_date("2012-01-01")) + self.client.paths.date_time_valid() + self.client.paths.date_valid() self.client.paths.unix_time_url(datetime(year=2016, month=4, day=13)) - self.client.paths.double_decimal_negative(-9999999.999) - self.client.paths.double_decimal_positive(9999999.999) + self.client.paths.double_decimal_negative() + self.client.paths.double_decimal_positive() - self.client.paths.float_scientific_negative(-1.034e-20) - self.client.paths.float_scientific_positive(1.034e+20) - self.client.paths.get_boolean_false(False) - self.client.paths.get_boolean_true(True) - self.client.paths.get_int_negative_one_million(-1000000) - self.client.paths.get_int_one_million(1000000) - self.client.paths.get_negative_ten_billion(-10000000000) - self.client.paths.get_ten_billion(10000000000) - self.client.paths.string_empty("") + self.client.paths.float_scientific_negative() + self.client.paths.float_scientific_positive() + self.client.paths.get_boolean_false() + self.client.paths.get_boolean_true() + self.client.paths.get_int_negative_one_million() + self.client.paths.get_int_one_million() + self.client.paths.get_negative_ten_billion() + self.client.paths.get_ten_billion() + self.client.paths.string_empty() test_array = ["ArrayPath1", r"begin!*'();:@ &=+$,/?#[]end", None, ""] self.client.paths.array_csv_in_path(test_array) @@ -95,7 +95,7 @@ def test_url_path(self): with self.assertRaises(ValidationError): self.client.paths.string_null(None) - self.client.paths.string_url_encoded(r"begin!*'();:@ &=+$,/?#[]end") + self.client.paths.string_url_encoded() self.client.paths.enum_valid(UriColor.greencolor) with self.assertRaises(ValidationError): @@ -110,29 +110,29 @@ def test_url_query(self): self.client.queries.byte_empty(bytearray()) u_bytes = bytearray(u"\u554A\u9F44\u4E02\u72DB\u72DC\uF9F1\uF92C\uF9F1\uFA0C\uFA29", encoding='utf-8') self.client.queries.byte_multi_byte(u_bytes) - self.client.queries.byte_null(None) - self.client.queries.date_null(None) - self.client.queries.date_time_null(None) - self.client.queries.date_time_valid(isodate.parse_datetime("2012-01-01T01:01:01Z")) - self.client.queries.date_valid(isodate.parse_date("2012-01-01")) - self.client.queries.double_null(None) - self.client.queries.double_decimal_negative(-9999999.999) - self.client.queries.double_decimal_positive(9999999.999) - self.client.queries.float_scientific_negative(-1.034e-20) - self.client.queries.float_scientific_positive(1.034e20) - self.client.queries.float_null(None) - self.client.queries.get_boolean_false(False) - self.client.queries.get_boolean_true(True) - self.client.queries.get_boolean_null(None) - self.client.queries.get_int_negative_one_million(-1000000) - self.client.queries.get_int_one_million(1000000) - self.client.queries.get_int_null(None) - self.client.queries.get_negative_ten_billion(-10000000000) - self.client.queries.get_ten_billion(10000000000) - self.client.queries.get_long_null(None) - self.client.queries.string_empty("") - self.client.queries.string_null(None) - self.client.queries.string_url_encoded("begin!*'();:@ &=+$,/?#[]end") + self.client.queries.byte_null() + self.client.queries.date_null() + self.client.queries.date_time_null() + self.client.queries.date_time_valid() + self.client.queries.date_valid() + self.client.queries.double_null() + self.client.queries.double_decimal_negative() + self.client.queries.double_decimal_positive() + self.client.queries.float_scientific_negative() + self.client.queries.float_scientific_positive() + self.client.queries.float_null() + self.client.queries.get_boolean_false() + self.client.queries.get_boolean_true() + self.client.queries.get_boolean_null() + self.client.queries.get_int_negative_one_million() + self.client.queries.get_int_one_million() + self.client.queries.get_int_null() + self.client.queries.get_negative_ten_billion() + self.client.queries.get_ten_billion() + self.client.queries.get_long_null() + self.client.queries.string_empty() + self.client.queries.string_null() + self.client.queries.string_url_encoded() self.client.queries.enum_valid(UriColor.greencolor) self.client.queries.enum_null(None) self.client.queries.array_string_csv_empty([]) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/auto_rest_swagger_bat_array_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/auto_rest_swagger_bat_array_service.py index 75d5ea27f0..ce96dcda4f 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/auto_rest_swagger_bat_array_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/auto_rest_swagger_bat_array_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.array import Array +from .operations.array_operations import ArrayOperations from . import models @@ -43,7 +43,7 @@ class AutoRestSwaggerBATArrayService(object): :vartype config: AutoRestSwaggerBATArrayServiceConfiguration :ivar array: Array operations - :vartype array: .operations.Array + :vartype array: .operations.ArrayOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.array = Array( + self.array = ArrayOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/operations/__init__.py index 9c080430a1..a318baee8c 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .array import Array +from .array_operations import ArrayOperations __all__ = [ - 'Array', + 'ArrayOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/operations/array.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/operations/array_operations.py similarity index 97% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/operations/array.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/operations/array_operations.py index 7c04d04bca..c15d77befc 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/operations/array.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/operations/array_operations.py @@ -1,2845 +1,2845 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class Array(object): - """Array operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - """ - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - self.config = config - - def get_null( - self, custom_headers=None, raw=False, **operation_config): - """Get null array value. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of int - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/null' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[int]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_invalid( - self, custom_headers=None, raw=False, **operation_config): - """Get invalid array [1, 2, 3. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of int - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/invalid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[int]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_empty( - self, custom_headers=None, raw=False, **operation_config): - """Get empty array value []. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of int - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/empty' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[int]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_empty( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value empty []. - - :param array_body: - :type array_body: list of str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/empty' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[str]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_boolean_tfft( - self, custom_headers=None, raw=False, **operation_config): - """Get boolean array value [true, false, false, true]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of bool - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/boolean/tfft' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[bool]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_boolean_tfft( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value empty [true, false, false, true]. - - :param array_body: - :type array_body: list of bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/boolean/tfft' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[bool]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_boolean_invalid_null( - self, custom_headers=None, raw=False, **operation_config): - """Get boolean array value [true, null, false]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of bool - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/boolean/true.null.false' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[bool]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_boolean_invalid_string( - self, custom_headers=None, raw=False, **operation_config): - """Get boolean array value [true, 'boolean', false]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of bool - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/boolean/true.boolean.false' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[bool]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_integer_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get integer array value [1, -1, 3, 300]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of int - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/integer/1.-1.3.300' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[int]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_integer_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value empty [1, -1, 3, 300]. - - :param array_body: - :type array_body: list of int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/integer/1.-1.3.300' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[int]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_int_invalid_null( - self, custom_headers=None, raw=False, **operation_config): - """Get integer array value [1, null, 0]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of int - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/integer/1.null.zero' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[int]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_int_invalid_string( - self, custom_headers=None, raw=False, **operation_config): - """Get integer array value [1, 'integer', 0]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of int - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/integer/1.integer.0' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[int]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_long_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get integer array value [1, -1, 3, 300]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of long - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/long/1.-1.3.300' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[long]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_long_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value empty [1, -1, 3, 300]. - - :param array_body: - :type array_body: list of long - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/long/1.-1.3.300' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[long]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_long_invalid_null( - self, custom_headers=None, raw=False, **operation_config): - """Get long array value [1, null, 0]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of long - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/long/1.null.zero' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[long]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_long_invalid_string( - self, custom_headers=None, raw=False, **operation_config): - """Get long array value [1, 'integer', 0]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of long - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/long/1.integer.0' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[long]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_float_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get float array value [0, -0.01, 1.2e20]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of float - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/float/0--0.01-1.2e20' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[float]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_float_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value [0, -0.01, 1.2e20]. - - :param array_body: - :type array_body: list of float - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/float/0--0.01-1.2e20' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[float]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_float_invalid_null( - self, custom_headers=None, raw=False, **operation_config): - """Get float array value [0.0, null, -1.2e20]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of float - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/float/0.0-null-1.2e20' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[float]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_float_invalid_string( - self, custom_headers=None, raw=False, **operation_config): - """Get boolean array value [1.0, 'number', 0.0]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of float - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/float/1.number.0' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[float]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_double_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get float array value [0, -0.01, 1.2e20]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of float - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/double/0--0.01-1.2e20' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[float]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_double_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value [0, -0.01, 1.2e20]. - - :param array_body: - :type array_body: list of float - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/double/0--0.01-1.2e20' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[float]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_double_invalid_null( - self, custom_headers=None, raw=False, **operation_config): - """Get float array value [0.0, null, -1.2e20]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of float - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/double/0.0-null-1.2e20' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[float]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_double_invalid_string( - self, custom_headers=None, raw=False, **operation_config): - """Get boolean array value [1.0, 'number', 0.0]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of float - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/double/1.number.0' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[float]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_string_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get string array value ['foo1', 'foo2', 'foo3']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of str - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/string/foo1.foo2.foo3' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[str]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_string_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value ['foo1', 'foo2', 'foo3']. - - :param array_body: - :type array_body: list of str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/string/foo1.foo2.foo3' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[str]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_string_with_null( - self, custom_headers=None, raw=False, **operation_config): - """Get string array value ['foo', null, 'foo2']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of str - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/string/foo.null.foo2' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[str]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_string_with_invalid( - self, custom_headers=None, raw=False, **operation_config): - """Get string array value ['foo', 123, 'foo2']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of str - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/string/foo.123.foo2' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[str]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_uuid_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', - 'd1399005-30f7-40d6-8da6-dd7c89ad34db', - 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of str - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/uuid/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[str]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_uuid_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', - 'd1399005-30f7-40d6-8da6-dd7c89ad34db', - 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. - - :param array_body: - :type array_body: list of str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/uuid/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[str]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_uuid_invalid_chars( - self, custom_headers=None, raw=False, **operation_config): - """Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of str - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/uuid/invalidchars' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[str]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_date_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of date - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/date/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[date]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_date_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. - - :param array_body: - :type array_body: list of date - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/date/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[date]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_date_invalid_null( - self, custom_headers=None, raw=False, **operation_config): - """Get date array value ['2012-01-01', null, '1776-07-04']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of date - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/date/invalidnull' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[date]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_date_invalid_chars( - self, custom_headers=None, raw=False, **operation_config): - """Get date array value ['2011-03-22', 'date']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of date - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/date/invalidchars' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[date]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_date_time_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get date-time array value ['2000-12-01t00:00:01z', - '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of datetime - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/date-time/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[iso-8601]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_date_time_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', - '1492-10-12T10:15:01-08:00']. - - :param array_body: - :type array_body: list of datetime - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/date-time/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[iso-8601]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_date_time_invalid_null( - self, custom_headers=None, raw=False, **operation_config): - """Get date array value ['2000-12-01t00:00:01z', null]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of datetime - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/date-time/invalidnull' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[iso-8601]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_date_time_invalid_chars( - self, custom_headers=None, raw=False, **operation_config): - """Get date array value ['2000-12-01t00:00:01z', 'date-time']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of datetime - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/date-time/invalidchars' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[iso-8601]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_date_time_rfc1123_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 - Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of datetime - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/date-time-rfc1123/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[rfc-1123]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_date_time_rfc1123_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 - 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. - - :param array_body: - :type array_body: list of datetime - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/date-time-rfc1123/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[rfc-1123]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_duration_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of timedelta - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/duration/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[duration]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_duration_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. - - :param array_body: - :type array_body: list of timedelta - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/duration/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[duration]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_byte_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, - 43)] with each item encoded in base64. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of bytearray - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/byte/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[bytearray]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_byte_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, - 43)] with each elementencoded in base 64. - - :param array_body: - :type array_body: list of bytearray - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/byte/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[bytearray]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_byte_invalid_null( - self, custom_headers=None, raw=False, **operation_config): - """Get byte array value [hex(AB, AC, AD), null] with the first item - base64 encoded. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of bytearray - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/byte/invalidnull' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[bytearray]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_base64_url( - self, custom_headers=None, raw=False, **operation_config): - """Get array value ['a string that gets encoded with base64url', 'test - string' 'Lorem ipsum'] with the items base64url encoded. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of bytes - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/prim/base64url/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[base64]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_complex_null( - self, custom_headers=None, raw=False, **operation_config): - """Get array of complex type null value. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of :class:`Product - ` - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/complex/null' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[Product]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_complex_empty( - self, custom_headers=None, raw=False, **operation_config): - """Get empty array of complex type []. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of :class:`Product - ` - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/complex/empty' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[Product]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_complex_item_null( - self, custom_headers=None, raw=False, **operation_config): - """Get array of complex type with null item [{'integer': 1 'string': - '2'}, null, {'integer': 5, 'string': '6'}]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of :class:`Product - ` - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/complex/itemnull' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[Product]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_complex_item_empty( - self, custom_headers=None, raw=False, **operation_config): - """Get array of complex type with empty item [{'integer': 1 'string': - '2'}, {}, {'integer': 5, 'string': '6'}]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of :class:`Product - ` - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/complex/itemempty' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[Product]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_complex_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get array of complex type with [{'integer': 1 'string': '2'}, - {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of :class:`Product - ` - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/complex/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[Product]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_complex_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Put an array of complex type with values [{'integer': 1 'string': - '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. - - :param array_body: - :type array_body: list of :class:`Product - ` - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/complex/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[Product]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_array_null( - self, custom_headers=None, raw=False, **operation_config): - """Get a null array. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of list of str - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/array/null' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[[str]]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_array_empty( - self, custom_headers=None, raw=False, **operation_config): - """Get an empty array []. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of list of str - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/array/empty' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[[str]]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_array_item_null( - self, custom_headers=None, raw=False, **operation_config): - """Get an array of array of strings [['1', '2', '3'], null, ['7', '8', - '9']]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of list of str - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/array/itemnull' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[[str]]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_array_item_empty( - self, custom_headers=None, raw=False, **operation_config): - """Get an array of array of strings [['1', '2', '3'], [], ['7', '8', - '9']]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of list of str - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/array/itemempty' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[[str]]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_array_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], - ['7', '8', '9']]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of list of str - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/array/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[[str]]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_array_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], - ['7', '8', '9']]. - - :param array_body: - :type array_body: list of list of str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/array/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[[str]]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_dictionary_null( - self, custom_headers=None, raw=False, **operation_config): - """Get an array of Dictionaries with value null. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of dict - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/dictionary/null' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[{str}]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_dictionary_empty( - self, custom_headers=None, raw=False, **operation_config): - """Get an array of Dictionaries of type with value []. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of dict - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/dictionary/empty' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[{str}]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_dictionary_item_null( - self, custom_headers=None, raw=False, **operation_config): - """Get an array of Dictionaries of type with value - [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': - 'eight', '9': 'nine'}]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of dict - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/dictionary/itemnull' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[{str}]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_dictionary_item_empty( - self, custom_headers=None, raw=False, **operation_config): - """Get an array of Dictionaries of type with value - [{'1': 'one', '2': 'two', '3': 'three'}, {}, {'7': 'seven', '8': - 'eight', '9': 'nine'}]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of dict - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/dictionary/itemempty' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[{str}]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_dictionary_valid( - self, custom_headers=None, raw=False, **operation_config): - """Get an array of Dictionaries of type with value - [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', - '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: list of dict - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/dictionary/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[{str}]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def put_dictionary_valid( - self, array_body, custom_headers=None, raw=False, **operation_config): - """Get an array of Dictionaries of type with value - [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', - '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. - - :param array_body: - :type array_body: list of dict - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - """ - # Construct URL - url = '/array/dictionary/valid' - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(array_body, '[{str}]') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ArrayOperations(object): + """ArrayOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def get_null( + self, custom_headers=None, raw=False, **operation_config): + """Get null array value. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of int + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/null' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[int]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_invalid( + self, custom_headers=None, raw=False, **operation_config): + """Get invalid array [1, 2, 3. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of int + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/invalid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[int]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_empty( + self, custom_headers=None, raw=False, **operation_config): + """Get empty array value []. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of int + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/empty' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[int]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_empty( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value empty []. + + :param array_body: + :type array_body: list of str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/empty' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[str]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_boolean_tfft( + self, custom_headers=None, raw=False, **operation_config): + """Get boolean array value [true, false, false, true]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of bool + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/boolean/tfft' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[bool]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_boolean_tfft( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value empty [true, false, false, true]. + + :param array_body: + :type array_body: list of bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/boolean/tfft' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[bool]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_boolean_invalid_null( + self, custom_headers=None, raw=False, **operation_config): + """Get boolean array value [true, null, false]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of bool + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/boolean/true.null.false' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[bool]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_boolean_invalid_string( + self, custom_headers=None, raw=False, **operation_config): + """Get boolean array value [true, 'boolean', false]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of bool + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/boolean/true.boolean.false' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[bool]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_integer_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get integer array value [1, -1, 3, 300]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of int + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/integer/1.-1.3.300' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[int]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_integer_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value empty [1, -1, 3, 300]. + + :param array_body: + :type array_body: list of int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/integer/1.-1.3.300' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[int]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_int_invalid_null( + self, custom_headers=None, raw=False, **operation_config): + """Get integer array value [1, null, 0]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of int + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/integer/1.null.zero' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[int]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_int_invalid_string( + self, custom_headers=None, raw=False, **operation_config): + """Get integer array value [1, 'integer', 0]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of int + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/integer/1.integer.0' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[int]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_long_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get integer array value [1, -1, 3, 300]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of long + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/long/1.-1.3.300' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[long]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_long_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value empty [1, -1, 3, 300]. + + :param array_body: + :type array_body: list of long + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/long/1.-1.3.300' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[long]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_long_invalid_null( + self, custom_headers=None, raw=False, **operation_config): + """Get long array value [1, null, 0]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of long + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/long/1.null.zero' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[long]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_long_invalid_string( + self, custom_headers=None, raw=False, **operation_config): + """Get long array value [1, 'integer', 0]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of long + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/long/1.integer.0' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[long]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_float_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get float array value [0, -0.01, 1.2e20]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of float + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/float/0--0.01-1.2e20' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[float]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_float_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value [0, -0.01, 1.2e20]. + + :param array_body: + :type array_body: list of float + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/float/0--0.01-1.2e20' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[float]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_float_invalid_null( + self, custom_headers=None, raw=False, **operation_config): + """Get float array value [0.0, null, -1.2e20]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of float + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/float/0.0-null-1.2e20' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[float]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_float_invalid_string( + self, custom_headers=None, raw=False, **operation_config): + """Get boolean array value [1.0, 'number', 0.0]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of float + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/float/1.number.0' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[float]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_double_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get float array value [0, -0.01, 1.2e20]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of float + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/double/0--0.01-1.2e20' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[float]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_double_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value [0, -0.01, 1.2e20]. + + :param array_body: + :type array_body: list of float + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/double/0--0.01-1.2e20' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[float]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_double_invalid_null( + self, custom_headers=None, raw=False, **operation_config): + """Get float array value [0.0, null, -1.2e20]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of float + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/double/0.0-null-1.2e20' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[float]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_double_invalid_string( + self, custom_headers=None, raw=False, **operation_config): + """Get boolean array value [1.0, 'number', 0.0]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of float + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/double/1.number.0' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[float]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_string_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get string array value ['foo1', 'foo2', 'foo3']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of str + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/string/foo1.foo2.foo3' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[str]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_string_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value ['foo1', 'foo2', 'foo3']. + + :param array_body: + :type array_body: list of str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/string/foo1.foo2.foo3' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[str]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_string_with_null( + self, custom_headers=None, raw=False, **operation_config): + """Get string array value ['foo', null, 'foo2']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of str + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/string/foo.null.foo2' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[str]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_string_with_invalid( + self, custom_headers=None, raw=False, **operation_config): + """Get string array value ['foo', 123, 'foo2']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of str + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/string/foo.123.foo2' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[str]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_uuid_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', + 'd1399005-30f7-40d6-8da6-dd7c89ad34db', + 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of str + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/uuid/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[str]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_uuid_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', + 'd1399005-30f7-40d6-8da6-dd7c89ad34db', + 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + + :param array_body: + :type array_body: list of str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/uuid/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[str]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_uuid_invalid_chars( + self, custom_headers=None, raw=False, **operation_config): + """Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of str + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/uuid/invalidchars' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[str]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_date_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of date + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/date/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[date]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_date_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. + + :param array_body: + :type array_body: list of date + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/date/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[date]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_date_invalid_null( + self, custom_headers=None, raw=False, **operation_config): + """Get date array value ['2012-01-01', null, '1776-07-04']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of date + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/date/invalidnull' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[date]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_date_invalid_chars( + self, custom_headers=None, raw=False, **operation_config): + """Get date array value ['2011-03-22', 'date']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of date + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/date/invalidchars' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[date]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_date_time_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get date-time array value ['2000-12-01t00:00:01z', + '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of datetime + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/date-time/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[iso-8601]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_date_time_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', + '1492-10-12T10:15:01-08:00']. + + :param array_body: + :type array_body: list of datetime + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/date-time/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[iso-8601]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_date_time_invalid_null( + self, custom_headers=None, raw=False, **operation_config): + """Get date array value ['2000-12-01t00:00:01z', null]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of datetime + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/date-time/invalidnull' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[iso-8601]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_date_time_invalid_chars( + self, custom_headers=None, raw=False, **operation_config): + """Get date array value ['2000-12-01t00:00:01z', 'date-time']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of datetime + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/date-time/invalidchars' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[iso-8601]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_date_time_rfc1123_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 + Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of datetime + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/date-time-rfc1123/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[rfc-1123]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_date_time_rfc1123_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 + 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + + :param array_body: + :type array_body: list of datetime + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/date-time-rfc1123/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[rfc-1123]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_duration_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of timedelta + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/duration/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[duration]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_duration_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + + :param array_body: + :type array_body: list of timedelta + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/duration/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[duration]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_byte_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, + 43)] with each item encoded in base64. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of bytearray + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/byte/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[bytearray]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_byte_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, + 43)] with each elementencoded in base 64. + + :param array_body: + :type array_body: list of bytearray + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/byte/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[bytearray]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_byte_invalid_null( + self, custom_headers=None, raw=False, **operation_config): + """Get byte array value [hex(AB, AC, AD), null] with the first item + base64 encoded. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of bytearray + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/byte/invalidnull' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[bytearray]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_base64_url( + self, custom_headers=None, raw=False, **operation_config): + """Get array value ['a string that gets encoded with base64url', 'test + string' 'Lorem ipsum'] with the items base64url encoded. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of bytes + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/prim/base64url/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[base64]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_complex_null( + self, custom_headers=None, raw=False, **operation_config): + """Get array of complex type null value. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of :class:`Product + ` + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/complex/null' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[Product]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_complex_empty( + self, custom_headers=None, raw=False, **operation_config): + """Get empty array of complex type []. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of :class:`Product + ` + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/complex/empty' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[Product]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_complex_item_null( + self, custom_headers=None, raw=False, **operation_config): + """Get array of complex type with null item [{'integer': 1 'string': + '2'}, null, {'integer': 5, 'string': '6'}]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of :class:`Product + ` + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/complex/itemnull' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[Product]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_complex_item_empty( + self, custom_headers=None, raw=False, **operation_config): + """Get array of complex type with empty item [{'integer': 1 'string': + '2'}, {}, {'integer': 5, 'string': '6'}]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of :class:`Product + ` + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/complex/itemempty' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[Product]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_complex_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get array of complex type with [{'integer': 1 'string': '2'}, + {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of :class:`Product + ` + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/complex/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[Product]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_complex_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Put an array of complex type with values [{'integer': 1 'string': + '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + + :param array_body: + :type array_body: list of :class:`Product + ` + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/complex/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[Product]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_array_null( + self, custom_headers=None, raw=False, **operation_config): + """Get a null array. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of list of str + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/array/null' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[[str]]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_array_empty( + self, custom_headers=None, raw=False, **operation_config): + """Get an empty array []. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of list of str + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/array/empty' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[[str]]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_array_item_null( + self, custom_headers=None, raw=False, **operation_config): + """Get an array of array of strings [['1', '2', '3'], null, ['7', '8', + '9']]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of list of str + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/array/itemnull' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[[str]]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_array_item_empty( + self, custom_headers=None, raw=False, **operation_config): + """Get an array of array of strings [['1', '2', '3'], [], ['7', '8', + '9']]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of list of str + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/array/itemempty' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[[str]]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_array_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], + ['7', '8', '9']]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of list of str + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/array/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[[str]]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_array_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], + ['7', '8', '9']]. + + :param array_body: + :type array_body: list of list of str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/array/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[[str]]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_dictionary_null( + self, custom_headers=None, raw=False, **operation_config): + """Get an array of Dictionaries with value null. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of dict + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/dictionary/null' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[{str}]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_dictionary_empty( + self, custom_headers=None, raw=False, **operation_config): + """Get an array of Dictionaries of type with value []. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of dict + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/dictionary/empty' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[{str}]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_dictionary_item_null( + self, custom_headers=None, raw=False, **operation_config): + """Get an array of Dictionaries of type with value + [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': + 'eight', '9': 'nine'}]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of dict + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/dictionary/itemnull' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[{str}]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_dictionary_item_empty( + self, custom_headers=None, raw=False, **operation_config): + """Get an array of Dictionaries of type with value + [{'1': 'one', '2': 'two', '3': 'three'}, {}, {'7': 'seven', '8': + 'eight', '9': 'nine'}]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of dict + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/dictionary/itemempty' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[{str}]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_dictionary_valid( + self, custom_headers=None, raw=False, **operation_config): + """Get an array of Dictionaries of type with value + [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', + '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: list of dict + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/dictionary/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[{str}]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_dictionary_valid( + self, array_body, custom_headers=None, raw=False, **operation_config): + """Get an array of Dictionaries of type with value + [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', + '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + + :param array_body: + :type array_body: list of dict + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/array/dictionary/valid' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(array_body, '[{str}]') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/auto_rest_bool_test_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/auto_rest_bool_test_service.py index 8cf4e5fffb..3e545353ac 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/auto_rest_bool_test_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/auto_rest_bool_test_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.bool_model import BoolModel +from .operations.bool_model_operations import BoolModelOperations from . import models @@ -43,7 +43,7 @@ class AutoRestBoolTestService(object): :vartype config: AutoRestBoolTestServiceConfiguration :ivar bool_model: BoolModel operations - :vartype bool_model: .operations.BoolModel + :vartype bool_model: .operations.BoolModelOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.bool_model = BoolModel( + self.bool_model = BoolModelOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/operations/__init__.py index 6183b00515..f72d76a79d 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .bool_model import BoolModel +from .bool_model_operations import BoolModelOperations __all__ = [ - 'BoolModel', + 'BoolModelOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/operations/bool_model.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/operations/bool_model_operations.py similarity index 98% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/operations/bool_model.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/operations/bool_model_operations.py index 999999347c..8854cfb7f1 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/operations/bool_model.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/operations/bool_model_operations.py @@ -14,13 +14,13 @@ from .. import models -class BoolModel(object): - """BoolModel operations. +class BoolModelOperations(object): + """BoolModelOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/auto_rest_swagger_bat_byte_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/auto_rest_swagger_bat_byte_service.py index 5da86b5b91..e9eba2261d 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/auto_rest_swagger_bat_byte_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/auto_rest_swagger_bat_byte_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.byte import Byte +from .operations.byte_operations import ByteOperations from . import models @@ -43,7 +43,7 @@ class AutoRestSwaggerBATByteService(object): :vartype config: AutoRestSwaggerBATByteServiceConfiguration :ivar byte: Byte operations - :vartype byte: .operations.Byte + :vartype byte: .operations.ByteOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.byte = Byte( + self.byte = ByteOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/operations/__init__.py index b1b1965596..38ecf95d6f 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .byte import Byte +from .byte_operations import ByteOperations __all__ = [ - 'Byte', + 'ByteOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/operations/byte.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/operations/byte_operations.py similarity index 98% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/operations/byte.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/operations/byte_operations.py index 4a4734bb27..3a66076bf9 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/operations/byte.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/operations/byte_operations.py @@ -14,13 +14,13 @@ from .. import models -class Byte(object): - """Byte operations. +class ByteOperations(object): + """ByteOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/auto_rest_complex_test_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/auto_rest_complex_test_service.py index 05a5944dc0..dfcb5a008f 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/auto_rest_complex_test_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/auto_rest_complex_test_service.py @@ -12,14 +12,14 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.basic_operations import BasicOperations -from .operations.primitive import Primitive -from .operations.array import Array -from .operations.dictionary import Dictionary -from .operations.inheritance import Inheritance -from .operations.polymorphism import Polymorphism -from .operations.polymorphicrecursive import Polymorphicrecursive -from .operations.readonlyproperty import Readonlyproperty +from .operations.basic_operations_operations import BasicOperationsOperations +from .operations.primitive_operations import PrimitiveOperations +from .operations.array_operations import ArrayOperations +from .operations.dictionary_operations import DictionaryOperations +from .operations.inheritance_operations import InheritanceOperations +from .operations.polymorphism_operations import PolymorphismOperations +from .operations.polymorphicrecursive_operations import PolymorphicrecursiveOperations +from .operations.readonlyproperty_operations import ReadonlypropertyOperations from . import models @@ -28,19 +28,15 @@ class AutoRestComplexTestServiceConfiguration(Configuration): Note that all parameters used to create this instance are saved as instance attributes. - :param api_version: API ID. + :ivar api_version: API ID. :type api_version: str :param str base_url: Service URL :param str filepath: Existing config """ def __init__( - self, api_version, base_url=None, filepath=None): + self, base_url=None, filepath=None): - if api_version is None: - raise ValueError("Parameter 'api_version' must not be None.") - if not isinstance(api_version, str): - raise TypeError("Parameter 'api_version' must be str.") if not base_url: base_url = 'http://localhost' @@ -48,7 +44,7 @@ def __init__( self.add_user_agent('autorestcomplextestservice/{}'.format(VERSION)) - self.api_version = api_version + self.api_version = "2014-04-01-preview" class AutoRestComplexTestService(object): @@ -58,51 +54,49 @@ class AutoRestComplexTestService(object): :vartype config: AutoRestComplexTestServiceConfiguration :ivar basic_operations: BasicOperations operations - :vartype basic_operations: .operations.BasicOperations + :vartype basic_operations: .operations.BasicOperationsOperations :ivar primitive: Primitive operations - :vartype primitive: .operations.Primitive + :vartype primitive: .operations.PrimitiveOperations :ivar array: Array operations - :vartype array: .operations.Array + :vartype array: .operations.ArrayOperations :ivar dictionary: Dictionary operations - :vartype dictionary: .operations.Dictionary + :vartype dictionary: .operations.DictionaryOperations :ivar inheritance: Inheritance operations - :vartype inheritance: .operations.Inheritance + :vartype inheritance: .operations.InheritanceOperations :ivar polymorphism: Polymorphism operations - :vartype polymorphism: .operations.Polymorphism + :vartype polymorphism: .operations.PolymorphismOperations :ivar polymorphicrecursive: Polymorphicrecursive operations - :vartype polymorphicrecursive: .operations.Polymorphicrecursive + :vartype polymorphicrecursive: .operations.PolymorphicrecursiveOperations :ivar readonlyproperty: Readonlyproperty operations - :vartype readonlyproperty: .operations.Readonlyproperty + :vartype readonlyproperty: .operations.ReadonlypropertyOperations - :param api_version: API ID. - :type api_version: str :param str base_url: Service URL :param str filepath: Existing config """ def __init__( - self, api_version, base_url=None, filepath=None): + self, base_url=None, filepath=None): - self.config = AutoRestComplexTestServiceConfiguration(api_version, base_url, filepath) + self.config = AutoRestComplexTestServiceConfiguration(base_url, filepath) self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.basic_operations = BasicOperations( + self.basic_operations = BasicOperationsOperations( self._client, self.config, self._serialize, self._deserialize) - self.primitive = Primitive( + self.primitive = PrimitiveOperations( self._client, self.config, self._serialize, self._deserialize) - self.array = Array( + self.array = ArrayOperations( self._client, self.config, self._serialize, self._deserialize) - self.dictionary = Dictionary( + self.dictionary = DictionaryOperations( self._client, self.config, self._serialize, self._deserialize) - self.inheritance = Inheritance( + self.inheritance = InheritanceOperations( self._client, self.config, self._serialize, self._deserialize) - self.polymorphism = Polymorphism( + self.polymorphism = PolymorphismOperations( self._client, self.config, self._serialize, self._deserialize) - self.polymorphicrecursive = Polymorphicrecursive( + self.polymorphicrecursive = PolymorphicrecursiveOperations( self._client, self.config, self._serialize, self._deserialize) - self.readonlyproperty = Readonlyproperty( + self.readonlyproperty = ReadonlypropertyOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/__init__.py index 0453bd0e2b..bdee1ec8dc 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/__init__.py @@ -9,22 +9,22 @@ # regenerated. # -------------------------------------------------------------------------- -from .basic_operations import BasicOperations -from .primitive import Primitive -from .array import Array -from .dictionary import Dictionary -from .inheritance import Inheritance -from .polymorphism import Polymorphism -from .polymorphicrecursive import Polymorphicrecursive -from .readonlyproperty import Readonlyproperty +from .basic_operations_operations import BasicOperationsOperations +from .primitive_operations import PrimitiveOperations +from .array_operations import ArrayOperations +from .dictionary_operations import DictionaryOperations +from .inheritance_operations import InheritanceOperations +from .polymorphism_operations import PolymorphismOperations +from .polymorphicrecursive_operations import PolymorphicrecursiveOperations +from .readonlyproperty_operations import ReadonlypropertyOperations __all__ = [ - 'BasicOperations', - 'Primitive', - 'Array', - 'Dictionary', - 'Inheritance', - 'Polymorphism', - 'Polymorphicrecursive', - 'Readonlyproperty', + 'BasicOperationsOperations', + 'PrimitiveOperations', + 'ArrayOperations', + 'DictionaryOperations', + 'InheritanceOperations', + 'PolymorphismOperations', + 'PolymorphicrecursiveOperations', + 'ReadonlypropertyOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/array.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/array_operations.py similarity index 98% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/array.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/array_operations.py index 53cb74829f..a65692c4bf 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/array.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/array_operations.py @@ -14,13 +14,13 @@ from .. import models -class Array(object): - """Array operations. +class ArrayOperations(object): + """ArrayOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/basic_operations.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/basic_operations_operations.py similarity index 98% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/basic_operations.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/basic_operations_operations.py index c77ee74a4f..6676c0eba9 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/basic_operations.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/basic_operations_operations.py @@ -14,13 +14,13 @@ from .. import models -class BasicOperations(object): - """BasicOperations operations. +class BasicOperationsOperations(object): + """BasicOperationsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/dictionary.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/dictionary_operations.py similarity index 98% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/dictionary.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/dictionary_operations.py index 1f822cf5bf..3144d519f0 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/dictionary.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/dictionary_operations.py @@ -14,13 +14,13 @@ from .. import models -class Dictionary(object): - """Dictionary operations. +class DictionaryOperations(object): + """DictionaryOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/inheritance.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/inheritance_operations.py similarity index 97% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/inheritance.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/inheritance_operations.py index 183eb0bbc5..4f3b39c126 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/inheritance.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/inheritance_operations.py @@ -14,13 +14,13 @@ from .. import models -class Inheritance(object): - """Inheritance operations. +class InheritanceOperations(object): + """InheritanceOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphicrecursive.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphicrecursive_operations.py similarity index 97% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphicrecursive.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphicrecursive_operations.py index b2194416a0..a0e57b65b6 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphicrecursive.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphicrecursive_operations.py @@ -14,13 +14,13 @@ from .. import models -class Polymorphicrecursive(object): - """Polymorphicrecursive operations. +class PolymorphicrecursiveOperations(object): + """PolymorphicrecursiveOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphism.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphism_operations.py similarity index 98% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphism.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphism_operations.py index e240b994c8..8cc31fd5de 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphism.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphism_operations.py @@ -14,13 +14,13 @@ from .. import models -class Polymorphism(object): - """Polymorphism operations. +class PolymorphismOperations(object): + """PolymorphismOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/primitive.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/primitive_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/primitive.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/primitive_operations.py index 5b035c3b5c..ff8c54d1d9 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/primitive.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/primitive_operations.py @@ -14,13 +14,13 @@ from .. import models -class Primitive(object): - """Primitive operations. +class PrimitiveOperations(object): + """PrimitiveOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/readonlyproperty.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/readonlyproperty_operations.py similarity index 96% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/readonlyproperty.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/readonlyproperty_operations.py index b2fb71d68f..ceafc2d18c 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/readonlyproperty.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/readonlyproperty_operations.py @@ -14,13 +14,13 @@ from .. import models -class Readonlyproperty(object): - """Readonlyproperty operations. +class ReadonlypropertyOperations(object): + """ReadonlypropertyOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/auto_rest_date_test_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/auto_rest_date_test_service.py index c37507db7f..8b665ea887 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/auto_rest_date_test_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/auto_rest_date_test_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.date_model import DateModel +from .operations.date_model_operations import DateModelOperations from . import models @@ -43,7 +43,7 @@ class AutoRestDateTestService(object): :vartype config: AutoRestDateTestServiceConfiguration :ivar date_model: DateModel operations - :vartype date_model: .operations.DateModel + :vartype date_model: .operations.DateModelOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.date_model = DateModel( + self.date_model = DateModelOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/operations/__init__.py index 3ac559d5b2..6b50268fb8 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .date_model import DateModel +from .date_model_operations import DateModelOperations __all__ = [ - 'DateModel', + 'DateModelOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/operations/date_model.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/operations/date_model_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/operations/date_model.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/operations/date_model_operations.py index a13846b56c..68e2f4adc8 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/operations/date_model.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/operations/date_model_operations.py @@ -14,13 +14,13 @@ from .. import models -class DateModel(object): - """DateModel operations. +class DateModelOperations(object): + """DateModelOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/auto_rest_date_time_test_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/auto_rest_date_time_test_service.py index a7189bd413..f51ab11b57 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/auto_rest_date_time_test_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/auto_rest_date_time_test_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.datetime_model import DatetimeModel +from .operations.datetime_model_operations import DatetimeModelOperations from . import models @@ -43,7 +43,7 @@ class AutoRestDateTimeTestService(object): :vartype config: AutoRestDateTimeTestServiceConfiguration :ivar datetime_model: DatetimeModel operations - :vartype datetime_model: .operations.DatetimeModel + :vartype datetime_model: .operations.DatetimeModelOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.datetime_model = DatetimeModel( + self.datetime_model = DatetimeModelOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/operations/__init__.py index e8f4d9c23f..dbd01c4329 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .datetime_model import DatetimeModel +from .datetime_model_operations import DatetimeModelOperations __all__ = [ - 'DatetimeModel', + 'DatetimeModelOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/operations/datetime_model.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/operations/datetime_model_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/operations/datetime_model.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/operations/datetime_model_operations.py index aa746582d4..1a5b77ccb1 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/operations/datetime_model.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/operations/datetime_model_operations.py @@ -14,13 +14,13 @@ from .. import models -class DatetimeModel(object): - """DatetimeModel operations. +class DatetimeModelOperations(object): + """DatetimeModelOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/auto_rest_rfc1123_date_time_test_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/auto_rest_rfc1123_date_time_test_service.py index 8ba043959a..b1f09a3c6a 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/auto_rest_rfc1123_date_time_test_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/auto_rest_rfc1123_date_time_test_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.datetimerfc1123 import Datetimerfc1123 +from .operations.datetimerfc1123_operations import Datetimerfc1123Operations from . import models @@ -43,7 +43,7 @@ class AutoRestRFC1123DateTimeTestService(object): :vartype config: AutoRestRFC1123DateTimeTestServiceConfiguration :ivar datetimerfc1123: Datetimerfc1123 operations - :vartype datetimerfc1123: .operations.Datetimerfc1123 + :vartype datetimerfc1123: .operations.Datetimerfc1123Operations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.datetimerfc1123 = Datetimerfc1123( + self.datetimerfc1123 = Datetimerfc1123Operations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/operations/__init__.py index 25309ae1be..eb83c424a1 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .datetimerfc1123 import Datetimerfc1123 +from .datetimerfc1123_operations import Datetimerfc1123Operations __all__ = [ - 'Datetimerfc1123', + 'Datetimerfc1123Operations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/operations/datetimerfc1123.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/operations/datetimerfc1123_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/operations/datetimerfc1123.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/operations/datetimerfc1123_operations.py index 5ae8a302e0..6d079088fc 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/operations/datetimerfc1123.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/operations/datetimerfc1123_operations.py @@ -14,13 +14,13 @@ from .. import models -class Datetimerfc1123(object): - """Datetimerfc1123 operations. +class Datetimerfc1123Operations(object): + """Datetimerfc1123Operations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/auto_rest_swagger_ba_tdictionary_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/auto_rest_swagger_ba_tdictionary_service.py index 7ec28039bc..26d72d6808 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/auto_rest_swagger_ba_tdictionary_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/auto_rest_swagger_ba_tdictionary_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.dictionary import Dictionary +from .operations.dictionary_operations import DictionaryOperations from . import models @@ -43,7 +43,7 @@ class AutoRestSwaggerBATdictionaryService(object): :vartype config: AutoRestSwaggerBATdictionaryServiceConfiguration :ivar dictionary: Dictionary operations - :vartype dictionary: .operations.Dictionary + :vartype dictionary: .operations.DictionaryOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.dictionary = Dictionary( + self.dictionary = DictionaryOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/operations/__init__.py index 140d2cbcd3..40e35e3578 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .dictionary import Dictionary +from .dictionary_operations import DictionaryOperations __all__ = [ - 'Dictionary', + 'DictionaryOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/operations/dictionary.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/operations/dictionary_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/operations/dictionary.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/operations/dictionary_operations.py index ca016a62d8..3add165508 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/operations/dictionary.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/operations/dictionary_operations.py @@ -14,13 +14,13 @@ from .. import models -class Dictionary(object): - """Dictionary operations. +class DictionaryOperations(object): + """DictionaryOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py index 6160f38a69..97941c29d7 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.duration import Duration +from .operations.duration_operations import DurationOperations from . import models @@ -43,7 +43,7 @@ class AutoRestDurationTestService(object): :vartype config: AutoRestDurationTestServiceConfiguration :ivar duration: Duration operations - :vartype duration: .operations.Duration + :vartype duration: .operations.DurationOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.duration = Duration( + self.duration = DurationOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/operations/__init__.py index b2d4d4d564..227cc9327c 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .duration import Duration +from .duration_operations import DurationOperations __all__ = [ - 'Duration', + 'DurationOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/operations/duration.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/operations/duration_operations.py similarity index 98% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/operations/duration.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/operations/duration_operations.py index e6f38d87a7..6716741f7a 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/operations/duration.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/operations/duration_operations.py @@ -14,13 +14,13 @@ from .. import models -class Duration(object): - """Duration operations. +class DurationOperations(object): + """DurationOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/auto_rest_swagger_bat_file_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/auto_rest_swagger_bat_file_service.py index b7b44c72d6..2b3303f49e 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/auto_rest_swagger_bat_file_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/auto_rest_swagger_bat_file_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.files import Files +from .operations.files_operations import FilesOperations from . import models @@ -43,7 +43,7 @@ class AutoRestSwaggerBATFileService(object): :vartype config: AutoRestSwaggerBATFileServiceConfiguration :ivar files: Files operations - :vartype files: .operations.Files + :vartype files: .operations.FilesOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.files = Files( + self.files = FilesOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/operations/__init__.py index 25dd388c75..42ee1bbd32 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .files import Files +from .files_operations import FilesOperations __all__ = [ - 'Files', + 'FilesOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/operations/files.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/operations/files_operations.py similarity index 98% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/operations/files.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/operations/files_operations.py index cd0c1ecd96..d5e7871ac6 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/operations/files.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/operations/files_operations.py @@ -14,13 +14,13 @@ from .. import models -class Files(object): - """Files operations. +class FilesOperations(object): + """FilesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/auto_rest_swagger_bat_form_data_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/auto_rest_swagger_bat_form_data_service.py index 07c4464eea..45ade7e198 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/auto_rest_swagger_bat_form_data_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/auto_rest_swagger_bat_form_data_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.formdata import Formdata +from .operations.formdata_operations import FormdataOperations from . import models @@ -43,7 +43,7 @@ class AutoRestSwaggerBATFormDataService(object): :vartype config: AutoRestSwaggerBATFormDataServiceConfiguration :ivar formdata: Formdata operations - :vartype formdata: .operations.Formdata + :vartype formdata: .operations.FormdataOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.formdata = Formdata( + self.formdata = FormdataOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/operations/__init__.py index 8083aa2351..e32476fee6 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .formdata import Formdata +from .formdata_operations import FormdataOperations __all__ = [ - 'Formdata', + 'FormdataOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/operations/formdata.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/operations/formdata_operations.py similarity index 97% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/operations/formdata.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/operations/formdata_operations.py index f0f30026ac..afc888fab3 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/operations/formdata.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/operations/formdata_operations.py @@ -14,13 +14,13 @@ from .. import models -class Formdata(object): - """Formdata operations. +class FormdataOperations(object): + """FormdataOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/auto_rest_integer_test_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/auto_rest_integer_test_service.py index 86c9440c50..37f074098b 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/auto_rest_integer_test_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/auto_rest_integer_test_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.int_model import IntModel +from .operations.int_model_operations import IntModelOperations from . import models @@ -43,7 +43,7 @@ class AutoRestIntegerTestService(object): :vartype config: AutoRestIntegerTestServiceConfiguration :ivar int_model: IntModel operations - :vartype int_model: .operations.IntModel + :vartype int_model: .operations.IntModelOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.int_model = IntModel( + self.int_model = IntModelOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/__init__.py index 6fb6aec34f..2053c0e8bf 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .int_model import IntModel +from .int_model_operations import IntModelOperations __all__ = [ - 'IntModel', + 'IntModelOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model_operations.py index a449942cea..3be8ee6af8 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model_operations.py @@ -14,13 +14,13 @@ from .. import models -class IntModel(object): - """IntModel operations. +class IntModelOperations(object): + """IntModelOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/auto_rest_number_test_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/auto_rest_number_test_service.py index 0f445b717a..568e5193e5 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/auto_rest_number_test_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/auto_rest_number_test_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.number import Number +from .operations.number_operations import NumberOperations from . import models @@ -43,7 +43,7 @@ class AutoRestNumberTestService(object): :vartype config: AutoRestNumberTestServiceConfiguration :ivar number: Number operations - :vartype number: .operations.Number + :vartype number: .operations.NumberOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.number = Number( + self.number = NumberOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/operations/__init__.py index dba3ace39f..a0b4f39621 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .number import Number +from .number_operations import NumberOperations __all__ = [ - 'Number', + 'NumberOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/operations/number.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/operations/number_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/operations/number.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/operations/number_operations.py index f8566de980..0830a77c83 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/operations/number.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/operations/number_operations.py @@ -14,13 +14,13 @@ from .. import models -class Number(object): - """Number operations. +class NumberOperations(object): + """NumberOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/auto_rest_swagger_bat_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/auto_rest_swagger_bat_service.py index cb1ce26901..4508283da3 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/auto_rest_swagger_bat_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/auto_rest_swagger_bat_service.py @@ -12,8 +12,8 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.string import String -from .operations.enum import Enum +from .operations.string_operations import StringOperations +from .operations.enum_operations import EnumOperations from . import models @@ -44,9 +44,9 @@ class AutoRestSwaggerBATService(object): :vartype config: AutoRestSwaggerBATServiceConfiguration :ivar string: String operations - :vartype string: .operations.String + :vartype string: .operations.StringOperations :ivar enum: Enum operations - :vartype enum: .operations.Enum + :vartype enum: .operations.EnumOperations :param str base_url: Service URL :param str filepath: Existing config @@ -62,7 +62,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.string = String( + self.string = StringOperations( self._client, self.config, self._serialize, self._deserialize) - self.enum = Enum( + self.enum = EnumOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/__init__.py index 8948c52399..af10897559 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/__init__.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .string import String -from .enum import Enum +from .string_operations import StringOperations +from .enum_operations import EnumOperations __all__ = [ - 'String', - 'Enum', + 'StringOperations', + 'EnumOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/enum.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/enum_operations.py similarity index 98% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/enum.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/enum_operations.py index b69093a844..0441b62c97 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/enum.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/enum_operations.py @@ -14,13 +14,13 @@ from .. import models -class Enum(object): - """Enum operations. +class EnumOperations(object): + """EnumOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/string.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/string_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/string.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/string_operations.py index 6763420e1d..e3f8b4d504 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/string.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/string_operations.py @@ -14,13 +14,13 @@ from .. import models -class String(object): - """String operations. +class StringOperations(object): + """StringOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py index 14b292dfa6..a38fd10df5 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.paths import Paths +from .operations.paths_operations import PathsOperations from . import models @@ -50,7 +50,7 @@ class AutoRestParameterizedHostTestClient(object): :vartype config: AutoRestParameterizedHostTestClientConfiguration :ivar paths: Paths operations - :vartype paths: .operations.Paths + :vartype paths: .operations.PathsOperations :param host: A string value that is used as a global part of the parameterized host @@ -68,5 +68,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.paths = Paths( + self.paths = PathsOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/operations/__init__.py index fa4a82a28d..75acd01d4c 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .paths import Paths +from .paths_operations import PathsOperations __all__ = [ - 'Paths', + 'PathsOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/operations/paths.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/operations/paths_operations.py similarity index 95% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/operations/paths.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/operations/paths_operations.py index 44c5c42dea..fa7331dfef 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/operations/paths.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/operations/paths_operations.py @@ -14,13 +14,13 @@ from .. import models -class Paths(object): - """Paths operations. +class PathsOperations(object): + """PathsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py index 9e5500f342..610032a915 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.paths import Paths +from .operations.paths_operations import PathsOperations from . import models @@ -57,7 +57,7 @@ class AutoRestParameterizedCustomHostTestClient(object): :vartype config: AutoRestParameterizedCustomHostTestClientConfiguration :ivar paths: Paths operations - :vartype paths: .operations.Paths + :vartype paths: .operations.PathsOperations :param subscription_id: The subscription id with value 'test12'. :type subscription_id: str @@ -77,5 +77,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.paths = Paths( + self.paths = PathsOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/__init__.py index fa4a82a28d..75acd01d4c 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .paths import Paths +from .paths_operations import PathsOperations __all__ = [ - 'Paths', + 'PathsOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/paths.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/paths_operations.py similarity index 96% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/paths.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/paths_operations.py index ed10e919ea..7b8070bf8b 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/paths.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/paths_operations.py @@ -14,13 +14,13 @@ from .. import models -class Paths(object): - """Paths operations. +class PathsOperations(object): + """PathsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/auto_rest_swagger_bat_header_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/auto_rest_swagger_bat_header_service.py index 2b6e1e65a9..34514ad2b9 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/auto_rest_swagger_bat_header_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/auto_rest_swagger_bat_header_service.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.header import Header +from .operations.header_operations import HeaderOperations from . import models @@ -43,7 +43,7 @@ class AutoRestSwaggerBATHeaderService(object): :vartype config: AutoRestSwaggerBATHeaderServiceConfiguration :ivar header: Header operations - :vartype header: .operations.Header + :vartype header: .operations.HeaderOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.header = Header( + self.header = HeaderOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/__init__.py index 3805a0608d..6c0fd01cdb 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .header import Header +from .header_operations import HeaderOperations __all__ = [ - 'Header', + 'HeaderOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/header.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/header_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/header.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/header_operations.py index 7a5585c8e1..ca12cb47ca 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/header.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/header_operations.py @@ -14,13 +14,13 @@ from .. import models -class Header(object): - """Header operations. +class HeaderOperations(object): + """HeaderOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/auto_rest_http_infrastructure_test_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/auto_rest_http_infrastructure_test_service.py index c830f26bc2..b4ea66fa12 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/auto_rest_http_infrastructure_test_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/auto_rest_http_infrastructure_test_service.py @@ -12,13 +12,13 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.http_failure import HttpFailure -from .operations.http_success import HttpSuccess -from .operations.http_redirects import HttpRedirects -from .operations.http_client_failure import HttpClientFailure -from .operations.http_server_failure import HttpServerFailure -from .operations.http_retry import HttpRetry -from .operations.multiple_responses import MultipleResponses +from .operations.http_failure_operations import HttpFailureOperations +from .operations.http_success_operations import HttpSuccessOperations +from .operations.http_redirects_operations import HttpRedirectsOperations +from .operations.http_client_failure_operations import HttpClientFailureOperations +from .operations.http_server_failure_operations import HttpServerFailureOperations +from .operations.http_retry_operations import HttpRetryOperations +from .operations.multiple_responses_operations import MultipleResponsesOperations from . import models @@ -49,19 +49,19 @@ class AutoRestHttpInfrastructureTestService(object): :vartype config: AutoRestHttpInfrastructureTestServiceConfiguration :ivar http_failure: HttpFailure operations - :vartype http_failure: .operations.HttpFailure + :vartype http_failure: .operations.HttpFailureOperations :ivar http_success: HttpSuccess operations - :vartype http_success: .operations.HttpSuccess + :vartype http_success: .operations.HttpSuccessOperations :ivar http_redirects: HttpRedirects operations - :vartype http_redirects: .operations.HttpRedirects + :vartype http_redirects: .operations.HttpRedirectsOperations :ivar http_client_failure: HttpClientFailure operations - :vartype http_client_failure: .operations.HttpClientFailure + :vartype http_client_failure: .operations.HttpClientFailureOperations :ivar http_server_failure: HttpServerFailure operations - :vartype http_server_failure: .operations.HttpServerFailure + :vartype http_server_failure: .operations.HttpServerFailureOperations :ivar http_retry: HttpRetry operations - :vartype http_retry: .operations.HttpRetry + :vartype http_retry: .operations.HttpRetryOperations :ivar multiple_responses: MultipleResponses operations - :vartype multiple_responses: .operations.MultipleResponses + :vartype multiple_responses: .operations.MultipleResponsesOperations :param str base_url: Service URL :param str filepath: Existing config @@ -77,17 +77,17 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.http_failure = HttpFailure( + self.http_failure = HttpFailureOperations( self._client, self.config, self._serialize, self._deserialize) - self.http_success = HttpSuccess( + self.http_success = HttpSuccessOperations( self._client, self.config, self._serialize, self._deserialize) - self.http_redirects = HttpRedirects( + self.http_redirects = HttpRedirectsOperations( self._client, self.config, self._serialize, self._deserialize) - self.http_client_failure = HttpClientFailure( + self.http_client_failure = HttpClientFailureOperations( self._client, self.config, self._serialize, self._deserialize) - self.http_server_failure = HttpServerFailure( + self.http_server_failure = HttpServerFailureOperations( self._client, self.config, self._serialize, self._deserialize) - self.http_retry = HttpRetry( + self.http_retry = HttpRetryOperations( self._client, self.config, self._serialize, self._deserialize) - self.multiple_responses = MultipleResponses( + self.multiple_responses = MultipleResponsesOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/__init__.py index 21a2353ad1..239a80810c 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/__init__.py @@ -9,20 +9,20 @@ # regenerated. # -------------------------------------------------------------------------- -from .http_failure import HttpFailure -from .http_success import HttpSuccess -from .http_redirects import HttpRedirects -from .http_client_failure import HttpClientFailure -from .http_server_failure import HttpServerFailure -from .http_retry import HttpRetry -from .multiple_responses import MultipleResponses +from .http_failure_operations import HttpFailureOperations +from .http_success_operations import HttpSuccessOperations +from .http_redirects_operations import HttpRedirectsOperations +from .http_client_failure_operations import HttpClientFailureOperations +from .http_server_failure_operations import HttpServerFailureOperations +from .http_retry_operations import HttpRetryOperations +from .multiple_responses_operations import MultipleResponsesOperations __all__ = [ - 'HttpFailure', - 'HttpSuccess', - 'HttpRedirects', - 'HttpClientFailure', - 'HttpServerFailure', - 'HttpRetry', - 'MultipleResponses', + 'HttpFailureOperations', + 'HttpSuccessOperations', + 'HttpRedirectsOperations', + 'HttpClientFailureOperations', + 'HttpServerFailureOperations', + 'HttpRetryOperations', + 'MultipleResponsesOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_client_failure.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_client_failure_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_client_failure.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_client_failure_operations.py index 1e7d867b8c..e7fb502a50 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_client_failure.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_client_failure_operations.py @@ -14,13 +14,13 @@ from .. import models -class HttpClientFailure(object): - """HttpClientFailure operations. +class HttpClientFailureOperations(object): + """HttpClientFailureOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_failure.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_failure_operations.py similarity index 97% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_failure.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_failure_operations.py index 7184aa10a4..a5d228333d 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_failure.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_failure_operations.py @@ -15,13 +15,13 @@ from .. import models -class HttpFailure(object): - """HttpFailure operations. +class HttpFailureOperations(object): + """HttpFailureOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_redirects.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_redirects_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_redirects.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_redirects_operations.py index 5baf86219f..a1a8ebaaa7 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_redirects.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_redirects_operations.py @@ -14,13 +14,13 @@ from .. import models -class HttpRedirects(object): - """HttpRedirects operations. +class HttpRedirectsOperations(object): + """HttpRedirectsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_retry.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_retry_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_retry.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_retry_operations.py index 3b6f6ae638..7569760fa1 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_retry.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_retry_operations.py @@ -14,13 +14,13 @@ from .. import models -class HttpRetry(object): - """HttpRetry operations. +class HttpRetryOperations(object): + """HttpRetryOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_server_failure.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_server_failure_operations.py similarity index 98% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_server_failure.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_server_failure_operations.py index bd83490b51..6129eedcc8 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_server_failure.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_server_failure_operations.py @@ -14,13 +14,13 @@ from .. import models -class HttpServerFailure(object): - """HttpServerFailure operations. +class HttpServerFailureOperations(object): + """HttpServerFailureOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_success.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_success_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_success.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_success_operations.py index 55fd3419a9..08a5c08d6b 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_success.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_success_operations.py @@ -14,13 +14,13 @@ from .. import models -class HttpSuccess(object): - """HttpSuccess operations. +class HttpSuccessOperations(object): + """HttpSuccessOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/multiple_responses.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/multiple_responses_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/multiple_responses.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/multiple_responses_operations.py index 535a72d19b..5c44993610 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/multiple_responses.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/multiple_responses_operations.py @@ -15,13 +15,13 @@ from .. import models -class MultipleResponses(object): - """MultipleResponses operations. +class MultipleResponsesOperations(object): + """MultipleResponsesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/auto_rest_parameter_flattening.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/auto_rest_parameter_flattening.py index b3c9a71e2c..bc0409a509 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/auto_rest_parameter_flattening.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/auto_rest_parameter_flattening.py @@ -12,7 +12,7 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.availability_sets import AvailabilitySets +from .operations.availability_sets_operations import AvailabilitySetsOperations from . import models @@ -43,7 +43,7 @@ class AutoRestParameterFlattening(object): :vartype config: AutoRestParameterFlatteningConfiguration :ivar availability_sets: AvailabilitySets operations - :vartype availability_sets: .operations.AvailabilitySets + :vartype availability_sets: .operations.AvailabilitySetsOperations :param str base_url: Service URL :param str filepath: Existing config @@ -59,5 +59,5 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.availability_sets = AvailabilitySets( + self.availability_sets = AvailabilitySetsOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/__init__.py index 03b2b6b8b6..0c48fc6d9d 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .availability_sets import AvailabilitySets +from .availability_sets_operations import AvailabilitySetsOperations __all__ = [ - 'AvailabilitySets', + 'AvailabilitySetsOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/availability_sets.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/availability_sets_operations.py similarity index 95% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/availability_sets.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/availability_sets_operations.py index 420cd98429..2df2cdadda 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/availability_sets.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/availability_sets_operations.py @@ -15,13 +15,13 @@ from .. import models -class AvailabilitySets(object): - """AvailabilitySets operations. +class AvailabilitySetsOperations(object): + """AvailabilitySetsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/auto_rest_required_optional_test_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/auto_rest_required_optional_test_service.py index c22c57d10f..aaead814da 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/auto_rest_required_optional_test_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/auto_rest_required_optional_test_service.py @@ -12,8 +12,8 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.implicit import Implicit -from .operations.explicit import Explicit +from .operations.implicit_operations import ImplicitOperations +from .operations.explicit_operations import ExplicitOperations from . import models @@ -62,9 +62,9 @@ class AutoRestRequiredOptionalTestService(object): :vartype config: AutoRestRequiredOptionalTestServiceConfiguration :ivar implicit: Implicit operations - :vartype implicit: .operations.Implicit + :vartype implicit: .operations.ImplicitOperations :ivar explicit: Explicit operations - :vartype explicit: .operations.Explicit + :vartype explicit: .operations.ExplicitOperations :param required_global_path: number of items to skip :type required_global_path: str @@ -86,7 +86,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.implicit = Implicit( + self.implicit = ImplicitOperations( self._client, self.config, self._serialize, self._deserialize) - self.explicit = Explicit( + self.explicit = ExplicitOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/__init__.py index f40afd9bd2..69ac89601e 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/__init__.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .implicit import Implicit -from .explicit import Explicit +from .implicit_operations import ImplicitOperations +from .explicit_operations import ExplicitOperations __all__ = [ - 'Implicit', - 'Explicit', + 'ImplicitOperations', + 'ExplicitOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/explicit.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/explicit_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/explicit.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/explicit_operations.py index 655fec8db3..1f27d7d730 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/explicit.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/explicit_operations.py @@ -14,13 +14,13 @@ from .. import models -class Explicit(object): - """Explicit operations. +class ExplicitOperations(object): + """ExplicitOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/implicit.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/implicit_operations.py similarity index 98% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/implicit.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/implicit_operations.py index 7ad1b6ed39..35abd79b14 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/implicit.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/implicit_operations.py @@ -14,13 +14,13 @@ from .. import models -class Implicit(object): - """Implicit operations. +class ImplicitOperations(object): + """ImplicitOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/auto_rest_url_test_service.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/auto_rest_url_test_service.py index a6d660a1c2..9e28b43bcf 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/auto_rest_url_test_service.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/auto_rest_url_test_service.py @@ -12,9 +12,9 @@ from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from .operations.paths import Paths -from .operations.queries import Queries -from .operations.path_items import PathItems +from .operations.paths_operations import PathsOperations +from .operations.queries_operations import QueriesOperations +from .operations.path_items_operations import PathItemsOperations from . import models @@ -59,11 +59,11 @@ class AutoRestUrlTestService(object): :vartype config: AutoRestUrlTestServiceConfiguration :ivar paths: Paths operations - :vartype paths: .operations.Paths + :vartype paths: .operations.PathsOperations :ivar queries: Queries operations - :vartype queries: .operations.Queries + :vartype queries: .operations.QueriesOperations :ivar path_items: PathItems operations - :vartype path_items: .operations.PathItems + :vartype path_items: .operations.PathItemsOperations :param global_string_path: A string value 'globalItemStringPath' that appears in the path @@ -84,9 +84,9 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.paths = Paths( + self.paths = PathsOperations( self._client, self.config, self._serialize, self._deserialize) - self.queries = Queries( + self.queries = QueriesOperations( self._client, self.config, self._serialize, self._deserialize) - self.path_items = PathItems( + self.path_items = PathItemsOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/__init__.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/__init__.py index fde1f7beb4..9041248170 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/__init__.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/__init__.py @@ -9,12 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from .paths import Paths -from .queries import Queries -from .path_items import PathItems +from .paths_operations import PathsOperations +from .queries_operations import QueriesOperations +from .path_items_operations import PathItemsOperations __all__ = [ - 'Paths', - 'Queries', - 'PathItems', + 'PathsOperations', + 'QueriesOperations', + 'PathItemsOperations', ] diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/path_items.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/path_items_operations.py similarity index 99% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/path_items.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/path_items_operations.py index e4783eb3df..c81f94d16d 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/path_items.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/path_items_operations.py @@ -14,13 +14,13 @@ from .. import models -class PathItems(object): - """PathItems operations. +class PathItemsOperations(object): + """PathItemsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths_operations.py similarity index 92% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths_operations.py index f9764bb6df..259a27692c 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths_operations.py @@ -14,13 +14,16 @@ from .. import models -class Paths(object): - """Paths operations. +class PathsOperations(object): + """PathsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. + :ivar byte_path: '' as byte array. Constant value: bytearray("", encoding="utf-8"). + :ivar date_path: '2012-01-01' as date. Constant value: "2012-01-01". + :ivar date_time_path: '2012-01-01T01:01:01Z' as date-time. Constant value: "2012-01-01T01:01:01Z". """ def __init__(self, client, config, serializer, deserializer): @@ -30,13 +33,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self.config = config + self.byte_path = bytearray("", encoding="utf-8") + self.date_path = "2012-01-01" + self.date_time_path = "2012-01-01T01:01:01Z" def get_boolean_true( - self, bool_path=True, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get true Boolean value on path. - :param bool_path: true boolean value - :type bool_path: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -46,6 +50,8 @@ def get_boolean_true( :rtype: :class:`ClientRawResponse` if raw=true """ + bool_path = True + # Construct URL url = '/paths/bool/true/{boolPath}' path_format_arguments = { @@ -74,11 +80,9 @@ def get_boolean_true( return client_raw_response def get_boolean_false( - self, bool_path=False, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get false Boolean value on path. - :param bool_path: false boolean value - :type bool_path: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -88,6 +92,8 @@ def get_boolean_false( :rtype: :class:`ClientRawResponse` if raw=true """ + bool_path = False + # Construct URL url = '/paths/bool/false/{boolPath}' path_format_arguments = { @@ -116,11 +122,9 @@ def get_boolean_false( return client_raw_response def get_int_one_million( - self, int_path=1000000, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '1000000' integer value. - :param int_path: '1000000' integer value - :type int_path: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -130,6 +134,8 @@ def get_int_one_million( :rtype: :class:`ClientRawResponse` if raw=true """ + int_path = 1000000 + # Construct URL url = '/paths/int/1000000/{intPath}' path_format_arguments = { @@ -158,11 +164,9 @@ def get_int_one_million( return client_raw_response def get_int_negative_one_million( - self, int_path=-1000000, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '-1000000' integer value. - :param int_path: '-1000000' integer value - :type int_path: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -172,6 +176,8 @@ def get_int_negative_one_million( :rtype: :class:`ClientRawResponse` if raw=true """ + int_path = -1000000 + # Construct URL url = '/paths/int/-1000000/{intPath}' path_format_arguments = { @@ -200,11 +206,9 @@ def get_int_negative_one_million( return client_raw_response def get_ten_billion( - self, long_path=10000000000, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '10000000000' 64 bit integer value. - :param long_path: '10000000000' 64 bit integer value - :type long_path: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -214,6 +218,8 @@ def get_ten_billion( :rtype: :class:`ClientRawResponse` if raw=true """ + long_path = 10000000000 + # Construct URL url = '/paths/long/10000000000/{longPath}' path_format_arguments = { @@ -242,11 +248,9 @@ def get_ten_billion( return client_raw_response def get_negative_ten_billion( - self, long_path=-10000000000, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '-10000000000' 64 bit integer value. - :param long_path: '-10000000000' 64 bit integer value - :type long_path: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -256,6 +260,8 @@ def get_negative_ten_billion( :rtype: :class:`ClientRawResponse` if raw=true """ + long_path = -10000000000 + # Construct URL url = '/paths/long/-10000000000/{longPath}' path_format_arguments = { @@ -284,11 +290,9 @@ def get_negative_ten_billion( return client_raw_response def float_scientific_positive( - self, float_path=1.034E+20, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '1.034E+20' numeric value. - :param float_path: '1.034E+20'numeric value - :type float_path: float :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -298,6 +302,8 @@ def float_scientific_positive( :rtype: :class:`ClientRawResponse` if raw=true """ + float_path = 1.034E+20 + # Construct URL url = '/paths/float/1.034E+20/{floatPath}' path_format_arguments = { @@ -326,11 +332,9 @@ def float_scientific_positive( return client_raw_response def float_scientific_negative( - self, float_path=-1.034E-20, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '-1.034E-20' numeric value. - :param float_path: '-1.034E-20'numeric value - :type float_path: float :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -340,6 +344,8 @@ def float_scientific_negative( :rtype: :class:`ClientRawResponse` if raw=true """ + float_path = -1.034E-20 + # Construct URL url = '/paths/float/-1.034E-20/{floatPath}' path_format_arguments = { @@ -368,11 +374,9 @@ def float_scientific_negative( return client_raw_response def double_decimal_positive( - self, double_path=9999999.999, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '9999999.999' numeric value. - :param double_path: '9999999.999'numeric value - :type double_path: float :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -382,6 +386,8 @@ def double_decimal_positive( :rtype: :class:`ClientRawResponse` if raw=true """ + double_path = 9999999.999 + # Construct URL url = '/paths/double/9999999.999/{doublePath}' path_format_arguments = { @@ -410,11 +416,9 @@ def double_decimal_positive( return client_raw_response def double_decimal_negative( - self, double_path=-9999999.999, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '-9999999.999' numeric value. - :param double_path: '-9999999.999'numeric value - :type double_path: float :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -424,6 +428,8 @@ def double_decimal_negative( :rtype: :class:`ClientRawResponse` if raw=true """ + double_path = -9999999.999 + # Construct URL url = '/paths/double/-9999999.999/{doublePath}' path_format_arguments = { @@ -452,11 +458,9 @@ def double_decimal_negative( return client_raw_response def string_unicode( - self, string_path="啊齄丂狛狜隣郎隣兀﨩", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. - :param string_path: '啊齄丂狛狜隣郎隣兀﨩'multi-byte string value - :type string_path: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -466,6 +470,8 @@ def string_unicode( :rtype: :class:`ClientRawResponse` if raw=true """ + string_path = "啊齄丂狛狜隣郎隣兀﨩" + # Construct URL url = '/paths/string/unicode/{stringPath}' path_format_arguments = { @@ -494,12 +500,9 @@ def string_unicode( return client_raw_response def string_url_encoded( - self, string_path="begin!*'();:@ &=+$,/?#[]end", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get 'begin!*'();:@ &=+$,/?#[]end. - :param string_path: 'begin!*'();:@ &=+$,/?#[]end' url encoded string - value - :type string_path: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -509,6 +512,8 @@ def string_url_encoded( :rtype: :class:`ClientRawResponse` if raw=true """ + string_path = "begin!*'();:@ &=+$,/?#[]end" + # Construct URL url = '/paths/string/begin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend/{stringPath}' path_format_arguments = { @@ -537,11 +542,9 @@ def string_url_encoded( return client_raw_response def string_empty( - self, string_path="", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get ''. - :param string_path: '' string value - :type string_path: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -551,6 +554,8 @@ def string_empty( :rtype: :class:`ClientRawResponse` if raw=true """ + string_path = "" + # Construct URL url = '/paths/string/empty/{stringPath}' path_format_arguments = { @@ -753,11 +758,9 @@ def byte_multi_byte( return client_raw_response def byte_empty( - self, byte_path=bytearray("", encoding="utf-8"), custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '' as byte array. - :param byte_path: '' as byte array - :type byte_path: bytearray :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -770,7 +773,7 @@ def byte_empty( # Construct URL url = '/paths/byte/empty/{bytePath}' path_format_arguments = { - 'bytePath': self._serialize.url("byte_path", byte_path, 'bytearray') + 'bytePath': self._serialize.url("self.byte_path", self.byte_path, 'bytearray') } url = self._client.format_url(url, **path_format_arguments) @@ -837,11 +840,9 @@ def byte_null( return client_raw_response def date_valid( - self, date_path, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '2012-01-01' as date. - :param date_path: '2012-01-01' as date - :type date_path: date :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -854,7 +855,7 @@ def date_valid( # Construct URL url = '/paths/date/2012-01-01/{datePath}' path_format_arguments = { - 'datePath': self._serialize.url("date_path", date_path, 'date') + 'datePath': self._serialize.url("self.date_path", self.date_path, 'date') } url = self._client.format_url(url, **path_format_arguments) @@ -922,11 +923,9 @@ def date_null( return client_raw_response def date_time_valid( - self, date_time_path, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '2012-01-01T01:01:01Z' as date-time. - :param date_time_path: '2012-01-01T01:01:01Z' as date-time - :type date_time_path: datetime :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -939,7 +938,7 @@ def date_time_valid( # Construct URL url = '/paths/datetime/2012-01-01T01%3A01%3A01Z/{dateTimePath}' path_format_arguments = { - 'dateTimePath': self._serialize.url("date_time_path", date_time_path, 'iso-8601') + 'dateTimePath': self._serialize.url("self.date_time_path", self.date_time_path, 'iso-8601') } url = self._client.format_url(url, **path_format_arguments) diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/queries.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/queries_operations.py similarity index 94% rename from src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/queries.py rename to src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/queries_operations.py index 8dd024e7fc..8f69c66a20 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/queries.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/queries_operations.py @@ -14,13 +14,16 @@ from .. import models -class Queries(object): - """Queries operations. +class QueriesOperations(object): + """QueriesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. + :ivar byte_query: '' as byte array. Constant value: bytearray("", encoding="utf-8"). + :ivar date_query: '2012-01-01' as date. Constant value: "2012-01-01". + :ivar date_time_query: '2012-01-01T01:01:01Z' as date-time. Constant value: "2012-01-01T01:01:01Z". """ def __init__(self, client, config, serializer, deserializer): @@ -30,13 +33,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self.config = config + self.byte_query = bytearray("", encoding="utf-8") + self.date_query = "2012-01-01" + self.date_time_query = "2012-01-01T01:01:01Z" def get_boolean_true( - self, bool_query=True, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get true Boolean value on path. - :param bool_query: true boolean value - :type bool_query: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -46,6 +50,8 @@ def get_boolean_true( :rtype: :class:`ClientRawResponse` if raw=true """ + bool_query = True + # Construct URL url = '/queries/bool/true' @@ -71,11 +77,9 @@ def get_boolean_true( return client_raw_response def get_boolean_false( - self, bool_query=False, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get false Boolean value on path. - :param bool_query: false boolean value - :type bool_query: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -85,6 +89,8 @@ def get_boolean_false( :rtype: :class:`ClientRawResponse` if raw=true """ + bool_query = False + # Construct URL url = '/queries/bool/false' @@ -150,11 +156,9 @@ def get_boolean_null( return client_raw_response def get_int_one_million( - self, int_query=1000000, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '1000000' integer value. - :param int_query: '1000000' integer value - :type int_query: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -164,6 +168,8 @@ def get_int_one_million( :rtype: :class:`ClientRawResponse` if raw=true """ + int_query = 1000000 + # Construct URL url = '/queries/int/1000000' @@ -189,11 +195,9 @@ def get_int_one_million( return client_raw_response def get_int_negative_one_million( - self, int_query=-1000000, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '-1000000' integer value. - :param int_query: '-1000000' integer value - :type int_query: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -203,6 +207,8 @@ def get_int_negative_one_million( :rtype: :class:`ClientRawResponse` if raw=true """ + int_query = -1000000 + # Construct URL url = '/queries/int/-1000000' @@ -268,11 +274,9 @@ def get_int_null( return client_raw_response def get_ten_billion( - self, long_query=10000000000, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '10000000000' 64 bit integer value. - :param long_query: '10000000000' 64 bit integer value - :type long_query: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -282,6 +286,8 @@ def get_ten_billion( :rtype: :class:`ClientRawResponse` if raw=true """ + long_query = 10000000000 + # Construct URL url = '/queries/long/10000000000' @@ -307,11 +313,9 @@ def get_ten_billion( return client_raw_response def get_negative_ten_billion( - self, long_query=-10000000000, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '-10000000000' 64 bit integer value. - :param long_query: '-10000000000' 64 bit integer value - :type long_query: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -321,6 +325,8 @@ def get_negative_ten_billion( :rtype: :class:`ClientRawResponse` if raw=true """ + long_query = -10000000000 + # Construct URL url = '/queries/long/-10000000000' @@ -386,11 +392,9 @@ def get_long_null( return client_raw_response def float_scientific_positive( - self, float_query=1.034E+20, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '1.034E+20' numeric value. - :param float_query: '1.034E+20'numeric value - :type float_query: float :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -400,6 +404,8 @@ def float_scientific_positive( :rtype: :class:`ClientRawResponse` if raw=true """ + float_query = 1.034E+20 + # Construct URL url = '/queries/float/1.034E+20' @@ -425,11 +431,9 @@ def float_scientific_positive( return client_raw_response def float_scientific_negative( - self, float_query=-1.034E-20, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '-1.034E-20' numeric value. - :param float_query: '-1.034E-20'numeric value - :type float_query: float :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -439,6 +443,8 @@ def float_scientific_negative( :rtype: :class:`ClientRawResponse` if raw=true """ + float_query = -1.034E-20 + # Construct URL url = '/queries/float/-1.034E-20' @@ -504,11 +510,9 @@ def float_null( return client_raw_response def double_decimal_positive( - self, double_query=9999999.999, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '9999999.999' numeric value. - :param double_query: '9999999.999'numeric value - :type double_query: float :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -518,6 +522,8 @@ def double_decimal_positive( :rtype: :class:`ClientRawResponse` if raw=true """ + double_query = 9999999.999 + # Construct URL url = '/queries/double/9999999.999' @@ -543,11 +549,9 @@ def double_decimal_positive( return client_raw_response def double_decimal_negative( - self, double_query=-9999999.999, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '-9999999.999' numeric value. - :param double_query: '-9999999.999'numeric value - :type double_query: float :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -557,6 +561,8 @@ def double_decimal_negative( :rtype: :class:`ClientRawResponse` if raw=true """ + double_query = -9999999.999 + # Construct URL url = '/queries/double/-9999999.999' @@ -622,11 +628,9 @@ def double_null( return client_raw_response def string_unicode( - self, string_query="啊齄丂狛狜隣郎隣兀﨩", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. - :param string_query: '啊齄丂狛狜隣郎隣兀﨩'multi-byte string value - :type string_query: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -636,6 +640,8 @@ def string_unicode( :rtype: :class:`ClientRawResponse` if raw=true """ + string_query = "啊齄丂狛狜隣郎隣兀﨩" + # Construct URL url = '/queries/string/unicode/' @@ -661,12 +667,9 @@ def string_unicode( return client_raw_response def string_url_encoded( - self, string_query="begin!*'();:@ &=+$,/?#[]end", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get 'begin!*'();:@ &=+$,/?#[]end. - :param string_query: 'begin!*'();:@ &=+$,/?#[]end' url encoded string - value - :type string_query: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -676,6 +679,8 @@ def string_url_encoded( :rtype: :class:`ClientRawResponse` if raw=true """ + string_query = "begin!*'();:@ &=+$,/?#[]end" + # Construct URL url = '/queries/string/begin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend' @@ -701,11 +706,9 @@ def string_url_encoded( return client_raw_response def string_empty( - self, string_query="", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get ''. - :param string_query: '' string value - :type string_query: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -715,6 +718,8 @@ def string_empty( :rtype: :class:`ClientRawResponse` if raw=true """ + string_query = "" + # Construct URL url = '/queries/string/empty' @@ -905,11 +910,9 @@ def byte_multi_byte( return client_raw_response def byte_empty( - self, byte_query=bytearray("", encoding="utf-8"), custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '' as byte array. - :param byte_query: '' as byte array - :type byte_query: bytearray :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -924,7 +927,7 @@ def byte_empty( # Construct parameters query_parameters = {} - query_parameters['byteQuery'] = self._serialize.query("byte_query", byte_query, 'bytearray') + query_parameters['byteQuery'] = self._serialize.query("self.byte_query", self.byte_query, 'bytearray') # Construct headers header_parameters = {} @@ -984,11 +987,9 @@ def byte_null( return client_raw_response def date_valid( - self, date_query, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '2012-01-01' as date. - :param date_query: '2012-01-01' as date - :type date_query: date :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -1003,7 +1004,7 @@ def date_valid( # Construct parameters query_parameters = {} - query_parameters['dateQuery'] = self._serialize.query("date_query", date_query, 'date') + query_parameters['dateQuery'] = self._serialize.query("self.date_query", self.date_query, 'date') # Construct headers header_parameters = {} @@ -1063,11 +1064,9 @@ def date_null( return client_raw_response def date_time_valid( - self, date_time_query, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Get '2012-01-01T01:01:01Z' as date-time. - :param date_time_query: '2012-01-01T01:01:01Z' as date-time - :type date_time_query: datetime :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -1082,7 +1081,7 @@ def date_time_valid( # Construct parameters query_parameters = {} - query_parameters['dateTimeQuery'] = self._serialize.query("date_time_query", date_time_query, 'iso-8601') + query_parameters['dateTimeQuery'] = self._serialize.query("self.date_time_query", self.date_time_query, 'iso-8601') # Construct headers header_parameters = {} diff --git a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/auto_rest_validation_test.py b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/auto_rest_validation_test.py index a2c3419bc5..6d356ef26a 100644 --- a/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/auto_rest_validation_test.py +++ b/src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/auto_rest_validation_test.py @@ -200,11 +200,9 @@ def validation_of_body( return deserialized def get_with_constant_in_path( - self, constant_param="constant", custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """ - :param constant_param: - :type constant_param: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -214,6 +212,8 @@ def get_with_constant_in_path( :rtype: :class:`ClientRawResponse` if raw=true """ + constant_param = "constant" + # Construct URL url = '/validation/constantsInPath/{constantParam}/value' path_format_arguments = { @@ -242,11 +242,9 @@ def get_with_constant_in_path( return client_raw_response def post_with_constant_in_body( - self, constant_param="constant", body=None, custom_headers=None, raw=False, **operation_config): + self, body=None, custom_headers=None, raw=False, **operation_config): """ - :param constant_param: - :type constant_param: str :param body: :type body: :class:`Product ` @@ -260,6 +258,8 @@ def post_with_constant_in_body( :rtype: :class:`ClientRawResponse` if raw=true """ + constant_param = "constant" + # Construct URL url = '/validation/constantsInPath/{constantParam}/value' path_format_arguments = { diff --git a/src/generator/AutoRest.Python/PythonCodeNamer.cs b/src/generator/AutoRest.Python/PythonCodeNamer.cs index 9c81745770..16f100fb8a 100644 --- a/src/generator/AutoRest.Python/PythonCodeNamer.cs +++ b/src/generator/AutoRest.Python/PythonCodeNamer.cs @@ -11,6 +11,7 @@ using AutoRest.Core.Utilities; using AutoRest.Extensions; using AutoRest.Python.Properties; +using Microsoft.Rest.Generator.Python; namespace AutoRest.Python { @@ -174,10 +175,14 @@ public override void NormalizeClientModel(ServiceClient client) } base.NormalizeClientModel(client); + var globalParams = new List(); foreach (var method in client.Methods) { foreach (var parameter in method.Parameters) { + if (parameter.Extensions.ContainsKey("hostParameter")) + globalParams.Add(parameter); + if (parameter.ClientProperty != null) { parameter.Name = string.Format(CultureInfo.InvariantCulture, @@ -186,6 +191,10 @@ public override void NormalizeClientModel(ServiceClient client) } } } + foreach (var parameter in globalParams.Distinct()) + { + QuoteParameter(parameter); + } } /// @@ -200,7 +209,8 @@ protected override void NormalizeParameters(Method method) { parameter.Name = method.Scope.GetUniqueName(GetParameterName(parameter.GetClientName())); parameter.Type = NormalizeTypeReference(parameter.Type); - QuoteParameter(parameter); + if (!parameter.Extensions.ContainsKey("hostParameter")) + QuoteParameter(parameter); } foreach (var parameterTransformation in method.InputParameterTransformation) @@ -444,24 +454,15 @@ public override string EscapeDefaultValue(string defaultValue, IType type) else { //TODO: Add support for default KnownPrimaryType.DateTimeRfc1123 - //TODO: Default date objects can only be supported with an isodate import statement - - //if (primaryType.Type == KnownPrimaryType.Date) - //{ - // parsedDefault = "isodate.parse_date(\"" + defaultValue + "\")"; - //} - //else if (primaryType.Type == KnownPrimaryType.DateTime) - //{ - // parsedDefault = "isodate.parse_datetime(\"" + defaultValue + "\")"; - //} - - //else if (primaryType.Type == KnownPrimaryType.TimeSpan) - //{ - // parsedDefault = "isodate.parse_duration(\"" + defaultValue + "\")"; - //} + if (primaryType.Type == KnownPrimaryType.Date || + primaryType.Type == KnownPrimaryType.DateTime || + primaryType.Type == KnownPrimaryType.TimeSpan) + { + parsedDefault = CodeNamer.QuoteValue(defaultValue); + } - if (primaryType.Type == KnownPrimaryType.ByteArray) + else if (primaryType.Type == KnownPrimaryType.ByteArray) { parsedDefault = "bytearray(\"" + defaultValue + "\", encoding=\"utf-8\")"; } diff --git a/src/generator/AutoRest.Python/TemplateModels/MethodGroupTemplateModel.cs b/src/generator/AutoRest.Python/TemplateModels/MethodGroupTemplateModel.cs index ece3f99cc5..f17a4ce2ce 100644 --- a/src/generator/AutoRest.Python/TemplateModels/MethodGroupTemplateModel.cs +++ b/src/generator/AutoRest.Python/TemplateModels/MethodGroupTemplateModel.cs @@ -1,8 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +using System; using System.Collections.Generic; using System.Linq; +using System.Globalization; using AutoRest.Core.ClientModel; using AutoRest.Core.Utilities; @@ -13,13 +15,43 @@ public class MethodGroupTemplateModel : ServiceClient public MethodGroupTemplateModel(ServiceClient serviceClient, string methodGroupName) { this.LoadFrom(serviceClient); + ConstantProperties = new List(); MethodTemplateModels = new List(); // MethodGroup name and type are always the same but can be // changed in derived classes MethodGroupName = methodGroupName; - MethodGroupType = methodGroupName; + MethodGroupType = methodGroupName + "Operations"; Methods.Where(m => m.Group == MethodGroupName) .ForEach(m => MethodTemplateModels.Add(new MethodTemplateModel(m, serviceClient))); + + var allParameters = MethodTemplateModels.SelectMany(x => x.Parameters).Where(p => p.IsConstant && p.ClientProperty == null).ToList(); + foreach (var parameter in allParameters) + { + var conflicts = allParameters.Where(p => p.Name == parameter.Name && p.DefaultValue != parameter.DefaultValue); + if (conflicts.Any()) + { + continue; + } + else + { + if (!ConstantProperties.Any(p => p.Name == parameter.Name)) + { + var constantProperty = new Property + { + Name = parameter.Name, + DefaultValue = parameter.DefaultValue, + IsConstant = parameter.IsConstant, + IsRequired = parameter.IsRequired, + Documentation = parameter.Documentation, + SerializedName = parameter.SerializedName, + Type = parameter.Type + }; + ConstantProperties.Add(constantProperty); + } + if (!parameter.Name.StartsWith("self.")) + parameter.Name = "self." + parameter.Name; + } + } } public virtual bool HasAnyModel @@ -42,10 +74,55 @@ public bool HasAnyDefaultExceptions get { return this.MethodTemplateModels.Any(item => item.DefaultResponse.Body == null); } } + public List ConstantProperties { get; private set; } + public List MethodTemplateModels { get; private set; } public string MethodGroupName { get; set; } public string MethodGroupType { get; set; } + + /// + /// Provides the modelProperty documentation string along with default value if any. + /// + /// Parameter to be documented + /// Parameter documentation string along with default value if any + /// in correct jsdoc notation + public string GetPropertyDocumentationString(Property property) + { + if (property == null) + { + throw new ArgumentNullException("property"); + } + string propertyName = property.Name.Split('.').Last(); + string docString = string.Format(CultureInfo.InvariantCulture, ":ivar {0}:", propertyName); + + string summary = property.Summary; + if (!string.IsNullOrWhiteSpace(summary) && !summary.EndsWith(".", StringComparison.OrdinalIgnoreCase)) + { + summary += "."; + } + + string documentation = property.Documentation; + if (property.DefaultValue != PythonConstants.None) + { + if (documentation != null && !documentation.EndsWith(".", StringComparison.OrdinalIgnoreCase)) + { + documentation += "."; + } + documentation += " Constant value: " + property.DefaultValue + "."; + } + + if (!string.IsNullOrWhiteSpace(summary)) + { + docString += " " + summary; + } + + if (!string.IsNullOrWhiteSpace(documentation)) + { + docString += " " + documentation; + } + return docString; + } } } \ No newline at end of file diff --git a/src/generator/AutoRest.Python/TemplateModels/MethodTemplateModel.cs b/src/generator/AutoRest.Python/TemplateModels/MethodTemplateModel.cs index 445cdfd4ff..c459f6fd56 100644 --- a/src/generator/AutoRest.Python/TemplateModels/MethodTemplateModel.cs +++ b/src/generator/AutoRest.Python/TemplateModels/MethodTemplateModel.cs @@ -160,7 +160,7 @@ public virtual string MethodParameterDeclaration(bool addCustomHeaderParameters) List requiredDeclarations = new List(); List combinedDeclarations = new List(); - foreach (var parameter in LocalParameters) + foreach (var parameter in DocumentationParameters) { if (parameter.IsRequired && parameter.DefaultValue == PythonConstants.None) { @@ -501,7 +501,15 @@ public IEnumerable DocumentationParameters { get { - return this.LocalParameters; + return this.LocalParameters.Where(p => !p.IsConstant); + } + } + + public IEnumerable ConstantParameters + { + get + { + return this.LocalParameters.Where(p => p.IsConstant && !p.Name.StartsWith("self.")); } } diff --git a/src/generator/AutoRest.Python/TemplateModels/ServiceClientTemplateModel.cs b/src/generator/AutoRest.Python/TemplateModels/ServiceClientTemplateModel.cs index 0d3c58322a..ecd8bd3837 100644 --- a/src/generator/AutoRest.Python/TemplateModels/ServiceClientTemplateModel.cs +++ b/src/generator/AutoRest.Python/TemplateModels/ServiceClientTemplateModel.cs @@ -30,12 +30,15 @@ public ServiceClientTemplateModel(ServiceClient serviceClient) { this.HasAnyModel = true; } - + ConstantProperties = Properties.Where(p => p.IsConstant).ToList(); + Properties.RemoveAll(p => ConstantProperties.Contains(p)); this.IsCustomBaseUri = serviceClient.Extensions.ContainsKey(SwaggerExtensions.ParameterizedHostExtension); } public bool IsCustomBaseUri { get; private set; } + public List ConstantProperties { get; set; } + public ServiceClient ServiceClient { get; set; } public List MethodTemplateModels { get; private set; } @@ -222,26 +225,39 @@ public string ServiceDocument } /// - /// Provides the property documentation string. + /// Provides the property documentation string along with default value if any. /// /// Parameter to be documented - /// Parameter documentation string correct notation + /// Parameter documentation string along with default value if any + /// in correct jsdoc notation public static string GetPropertyDocumentationString(Property property) { if (property == null) { throw new ArgumentNullException("property"); } + string docString = string.Format(CultureInfo.InvariantCulture, ":param {0}:", property.Name); + if (property.IsConstant) + { + docString = string.Format(CultureInfo.InvariantCulture, ":ivar {0}:", property.Name); + } - string docString = ":param "; - - docString += property.Name + ":"; + string summary = property.Summary; + if (!string.IsNullOrWhiteSpace(summary) && !summary.EndsWith(".", StringComparison.OrdinalIgnoreCase)) + { + summary += "."; + } - if (!string.IsNullOrWhiteSpace(property.Documentation)) + string documentation = property.Documentation; + if (!string.IsNullOrWhiteSpace(summary)) { - docString += " " + property.Documentation; + docString += " " + summary; } + if (!string.IsNullOrWhiteSpace(documentation)) + { + docString += " " + documentation; + } return docString; } diff --git a/src/generator/AutoRest.Python/Templates/MethodGroupTemplate.cshtml b/src/generator/AutoRest.Python/Templates/MethodGroupTemplate.cshtml index 998c8b39a2..0d26d842d0 100644 --- a/src/generator/AutoRest.Python/Templates/MethodGroupTemplate.cshtml +++ b/src/generator/AutoRest.Python/Templates/MethodGroupTemplate.cshtml @@ -25,7 +25,11 @@ class @(Model.MethodGroupType)(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. +@foreach(var property in Model.ConstantProperties) +{ + @:@Model.GetPropertyDocumentationString(property) +} """ @EmptyLine def __init__(self, client, config, serializer, deserializer): @@ -35,6 +39,10 @@ class @(Model.MethodGroupType)(object): self._deserialize = deserializer @EmptyLine self.config = config +@foreach(var property in Model.ConstantProperties) +{ + @:@property.Name = @property.DefaultValue +} @foreach (var method in Model.MethodTemplateModels) { @EmptyLine diff --git a/src/generator/AutoRest.Python/Templates/MethodTemplate.cshtml b/src/generator/AutoRest.Python/Templates/MethodTemplate.cshtml index 75e52e6e01..86524f2d7f 100644 --- a/src/generator/AutoRest.Python/Templates/MethodTemplate.cshtml +++ b/src/generator/AutoRest.Python/Templates/MethodTemplate.cshtml @@ -30,6 +30,14 @@ @if (Model.InputParameterTransformation.Any()) { @EmptyLine +} +@if (Model.ConstantParameters.Any()) +{ + foreach (var parameter in Model.ConstantParameters) + { + @:@(parameter.Name) = @(parameter.DefaultValue) + } +@EmptyLine } # Construct URL url = '@(Model.Url)' diff --git a/src/generator/AutoRest.Python/Templates/ServiceClientTemplate.cshtml b/src/generator/AutoRest.Python/Templates/ServiceClientTemplate.cshtml index e51b6f317d..49467ac125 100644 --- a/src/generator/AutoRest.Python/Templates/ServiceClientTemplate.cshtml +++ b/src/generator/AutoRest.Python/Templates/ServiceClientTemplate.cshtml @@ -46,6 +46,11 @@ class @(Model.Name)Configuration(Configuration): @: @ParameterWrapComment(string.Empty, ServiceClientTemplateModel.GetPropertyDocumentationString(property)) @: @ParameterWrapComment(string.Empty, ":type " + property.Name + ": " + Model.GetPropertyDocumentationType(property.Type)) } +@foreach(var property in Model.ConstantProperties) +{ +@: @ParameterWrapComment(string.Empty, ServiceClientTemplateModel.GetPropertyDocumentationString(property)) +@: @ParameterWrapComment(string.Empty, ":type " + property.Name + ": " + Model.GetPropertyDocumentationType(property.Type)) +} @if (!Model.IsCustomBaseUri) { @@ -73,13 +78,17 @@ else super(@(Model.Name)Configuration, self).__init__(base_url, filepath) @EmptyLine self.add_user_agent('@Model.UserAgent/{}'.format(VERSION)) -@if (Model.Properties.Any()) +@if (Model.Properties.Any() || Model.ConstantProperties.Any()) { @EmptyLine - foreach (var property in Model.Properties) + foreach (var property in Model.Properties) { @:self.@(property.Name) = @(property.Name) - } + } + foreach (var property in Model.ConstantProperties) + { + @:self.@(property.Name) = @(property.DefaultValue) + } } @EmptyLine @EmptyLine