From 308d176404940e8d43c3e77d595f3aafc9d30282 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 3 Aug 2019 04:13:29 +0000 Subject: [PATCH 1/3] Generated from 06bfc11dfa82fb5c140c82c3496fd59adc6f3b8b just triggereing rebuild --- .../azure/mgmt/healthcareapis/__init__.py | 19 + .../mgmt/healthcareapis/_configuration.py | 48 ++ .../_healthcare_apis_management_client.py | 59 ++ .../mgmt/healthcareapis/models/__init__.py | 75 +++ ...healthcare_apis_management_client_enums.py | 47 ++ .../mgmt/healthcareapis/models/_models.py | 543 ++++++++++++++++ .../mgmt/healthcareapis/models/_models_py3.py | 543 ++++++++++++++++ .../healthcareapis/models/_paged_models.py | 40 ++ .../healthcareapis/operations/__init__.py | 20 + .../_operation_results_operations.py | 100 +++ .../healthcareapis/operations/_operations.py | 100 +++ .../operations/_services_operations.py | 585 ++++++++++++++++++ .../azure/mgmt/healthcareapis/version.py | 13 + 13 files changed, 2192 insertions(+) create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/__init__.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_configuration.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_healthcare_apis_management_client.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/__init__.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_healthcare_apis_management_client_enums.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models_py3.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_paged_models.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/__init__.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operation_results_operations.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operations.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_services_operations.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/version.py diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/__init__.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/__init__.py new file mode 100644 index 000000000000..74676ff31aac --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/__init__.py @@ -0,0 +1,19 @@ +# 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 ._configuration import HealthcareApisManagementClientConfiguration +from ._healthcare_apis_management_client import HealthcareApisManagementClient +__all__ = ['HealthcareApisManagementClient', 'HealthcareApisManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_configuration.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_configuration.py new file mode 100644 index 000000000000..351baa8a13f5 --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class HealthcareApisManagementClientConfiguration(AzureConfiguration): + """Configuration for HealthcareApisManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(HealthcareApisManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-healthcareapis/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_healthcare_apis_management_client.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_healthcare_apis_management_client.py new file mode 100644 index 000000000000..61807f835bc4 --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_healthcare_apis_management_client.py @@ -0,0 +1,59 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import HealthcareApisManagementClientConfiguration +from .operations import ServicesOperations +from .operations import Operations +from .operations import OperationResultsOperations +from . import models + + +class HealthcareApisManagementClient(SDKClient): + """Azure Healthcare APIs Client + + :ivar config: Configuration for client. + :vartype config: HealthcareApisManagementClientConfiguration + + :ivar services: Services operations + :vartype services: azure.mgmt.healthcareapis.operations.ServicesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.healthcareapis.operations.Operations + :ivar operation_results: OperationResults operations + :vartype operation_results: azure.mgmt.healthcareapis.operations.OperationResultsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = HealthcareApisManagementClientConfiguration(credentials, subscription_id, base_url) + super(HealthcareApisManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-08-20-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.services = ServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.operation_results = OperationResultsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/__init__.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/__init__.py new file mode 100644 index 000000000000..cb27d5affb6e --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/__init__.py @@ -0,0 +1,75 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import CheckNameAvailabilityParameters + from ._models_py3 import ErrorDetails, ErrorDetailsException + from ._models_py3 import ErrorDetailsInternal + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationResultsDescription + from ._models_py3 import Resource + from ._models_py3 import ServiceAccessPolicyEntry + from ._models_py3 import ServiceAuthenticationConfigurationInfo + from ._models_py3 import ServiceCorsConfigurationInfo + from ._models_py3 import ServiceCosmosDbConfigurationInfo + from ._models_py3 import ServicesDescription + from ._models_py3 import ServicesNameAvailabilityInfo + from ._models_py3 import ServicesPatchDescription + from ._models_py3 import ServicesProperties +except (SyntaxError, ImportError): + from ._models import CheckNameAvailabilityParameters + from ._models import ErrorDetails, ErrorDetailsException + from ._models import ErrorDetailsInternal + from ._models import Operation + from ._models import OperationDisplay + from ._models import OperationResultsDescription + from ._models import Resource + from ._models import ServiceAccessPolicyEntry + from ._models import ServiceAuthenticationConfigurationInfo + from ._models import ServiceCorsConfigurationInfo + from ._models import ServiceCosmosDbConfigurationInfo + from ._models import ServicesDescription + from ._models import ServicesNameAvailabilityInfo + from ._models import ServicesPatchDescription + from ._models import ServicesProperties +from ._paged_models import OperationPaged +from ._paged_models import ServicesDescriptionPaged +from ._healthcare_apis_management_client_enums import ( + ProvisioningState, + Kind, + ServiceNameUnavailabilityReason, + OperationResultStatus, +) + +__all__ = [ + 'CheckNameAvailabilityParameters', + 'ErrorDetails', 'ErrorDetailsException', + 'ErrorDetailsInternal', + 'Operation', + 'OperationDisplay', + 'OperationResultsDescription', + 'Resource', + 'ServiceAccessPolicyEntry', + 'ServiceAuthenticationConfigurationInfo', + 'ServiceCorsConfigurationInfo', + 'ServiceCosmosDbConfigurationInfo', + 'ServicesDescription', + 'ServicesNameAvailabilityInfo', + 'ServicesPatchDescription', + 'ServicesProperties', + 'ServicesDescriptionPaged', + 'OperationPaged', + 'ProvisioningState', + 'Kind', + 'ServiceNameUnavailabilityReason', + 'OperationResultStatus', +] diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_healthcare_apis_management_client_enums.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_healthcare_apis_management_client_enums.py new file mode 100644 index 000000000000..a910aebf78d1 --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_healthcare_apis_management_client_enums.py @@ -0,0 +1,47 @@ +# 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 enum import Enum + + +class ProvisioningState(str, Enum): + + deleting = "Deleting" + succeeded = "Succeeded" + creating = "Creating" + accepted = "Accepted" + verifying = "Verifying" + updating = "Updating" + failed = "Failed" + canceled = "Canceled" + deprovisioned = "Deprovisioned" + + +class Kind(str, Enum): + + fhir = "fhir" + fhir_stu3 = "fhir-Stu3" + fhir_r4 = "fhir-R4" + + +class ServiceNameUnavailabilityReason(str, Enum): + + invalid = "Invalid" + already_exists = "AlreadyExists" + + +class OperationResultStatus(str, Enum): + + canceled = "Canceled" + succeeded = "Succeeded" + failed = "Failed" + requested = "Requested" + running = "Running" diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models.py new file mode 100644 index 000000000000..5993183ed587 --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models.py @@ -0,0 +1,543 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class CheckNameAvailabilityParameters(Model): + """Input values. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the service instance to check. + :type name: str + :param type: Required. The fully qualified resource type which includes + provider namespace. + :type type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorDetails(Model): + """Error details. + + :param error: Object containing error details. + :type error: ~azure.mgmt.healthcareapis.models.ErrorDetailsInternal + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetailsInternal'}, + } + + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorDetailsException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDetails'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) + + +class ErrorDetailsInternal(Model): + """Error details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The target of the particular error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetailsInternal, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + + +class Operation(Model): + """Service REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{read | write | action | + delete} + :vartype name: str + :ivar origin: Default value is 'user,system'. + :vartype origin: str + :param display: The information displayed about the operation. + :type display: ~azure.mgmt.healthcareapis.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.origin = None + self.display = kwargs.get('display', None) + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.HealthcareApis + :vartype provider: str + :ivar resource: Resource Type: Services + :vartype resource: str + :ivar operation: Name of the operation + :vartype operation: str + :ivar description: Friendly description for the operation, + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _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 = None + self.resource = None + self.operation = None + self.description = None + + +class OperationResultsDescription(Model): + """The properties indicating the operation result of an operation on a + service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the operation returned. + :vartype id: str + :ivar name: The name of the operation result. + :vartype name: str + :ivar status: The status of the operation being performed. Possible values + include: 'Canceled', 'Succeeded', 'Failed', 'Requested', 'Running' + :vartype status: str or + ~azure.mgmt.healthcareapis.models.OperationResultStatus + :ivar start_time: The time that the operation was started. + :vartype start_time: str + :param properties: Additional properties of the operation result. + :type properties: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(OperationResultsDescription, self).__init__(**kwargs) + self.id = None + self.name = None + self.status = None + self.start_time = None + self.properties = kwargs.get('properties', None) + + +class Resource(Model): + """The common properties of a service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param kind: Required. The kind of the service. Valid values are: fhir, + fhir-Stu3 and fhir-R4. Possible values include: 'fhir', 'fhir-Stu3', + 'fhir-R4' + :type kind: str or ~azure.mgmt.healthcareapis.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.etag = kwargs.get('etag', None) + + +class ServiceAccessPolicyEntry(Model): + """An access policy entry. + + All required parameters must be populated in order to send to Azure. + + :param object_id: Required. An object ID that is allowed access to the + FHIR service. + :type object_id: str + """ + + _validation = { + 'object_id': {'required': True, 'pattern': r'^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$'}, + } + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceAccessPolicyEntry, self).__init__(**kwargs) + self.object_id = kwargs.get('object_id', None) + + +class ServiceAuthenticationConfigurationInfo(Model): + """Authentication configuration information. + + :param authority: The authority url for the service + :type authority: str + :param audience: The audience url for the service + :type audience: str + :param smart_proxy_enabled: If the SMART on FHIR proxy is enabled + :type smart_proxy_enabled: bool + """ + + _attribute_map = { + 'authority': {'key': 'authority', 'type': 'str'}, + 'audience': {'key': 'audience', 'type': 'str'}, + 'smart_proxy_enabled': {'key': 'smartProxyEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ServiceAuthenticationConfigurationInfo, self).__init__(**kwargs) + self.authority = kwargs.get('authority', None) + self.audience = kwargs.get('audience', None) + self.smart_proxy_enabled = kwargs.get('smart_proxy_enabled', None) + + +class ServiceCorsConfigurationInfo(Model): + """The settings for the CORS configuration of the service instance. + + :param origins: The origins to be allowed via CORS. + :type origins: list[str] + :param headers: The headers to be allowed via CORS. + :type headers: list[str] + :param methods: The methods to be allowed via CORS. + :type methods: list[str] + :param max_age: The max age to be allowed via CORS. + :type max_age: int + :param allow_credentials: If credentials are allowed via CORS. + :type allow_credentials: bool + """ + + _validation = { + 'max_age': {'maximum': 99999, 'minimum': 0}, + } + + _attribute_map = { + 'origins': {'key': 'origins', 'type': '[str]'}, + 'headers': {'key': 'headers', 'type': '[str]'}, + 'methods': {'key': 'methods', 'type': '[str]'}, + 'max_age': {'key': 'maxAge', 'type': 'int'}, + 'allow_credentials': {'key': 'allowCredentials', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ServiceCorsConfigurationInfo, self).__init__(**kwargs) + self.origins = kwargs.get('origins', None) + self.headers = kwargs.get('headers', None) + self.methods = kwargs.get('methods', None) + self.max_age = kwargs.get('max_age', None) + self.allow_credentials = kwargs.get('allow_credentials', None) + + +class ServiceCosmosDbConfigurationInfo(Model): + """The settings for the Cosmos DB database backing the service. + + :param offer_throughput: The provisioned throughput for the backing + database. + :type offer_throughput: int + """ + + _validation = { + 'offer_throughput': {'maximum': 10000, 'minimum': 400}, + } + + _attribute_map = { + 'offer_throughput': {'key': 'offerThroughput', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ServiceCosmosDbConfigurationInfo, self).__init__(**kwargs) + self.offer_throughput = kwargs.get('offer_throughput', None) + + +class ServicesDescription(Resource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param kind: Required. The kind of the service. Valid values are: fhir, + fhir-Stu3 and fhir-R4. Possible values include: 'fhir', 'fhir-Stu3', + 'fhir-R4' + :type kind: str or ~azure.mgmt.healthcareapis.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param properties: The common properties of a service. + :type properties: ~azure.mgmt.healthcareapis.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, **kwargs): + super(ServicesDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ServicesNameAvailabilityInfo(Model): + """The properties indicating whether a given service name is available. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: The value which indicates whether the provided name + is available. + :vartype name_available: bool + :ivar reason: The reason for unavailability. Possible values include: + 'Invalid', 'AlreadyExists' + :vartype reason: str or + ~azure.mgmt.healthcareapis.models.ServiceNameUnavailabilityReason + :param message: The detailed reason message. + :type message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'ServiceNameUnavailabilityReason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServicesNameAvailabilityInfo, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = kwargs.get('message', None) + + +class ServicesPatchDescription(Model): + """The description of the service. + + :param tags: Instance tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ServicesPatchDescription, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class ServicesProperties(Model): + """The properties of a service instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state. Possible values include: + 'Deleting', 'Succeeded', 'Creating', 'Accepted', 'Verifying', 'Updating', + 'Failed', 'Canceled', 'Deprovisioned' + :vartype provisioning_state: str or + ~azure.mgmt.healthcareapis.models.ProvisioningState + :param access_policies: Required. The access policies of the service + instance. + :type access_policies: + list[~azure.mgmt.healthcareapis.models.ServiceAccessPolicyEntry] + :param cosmos_db_configuration: The settings for the Cosmos DB database + backing the service. + :type cosmos_db_configuration: + ~azure.mgmt.healthcareapis.models.ServiceCosmosDbConfigurationInfo + :param authentication_configuration: The authentication configuration for + the service instance. + :type authentication_configuration: + ~azure.mgmt.healthcareapis.models.ServiceAuthenticationConfigurationInfo + :param cors_configuration: The settings for the CORS configuration of the + service instance. + :type cors_configuration: + ~azure.mgmt.healthcareapis.models.ServiceCorsConfigurationInfo + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'access_policies': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[ServiceAccessPolicyEntry]'}, + 'cosmos_db_configuration': {'key': 'cosmosDbConfiguration', 'type': 'ServiceCosmosDbConfigurationInfo'}, + 'authentication_configuration': {'key': 'authenticationConfiguration', 'type': 'ServiceAuthenticationConfigurationInfo'}, + 'cors_configuration': {'key': 'corsConfiguration', 'type': 'ServiceCorsConfigurationInfo'}, + } + + def __init__(self, **kwargs): + super(ServicesProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.access_policies = kwargs.get('access_policies', None) + self.cosmos_db_configuration = kwargs.get('cosmos_db_configuration', None) + self.authentication_configuration = kwargs.get('authentication_configuration', None) + self.cors_configuration = kwargs.get('cors_configuration', None) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models_py3.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models_py3.py new file mode 100644 index 000000000000..8070f9eec9dc --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models_py3.py @@ -0,0 +1,543 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class CheckNameAvailabilityParameters(Model): + """Input values. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the service instance to check. + :type name: str + :param type: Required. The fully qualified resource type which includes + provider namespace. + :type type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str, type: str, **kwargs) -> None: + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + self.type = type + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorDetails(Model): + """Error details. + + :param error: Object containing error details. + :type error: ~azure.mgmt.healthcareapis.models.ErrorDetailsInternal + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetailsInternal'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.error = error + + +class ErrorDetailsException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDetails'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) + + +class ErrorDetailsInternal(Model): + """Error details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The target of the particular error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetailsInternal, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + + +class Operation(Model): + """Service REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{read | write | action | + delete} + :vartype name: str + :ivar origin: Default value is 'user,system'. + :vartype origin: str + :param display: The information displayed about the operation. + :type display: ~azure.mgmt.healthcareapis.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.origin = None + self.display = display + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.HealthcareApis + :vartype provider: str + :ivar resource: Resource Type: Services + :vartype resource: str + :ivar operation: Name of the operation + :vartype operation: str + :ivar description: Friendly description for the operation, + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _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) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationResultsDescription(Model): + """The properties indicating the operation result of an operation on a + service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the operation returned. + :vartype id: str + :ivar name: The name of the operation result. + :vartype name: str + :ivar status: The status of the operation being performed. Possible values + include: 'Canceled', 'Succeeded', 'Failed', 'Requested', 'Running' + :vartype status: str or + ~azure.mgmt.healthcareapis.models.OperationResultStatus + :ivar start_time: The time that the operation was started. + :vartype start_time: str + :param properties: Additional properties of the operation result. + :type properties: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(OperationResultsDescription, self).__init__(**kwargs) + self.id = None + self.name = None + self.status = None + self.start_time = None + self.properties = properties + + +class Resource(Model): + """The common properties of a service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param kind: Required. The kind of the service. Valid values are: fhir, + fhir-Stu3 and fhir-R4. Possible values include: 'fhir', 'fhir-Stu3', + 'fhir-R4' + :type kind: str or ~azure.mgmt.healthcareapis.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, kind, location: str, tags=None, etag: str=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = kind + self.location = location + self.tags = tags + self.etag = etag + + +class ServiceAccessPolicyEntry(Model): + """An access policy entry. + + All required parameters must be populated in order to send to Azure. + + :param object_id: Required. An object ID that is allowed access to the + FHIR service. + :type object_id: str + """ + + _validation = { + 'object_id': {'required': True, 'pattern': r'^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$'}, + } + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__(self, *, object_id: str, **kwargs) -> None: + super(ServiceAccessPolicyEntry, self).__init__(**kwargs) + self.object_id = object_id + + +class ServiceAuthenticationConfigurationInfo(Model): + """Authentication configuration information. + + :param authority: The authority url for the service + :type authority: str + :param audience: The audience url for the service + :type audience: str + :param smart_proxy_enabled: If the SMART on FHIR proxy is enabled + :type smart_proxy_enabled: bool + """ + + _attribute_map = { + 'authority': {'key': 'authority', 'type': 'str'}, + 'audience': {'key': 'audience', 'type': 'str'}, + 'smart_proxy_enabled': {'key': 'smartProxyEnabled', 'type': 'bool'}, + } + + def __init__(self, *, authority: str=None, audience: str=None, smart_proxy_enabled: bool=None, **kwargs) -> None: + super(ServiceAuthenticationConfigurationInfo, self).__init__(**kwargs) + self.authority = authority + self.audience = audience + self.smart_proxy_enabled = smart_proxy_enabled + + +class ServiceCorsConfigurationInfo(Model): + """The settings for the CORS configuration of the service instance. + + :param origins: The origins to be allowed via CORS. + :type origins: list[str] + :param headers: The headers to be allowed via CORS. + :type headers: list[str] + :param methods: The methods to be allowed via CORS. + :type methods: list[str] + :param max_age: The max age to be allowed via CORS. + :type max_age: int + :param allow_credentials: If credentials are allowed via CORS. + :type allow_credentials: bool + """ + + _validation = { + 'max_age': {'maximum': 99999, 'minimum': 0}, + } + + _attribute_map = { + 'origins': {'key': 'origins', 'type': '[str]'}, + 'headers': {'key': 'headers', 'type': '[str]'}, + 'methods': {'key': 'methods', 'type': '[str]'}, + 'max_age': {'key': 'maxAge', 'type': 'int'}, + 'allow_credentials': {'key': 'allowCredentials', 'type': 'bool'}, + } + + def __init__(self, *, origins=None, headers=None, methods=None, max_age: int=None, allow_credentials: bool=None, **kwargs) -> None: + super(ServiceCorsConfigurationInfo, self).__init__(**kwargs) + self.origins = origins + self.headers = headers + self.methods = methods + self.max_age = max_age + self.allow_credentials = allow_credentials + + +class ServiceCosmosDbConfigurationInfo(Model): + """The settings for the Cosmos DB database backing the service. + + :param offer_throughput: The provisioned throughput for the backing + database. + :type offer_throughput: int + """ + + _validation = { + 'offer_throughput': {'maximum': 10000, 'minimum': 400}, + } + + _attribute_map = { + 'offer_throughput': {'key': 'offerThroughput', 'type': 'int'}, + } + + def __init__(self, *, offer_throughput: int=None, **kwargs) -> None: + super(ServiceCosmosDbConfigurationInfo, self).__init__(**kwargs) + self.offer_throughput = offer_throughput + + +class ServicesDescription(Resource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param kind: Required. The kind of the service. Valid values are: fhir, + fhir-Stu3 and fhir-R4. Possible values include: 'fhir', 'fhir-Stu3', + 'fhir-R4' + :type kind: str or ~azure.mgmt.healthcareapis.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param properties: The common properties of a service. + :type properties: ~azure.mgmt.healthcareapis.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, *, kind, location: str, tags=None, etag: str=None, properties=None, **kwargs) -> None: + super(ServicesDescription, self).__init__(kind=kind, location=location, tags=tags, etag=etag, **kwargs) + self.properties = properties + + +class ServicesNameAvailabilityInfo(Model): + """The properties indicating whether a given service name is available. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: The value which indicates whether the provided name + is available. + :vartype name_available: bool + :ivar reason: The reason for unavailability. Possible values include: + 'Invalid', 'AlreadyExists' + :vartype reason: str or + ~azure.mgmt.healthcareapis.models.ServiceNameUnavailabilityReason + :param message: The detailed reason message. + :type message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'ServiceNameUnavailabilityReason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, message: str=None, **kwargs) -> None: + super(ServicesNameAvailabilityInfo, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = message + + +class ServicesPatchDescription(Model): + """The description of the service. + + :param tags: Instance tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ServicesPatchDescription, self).__init__(**kwargs) + self.tags = tags + + +class ServicesProperties(Model): + """The properties of a service instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state. Possible values include: + 'Deleting', 'Succeeded', 'Creating', 'Accepted', 'Verifying', 'Updating', + 'Failed', 'Canceled', 'Deprovisioned' + :vartype provisioning_state: str or + ~azure.mgmt.healthcareapis.models.ProvisioningState + :param access_policies: Required. The access policies of the service + instance. + :type access_policies: + list[~azure.mgmt.healthcareapis.models.ServiceAccessPolicyEntry] + :param cosmos_db_configuration: The settings for the Cosmos DB database + backing the service. + :type cosmos_db_configuration: + ~azure.mgmt.healthcareapis.models.ServiceCosmosDbConfigurationInfo + :param authentication_configuration: The authentication configuration for + the service instance. + :type authentication_configuration: + ~azure.mgmt.healthcareapis.models.ServiceAuthenticationConfigurationInfo + :param cors_configuration: The settings for the CORS configuration of the + service instance. + :type cors_configuration: + ~azure.mgmt.healthcareapis.models.ServiceCorsConfigurationInfo + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'access_policies': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[ServiceAccessPolicyEntry]'}, + 'cosmos_db_configuration': {'key': 'cosmosDbConfiguration', 'type': 'ServiceCosmosDbConfigurationInfo'}, + 'authentication_configuration': {'key': 'authenticationConfiguration', 'type': 'ServiceAuthenticationConfigurationInfo'}, + 'cors_configuration': {'key': 'corsConfiguration', 'type': 'ServiceCorsConfigurationInfo'}, + } + + def __init__(self, *, access_policies, cosmos_db_configuration=None, authentication_configuration=None, cors_configuration=None, **kwargs) -> None: + super(ServicesProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.access_policies = access_policies + self.cosmos_db_configuration = cosmos_db_configuration + self.authentication_configuration = authentication_configuration + self.cors_configuration = cors_configuration diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_paged_models.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_paged_models.py new file mode 100644 index 000000000000..646be2a168cc --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_paged_models.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.paging import Paged + + +class ServicesDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ServicesDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServicesDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(ServicesDescriptionPaged, self).__init__(*args, **kwargs) +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/__init__.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/__init__.py new file mode 100644 index 000000000000..6bca9ee351e6 --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/__init__.py @@ -0,0 +1,20 @@ +# 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 ._services_operations import ServicesOperations +from ._operations import Operations +from ._operation_results_operations import OperationResultsOperations + +__all__ = [ + 'ServicesOperations', + 'Operations', + 'OperationResultsOperations', +] diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operation_results_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operation_results_operations.py new file mode 100644 index 000000000000..7050fa3cc564 --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operation_results_operations.py @@ -0,0 +1,100 @@ +# 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 .. import models + + +class OperationResultsOperations(object): + """OperationResultsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2018-08-20-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-20-preview" + + self.config = config + + def get( + self, location_name, operation_result_id, custom_headers=None, raw=False, **operation_config): + """Get the operation result for a long running operation. + + :param location_name: The location of the operation. + :type location_name: str + :param operation_result_id: The ID of the operation result to get. + :type operation_result_id: 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`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'operationResultId': self._serialize.url("operation_result_id", operation_result_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=10) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResultsDescription', response) + if response.status_code == 404: + deserialized = self._deserialize('ErrorDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}'} diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operations.py new file mode 100644 index 000000000000..e60e1aff1e7d --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operations.py @@ -0,0 +1,100 @@ +# 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 .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2018-08-20-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-20-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Healthcare service REST API 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: An iterator like instance of Operation + :rtype: + ~azure.mgmt.healthcareapis.models.OperationPaged[~azure.mgmt.healthcareapis.models.Operation] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=10) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.HealthcareApis/operations'} diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_services_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_services_operations.py new file mode 100644 index 000000000000..76ee198c35a8 --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_services_operations.py @@ -0,0 +1,585 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ServicesOperations(object): + """ServicesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2018-08-20-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-20-preview" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the metadata of a service instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: 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`. + :return: ServicesDescription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.healthcareapis.models.ServicesDescription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=10) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ServicesDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_name, service_description, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=10) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(service_description, 'ServicesDescription') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServicesDescription', response) + if response.status_code == 201: + deserialized = self._deserialize('ServicesDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, service_description, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update the metadata of a service instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param service_description: The service instance metadata. + :type service_description: + ~azure.mgmt.healthcareapis.models.ServicesDescription + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ServicesDescription or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.healthcareapis.models.ServicesDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.healthcareapis.models.ServicesDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + service_description=service_description, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServicesDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): + service_patch_description = models.ServicesPatchDescription(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=10) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(service_patch_description, 'ServicesPatchDescription') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServicesDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the metadata of a service instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param tags: Instance tags + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ServicesDescription or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.healthcareapis.models.ServicesDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.healthcareapis.models.ServicesDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServicesDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=10) + + # Construct headers + header_parameters = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a service instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get all the service instances in a subscription. + + :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: An iterator like instance of ServicesDescription + :rtype: + ~azure.mgmt.healthcareapis.models.ServicesDescriptionPaged[~azure.mgmt.healthcareapis.models.ServicesDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=10) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ServicesDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all the service instances in a resource group. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: 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`. + :return: An iterator like instance of ServicesDescription + :rtype: + ~azure.mgmt.healthcareapis.models.ServicesDescriptionPaged[~azure.mgmt.healthcareapis.models.ServicesDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=10) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ServicesDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services'} + + def check_name_availability( + self, name, type, custom_headers=None, raw=False, **operation_config): + """Check if a service instance name is available. + + :param name: The name of the service instance to check. + :type name: str + :param type: The fully qualified resource type which includes provider + namespace. + :type type: 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`. + :return: ServicesNameAvailabilityInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.healthcareapis.models.ServicesNameAvailabilityInfo + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + check_name_availability_inputs = models.CheckNameAvailabilityParameters(name=name, type=type) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=10) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(check_name_availability_inputs, 'CheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ServicesNameAvailabilityInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability'} diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/version.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + From 80b1efc85d1e10280fbca21fb472a5bb42cfaaad Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 3 Aug 2019 04:16:26 +0000 Subject: [PATCH 2/3] Packaging update of azure-mgmt-healthcareapis --- .../azure-mgmt-healthcareapis/HISTORY.rst | 9 ++ .../azure-mgmt-healthcareapis/MANIFEST.in | 5 ++ .../azure-mgmt-healthcareapis/README.rst | 33 +++++++ .../azure/__init__.py | 1 + .../azure/mgmt/__init__.py | 1 + .../sdk_packaging.toml | 8 ++ .../azure-mgmt-healthcareapis/setup.cfg | 2 + .../azure-mgmt-healthcareapis/setup.py | 87 +++++++++++++++++++ 8 files changed, 146 insertions(+) create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/HISTORY.rst create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/MANIFEST.in create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/README.rst create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/__init__.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/__init__.py create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/sdk_packaging.toml create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/setup.cfg create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/setup.py diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/HISTORY.rst b/sdk/healthcareapis/azure-mgmt-healthcareapis/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/MANIFEST.in b/sdk/healthcareapis/azure-mgmt-healthcareapis/MANIFEST.in new file mode 100644 index 000000000000..e4884efef41b --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/README.rst b/sdk/healthcareapis/azure-mgmt-healthcareapis/README.rst new file mode 100644 index 000000000000..c4945c69391f --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/README.rst @@ -0,0 +1,33 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-healthcareapis%2FREADME.png diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/__init__.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/__init__.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/sdk_packaging.toml b/sdk/healthcareapis/azure-mgmt-healthcareapis/sdk_packaging.toml new file mode 100644 index 000000000000..c100847826ee --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-healthcareapis" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/setup.cfg b/sdk/healthcareapis/azure-mgmt-healthcareapis/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/setup.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/setup.py new file mode 100644 index 000000000000..871317f35cde --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-healthcareapis" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) From dfab51ac8605dd3d996fba4daf4c8fe9c7ae8a93 Mon Sep 17 00:00:00 2001 From: zikalino Date: Sat, 3 Aug 2019 14:29:46 +0800 Subject: [PATCH 3/3] fixed release date --- sdk/healthcareapis/azure-mgmt-healthcareapis/HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/HISTORY.rst b/sdk/healthcareapis/azure-mgmt-healthcareapis/HISTORY.rst index 8924d5d6c445..25dd1b56ea24 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/HISTORY.rst +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/HISTORY.rst @@ -3,7 +3,7 @@ Release History =============== -0.1.0 (1970-01-01) +0.1.0 (2019-08-03) ++++++++++++++++++ * Initial Release