diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models.py index 1d68896e19a..e2653ada7f3 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models.py @@ -85,29 +85,6 @@ class CloudError(Model): } -class DigitalTwinsSkuInfo(Model): - """Information about the SKU of the DigitalTwinsInstance. - - 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 name: Required. The name of the SKU. Default value: "F1" . - :vartype name: str - """ - - _validation = { - 'name': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - name = "F1" - - class DigitalTwinsResource(Model): """The common properties of a DigitalTwinsInstance. @@ -358,6 +335,29 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) +class DigitalTwinsSkuInfo(Model): + """Information about the SKU of the DigitalTwinsInstance. + + 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 name: Required. The name of the SKU. Default value: "F1" . + :vartype name: str + """ + + _validation = { + 'name': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + name = "F1" + + class ErrorDefinition(Model): """Error definition. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models_py3.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models_py3.py index 7eb73bca12b..e09f6604c70 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models_py3.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models_py3.py @@ -85,29 +85,6 @@ class CloudError(Model): } -class DigitalTwinsSkuInfo(Model): - """Information about the SKU of the DigitalTwinsInstance. - - 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 name: Required. The name of the SKU. Default value: "F1" . - :vartype name: str - """ - - _validation = { - 'name': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - name = "F1" - - class DigitalTwinsResource(Model): """The common properties of a DigitalTwinsInstance. @@ -358,6 +335,29 @@ def __init__(self, *, tags=None, **kwargs) -> None: self.tags = tags +class DigitalTwinsSkuInfo(Model): + """Information about the SKU of the DigitalTwinsInstance. + + 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 name: Required. The name of the SKU. Default value: "F1" . + :vartype name: str + """ + + _validation = { + 'name': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + name = "F1" + + class ErrorDefinition(Model): """Error definition. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/__init__.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/__init__.py new file mode 100644 index 00000000000..29751a31716 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/__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 AzureDigitalTwinsManagementClientConfiguration +from ._azure_digital_twins_management_client import AzureDigitalTwinsManagementClient +__all__ = ['AzureDigitalTwinsManagementClient', 'AzureDigitalTwinsManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_azure_digital_twins_management_client.py new file mode 100644 index 00000000000..23aef75e641 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_azure_digital_twins_management_client.py @@ -0,0 +1,69 @@ +# 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 AzureDigitalTwinsManagementClientConfiguration +from .operations import DigitalTwinsOperations +from .operations import DigitalTwinsEndpointOperations +from .operations import Operations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations +from . import models + + +class AzureDigitalTwinsManagementClient(SDKClient): + """Azure Digital Twins Client for managing DigitalTwinsInstance + + :ivar config: Configuration for client. + :vartype config: AzureDigitalTwinsManagementClientConfiguration + + :ivar digital_twins: DigitalTwins operations + :vartype digital_twins: azure.mgmt.digitaltwins.operations.DigitalTwinsOperations + :ivar digital_twins_endpoint: DigitalTwinsEndpoint operations + :vartype digital_twins_endpoint: azure.mgmt.digitaltwins.operations.DigitalTwinsEndpointOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.digitaltwins.operations.Operations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.digitaltwins.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnections operations + :vartype private_endpoint_connections: azure.mgmt.digitaltwins.operations.PrivateEndpointConnectionsOperations + + :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 = AzureDigitalTwinsManagementClientConfiguration(credentials, subscription_id, base_url) + super(AzureDigitalTwinsManagementClient, 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 = '2020-12-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.digital_twins = DigitalTwinsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.digital_twins_endpoint = DigitalTwinsEndpointOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_configuration.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_configuration.py new file mode 100644 index 00000000000..011639f40f2 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_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 AzureDigitalTwinsManagementClientConfiguration(AzureConfiguration): + """Configuration for AzureDigitalTwinsManagementClient + 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(AzureDigitalTwinsManagementClientConfiguration, 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-digitaltwins/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/__init__.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/__init__.py new file mode 100644 index 00000000000..87ad79723e9 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/__init__.py @@ -0,0 +1,127 @@ +# 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 CheckNameRequest + from ._models_py3 import CheckNameResult + from ._models_py3 import ConnectionProperties + from ._models_py3 import ConnectionPropertiesPrivateEndpoint + from ._models_py3 import ConnectionPropertiesPrivateLinkServiceConnectionState + from ._models_py3 import ConnectionState + from ._models_py3 import DigitalTwinsDescription + from ._models_py3 import DigitalTwinsEndpointResource + from ._models_py3 import DigitalTwinsEndpointResourceProperties + from ._models_py3 import DigitalTwinsIdentity + from ._models_py3 import DigitalTwinsPatchDescription + from ._models_py3 import DigitalTwinsPatchProperties + from ._models_py3 import DigitalTwinsResource + from ._models_py3 import ErrorDefinition + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import EventGrid + from ._models_py3 import EventHub + from ._models_py3 import ExternalResource + from ._models_py3 import GroupIdInformation + from ._models_py3 import GroupIdInformationProperties + from ._models_py3 import GroupIdInformationPropertiesModel + from ._models_py3 import GroupIdInformationResponse + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionProperties + from ._models_py3 import PrivateEndpointConnectionsResponse + from ._models_py3 import ServiceBus +except (SyntaxError, ImportError): + from ._models import CheckNameRequest + from ._models import CheckNameResult + from ._models import ConnectionProperties + from ._models import ConnectionPropertiesPrivateEndpoint + from ._models import ConnectionPropertiesPrivateLinkServiceConnectionState + from ._models import ConnectionState + from ._models import DigitalTwinsDescription + from ._models import DigitalTwinsEndpointResource + from ._models import DigitalTwinsEndpointResourceProperties + from ._models import DigitalTwinsIdentity + from ._models import DigitalTwinsPatchDescription + from ._models import DigitalTwinsPatchProperties + from ._models import DigitalTwinsResource + from ._models import ErrorDefinition + from ._models import ErrorResponse, ErrorResponseException + from ._models import EventGrid + from ._models import EventHub + from ._models import ExternalResource + from ._models import GroupIdInformation + from ._models import GroupIdInformationProperties + from ._models import GroupIdInformationPropertiesModel + from ._models import GroupIdInformationResponse + from ._models import Operation + from ._models import OperationDisplay + from ._models import PrivateEndpoint + from ._models import PrivateEndpointConnection + from ._models import PrivateEndpointConnectionProperties + from ._models import PrivateEndpointConnectionsResponse + from ._models import ServiceBus +from ._paged_models import DigitalTwinsDescriptionPaged +from ._paged_models import DigitalTwinsEndpointResourcePaged +from ._paged_models import OperationPaged +from ._azure_digital_twins_management_client_enums import ( + PublicNetworkAccess, + ProvisioningState, + DigitalTwinsIdentityType, + Reason, + EndpointProvisioningState, + AuthenticationType, + PrivateLinkServiceConnectionStatus, + ConnectionPropertiesProvisioningState, +) + +__all__ = [ + 'CheckNameRequest', + 'CheckNameResult', + 'ConnectionProperties', + 'ConnectionPropertiesPrivateEndpoint', + 'ConnectionPropertiesPrivateLinkServiceConnectionState', + 'ConnectionState', + 'DigitalTwinsDescription', + 'DigitalTwinsEndpointResource', + 'DigitalTwinsEndpointResourceProperties', + 'DigitalTwinsIdentity', + 'DigitalTwinsPatchDescription', + 'DigitalTwinsPatchProperties', + 'DigitalTwinsResource', + 'ErrorDefinition', + 'ErrorResponse', 'ErrorResponseException', + 'EventGrid', + 'EventHub', + 'ExternalResource', + 'GroupIdInformation', + 'GroupIdInformationProperties', + 'GroupIdInformationPropertiesModel', + 'GroupIdInformationResponse', + 'Operation', + 'OperationDisplay', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionProperties', + 'PrivateEndpointConnectionsResponse', + 'ServiceBus', + 'DigitalTwinsDescriptionPaged', + 'DigitalTwinsEndpointResourcePaged', + 'OperationPaged', + 'PublicNetworkAccess', + 'ProvisioningState', + 'DigitalTwinsIdentityType', + 'Reason', + 'EndpointProvisioningState', + 'AuthenticationType', + 'PrivateLinkServiceConnectionStatus', + 'ConnectionPropertiesProvisioningState', +] diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_azure_digital_twins_management_client_enums.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_azure_digital_twins_management_client_enums.py new file mode 100644 index 00000000000..c5cef2830d4 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_azure_digital_twins_management_client_enums.py @@ -0,0 +1,82 @@ +# 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 PublicNetworkAccess(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class ProvisioningState(str, Enum): + + provisioning = "Provisioning" + deleting = "Deleting" + updating = "Updating" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + deleted = "Deleted" + warning = "Warning" + suspending = "Suspending" + restoring = "Restoring" + moving = "Moving" + + +class DigitalTwinsIdentityType(str, Enum): + + none = "None" + system_assigned = "SystemAssigned" + + +class Reason(str, Enum): + + invalid = "Invalid" + already_exists = "AlreadyExists" + + +class EndpointProvisioningState(str, Enum): + + provisioning = "Provisioning" + deleting = "Deleting" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + deleted = "Deleted" + warning = "Warning" + suspending = "Suspending" + restoring = "Restoring" + moving = "Moving" + disabled = "Disabled" + + +class AuthenticationType(str, Enum): + + key_based = "KeyBased" + identity_based = "IdentityBased" + + +class PrivateLinkServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" + + +class ConnectionPropertiesProvisioningState(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_models.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_models.py new file mode 100644 index 00000000000..a050b8fa28b --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_models.py @@ -0,0 +1,1121 @@ +# 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 CheckNameRequest(Model): + """The result returned from a database check name availability request. + + 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. + + :param name: Required. Resource name. + :type name: str + :ivar type: Required. The type of resource, for instance + Microsoft.DigitalTwins/digitalTwinsInstances. Default value: + "Microsoft.DigitalTwins/digitalTwinsInstances" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.DigitalTwins/digitalTwinsInstances" + + def __init__(self, **kwargs): + super(CheckNameRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class CheckNameResult(Model): + """The result returned from a check name availability request. + + :param name_available: Specifies a Boolean value that indicates if the + name is available. + :type name_available: bool + :param message: Message indicating an unavailable name due to a conflict, + or a description of the naming rules that are violated. + :type message: str + :param reason: Message providing the reason why the given name is invalid. + Possible values include: 'Invalid', 'AlreadyExists' + :type reason: str or ~azure.mgmt.digitaltwins.models.Reason + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameResult, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.message = kwargs.get('message', None) + self.reason = kwargs.get('reason', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ConnectionProperties(Model): + """The properties of a private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. Possible values include: + 'Pending', 'Approved', 'Rejected', 'Disconnected' + :vartype provisioning_state: str or + ~azure.mgmt.digitaltwins.models.ConnectionPropertiesProvisioningState + :param private_endpoint: + :type private_endpoint: + ~azure.mgmt.digitaltwins.models.ConnectionPropertiesPrivateEndpoint + :param group_ids: The list of group ids for the private endpoint + connection. + :type group_ids: list[str] + :param private_link_service_connection_state: + :type private_link_service_connection_state: + ~azure.mgmt.digitaltwins.models.ConnectionPropertiesPrivateLinkServiceConnectionState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'privateEndpoint', 'type': 'ConnectionPropertiesPrivateEndpoint'}, + 'group_ids': {'key': 'groupIds', 'type': '[str]'}, + 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'ConnectionPropertiesPrivateLinkServiceConnectionState'}, + } + + def __init__(self, **kwargs): + super(ConnectionProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.private_endpoint = kwargs.get('private_endpoint', None) + self.group_ids = kwargs.get('group_ids', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateEndpoint(Model): + """The private endpoint property of a private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource identifier. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class ConnectionPropertiesPrivateEndpoint(PrivateEndpoint): + """ConnectionPropertiesPrivateEndpoint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource identifier. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionPropertiesPrivateEndpoint, self).__init__(**kwargs) + + +class ConnectionState(Model): + """The current state of a private endpoint connection. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The status of a private endpoint connection. + Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.digitaltwins.models.PrivateLinkServiceConnectionStatus + :param description: Required. The description for the current state of a + private endpoint connection. + :type description: str + :param actions_required: Actions required for a private endpoint + connection. + :type actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class ConnectionPropertiesPrivateLinkServiceConnectionState(ConnectionState): + """ConnectionPropertiesPrivateLinkServiceConnectionState. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The status of a private endpoint connection. + Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.digitaltwins.models.PrivateLinkServiceConnectionStatus + :param description: Required. The description for the current state of a + private endpoint connection. + :type description: str + :param actions_required: Actions required for a private endpoint + connection. + :type actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionPropertiesPrivateLinkServiceConnectionState, self).__init__(**kwargs) + + +class DigitalTwinsResource(Model): + """The common properties of a DigitalTwinsInstance. + + 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 location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param identity: The managed identity for the DigitalTwinsInstance. + :type identity: ~azure.mgmt.digitaltwins.models.DigitalTwinsIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?!-)[A-Za-z0-9-]{3,63}(? None: + super(CheckNameRequest, self).__init__(**kwargs) + self.name = name + + +class CheckNameResult(Model): + """The result returned from a check name availability request. + + :param name_available: Specifies a Boolean value that indicates if the + name is available. + :type name_available: bool + :param message: Message indicating an unavailable name due to a conflict, + or a description of the naming rules that are violated. + :type message: str + :param reason: Message providing the reason why the given name is invalid. + Possible values include: 'Invalid', 'AlreadyExists' + :type reason: str or ~azure.mgmt.digitaltwins.models.Reason + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, message: str=None, reason=None, **kwargs) -> None: + super(CheckNameResult, self).__init__(**kwargs) + self.name_available = name_available + self.message = message + self.reason = reason + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ConnectionProperties(Model): + """The properties of a private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. Possible values include: + 'Pending', 'Approved', 'Rejected', 'Disconnected' + :vartype provisioning_state: str or + ~azure.mgmt.digitaltwins.models.ConnectionPropertiesProvisioningState + :param private_endpoint: + :type private_endpoint: + ~azure.mgmt.digitaltwins.models.ConnectionPropertiesPrivateEndpoint + :param group_ids: The list of group ids for the private endpoint + connection. + :type group_ids: list[str] + :param private_link_service_connection_state: + :type private_link_service_connection_state: + ~azure.mgmt.digitaltwins.models.ConnectionPropertiesPrivateLinkServiceConnectionState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'privateEndpoint', 'type': 'ConnectionPropertiesPrivateEndpoint'}, + 'group_ids': {'key': 'groupIds', 'type': '[str]'}, + 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'ConnectionPropertiesPrivateLinkServiceConnectionState'}, + } + + def __init__(self, *, private_endpoint=None, group_ids=None, private_link_service_connection_state=None, **kwargs) -> None: + super(ConnectionProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.group_ids = group_ids + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateEndpoint(Model): + """The private endpoint property of a private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource identifier. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class ConnectionPropertiesPrivateEndpoint(PrivateEndpoint): + """ConnectionPropertiesPrivateEndpoint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource identifier. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectionPropertiesPrivateEndpoint, self).__init__(**kwargs) + + +class ConnectionState(Model): + """The current state of a private endpoint connection. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The status of a private endpoint connection. + Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.digitaltwins.models.PrivateLinkServiceConnectionStatus + :param description: Required. The description for the current state of a + private endpoint connection. + :type description: str + :param actions_required: Actions required for a private endpoint + connection. + :type actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status, description: str, actions_required: str=None, **kwargs) -> None: + super(ConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class ConnectionPropertiesPrivateLinkServiceConnectionState(ConnectionState): + """ConnectionPropertiesPrivateLinkServiceConnectionState. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The status of a private endpoint connection. + Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.digitaltwins.models.PrivateLinkServiceConnectionStatus + :param description: Required. The description for the current state of a + private endpoint connection. + :type description: str + :param actions_required: Actions required for a private endpoint + connection. + :type actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status, description: str, actions_required: str=None, **kwargs) -> None: + super(ConnectionPropertiesPrivateLinkServiceConnectionState, self).__init__(status=status, description=description, actions_required=actions_required, **kwargs) + + +class DigitalTwinsResource(Model): + """The common properties of a DigitalTwinsInstance. + + 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 location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param identity: The managed identity for the DigitalTwinsInstance. + :type identity: ~azure.mgmt.digitaltwins.models.DigitalTwinsIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?!-)[A-Za-z0-9-]{3,63}(? None: + super(DigitalTwinsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.identity = identity + + +class DigitalTwinsDescription(DigitalTwinsResource): + """The description of the DigitalTwins 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 location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param identity: The managed identity for the DigitalTwinsInstance. + :type identity: ~azure.mgmt.digitaltwins.models.DigitalTwinsIdentity + :ivar created_time: Time when DigitalTwinsInstance was created. + :vartype created_time: datetime + :ivar last_updated_time: Time when DigitalTwinsInstance was updated. + :vartype last_updated_time: datetime + :ivar provisioning_state: The provisioning state. Possible values include: + 'Provisioning', 'Deleting', 'Updating', 'Succeeded', 'Failed', 'Canceled', + 'Deleted', 'Warning', 'Suspending', 'Restoring', 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.digitaltwins.models.ProvisioningState + :ivar host_name: Api endpoint to work with DigitalTwinsInstance. + :vartype host_name: str + :param private_endpoint_connections: + :type private_endpoint_connections: + list[~azure.mgmt.digitaltwins.models.PrivateEndpointConnection] + :param public_network_access: Public network access for the + DigitalTwinsInstance. Possible values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.digitaltwins.models.PublicNetworkAccess + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?!-)[A-Za-z0-9-]{3,63}(? None: + super(DigitalTwinsDescription, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + self.created_time = None + self.last_updated_time = None + self.provisioning_state = None + self.host_name = None + self.private_endpoint_connections = private_endpoint_connections + self.public_network_access = public_network_access + + +class ExternalResource(Model): + """Definition of a resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: Extension resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ExternalResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class DigitalTwinsEndpointResource(ExternalResource): + """DigitalTwinsInstance endpoint resource. + + 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: Extension resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param properties: Required. DigitalTwinsInstance endpoint resource + properties. + :type properties: + ~azure.mgmt.digitaltwins.models.DigitalTwinsEndpointResourceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DigitalTwinsEndpointResourceProperties'}, + } + + def __init__(self, *, properties, **kwargs) -> None: + super(DigitalTwinsEndpointResource, self).__init__(**kwargs) + self.properties = properties + + +class DigitalTwinsEndpointResourceProperties(Model): + """Properties related to Digital Twins Endpoint. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ServiceBus, EventHub, EventGrid + + 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: + 'Provisioning', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', + 'Warning', 'Suspending', 'Restoring', 'Moving', 'Disabled' + :vartype provisioning_state: str or + ~azure.mgmt.digitaltwins.models.EndpointProvisioningState + :ivar created_time: Time when the Endpoint was added to + DigitalTwinsInstance. + :vartype created_time: datetime + :param authentication_type: Specifies the authentication type being used + for connecting to the endpoint. Possible values include: 'KeyBased', + 'IdentityBased' + :type authentication_type: str or + ~azure.mgmt.digitaltwins.models.AuthenticationType + :param dead_letter_secret: Dead letter storage secret for key-based + authentication. Will be obfuscated during read. + :type dead_letter_secret: str + :param dead_letter_uri: Dead letter storage URL for identity-based + authentication. + :type dead_letter_uri: str + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'dead_letter_secret': {'key': 'deadLetterSecret', 'type': 'str'}, + 'dead_letter_uri': {'key': 'deadLetterUri', 'type': 'str'}, + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + } + + _subtype_map = { + 'endpoint_type': {'ServiceBus': 'ServiceBus', 'EventHub': 'EventHub', 'EventGrid': 'EventGrid'} + } + + def __init__(self, *, authentication_type=None, dead_letter_secret: str=None, dead_letter_uri: str=None, **kwargs) -> None: + super(DigitalTwinsEndpointResourceProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.created_time = None + self.authentication_type = authentication_type + self.dead_letter_secret = dead_letter_secret + self.dead_letter_uri = dead_letter_uri + self.endpoint_type = None + + +class DigitalTwinsIdentity(Model): + """The managed identity for the DigitalTwinsInstance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param type: The type of Managed Identity used by the + DigitalTwinsInstance. Only SystemAssigned is supported. Possible values + include: 'None', 'SystemAssigned' + :type type: str or + ~azure.mgmt.digitaltwins.models.DigitalTwinsIdentityType + :ivar principal_id: The object id of the Managed Identity Resource. This + will be sent to the RP from ARM via the x-ms-identity-principal-id header + in the PUT request if the resource has a systemAssigned(implicit) identity + :vartype principal_id: str + :ivar tenant_id: The tenant id of the Managed Identity Resource. This will + be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT + request if the resource has a systemAssigned(implicit) identity + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(DigitalTwinsIdentity, self).__init__(**kwargs) + self.type = type + self.principal_id = None + self.tenant_id = None + + +class DigitalTwinsPatchDescription(Model): + """The description of the DigitalTwins service. + + :param tags: Instance patch properties + :type tags: dict[str, str] + :param identity: The managed identity for the DigitalTwinsInstance. + :type identity: ~azure.mgmt.digitaltwins.models.DigitalTwinsIdentity + :param properties: Properties for the DigitalTwinsInstance. + :type properties: + ~azure.mgmt.digitaltwins.models.DigitalTwinsPatchProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'DigitalTwinsIdentity'}, + 'properties': {'key': 'properties', 'type': 'DigitalTwinsPatchProperties'}, + } + + def __init__(self, *, tags=None, identity=None, properties=None, **kwargs) -> None: + super(DigitalTwinsPatchDescription, self).__init__(**kwargs) + self.tags = tags + self.identity = identity + self.properties = properties + + +class DigitalTwinsPatchProperties(Model): + """The properties of a DigitalTwinsInstance. + + :param public_network_access: Public network access for the + DigitalTwinsInstance. Possible values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.digitaltwins.models.PublicNetworkAccess + """ + + _attribute_map = { + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + } + + def __init__(self, *, public_network_access=None, **kwargs) -> None: + super(DigitalTwinsPatchProperties, self).__init__(**kwargs) + self.public_network_access = public_network_access + + +class ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: list[~azure.mgmt.digitaltwins.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + + +class ErrorResponse(Model): + """Error response. + + :param error: Error description + :type error: ~azure.mgmt.digitaltwins.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class EventGrid(DigitalTwinsEndpointResourceProperties): + """Properties related to EventGrid. + + 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: + 'Provisioning', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', + 'Warning', 'Suspending', 'Restoring', 'Moving', 'Disabled' + :vartype provisioning_state: str or + ~azure.mgmt.digitaltwins.models.EndpointProvisioningState + :ivar created_time: Time when the Endpoint was added to + DigitalTwinsInstance. + :vartype created_time: datetime + :param authentication_type: Specifies the authentication type being used + for connecting to the endpoint. Possible values include: 'KeyBased', + 'IdentityBased' + :type authentication_type: str or + ~azure.mgmt.digitaltwins.models.AuthenticationType + :param dead_letter_secret: Dead letter storage secret for key-based + authentication. Will be obfuscated during read. + :type dead_letter_secret: str + :param dead_letter_uri: Dead letter storage URL for identity-based + authentication. + :type dead_letter_uri: str + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + :param topic_endpoint: Required. EventGrid Topic Endpoint + :type topic_endpoint: str + :param access_key1: Required. EventGrid secondary accesskey. Will be + obfuscated during read. + :type access_key1: str + :param access_key2: EventGrid secondary accesskey. Will be obfuscated + during read. + :type access_key2: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + 'endpoint_type': {'required': True}, + 'topic_endpoint': {'required': True}, + 'access_key1': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'dead_letter_secret': {'key': 'deadLetterSecret', 'type': 'str'}, + 'dead_letter_uri': {'key': 'deadLetterUri', 'type': 'str'}, + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'topic_endpoint': {'key': 'TopicEndpoint', 'type': 'str'}, + 'access_key1': {'key': 'accessKey1', 'type': 'str'}, + 'access_key2': {'key': 'accessKey2', 'type': 'str'}, + } + + def __init__(self, *, topic_endpoint: str, access_key1: str, authentication_type=None, dead_letter_secret: str=None, dead_letter_uri: str=None, access_key2: str=None, **kwargs) -> None: + super(EventGrid, self).__init__(authentication_type=authentication_type, dead_letter_secret=dead_letter_secret, dead_letter_uri=dead_letter_uri, **kwargs) + self.topic_endpoint = topic_endpoint + self.access_key1 = access_key1 + self.access_key2 = access_key2 + self.endpoint_type = 'EventGrid' + + +class EventHub(DigitalTwinsEndpointResourceProperties): + """Properties related to EventHub. + + 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: + 'Provisioning', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', + 'Warning', 'Suspending', 'Restoring', 'Moving', 'Disabled' + :vartype provisioning_state: str or + ~azure.mgmt.digitaltwins.models.EndpointProvisioningState + :ivar created_time: Time when the Endpoint was added to + DigitalTwinsInstance. + :vartype created_time: datetime + :param authentication_type: Specifies the authentication type being used + for connecting to the endpoint. Possible values include: 'KeyBased', + 'IdentityBased' + :type authentication_type: str or + ~azure.mgmt.digitaltwins.models.AuthenticationType + :param dead_letter_secret: Dead letter storage secret for key-based + authentication. Will be obfuscated during read. + :type dead_letter_secret: str + :param dead_letter_uri: Dead letter storage URL for identity-based + authentication. + :type dead_letter_uri: str + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + :param connection_string_primary_key: PrimaryConnectionString of the + endpoint for key-based authentication. Will be obfuscated during read. + :type connection_string_primary_key: str + :param connection_string_secondary_key: SecondaryConnectionString of the + endpoint for key-based authentication. Will be obfuscated during read. + :type connection_string_secondary_key: str + :param endpoint_uri: The URL of the EventHub namespace for identity-based + authentication. It must include the protocol sb:// + :type endpoint_uri: str + :param entity_path: The EventHub name in the EventHub namespace for + identity-based authentication. + :type entity_path: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'dead_letter_secret': {'key': 'deadLetterSecret', 'type': 'str'}, + 'dead_letter_uri': {'key': 'deadLetterUri', 'type': 'str'}, + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'connection_string_primary_key': {'key': 'connectionStringPrimaryKey', 'type': 'str'}, + 'connection_string_secondary_key': {'key': 'connectionStringSecondaryKey', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'entity_path': {'key': 'entityPath', 'type': 'str'}, + } + + def __init__(self, *, authentication_type=None, dead_letter_secret: str=None, dead_letter_uri: str=None, connection_string_primary_key: str=None, connection_string_secondary_key: str=None, endpoint_uri: str=None, entity_path: str=None, **kwargs) -> None: + super(EventHub, self).__init__(authentication_type=authentication_type, dead_letter_secret=dead_letter_secret, dead_letter_uri=dead_letter_uri, **kwargs) + self.connection_string_primary_key = connection_string_primary_key + self.connection_string_secondary_key = connection_string_secondary_key + self.endpoint_uri = endpoint_uri + self.entity_path = entity_path + self.endpoint_type = 'EventHub' + + +class GroupIdInformation(Model): + """The group information for creating a private endpoint on Digital Twin. + + 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. + + :param properties: Required. + :type properties: + ~azure.mgmt.digitaltwins.models.GroupIdInformationPropertiesModel + :param id: The resource identifier. + :type id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + """ + + _validation = { + 'properties': {'required': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'GroupIdInformationPropertiesModel'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, properties, id: str=None, **kwargs) -> None: + super(GroupIdInformation, self).__init__(**kwargs) + self.properties = properties + self.id = id + self.name = None + self.type = None + + +class GroupIdInformationProperties(Model): + """The properties for a group information object. + + :param group_id: The group id + :type group_id: str + :param required_members: The required members for a specific group id. + :type required_members: list[str] + :param required_zone_names: The required DNS zones for a specific group + id. + :type required_zone_names: list[str] + """ + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, *, group_id: str=None, required_members=None, required_zone_names=None, **kwargs) -> None: + super(GroupIdInformationProperties, self).__init__(**kwargs) + self.group_id = group_id + self.required_members = required_members + self.required_zone_names = required_zone_names + + +class GroupIdInformationPropertiesModel(GroupIdInformationProperties): + """GroupIdInformationPropertiesModel. + + :param group_id: The group id + :type group_id: str + :param required_members: The required members for a specific group id. + :type required_members: list[str] + :param required_zone_names: The required DNS zones for a specific group + id. + :type required_zone_names: list[str] + """ + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, *, group_id: str=None, required_members=None, required_zone_names=None, **kwargs) -> None: + super(GroupIdInformationPropertiesModel, self).__init__(group_id=group_id, required_members=required_members, required_zone_names=required_zone_names, **kwargs) + + +class GroupIdInformationResponse(Model): + """The available private link resources for a Digital Twin. + + :param value: The list of available private link resources for a Digital + Twin. + :type value: list[~azure.mgmt.digitaltwins.models.GroupIdInformation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GroupIdInformation]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(GroupIdInformationResponse, self).__init__(**kwargs) + self.value = value + + +class Operation(Model): + """DigitalTwins 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 + :param display: Operation properties display + :type display: ~azure.mgmt.digitaltwins.models.OperationDisplay + :ivar origin: The intended executor of the operation. + :vartype origin: str + :ivar is_data_action: If the operation is a data action (for data plane + rbac). + :vartype is_data_action: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + 'is_data_action': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + self.origin = None + self.is_data_action = 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 DigitalTwins + :vartype provider: str + :ivar resource: Resource Type: DigitalTwinsInstances + :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 PrivateEndpointConnection(Model): + """The private endpoint connection of a Digital Twin. + + 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 properties: Required. + :type properties: + ~azure.mgmt.digitaltwins.models.PrivateEndpointConnectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + } + + def __init__(self, *, properties, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class PrivateEndpointConnectionProperties(ConnectionProperties): + """PrivateEndpointConnectionProperties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. Possible values include: + 'Pending', 'Approved', 'Rejected', 'Disconnected' + :vartype provisioning_state: str or + ~azure.mgmt.digitaltwins.models.ConnectionPropertiesProvisioningState + :param private_endpoint: + :type private_endpoint: + ~azure.mgmt.digitaltwins.models.ConnectionPropertiesPrivateEndpoint + :param group_ids: The list of group ids for the private endpoint + connection. + :type group_ids: list[str] + :param private_link_service_connection_state: + :type private_link_service_connection_state: + ~azure.mgmt.digitaltwins.models.ConnectionPropertiesPrivateLinkServiceConnectionState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'privateEndpoint', 'type': 'ConnectionPropertiesPrivateEndpoint'}, + 'group_ids': {'key': 'groupIds', 'type': '[str]'}, + 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'ConnectionPropertiesPrivateLinkServiceConnectionState'}, + } + + def __init__(self, *, private_endpoint=None, group_ids=None, private_link_service_connection_state=None, **kwargs) -> None: + super(PrivateEndpointConnectionProperties, self).__init__(private_endpoint=private_endpoint, group_ids=group_ids, private_link_service_connection_state=private_link_service_connection_state, **kwargs) + + +class PrivateEndpointConnectionsResponse(Model): + """The available private link connections for a Digital Twin. + + :param value: The list of available private link connections for a Digital + Twin. + :type value: + list[~azure.mgmt.digitaltwins.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(PrivateEndpointConnectionsResponse, self).__init__(**kwargs) + self.value = value + + +class ServiceBus(DigitalTwinsEndpointResourceProperties): + """Properties related to ServiceBus. + + 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: + 'Provisioning', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', + 'Warning', 'Suspending', 'Restoring', 'Moving', 'Disabled' + :vartype provisioning_state: str or + ~azure.mgmt.digitaltwins.models.EndpointProvisioningState + :ivar created_time: Time when the Endpoint was added to + DigitalTwinsInstance. + :vartype created_time: datetime + :param authentication_type: Specifies the authentication type being used + for connecting to the endpoint. Possible values include: 'KeyBased', + 'IdentityBased' + :type authentication_type: str or + ~azure.mgmt.digitaltwins.models.AuthenticationType + :param dead_letter_secret: Dead letter storage secret for key-based + authentication. Will be obfuscated during read. + :type dead_letter_secret: str + :param dead_letter_uri: Dead letter storage URL for identity-based + authentication. + :type dead_letter_uri: str + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + :param primary_connection_string: PrimaryConnectionString of the endpoint + for key-based authentication. Will be obfuscated during read. + :type primary_connection_string: str + :param secondary_connection_string: SecondaryConnectionString of the + endpoint for key-based authentication. Will be obfuscated during read. + :type secondary_connection_string: str + :param endpoint_uri: The URL of the ServiceBus namespace for + identity-based authentication. It must include the protocol sb:// + :type endpoint_uri: str + :param entity_path: The ServiceBus Topic name for identity-based + authentication + :type entity_path: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'dead_letter_secret': {'key': 'deadLetterSecret', 'type': 'str'}, + 'dead_letter_uri': {'key': 'deadLetterUri', 'type': 'str'}, + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'}, + 'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'entity_path': {'key': 'entityPath', 'type': 'str'}, + } + + def __init__(self, *, authentication_type=None, dead_letter_secret: str=None, dead_letter_uri: str=None, primary_connection_string: str=None, secondary_connection_string: str=None, endpoint_uri: str=None, entity_path: str=None, **kwargs) -> None: + super(ServiceBus, self).__init__(authentication_type=authentication_type, dead_letter_secret=dead_letter_secret, dead_letter_uri=dead_letter_uri, **kwargs) + self.primary_connection_string = primary_connection_string + self.secondary_connection_string = secondary_connection_string + self.endpoint_uri = endpoint_uri + self.entity_path = entity_path + self.endpoint_type = 'ServiceBus' diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_paged_models.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_paged_models.py new file mode 100644 index 00000000000..d8a87d7af10 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_paged_models.py @@ -0,0 +1,53 @@ +# 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 DigitalTwinsDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`DigitalTwinsDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DigitalTwinsDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(DigitalTwinsDescriptionPaged, self).__init__(*args, **kwargs) +class DigitalTwinsEndpointResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`DigitalTwinsEndpointResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DigitalTwinsEndpointResource]'} + } + + def __init__(self, *args, **kwargs): + + super(DigitalTwinsEndpointResourcePaged, 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/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/__init__.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/__init__.py new file mode 100644 index 00000000000..defbc7f9011 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/__init__.py @@ -0,0 +1,24 @@ +# 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 ._digital_twins_operations import DigitalTwinsOperations +from ._digital_twins_endpoint_operations import DigitalTwinsEndpointOperations +from ._operations import Operations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'DigitalTwinsOperations', + 'DigitalTwinsEndpointOperations', + 'Operations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', +] diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_endpoint_operations.py new file mode 100644 index 00000000000..bb34c4e2ff8 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_endpoint_operations.py @@ -0,0 +1,387 @@ +# 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 DigitalTwinsEndpointOperations(object): + """DigitalTwinsEndpointOperations 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: Version of the DigitalTwinsInstance Management API. Constant value: "2020-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-12-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get DigitalTwinsInstance Endpoints. + + :param resource_group_name: The name of the resource group that + contains the DigitalTwinsInstance. + :type resource_group_name: str + :param resource_name: The name of the DigitalTwinsInstance. + :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: An iterator like instance of DigitalTwinsEndpointResource + :rtype: + ~azure.mgmt.digitaltwins.models.DigitalTwinsEndpointResourcePaged[~azure.mgmt.digitaltwins.models.DigitalTwinsEndpointResource] + :raises: + :class:`ErrorResponseException` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=3, pattern=r'^(?!-)[A-Za-z0-9-]{3,63}(?`. + :return: DigitalTwinsEndpointResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.digitaltwins.models.DigitalTwinsEndpointResource + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=3, pattern=r'^(?!-)[A-Za-z0-9-]{3,63}(? if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.digitaltwins.models.DigitalTwinsEndpointResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.digitaltwins.models.DigitalTwinsEndpointResource]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + endpoint_name=endpoint_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DigitalTwinsEndpointResource', 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.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints/{endpointName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, endpoint_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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=3, pattern=r'^(?!-)[A-Za-z0-9-]{3,63}(? if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.digitaltwins.models.DigitalTwinsEndpointResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.digitaltwins.models.DigitalTwinsEndpointResource]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + endpoint_name=endpoint_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DigitalTwinsEndpointResource', 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints/{endpointName}'} diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_operations.py new file mode 100644 index 00000000000..c6d40566e46 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_operations.py @@ -0,0 +1,607 @@ +# 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 DigitalTwinsOperations(object): + """DigitalTwinsOperations 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: Version of the DigitalTwinsInstance Management API. Constant value: "2020-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-12-01" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get DigitalTwinsInstances resource. + + :param resource_group_name: The name of the resource group that + contains the DigitalTwinsInstance. + :type resource_group_name: str + :param resource_name: The name of the DigitalTwinsInstance. + :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: DigitalTwinsDescription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.digitaltwins.models.DigitalTwinsDescription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=3, pattern=r'^(?!-)[A-Za-z0-9-]{3,63}(? if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.digitaltwins.models.DigitalTwinsDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.digitaltwins.models.DigitalTwinsDescription]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + digital_twins_create=digital_twins_create, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DigitalTwinsDescription', 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.DigitalTwins/digitalTwinsInstances/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_name, digital_twins_patch_description, custom_headers=None, raw=False, **operation_config): + # 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=3, pattern=r'^(?!-)[A-Za-z0-9-]{3,63}(? if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.digitaltwins.models.DigitalTwinsDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.digitaltwins.models.DigitalTwinsDescription]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + digital_twins_patch_description=digital_twins_patch_description, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DigitalTwinsDescription', 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.DigitalTwins/digitalTwinsInstances/{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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=3, pattern=r'^(?!-)[A-Za-z0-9-]{3,63}(? if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.digitaltwins.models.DigitalTwinsDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.digitaltwins.models.DigitalTwinsDescription]] + :raises: + :class:`ErrorResponseException` + """ + 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): + deserialized = self._deserialize('DigitalTwinsDescription', 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get all the DigitalTwinsInstances 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 DigitalTwinsDescription + :rtype: + ~azure.mgmt.digitaltwins.models.DigitalTwinsDescriptionPaged[~azure.mgmt.digitaltwins.models.DigitalTwinsDescription] + :raises: + :class:`ErrorResponseException` + """ + 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.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DigitalTwinsDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DigitalTwins/digitalTwinsInstances'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all the DigitalTwinsInstances in a resource group. + + :param resource_group_name: The name of the resource group that + contains the DigitalTwinsInstance. + :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 DigitalTwinsDescription + :rtype: + ~azure.mgmt.digitaltwins.models.DigitalTwinsDescriptionPaged[~azure.mgmt.digitaltwins.models.DigitalTwinsDescription] + :raises: + :class:`ErrorResponseException` + """ + 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) + } + 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.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DigitalTwinsDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances'} + + def check_name_availability( + self, location, name, custom_headers=None, raw=False, **operation_config): + """Check if a DigitalTwinsInstance name is available. + + :param location: Location of DigitalTwinsInstance. + :type location: str + :param name: Resource name. + :type 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: CheckNameResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.digitaltwins.models.CheckNameResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + digital_twins_instance_check_name = models.CheckNameRequest(name=name) + + # 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'), + 'location': self._serialize.url("location", location, 'str', 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(digital_twins_instance_check_name, 'CheckNameRequest') + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckNameResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DigitalTwins/locations/{location}/checkNameAvailability'} diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_operations.py new file mode 100644 index 00000000000..863f52a198c --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/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: Version of the DigitalTwinsInstance Management API. Constant value: "2020-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-12-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available DigitalTwins 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.digitaltwins.models.OperationPaged[~azure.mgmt.digitaltwins.models.Operation] + :raises: + :class:`ErrorResponseException` + """ + 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.ErrorResponseException(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.DigitalTwins/operations'} diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_private_endpoint_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_private_endpoint_connections_operations.py new file mode 100644 index 00000000000..b36c2c3645d --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,365 @@ +# 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 PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations 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: Version of the DigitalTwinsInstance Management API. Constant value: "2020-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-12-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """List private endpoint connection properties. + + :param resource_group_name: The name of the resource group that + contains the DigitalTwinsInstance. + :type resource_group_name: str + :param resource_name: The name of the DigitalTwinsInstance. + :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: PrivateEndpointConnectionsResponse or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.digitaltwins.models.PrivateEndpointConnectionsResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=3, pattern=r'^(?!-)[A-Za-z0-9-]{3,63}(?`. + :return: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.digitaltwins.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=3, pattern=r'^(?!-)[A-Za-z0-9-]{3,63}(? if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_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.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, **operation_config): + private_endpoint_connection = models.PrivateEndpointConnection(properties=properties) + + # 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=3, pattern=r'^(?!-)[A-Za-z0-9-]{3,63}(? if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.digitaltwins.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.digitaltwins.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateEndpointConnection', 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.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_private_link_resources_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_private_link_resources_operations.py new file mode 100644 index 00000000000..abd0e19f02e --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_private_link_resources_operations.py @@ -0,0 +1,164 @@ +# 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 PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations 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: Version of the DigitalTwinsInstance Management API. Constant value: "2020-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-12-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """List private link resources for given Digital Twin. + + :param resource_group_name: The name of the resource group that + contains the DigitalTwinsInstance. + :type resource_group_name: str + :param resource_name: The name of the DigitalTwinsInstance. + :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: GroupIdInformationResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.digitaltwins.models.GroupIdInformationResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=3, pattern=r'^(?!-)[A-Za-z0-9-]{3,63}(?`. + :return: GroupIdInformation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.digitaltwins.models.GroupIdInformation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=3, pattern=r'^(?!-)[A-Za-z0-9-]{3,63}(?