diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py index 59fc0c7f229d..28315e2f7522 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py @@ -12,13 +12,22 @@ try: from .feature_properties_py3 import FeatureProperties from .feature_result_py3 import FeatureResult + from .operation_display_py3 import OperationDisplay + from .operation_definition_py3 import OperationDefinition + from .operations_list_py3 import OperationsList except (SyntaxError, ImportError): from .feature_properties import FeatureProperties from .feature_result import FeatureResult + from .operation_display import OperationDisplay + from .operation_definition import OperationDefinition + from .operations_list import OperationsList from .feature_result_paged import FeatureResultPaged __all__ = [ 'FeatureProperties', 'FeatureResult', + 'OperationDisplay', + 'OperationDefinition', + 'OperationsList', 'FeatureResultPaged', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition.py new file mode 100644 index 000000000000..a982fcce7dcc --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition.py @@ -0,0 +1,33 @@ +# 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.serialization import Model + + +class OperationDefinition(Model): + """OperationDefinition. + + :param name: The name of the operation. + :type name: str + :param display: The operation display definition. + :type display: + ~azure.mgmt.resource.features.v2015_12_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition_py3.py new file mode 100644 index 000000000000..6dafa7009023 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition_py3.py @@ -0,0 +1,33 @@ +# 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.serialization import Model + + +class OperationDefinition(Model): + """OperationDefinition. + + :param name: The name of the operation. + :type name: str + :param display: The operation display definition. + :type display: + ~azure.mgmt.resource.features.v2015_12_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.py new file mode 100644 index 000000000000..8ba502a243f8 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.py @@ -0,0 +1,40 @@ +# 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.serialization import Model + + +class OperationDisplay(Model): + """OperationDisplay. + + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display_py3.py new file mode 100644 index 000000000000..c8f686362819 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# 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.serialization import Model + + +class OperationDisplay(Model): + """OperationDisplay. + + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list.py new file mode 100644 index 000000000000..183d556b18aa --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list.py @@ -0,0 +1,29 @@ +# 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.serialization import Model + + +class OperationsList(Model): + """OperationsList. + + :param operations: The array of feature operations. + :type operations: + list[~azure.mgmt.resource.features.v2015_12_01.models.OperationDefinition] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[OperationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationsList, self).__init__(**kwargs) + self.operations = kwargs.get('operations', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list_py3.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list_py3.py new file mode 100644 index 000000000000..196d1a41f756 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list_py3.py @@ -0,0 +1,29 @@ +# 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.serialization import Model + + +class OperationsList(Model): + """OperationsList. + + :param operations: The array of feature operations. + :type operations: + list[~azure.mgmt.resource.features.v2015_12_01.models.OperationDefinition] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[OperationDefinition]'}, + } + + def __init__(self, *, operations=None, **kwargs) -> None: + super(OperationsList, self).__init__(**kwargs) + self.operations = operations diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/features_operations.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/features_operations.py index dc13aa490301..5d7d290838a8 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/features_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/features_operations.py @@ -103,6 +103,58 @@ def internal_paging(next_link=None, raw=False): return deserialized list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Features/features'} + def operations( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the preview feature operations. + + :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`. + :return: OperationsList or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.features.v2015_12_01.models.OperationsList or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.operations.metadata['url'] + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationsList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + operations.metadata = {'url': '/providers/Microsoft.Features/operations'} + def list( self, resource_provider_namespace, custom_headers=None, raw=False, **operation_config): """Gets all the preview features in a provider namespace that are diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/application_client.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/application_client.py index 93562e98da94..363051e82b15 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/application_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/application_client.py @@ -15,6 +15,7 @@ from .version import VERSION from .operations.applications_operations import ApplicationsOperations from .operations.application_definitions_operations import ApplicationDefinitionsOperations +from .operations.solutions_operations import SolutionsOperations from . import models @@ -60,6 +61,8 @@ class ApplicationClient(SDKClient): :vartype applications: azure.mgmt.resource.managedapplications.operations.ApplicationsOperations :ivar application_definitions: ApplicationDefinitions operations :vartype application_definitions: azure.mgmt.resource.managedapplications.operations.ApplicationDefinitionsOperations + :ivar solutions: Solutions operations + :vartype solutions: azure.mgmt.resource.managedapplications.operations.SolutionsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -84,3 +87,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.application_definitions = ApplicationDefinitionsOperations( self._client, self.config, self._serialize, self._deserialize) + self.solutions = SolutionsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/__init__.py index 4cb32a1f8c85..1f2a37d3eaba 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/__init__.py @@ -22,6 +22,9 @@ from .generic_resource_py3 import GenericResource from .resource_py3 import Resource from .error_response_py3 import ErrorResponse, ErrorResponseException + from .operation_display_py3 import OperationDisplay + from .operation_definition_py3 import OperationDefinition + from .operations_list_py3 import OperationsList except (SyntaxError, ImportError): from .plan import Plan from .application import Application @@ -35,6 +38,9 @@ from .generic_resource import GenericResource from .resource import Resource from .error_response import ErrorResponse, ErrorResponseException + from .operation_display import OperationDisplay + from .operation_definition import OperationDefinition + from .operations_list import OperationsList from .application_paged import ApplicationPaged from .application_definition_paged import ApplicationDefinitionPaged from .application_client_enums import ( @@ -57,6 +63,9 @@ 'GenericResource', 'Resource', 'ErrorResponse', 'ErrorResponseException', + 'OperationDisplay', + 'OperationDefinition', + 'OperationsList', 'ApplicationPaged', 'ApplicationDefinitionPaged', 'ProvisioningState', diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition.py new file mode 100644 index 000000000000..b7d8024f1e87 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition.py @@ -0,0 +1,33 @@ +# 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.serialization import Model + + +class OperationDefinition(Model): + """OperationDefinition. + + :param name: The name of the operation. + :type name: str + :param display: The operation display definition. + :type display: + ~azure.mgmt.resource.managedapplications.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition_py3.py new file mode 100644 index 000000000000..65a915233b49 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition_py3.py @@ -0,0 +1,33 @@ +# 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.serialization import Model + + +class OperationDefinition(Model): + """OperationDefinition. + + :param name: The name of the operation. + :type name: str + :param display: The operation display definition. + :type display: + ~azure.mgmt.resource.managedapplications.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display.py new file mode 100644 index 000000000000..8ba502a243f8 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display.py @@ -0,0 +1,40 @@ +# 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.serialization import Model + + +class OperationDisplay(Model): + """OperationDisplay. + + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display_py3.py new file mode 100644 index 000000000000..c8f686362819 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# 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.serialization import Model + + +class OperationDisplay(Model): + """OperationDisplay. + + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list.py new file mode 100644 index 000000000000..1b51bf014a4d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list.py @@ -0,0 +1,29 @@ +# 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.serialization import Model + + +class OperationsList(Model): + """OperationsList. + + :param operations: The array of solution operations. + :type operations: + list[~azure.mgmt.resource.managedapplications.models.OperationDefinition] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[OperationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationsList, self).__init__(**kwargs) + self.operations = kwargs.get('operations', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list_py3.py new file mode 100644 index 000000000000..02adf7630943 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list_py3.py @@ -0,0 +1,29 @@ +# 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.serialization import Model + + +class OperationsList(Model): + """OperationsList. + + :param operations: The array of solution operations. + :type operations: + list[~azure.mgmt.resource.managedapplications.models.OperationDefinition] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[OperationDefinition]'}, + } + + def __init__(self, *, operations=None, **kwargs) -> None: + super(OperationsList, self).__init__(**kwargs) + self.operations = operations diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/__init__.py index 8dde81835052..7a0f8fec8ca5 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/__init__.py @@ -11,8 +11,10 @@ from .applications_operations import ApplicationsOperations from .application_definitions_operations import ApplicationDefinitionsOperations +from .solutions_operations import SolutionsOperations __all__ = [ 'ApplicationsOperations', 'ApplicationDefinitionsOperations', + 'SolutionsOperations', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/solutions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/solutions_operations.py new file mode 100644 index 000000000000..575927240b1e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/solutions_operations.py @@ -0,0 +1,87 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SolutionsOperations(object): + """SolutionsOperations 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. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def operations( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the preview solution operations. + + :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`. + :return: OperationsList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.managedapplications.models.OperationsList + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.operations.metadata['url'] + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationsList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + operations.metadata = {'url': '/providers/Microsoft.Solutions/operations'}