From ad598884875e3f801352c9a2c1f7228fd473a6f1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 07:24:11 +0000 Subject: [PATCH] CodeGen from PR 16949 in Azure/azure-rest-api-specs Track2 modify readme.go.md 6 (#16949) * Track2 modify readme.go.md 6 * mariadb derective description --- .../CHANGELOG.md | 5 + .../MANIFEST.in | 6 + .../README.md | 27 + .../_meta.json | 8 + .../azure/__init__.py | 1 + .../azure/mgmt/__init__.py | 1 + .../m365securityandcompliance/__init__.py | 19 + .../_configuration.py | 48 + .../_m365_security_and_compliance_client.py | 149 ++ .../models/__init__.py | 140 ++ ...65_security_and_compliance_client_enums.py | 76 + .../models/_models.py | 1278 +++++++++++++++++ .../models/_models_py3.py | 1278 +++++++++++++++++ .../models/_paged_models.py | 118 ++ .../operations/__init__.py | 56 + .../_operation_results_operations.py | 100 ++ .../operations/_operations.py | 101 ++ ...endpoint_connections_adt_api_operations.py | 374 +++++ ...te_endpoint_connections_comp_operations.py | 374 +++++ ...endpoint_connections_for_edm_operations.py | 374 +++++ ...nections_for_mip_policy_sync_operations.py | 374 +++++ ...nnections_for_scc_powershell_operations.py | 374 +++++ ...ate_endpoint_connections_sec_operations.py | 374 +++++ ...ivate_link_resources_adt_api_operations.py | 167 +++ ..._private_link_resources_comp_operations.py | 167 +++ ...esources_for_mip_policy_sync_operations.py | 167 +++ ...resources_for_scc_powershell_operations.py | 167 +++ .../_private_link_resources_operations.py | 167 +++ .../_private_link_resources_sec_operations.py | 167 +++ ...link_services_for_edm_upload_operations.py | 460 ++++++ ...s_for_m365_compliance_center_operations.py | 541 +++++++ ...ces_for_m365_security_center_operations.py | 541 +++++++ ...services_for_mip_policy_sync_operations.py | 539 +++++++ ...o365_management_activity_api_operations.py | 543 +++++++ ..._services_for_scc_powershell_operations.py | 539 +++++++ .../operations/_services_operations.py | 120 ++ .../mgmt/m365securityandcompliance/version.py | 13 + .../sdk_packaging.toml | 8 + .../setup.cfg | 2 + .../setup.py | 91 ++ sdk/m365securityandcompliance/ci.yml | 35 + 41 files changed, 10089 insertions(+) create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/CHANGELOG.md create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/MANIFEST.in create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/README.md create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/_meta.json create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/__init__.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/__init__.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/__init__.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/_configuration.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/_m365_security_and_compliance_client.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/__init__.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_m365_security_and_compliance_client_enums.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_models.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_models_py3.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_paged_models.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/__init__.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_operation_results_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_adt_api_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_comp_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_edm_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_mip_policy_sync_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_scc_powershell_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_sec_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_adt_api_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_comp_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_for_mip_policy_sync_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_for_scc_powershell_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_sec_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_edm_upload_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_m365_compliance_center_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_m365_security_center_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_mip_policy_sync_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_o365_management_activity_api_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_scc_powershell_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_services_operations.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/version.py create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/sdk_packaging.toml create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/setup.cfg create mode 100644 sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/setup.py create mode 100644 sdk/m365securityandcompliance/ci.yml diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/CHANGELOG.md b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/CHANGELOG.md new file mode 100644 index 0000000000000..578ed6acf4796 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/MANIFEST.in b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/MANIFEST.in new file mode 100644 index 0000000000000..3a9b6517412bc --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/MANIFEST.in @@ -0,0 +1,6 @@ +include _meta.json +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/README.md b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/README.md new file mode 100644 index 0000000000000..72195f6b79769 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-m365securityandcompliance%2FREADME.png) diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/_meta.json b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/_meta.json new file mode 100644 index 0000000000000..75e7ccd3abb74 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "e8c6db17dc13a00155936dcaeacf4da0a1fabf77", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/m365securityandcompliance/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/m365securityandcompliance/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/__init__.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/__init__.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/__init__.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/__init__.py new file mode 100644 index 0000000000000..8bdc73df04784 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/__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 M365SecurityAndComplianceClientConfiguration +from ._m365_security_and_compliance_client import M365SecurityAndComplianceClient +__all__ = ['M365SecurityAndComplianceClient', 'M365SecurityAndComplianceClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/_configuration.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/_configuration.py new file mode 100644 index 0000000000000..7f77893deef1d --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/_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 M365SecurityAndComplianceClientConfiguration(AzureConfiguration): + """Configuration for M365SecurityAndComplianceClient + 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(M365SecurityAndComplianceClientConfiguration, 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-m365securityandcompliance/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/_m365_security_and_compliance_client.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/_m365_security_and_compliance_client.py new file mode 100644 index 0000000000000..2a8905d7cfa50 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/_m365_security_and_compliance_client.py @@ -0,0 +1,149 @@ +# 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 M365SecurityAndComplianceClientConfiguration +from .operations import Operations +from .operations import OperationResultsOperations +from .operations import PrivateLinkServicesForEDMUploadOperations +from .operations import ServicesOperations +from .operations import PrivateEndpointConnectionsForEDMOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateLinkServicesForM365ComplianceCenterOperations +from .operations import PrivateEndpointConnectionsCompOperations +from .operations import PrivateLinkResourcesCompOperations +from .operations import PrivateLinkServicesForM365SecurityCenterOperations +from .operations import PrivateEndpointConnectionsSecOperations +from .operations import PrivateLinkResourcesSecOperations +from .operations import PrivateLinkServicesForO365ManagementActivityAPIOperations +from .operations import PrivateEndpointConnectionsAdtAPIOperations +from .operations import PrivateLinkResourcesAdtAPIOperations +from .operations import PrivateLinkServicesForSCCPowershellOperations +from .operations import PrivateEndpointConnectionsForSCCPowershellOperations +from .operations import PrivateLinkResourcesForSCCPowershellOperations +from .operations import PrivateLinkServicesForMIPPolicySyncOperations +from .operations import PrivateEndpointConnectionsForMIPPolicySyncOperations +from .operations import PrivateLinkResourcesForMIPPolicySyncOperations +from . import models + + +class M365SecurityAndComplianceClient(SDKClient): + """Security And Compliance Client + + :ivar config: Configuration for client. + :vartype config: M365SecurityAndComplianceClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.m365securityandcompliance.operations.Operations + :ivar operation_results: OperationResults operations + :vartype operation_results: azure.mgmt.m365securityandcompliance.operations.OperationResultsOperations + :ivar private_link_services_for_edm_upload: PrivateLinkServicesForEDMUpload operations + :vartype private_link_services_for_edm_upload: azure.mgmt.m365securityandcompliance.operations.PrivateLinkServicesForEDMUploadOperations + :ivar services: Services operations + :vartype services: azure.mgmt.m365securityandcompliance.operations.ServicesOperations + :ivar private_endpoint_connections_for_edm: PrivateEndpointConnectionsForEDM operations + :vartype private_endpoint_connections_for_edm: azure.mgmt.m365securityandcompliance.operations.PrivateEndpointConnectionsForEDMOperations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.m365securityandcompliance.operations.PrivateLinkResourcesOperations + :ivar private_link_services_for_m365_compliance_center: PrivateLinkServicesForM365ComplianceCenter operations + :vartype private_link_services_for_m365_compliance_center: azure.mgmt.m365securityandcompliance.operations.PrivateLinkServicesForM365ComplianceCenterOperations + :ivar private_endpoint_connections_comp: PrivateEndpointConnectionsComp operations + :vartype private_endpoint_connections_comp: azure.mgmt.m365securityandcompliance.operations.PrivateEndpointConnectionsCompOperations + :ivar private_link_resources_comp: PrivateLinkResourcesComp operations + :vartype private_link_resources_comp: azure.mgmt.m365securityandcompliance.operations.PrivateLinkResourcesCompOperations + :ivar private_link_services_for_m365_security_center: PrivateLinkServicesForM365SecurityCenter operations + :vartype private_link_services_for_m365_security_center: azure.mgmt.m365securityandcompliance.operations.PrivateLinkServicesForM365SecurityCenterOperations + :ivar private_endpoint_connections_sec: PrivateEndpointConnectionsSec operations + :vartype private_endpoint_connections_sec: azure.mgmt.m365securityandcompliance.operations.PrivateEndpointConnectionsSecOperations + :ivar private_link_resources_sec: PrivateLinkResourcesSec operations + :vartype private_link_resources_sec: azure.mgmt.m365securityandcompliance.operations.PrivateLinkResourcesSecOperations + :ivar private_link_services_for_o365_management_activity_api: PrivateLinkServicesForO365ManagementActivityAPI operations + :vartype private_link_services_for_o365_management_activity_api: azure.mgmt.m365securityandcompliance.operations.PrivateLinkServicesForO365ManagementActivityAPIOperations + :ivar private_endpoint_connections_adt_api: PrivateEndpointConnectionsAdtAPI operations + :vartype private_endpoint_connections_adt_api: azure.mgmt.m365securityandcompliance.operations.PrivateEndpointConnectionsAdtAPIOperations + :ivar private_link_resources_adt_api: PrivateLinkResourcesAdtAPI operations + :vartype private_link_resources_adt_api: azure.mgmt.m365securityandcompliance.operations.PrivateLinkResourcesAdtAPIOperations + :ivar private_link_services_for_scc_powershell: PrivateLinkServicesForSCCPowershell operations + :vartype private_link_services_for_scc_powershell: azure.mgmt.m365securityandcompliance.operations.PrivateLinkServicesForSCCPowershellOperations + :ivar private_endpoint_connections_for_scc_powershell: PrivateEndpointConnectionsForSCCPowershell operations + :vartype private_endpoint_connections_for_scc_powershell: azure.mgmt.m365securityandcompliance.operations.PrivateEndpointConnectionsForSCCPowershellOperations + :ivar private_link_resources_for_scc_powershell: PrivateLinkResourcesForSCCPowershell operations + :vartype private_link_resources_for_scc_powershell: azure.mgmt.m365securityandcompliance.operations.PrivateLinkResourcesForSCCPowershellOperations + :ivar private_link_services_for_mip_policy_sync: PrivateLinkServicesForMIPPolicySync operations + :vartype private_link_services_for_mip_policy_sync: azure.mgmt.m365securityandcompliance.operations.PrivateLinkServicesForMIPPolicySyncOperations + :ivar private_endpoint_connections_for_mip_policy_sync: PrivateEndpointConnectionsForMIPPolicySync operations + :vartype private_endpoint_connections_for_mip_policy_sync: azure.mgmt.m365securityandcompliance.operations.PrivateEndpointConnectionsForMIPPolicySyncOperations + :ivar private_link_resources_for_mip_policy_sync: PrivateLinkResourcesForMIPPolicySync operations + :vartype private_link_resources_for_mip_policy_sync: azure.mgmt.m365securityandcompliance.operations.PrivateLinkResourcesForMIPPolicySyncOperations + + :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 = M365SecurityAndComplianceClientConfiguration(credentials, subscription_id, base_url) + super(M365SecurityAndComplianceClient, 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 = '2021-03-25-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.operation_results = OperationResultsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_services_for_edm_upload = PrivateLinkServicesForEDMUploadOperations( + self._client, self.config, self._serialize, self._deserialize) + self.services = ServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections_for_edm = PrivateEndpointConnectionsForEDMOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_services_for_m365_compliance_center = PrivateLinkServicesForM365ComplianceCenterOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections_comp = PrivateEndpointConnectionsCompOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources_comp = PrivateLinkResourcesCompOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_services_for_m365_security_center = PrivateLinkServicesForM365SecurityCenterOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections_sec = PrivateEndpointConnectionsSecOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources_sec = PrivateLinkResourcesSecOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_services_for_o365_management_activity_api = PrivateLinkServicesForO365ManagementActivityAPIOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections_adt_api = PrivateEndpointConnectionsAdtAPIOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources_adt_api = PrivateLinkResourcesAdtAPIOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_services_for_scc_powershell = PrivateLinkServicesForSCCPowershellOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections_for_scc_powershell = PrivateEndpointConnectionsForSCCPowershellOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources_for_scc_powershell = PrivateLinkResourcesForSCCPowershellOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_services_for_mip_policy_sync = PrivateLinkServicesForMIPPolicySyncOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections_for_mip_policy_sync = PrivateEndpointConnectionsForMIPPolicySyncOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources_for_mip_policy_sync = PrivateLinkResourcesForMIPPolicySyncOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/__init__.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/__init__.py new file mode 100644 index 0000000000000..9a04ab74a080d --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/__init__.py @@ -0,0 +1,140 @@ +# 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 AzureEntityResource + from ._models_py3 import ErrorDetails, ErrorDetailsException + from ._models_py3 import ErrorDetailsInternal + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationResultsDescription + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import PrivateLinkServicesForEDMUploadDescription + from ._models_py3 import PrivateLinkServicesForM365ComplianceCenterDescription + from ._models_py3 import PrivateLinkServicesForM365SecurityCenterDescription + from ._models_py3 import PrivateLinkServicesForMIPPolicySyncDescription + from ._models_py3 import PrivateLinkServicesForO365ManagementActivityAPIDescription + from ._models_py3 import PrivateLinkServicesForSCCPowershellDescription + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import ServiceAccessPolicyEntry + from ._models_py3 import ServiceAuthenticationConfigurationInfo + from ._models_py3 import ServiceCorsConfigurationInfo + from ._models_py3 import ServiceCosmosDbConfigurationInfo + from ._models_py3 import ServiceExportConfigurationInfo + from ._models_py3 import ServicesPatchDescription + from ._models_py3 import ServicesProperties + from ._models_py3 import ServicesResource + from ._models_py3 import ServicesResourceIdentity + from ._models_py3 import SystemData + from ._models_py3 import TrackedResource +except (SyntaxError, ImportError): + from ._models import AzureEntityResource + from ._models import ErrorDetails, ErrorDetailsException + from ._models import ErrorDetailsInternal + from ._models import Operation + from ._models import OperationDisplay + from ._models import OperationResultsDescription + from ._models import PrivateEndpoint + from ._models import PrivateEndpointConnection + from ._models import PrivateLinkResource + from ._models import PrivateLinkResourceListResult + from ._models import PrivateLinkServiceConnectionState + from ._models import PrivateLinkServicesForEDMUploadDescription + from ._models import PrivateLinkServicesForM365ComplianceCenterDescription + from ._models import PrivateLinkServicesForM365SecurityCenterDescription + from ._models import PrivateLinkServicesForMIPPolicySyncDescription + from ._models import PrivateLinkServicesForO365ManagementActivityAPIDescription + from ._models import PrivateLinkServicesForSCCPowershellDescription + from ._models import ProxyResource + from ._models import Resource + from ._models import ServiceAccessPolicyEntry + from ._models import ServiceAuthenticationConfigurationInfo + from ._models import ServiceCorsConfigurationInfo + from ._models import ServiceCosmosDbConfigurationInfo + from ._models import ServiceExportConfigurationInfo + from ._models import ServicesPatchDescription + from ._models import ServicesProperties + from ._models import ServicesResource + from ._models import ServicesResourceIdentity + from ._models import SystemData + from ._models import TrackedResource +from ._paged_models import OperationPaged +from ._paged_models import PrivateEndpointConnectionPaged +from ._paged_models import PrivateLinkServicesForEDMUploadDescriptionPaged +from ._paged_models import PrivateLinkServicesForM365ComplianceCenterDescriptionPaged +from ._paged_models import PrivateLinkServicesForM365SecurityCenterDescriptionPaged +from ._paged_models import PrivateLinkServicesForMIPPolicySyncDescriptionPaged +from ._paged_models import PrivateLinkServicesForO365ManagementActivityAPIDescriptionPaged +from ._paged_models import PrivateLinkServicesForSCCPowershellDescriptionPaged +from ._m365_security_and_compliance_client_enums import ( + ProvisioningState, + CreatedByType, + PrivateEndpointServiceConnectionStatus, + PrivateEndpointConnectionProvisioningState, + PublicNetworkAccess, + Kind, + ManagedServiceIdentityType, + OperationResultStatus, +) + +__all__ = [ + 'AzureEntityResource', + 'ErrorDetails', 'ErrorDetailsException', + 'ErrorDetailsInternal', + 'Operation', + 'OperationDisplay', + 'OperationResultsDescription', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'PrivateLinkServicesForEDMUploadDescription', + 'PrivateLinkServicesForM365ComplianceCenterDescription', + 'PrivateLinkServicesForM365SecurityCenterDescription', + 'PrivateLinkServicesForMIPPolicySyncDescription', + 'PrivateLinkServicesForO365ManagementActivityAPIDescription', + 'PrivateLinkServicesForSCCPowershellDescription', + 'ProxyResource', + 'Resource', + 'ServiceAccessPolicyEntry', + 'ServiceAuthenticationConfigurationInfo', + 'ServiceCorsConfigurationInfo', + 'ServiceCosmosDbConfigurationInfo', + 'ServiceExportConfigurationInfo', + 'ServicesPatchDescription', + 'ServicesProperties', + 'ServicesResource', + 'ServicesResourceIdentity', + 'SystemData', + 'TrackedResource', + 'OperationPaged', + 'PrivateLinkServicesForEDMUploadDescriptionPaged', + 'PrivateEndpointConnectionPaged', + 'PrivateLinkServicesForM365ComplianceCenterDescriptionPaged', + 'PrivateLinkServicesForM365SecurityCenterDescriptionPaged', + 'PrivateLinkServicesForO365ManagementActivityAPIDescriptionPaged', + 'PrivateLinkServicesForSCCPowershellDescriptionPaged', + 'PrivateLinkServicesForMIPPolicySyncDescriptionPaged', + 'ProvisioningState', + 'CreatedByType', + 'PrivateEndpointServiceConnectionStatus', + 'PrivateEndpointConnectionProvisioningState', + 'PublicNetworkAccess', + 'Kind', + 'ManagedServiceIdentityType', + 'OperationResultStatus', +] diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_m365_security_and_compliance_client_enums.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_m365_security_and_compliance_client_enums.py new file mode 100644 index 0000000000000..c2a87102cda7c --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_m365_security_and_compliance_client_enums.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ProvisioningState(str, Enum): + + deleting = "Deleting" + succeeded = "Succeeded" + creating = "Creating" + accepted = "Accepted" + verifying = "Verifying" + updating = "Updating" + failed = "Failed" + canceled = "Canceled" + deprovisioned = "Deprovisioned" + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + +class PrivateEndpointServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + + +class PrivateEndpointConnectionProvisioningState(str, Enum): + + succeeded = "Succeeded" + creating = "Creating" + deleting = "Deleting" + failed = "Failed" + + +class PublicNetworkAccess(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class Kind(str, Enum): + + fhir = "fhir" + fhir_stu3 = "fhir-Stu3" + fhir_r4 = "fhir-R4" + + +class ManagedServiceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + none = "None" + + +class OperationResultStatus(str, Enum): + + canceled = "Canceled" + succeeded = "Succeeded" + failed = "Failed" + requested = "Requested" + running = "Running" diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_models.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_models.py new file mode 100644 index 0000000000000..c1df5d2d1d1ad --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_models.py @@ -0,0 +1,1278 @@ +# 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 Resource(Model): + """Resource. + + Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorDetails(Model): + """Error details. + + :param error: Object containing error details. + :type error: + ~azure.mgmt.m365securityandcompliance.models.ErrorDetailsInternal + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetailsInternal'}, + } + + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorDetailsException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDetails'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) + + +class ErrorDetailsInternal(Model): + """Error details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The target of the particular error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetailsInternal, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + + +class Operation(Model): + """Service REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{read | write | action | + delete} + :vartype name: str + :ivar is_data_action: Indicates whether the operation is a data action + :vartype is_data_action: bool + :ivar origin: Default value is 'user,system'. + :vartype origin: str + :ivar display: The information displayed about the operation. + :vartype display: + ~azure.mgmt.m365securityandcompliance.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.is_data_action = None + self.origin = None + self.display = None + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.M365SecurityAndCompliance + :vartype provider: str + :ivar resource: Resource Type: Services + :vartype resource: str + :ivar operation: Name of the operation + :vartype operation: str + :ivar description: Friendly description for the operation, + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationResultsDescription(Model): + """The properties indicating the operation result of an operation on a + service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the operation returned. + :vartype id: str + :ivar name: The name of the operation result. + :vartype name: str + :ivar status: The status of the operation being performed. Possible values + include: 'Canceled', 'Succeeded', 'Failed', 'Requested', 'Running' + :vartype status: str or + ~azure.mgmt.m365securityandcompliance.models.OperationResultStatus + :ivar start_time: The time that the operation was started. + :vartype start_time: str + :param properties: Additional properties of the operation result. + :type properties: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(OperationResultsDescription, self).__init__(**kwargs) + self.id = None + self.name = None + self.status = None + self.start_time = None + self.properties = kwargs.get('properties', None) + + +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :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 PrivateEndpointConnection(Resource): + """The Private Endpoint Connection 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param private_endpoint: The resource of private end point. + :type private_endpoint: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.system_data = kwargs.get('system_data', None) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResource, self).__init__(**kwargs) + self.system_data = kwargs.get('system_data', None) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourceListResult(Model): + """A list of private link resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: Array of private link resources + :type value: + list[~azure.mgmt.m365securityandcompliance.models.PrivateLinkResource] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class ServicesResource(Model): + """The common properties of a service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + } + + def __init__(self, **kwargs): + super(ServicesResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = kwargs.get('system_data', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.etag = kwargs.get('etag', None) + self.identity = kwargs.get('identity', None) + + +class PrivateLinkServicesForEDMUploadDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServicesForEDMUploadDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class PrivateLinkServicesForM365ComplianceCenterDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServicesForM365ComplianceCenterDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class PrivateLinkServicesForM365SecurityCenterDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServicesForM365SecurityCenterDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class PrivateLinkServicesForMIPPolicySyncDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServicesForMIPPolicySyncDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class PrivateLinkServicesForO365ManagementActivityAPIDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServicesForO365ManagementActivityAPIDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class PrivateLinkServicesForSCCPowershellDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServicesForSCCPowershellDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ProxyResource(Resource): + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class ServiceAccessPolicyEntry(Model): + """An access policy entry. + + All required parameters must be populated in order to send to Azure. + + :param object_id: Required. An Azure AD object ID (User or Apps) that is + allowed access to the FHIR service. + :type object_id: str + """ + + _validation = { + 'object_id': {'required': True, 'pattern': r'^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$'}, + } + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceAccessPolicyEntry, self).__init__(**kwargs) + self.object_id = kwargs.get('object_id', None) + + +class ServiceAuthenticationConfigurationInfo(Model): + """Authentication configuration information. + + :param authority: The authority url for the service + :type authority: str + :param audience: The audience url for the service + :type audience: str + :param smart_proxy_enabled: If the SMART on FHIR proxy is enabled + :type smart_proxy_enabled: bool + """ + + _attribute_map = { + 'authority': {'key': 'authority', 'type': 'str'}, + 'audience': {'key': 'audience', 'type': 'str'}, + 'smart_proxy_enabled': {'key': 'smartProxyEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ServiceAuthenticationConfigurationInfo, self).__init__(**kwargs) + self.authority = kwargs.get('authority', None) + self.audience = kwargs.get('audience', None) + self.smart_proxy_enabled = kwargs.get('smart_proxy_enabled', None) + + +class ServiceCorsConfigurationInfo(Model): + """The settings for the CORS configuration of the service instance. + + :param origins: The origins to be allowed via CORS. + :type origins: list[str] + :param headers: The headers to be allowed via CORS. + :type headers: list[str] + :param methods: The methods to be allowed via CORS. + :type methods: list[str] + :param max_age: The max age to be allowed via CORS. + :type max_age: long + :param allow_credentials: If credentials are allowed via CORS. + :type allow_credentials: bool + """ + + _validation = { + 'max_age': {'maximum': 99999, 'minimum': 0}, + } + + _attribute_map = { + 'origins': {'key': 'origins', 'type': '[str]'}, + 'headers': {'key': 'headers', 'type': '[str]'}, + 'methods': {'key': 'methods', 'type': '[str]'}, + 'max_age': {'key': 'maxAge', 'type': 'long'}, + 'allow_credentials': {'key': 'allowCredentials', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ServiceCorsConfigurationInfo, self).__init__(**kwargs) + self.origins = kwargs.get('origins', None) + self.headers = kwargs.get('headers', None) + self.methods = kwargs.get('methods', None) + self.max_age = kwargs.get('max_age', None) + self.allow_credentials = kwargs.get('allow_credentials', None) + + +class ServiceCosmosDbConfigurationInfo(Model): + """The settings for the Cosmos DB database backing the service. + + :param offer_throughput: The provisioned throughput for the backing + database. + :type offer_throughput: long + :param key_vault_key_uri: The URI of the customer-managed key for the + backing database. + :type key_vault_key_uri: str + """ + + _validation = { + 'offer_throughput': {'maximum': 10000, 'minimum': 400}, + } + + _attribute_map = { + 'offer_throughput': {'key': 'offerThroughput', 'type': 'long'}, + 'key_vault_key_uri': {'key': 'keyVaultKeyUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceCosmosDbConfigurationInfo, self).__init__(**kwargs) + self.offer_throughput = kwargs.get('offer_throughput', None) + self.key_vault_key_uri = kwargs.get('key_vault_key_uri', None) + + +class ServiceExportConfigurationInfo(Model): + """Export operation configuration information. + + :param storage_account_name: The name of the default export storage + account. + :type storage_account_name: str + """ + + _attribute_map = { + 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceExportConfigurationInfo, self).__init__(**kwargs) + self.storage_account_name = kwargs.get('storage_account_name', None) + + +class ServicesPatchDescription(Model): + """The description of the service. + + :param tags: Instance tags + :type tags: dict[str, str] + :param public_network_access: Control permission for data plane traffic + coming from public networks while private endpoint is enabled. Possible + values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.m365securityandcompliance.models.PublicNetworkAccess + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServicesPatchDescription, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.public_network_access = kwargs.get('public_network_access', None) + + +class ServicesProperties(Model): + """The properties of a service instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. Possible values include: + 'Deleting', 'Succeeded', 'Creating', 'Accepted', 'Verifying', 'Updating', + 'Failed', 'Canceled', 'Deprovisioned' + :vartype provisioning_state: str or + ~azure.mgmt.m365securityandcompliance.models.ProvisioningState + :param access_policies: The access policies of the service instance. + :type access_policies: + list[~azure.mgmt.m365securityandcompliance.models.ServiceAccessPolicyEntry] + :param cosmos_db_configuration: The settings for the Cosmos DB database + backing the service. + :type cosmos_db_configuration: + ~azure.mgmt.m365securityandcompliance.models.ServiceCosmosDbConfigurationInfo + :param authentication_configuration: The authentication configuration for + the service instance. + :type authentication_configuration: + ~azure.mgmt.m365securityandcompliance.models.ServiceAuthenticationConfigurationInfo + :param cors_configuration: The settings for the CORS configuration of the + service instance. + :type cors_configuration: + ~azure.mgmt.m365securityandcompliance.models.ServiceCorsConfigurationInfo + :param export_configuration: The settings for the export operation of the + service instance. + :type export_configuration: + ~azure.mgmt.m365securityandcompliance.models.ServiceExportConfigurationInfo + :param private_endpoint_connections: The list of private endpoint + connections that are set up for this resource. + :type private_endpoint_connections: + list[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + :param public_network_access: Control permission for data plane traffic + coming from public networks while private endpoint is enabled. Possible + values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.m365securityandcompliance.models.PublicNetworkAccess + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[ServiceAccessPolicyEntry]'}, + 'cosmos_db_configuration': {'key': 'cosmosDbConfiguration', 'type': 'ServiceCosmosDbConfigurationInfo'}, + 'authentication_configuration': {'key': 'authenticationConfiguration', 'type': 'ServiceAuthenticationConfigurationInfo'}, + 'cors_configuration': {'key': 'corsConfiguration', 'type': 'ServiceCorsConfigurationInfo'}, + 'export_configuration': {'key': 'exportConfiguration', 'type': 'ServiceExportConfigurationInfo'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServicesProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.access_policies = kwargs.get('access_policies', None) + self.cosmos_db_configuration = kwargs.get('cosmos_db_configuration', None) + self.authentication_configuration = kwargs.get('authentication_configuration', None) + self.cors_configuration = kwargs.get('cors_configuration', None) + self.export_configuration = kwargs.get('export_configuration', None) + self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) + self.public_network_access = kwargs.get('public_network_access', None) + + +class ServicesResourceIdentity(Model): + """Setting indicating whether the service has a managed identity associated + with it. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of the resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the resource. + :vartype tenant_id: str + :param type: Type of identity being specified, currently SystemAssigned + and None are allowed. Possible values include: 'SystemAssigned', 'None' + :type type: str or + ~azure.mgmt.m365securityandcompliance.models.ManagedServiceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServicesResourceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.m365securityandcompliance.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.m365securityandcompliance.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TrackedResource(Resource): + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_models_py3.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_models_py3.py new file mode 100644 index 0000000000000..4f2e02b768800 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_models_py3.py @@ -0,0 +1,1278 @@ +# 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 Resource(Model): + """Resource. + + Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + '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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorDetails(Model): + """Error details. + + :param error: Object containing error details. + :type error: + ~azure.mgmt.m365securityandcompliance.models.ErrorDetailsInternal + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetailsInternal'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.error = error + + +class ErrorDetailsException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDetails'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) + + +class ErrorDetailsInternal(Model): + """Error details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The target of the particular error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetailsInternal, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + + +class Operation(Model): + """Service REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{read | write | action | + delete} + :vartype name: str + :ivar is_data_action: Indicates whether the operation is a data action + :vartype is_data_action: bool + :ivar origin: Default value is 'user,system'. + :vartype origin: str + :ivar display: The information displayed about the operation. + :vartype display: + ~azure.mgmt.m365securityandcompliance.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.is_data_action = None + self.origin = None + self.display = None + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.M365SecurityAndCompliance + :vartype provider: str + :ivar resource: Resource Type: Services + :vartype resource: str + :ivar operation: Name of the operation + :vartype operation: str + :ivar description: Friendly description for the operation, + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationResultsDescription(Model): + """The properties indicating the operation result of an operation on a + service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the operation returned. + :vartype id: str + :ivar name: The name of the operation result. + :vartype name: str + :ivar status: The status of the operation being performed. Possible values + include: 'Canceled', 'Succeeded', 'Failed', 'Requested', 'Running' + :vartype status: str or + ~azure.mgmt.m365securityandcompliance.models.OperationResultStatus + :ivar start_time: The time that the operation was started. + :vartype start_time: str + :param properties: Additional properties of the operation result. + :type properties: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(OperationResultsDescription, self).__init__(**kwargs) + self.id = None + self.name = None + self.status = None + self.start_time = None + self.properties = properties + + +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :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 PrivateEndpointConnection(Resource): + """The Private Endpoint Connection 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param private_endpoint: The resource of private end point. + :type private_endpoint: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, private_link_service_connection_state, system_data=None, private_endpoint=None, provisioning_state=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.system_data = system_data + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = provisioning_state + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, *, system_data=None, required_zone_names=None, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(**kwargs) + self.system_data = system_data + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourceListResult(Model): + """A list of private link resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: Array of private link resources + :type value: + list[~azure.mgmt.m365securityandcompliance.models.PrivateLinkResource] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status=None, description: str=None, actions_required: str=None, **kwargs) -> None: + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class ServicesResource(Model): + """The common properties of a service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + } + + def __init__(self, *, kind, location: str, system_data=None, tags=None, etag: str=None, identity=None, **kwargs) -> None: + super(ServicesResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = system_data + self.kind = kind + self.location = location + self.tags = tags + self.etag = etag + self.identity = identity + + +class PrivateLinkServicesForEDMUploadDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, *, kind, location: str, system_data=None, tags=None, etag: str=None, identity=None, properties=None, **kwargs) -> None: + super(PrivateLinkServicesForEDMUploadDescription, self).__init__(system_data=system_data, kind=kind, location=location, tags=tags, etag=etag, identity=identity, **kwargs) + self.properties = properties + + +class PrivateLinkServicesForM365ComplianceCenterDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, *, kind, location: str, system_data=None, tags=None, etag: str=None, identity=None, properties=None, **kwargs) -> None: + super(PrivateLinkServicesForM365ComplianceCenterDescription, self).__init__(system_data=system_data, kind=kind, location=location, tags=tags, etag=etag, identity=identity, **kwargs) + self.properties = properties + + +class PrivateLinkServicesForM365SecurityCenterDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, *, kind, location: str, system_data=None, tags=None, etag: str=None, identity=None, properties=None, **kwargs) -> None: + super(PrivateLinkServicesForM365SecurityCenterDescription, self).__init__(system_data=system_data, kind=kind, location=location, tags=tags, etag=etag, identity=identity, **kwargs) + self.properties = properties + + +class PrivateLinkServicesForMIPPolicySyncDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, *, kind, location: str, system_data=None, tags=None, etag: str=None, identity=None, properties=None, **kwargs) -> None: + super(PrivateLinkServicesForMIPPolicySyncDescription, self).__init__(system_data=system_data, kind=kind, location=location, tags=tags, etag=etag, identity=identity, **kwargs) + self.properties = properties + + +class PrivateLinkServicesForO365ManagementActivityAPIDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, *, kind, location: str, system_data=None, tags=None, etag: str=None, identity=None, properties=None, **kwargs) -> None: + super(PrivateLinkServicesForO365ManagementActivityAPIDescription, self).__init__(system_data=system_data, kind=kind, location=location, tags=tags, etag=etag, identity=identity, **kwargs) + self.properties = properties + + +class PrivateLinkServicesForSCCPowershellDescription(ServicesResource): + """The description of the service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param system_data: Required property for system data + :type system_data: ~azure.mgmt.m365securityandcompliance.models.SystemData + :param kind: Required. The kind of the service. Possible values include: + 'fhir', 'fhir-Stu3', 'fhir-R4' + :type kind: str or ~azure.mgmt.m365securityandcompliance.models.Kind + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: An etag associated with the resource, used for optimistic + concurrency when editing it. + :type etag: str + :param identity: Setting indicating whether the service has a managed + identity associated with it. + :type identity: + ~azure.mgmt.m365securityandcompliance.models.ServicesResourceIdentity + :param properties: The common properties of a service. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.ServicesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$'}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ServicesResourceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ServicesProperties'}, + } + + def __init__(self, *, kind, location: str, system_data=None, tags=None, etag: str=None, identity=None, properties=None, **kwargs) -> None: + super(PrivateLinkServicesForSCCPowershellDescription, self).__init__(system_data=system_data, kind=kind, location=location, tags=tags, etag=etag, identity=identity, **kwargs) + self.properties = properties + + +class ProxyResource(Resource): + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + '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(ProxyResource, self).__init__(**kwargs) + + +class ServiceAccessPolicyEntry(Model): + """An access policy entry. + + All required parameters must be populated in order to send to Azure. + + :param object_id: Required. An Azure AD object ID (User or Apps) that is + allowed access to the FHIR service. + :type object_id: str + """ + + _validation = { + 'object_id': {'required': True, 'pattern': r'^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$'}, + } + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__(self, *, object_id: str, **kwargs) -> None: + super(ServiceAccessPolicyEntry, self).__init__(**kwargs) + self.object_id = object_id + + +class ServiceAuthenticationConfigurationInfo(Model): + """Authentication configuration information. + + :param authority: The authority url for the service + :type authority: str + :param audience: The audience url for the service + :type audience: str + :param smart_proxy_enabled: If the SMART on FHIR proxy is enabled + :type smart_proxy_enabled: bool + """ + + _attribute_map = { + 'authority': {'key': 'authority', 'type': 'str'}, + 'audience': {'key': 'audience', 'type': 'str'}, + 'smart_proxy_enabled': {'key': 'smartProxyEnabled', 'type': 'bool'}, + } + + def __init__(self, *, authority: str=None, audience: str=None, smart_proxy_enabled: bool=None, **kwargs) -> None: + super(ServiceAuthenticationConfigurationInfo, self).__init__(**kwargs) + self.authority = authority + self.audience = audience + self.smart_proxy_enabled = smart_proxy_enabled + + +class ServiceCorsConfigurationInfo(Model): + """The settings for the CORS configuration of the service instance. + + :param origins: The origins to be allowed via CORS. + :type origins: list[str] + :param headers: The headers to be allowed via CORS. + :type headers: list[str] + :param methods: The methods to be allowed via CORS. + :type methods: list[str] + :param max_age: The max age to be allowed via CORS. + :type max_age: long + :param allow_credentials: If credentials are allowed via CORS. + :type allow_credentials: bool + """ + + _validation = { + 'max_age': {'maximum': 99999, 'minimum': 0}, + } + + _attribute_map = { + 'origins': {'key': 'origins', 'type': '[str]'}, + 'headers': {'key': 'headers', 'type': '[str]'}, + 'methods': {'key': 'methods', 'type': '[str]'}, + 'max_age': {'key': 'maxAge', 'type': 'long'}, + 'allow_credentials': {'key': 'allowCredentials', 'type': 'bool'}, + } + + def __init__(self, *, origins=None, headers=None, methods=None, max_age: int=None, allow_credentials: bool=None, **kwargs) -> None: + super(ServiceCorsConfigurationInfo, self).__init__(**kwargs) + self.origins = origins + self.headers = headers + self.methods = methods + self.max_age = max_age + self.allow_credentials = allow_credentials + + +class ServiceCosmosDbConfigurationInfo(Model): + """The settings for the Cosmos DB database backing the service. + + :param offer_throughput: The provisioned throughput for the backing + database. + :type offer_throughput: long + :param key_vault_key_uri: The URI of the customer-managed key for the + backing database. + :type key_vault_key_uri: str + """ + + _validation = { + 'offer_throughput': {'maximum': 10000, 'minimum': 400}, + } + + _attribute_map = { + 'offer_throughput': {'key': 'offerThroughput', 'type': 'long'}, + 'key_vault_key_uri': {'key': 'keyVaultKeyUri', 'type': 'str'}, + } + + def __init__(self, *, offer_throughput: int=None, key_vault_key_uri: str=None, **kwargs) -> None: + super(ServiceCosmosDbConfigurationInfo, self).__init__(**kwargs) + self.offer_throughput = offer_throughput + self.key_vault_key_uri = key_vault_key_uri + + +class ServiceExportConfigurationInfo(Model): + """Export operation configuration information. + + :param storage_account_name: The name of the default export storage + account. + :type storage_account_name: str + """ + + _attribute_map = { + 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, + } + + def __init__(self, *, storage_account_name: str=None, **kwargs) -> None: + super(ServiceExportConfigurationInfo, self).__init__(**kwargs) + self.storage_account_name = storage_account_name + + +class ServicesPatchDescription(Model): + """The description of the service. + + :param tags: Instance tags + :type tags: dict[str, str] + :param public_network_access: Control permission for data plane traffic + coming from public networks while private endpoint is enabled. Possible + values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.m365securityandcompliance.models.PublicNetworkAccess + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__(self, *, tags=None, public_network_access=None, **kwargs) -> None: + super(ServicesPatchDescription, self).__init__(**kwargs) + self.tags = tags + self.public_network_access = public_network_access + + +class ServicesProperties(Model): + """The properties of a service instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. Possible values include: + 'Deleting', 'Succeeded', 'Creating', 'Accepted', 'Verifying', 'Updating', + 'Failed', 'Canceled', 'Deprovisioned' + :vartype provisioning_state: str or + ~azure.mgmt.m365securityandcompliance.models.ProvisioningState + :param access_policies: The access policies of the service instance. + :type access_policies: + list[~azure.mgmt.m365securityandcompliance.models.ServiceAccessPolicyEntry] + :param cosmos_db_configuration: The settings for the Cosmos DB database + backing the service. + :type cosmos_db_configuration: + ~azure.mgmt.m365securityandcompliance.models.ServiceCosmosDbConfigurationInfo + :param authentication_configuration: The authentication configuration for + the service instance. + :type authentication_configuration: + ~azure.mgmt.m365securityandcompliance.models.ServiceAuthenticationConfigurationInfo + :param cors_configuration: The settings for the CORS configuration of the + service instance. + :type cors_configuration: + ~azure.mgmt.m365securityandcompliance.models.ServiceCorsConfigurationInfo + :param export_configuration: The settings for the export operation of the + service instance. + :type export_configuration: + ~azure.mgmt.m365securityandcompliance.models.ServiceExportConfigurationInfo + :param private_endpoint_connections: The list of private endpoint + connections that are set up for this resource. + :type private_endpoint_connections: + list[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + :param public_network_access: Control permission for data plane traffic + coming from public networks while private endpoint is enabled. Possible + values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.m365securityandcompliance.models.PublicNetworkAccess + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[ServiceAccessPolicyEntry]'}, + 'cosmos_db_configuration': {'key': 'cosmosDbConfiguration', 'type': 'ServiceCosmosDbConfigurationInfo'}, + 'authentication_configuration': {'key': 'authenticationConfiguration', 'type': 'ServiceAuthenticationConfigurationInfo'}, + 'cors_configuration': {'key': 'corsConfiguration', 'type': 'ServiceCorsConfigurationInfo'}, + 'export_configuration': {'key': 'exportConfiguration', 'type': 'ServiceExportConfigurationInfo'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + } + + def __init__(self, *, access_policies=None, cosmos_db_configuration=None, authentication_configuration=None, cors_configuration=None, export_configuration=None, private_endpoint_connections=None, public_network_access=None, **kwargs) -> None: + super(ServicesProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.access_policies = access_policies + self.cosmos_db_configuration = cosmos_db_configuration + self.authentication_configuration = authentication_configuration + self.cors_configuration = cors_configuration + self.export_configuration = export_configuration + self.private_endpoint_connections = private_endpoint_connections + self.public_network_access = public_network_access + + +class ServicesResourceIdentity(Model): + """Setting indicating whether the service has a managed identity associated + with it. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of the resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the resource. + :vartype tenant_id: str + :param type: Type of identity being specified, currently SystemAssigned + and None are allowed. Possible values include: 'SystemAssigned', 'None' + :type type: str or + ~azure.mgmt.m365securityandcompliance.models.ManagedServiceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(ServicesResourceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.m365securityandcompliance.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.m365securityandcompliance.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TrackedResource(Resource): + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_paged_models.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_paged_models.py new file mode 100644 index 0000000000000..71564a6f0f2a2 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/models/_paged_models.py @@ -0,0 +1,118 @@ +# 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 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) +class PrivateLinkServicesForEDMUploadDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateLinkServicesForEDMUploadDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateLinkServicesForEDMUploadDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateLinkServicesForEDMUploadDescriptionPaged, self).__init__(*args, **kwargs) +class PrivateEndpointConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) +class PrivateLinkServicesForM365ComplianceCenterDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateLinkServicesForM365ComplianceCenterDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateLinkServicesForM365ComplianceCenterDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateLinkServicesForM365ComplianceCenterDescriptionPaged, self).__init__(*args, **kwargs) +class PrivateLinkServicesForM365SecurityCenterDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateLinkServicesForM365SecurityCenterDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateLinkServicesForM365SecurityCenterDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateLinkServicesForM365SecurityCenterDescriptionPaged, self).__init__(*args, **kwargs) +class PrivateLinkServicesForO365ManagementActivityAPIDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateLinkServicesForO365ManagementActivityAPIDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateLinkServicesForO365ManagementActivityAPIDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateLinkServicesForO365ManagementActivityAPIDescriptionPaged, self).__init__(*args, **kwargs) +class PrivateLinkServicesForSCCPowershellDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateLinkServicesForSCCPowershellDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateLinkServicesForSCCPowershellDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateLinkServicesForSCCPowershellDescriptionPaged, self).__init__(*args, **kwargs) +class PrivateLinkServicesForMIPPolicySyncDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateLinkServicesForMIPPolicySyncDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateLinkServicesForMIPPolicySyncDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateLinkServicesForMIPPolicySyncDescriptionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/__init__.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/__init__.py new file mode 100644 index 0000000000000..833b4051bbf54 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/__init__.py @@ -0,0 +1,56 @@ +# 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 ._operations import Operations +from ._operation_results_operations import OperationResultsOperations +from ._private_link_services_for_edm_upload_operations import PrivateLinkServicesForEDMUploadOperations +from ._services_operations import ServicesOperations +from ._private_endpoint_connections_for_edm_operations import PrivateEndpointConnectionsForEDMOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_link_services_for_m365_compliance_center_operations import PrivateLinkServicesForM365ComplianceCenterOperations +from ._private_endpoint_connections_comp_operations import PrivateEndpointConnectionsCompOperations +from ._private_link_resources_comp_operations import PrivateLinkResourcesCompOperations +from ._private_link_services_for_m365_security_center_operations import PrivateLinkServicesForM365SecurityCenterOperations +from ._private_endpoint_connections_sec_operations import PrivateEndpointConnectionsSecOperations +from ._private_link_resources_sec_operations import PrivateLinkResourcesSecOperations +from ._private_link_services_for_o365_management_activity_api_operations import PrivateLinkServicesForO365ManagementActivityAPIOperations +from ._private_endpoint_connections_adt_api_operations import PrivateEndpointConnectionsAdtAPIOperations +from ._private_link_resources_adt_api_operations import PrivateLinkResourcesAdtAPIOperations +from ._private_link_services_for_scc_powershell_operations import PrivateLinkServicesForSCCPowershellOperations +from ._private_endpoint_connections_for_scc_powershell_operations import PrivateEndpointConnectionsForSCCPowershellOperations +from ._private_link_resources_for_scc_powershell_operations import PrivateLinkResourcesForSCCPowershellOperations +from ._private_link_services_for_mip_policy_sync_operations import PrivateLinkServicesForMIPPolicySyncOperations +from ._private_endpoint_connections_for_mip_policy_sync_operations import PrivateEndpointConnectionsForMIPPolicySyncOperations +from ._private_link_resources_for_mip_policy_sync_operations import PrivateLinkResourcesForMIPPolicySyncOperations + +__all__ = [ + 'Operations', + 'OperationResultsOperations', + 'PrivateLinkServicesForEDMUploadOperations', + 'ServicesOperations', + 'PrivateEndpointConnectionsForEDMOperations', + 'PrivateLinkResourcesOperations', + 'PrivateLinkServicesForM365ComplianceCenterOperations', + 'PrivateEndpointConnectionsCompOperations', + 'PrivateLinkResourcesCompOperations', + 'PrivateLinkServicesForM365SecurityCenterOperations', + 'PrivateEndpointConnectionsSecOperations', + 'PrivateLinkResourcesSecOperations', + 'PrivateLinkServicesForO365ManagementActivityAPIOperations', + 'PrivateEndpointConnectionsAdtAPIOperations', + 'PrivateLinkResourcesAdtAPIOperations', + 'PrivateLinkServicesForSCCPowershellOperations', + 'PrivateEndpointConnectionsForSCCPowershellOperations', + 'PrivateLinkResourcesForSCCPowershellOperations', + 'PrivateLinkServicesForMIPPolicySyncOperations', + 'PrivateEndpointConnectionsForMIPPolicySyncOperations', + 'PrivateLinkResourcesForMIPPolicySyncOperations', +] diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_operation_results_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_operation_results_operations.py new file mode 100644 index 0000000000000..fa985b73c8e4a --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_operation_results_operations.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class OperationResultsOperations(object): + """OperationResultsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def get( + self, location_name, operation_result_id, custom_headers=None, raw=False, **operation_config): + """Get the operation result for a long running operation. + + :param location_name: The location of the operation. + :type location_name: str + :param operation_result_id: The ID of the operation result to get. + :type operation_result_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationResultsDescription or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.OperationResultsDescription + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'operationResultId': self._serialize.url("operation_result_id", operation_result_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResultsDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.M365SecurityAndCompliance/locations/{locationName}/operationresults/{operationResultId}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_operations.py new file mode 100644 index 0000000000000..cea8dfab283ee --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_operations.py @@ -0,0 +1,101 @@ +# 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available M365SecurityAndCompliance 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.m365securityandcompliance.models.OperationPaged[~azure.mgmt.m365securityandcompliance.models.Operation] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.M365SecurityAndCompliance/operations'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_adt_api_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_adt_api_operations.py new file mode 100644 index 0000000000000..77c014d1146ca --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_adt_api_operations.py @@ -0,0 +1,374 @@ +# 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 PrivateEndpointConnectionsAdtAPIOperations(object): + """PrivateEndpointConnectionsAdtAPIOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Lists all private endpoint connections for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnectionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI/{resourceName}/privateEndpointConnections'} + + def get( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified private endpoint connection associated with the + service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI/{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): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # 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(properties, 'PrivateEndpointConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the state of the specified private endpoint connection + associated with the service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorDetailsException` + """ + 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.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + 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.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_comp_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_comp_operations.py new file mode 100644 index 0000000000000..1f3d28ed87e51 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_comp_operations.py @@ -0,0 +1,374 @@ +# 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 PrivateEndpointConnectionsCompOperations(object): + """PrivateEndpointConnectionsCompOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Lists all private endpoint connections for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnectionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter/{resourceName}/privateEndpointConnections'} + + def get( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified private endpoint connection associated with the + service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter/{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): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # 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(properties, 'PrivateEndpointConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the state of the specified private endpoint connection + associated with the service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorDetailsException` + """ + 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.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + 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.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_edm_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_edm_operations.py new file mode 100644 index 0000000000000..d6e178bebc206 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_edm_operations.py @@ -0,0 +1,374 @@ +# 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 PrivateEndpointConnectionsForEDMOperations(object): + """PrivateEndpointConnectionsForEDMOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Lists all private endpoint connections for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnectionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForEDMUpload/{resourceName}/privateEndpointConnections'} + + def get( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified private endpoint connection associated with the + service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForEDMUpload/{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): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # 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(properties, 'PrivateEndpointConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the state of the specified private endpoint connection + associated with the service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorDetailsException` + """ + 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.M365SecurityAndCompliance/privateLinkServicesForEDMUpload/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + 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.M365SecurityAndCompliance/privateLinkServicesForEDMUpload/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_mip_policy_sync_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_mip_policy_sync_operations.py new file mode 100644 index 0000000000000..9d2e38ef8bad9 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_mip_policy_sync_operations.py @@ -0,0 +1,374 @@ +# 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 PrivateEndpointConnectionsForMIPPolicySyncOperations(object): + """PrivateEndpointConnectionsForMIPPolicySyncOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Lists all private endpoint connections for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnectionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync/{resourceName}/privateEndpointConnections'} + + def get( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified private endpoint connection associated with the + service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync/{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): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # 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(properties, 'PrivateEndpointConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the state of the specified private endpoint connection + associated with the service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorDetailsException` + """ + 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.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + 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.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_scc_powershell_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_scc_powershell_operations.py new file mode 100644 index 0000000000000..afdb8241fa6fd --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_for_scc_powershell_operations.py @@ -0,0 +1,374 @@ +# 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 PrivateEndpointConnectionsForSCCPowershellOperations(object): + """PrivateEndpointConnectionsForSCCPowershellOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Lists all private endpoint connections for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnectionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell/{resourceName}/privateEndpointConnections'} + + def get( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified private endpoint connection associated with the + service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell/{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): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # 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(properties, 'PrivateEndpointConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the state of the specified private endpoint connection + associated with the service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorDetailsException` + """ + 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.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + 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.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_sec_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_sec_operations.py new file mode 100644 index 0000000000000..318385952cf61 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_endpoint_connections_sec_operations.py @@ -0,0 +1,374 @@ +# 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 PrivateEndpointConnectionsSecOperations(object): + """PrivateEndpointConnectionsSecOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Lists all private endpoint connections for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnectionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter/{resourceName}/privateEndpointConnections'} + + def get( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified private endpoint connection associated with the + service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter/{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): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # 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(properties, 'PrivateEndpointConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the state of the specified private endpoint connection + associated with the service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorDetailsException` + """ + 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.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + 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.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_adt_api_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_adt_api_operations.py new file mode 100644 index 0000000000000..e6ab168d295da --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_adt_api_operations.py @@ -0,0 +1,167 @@ +# 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 PrivateLinkResourcesAdtAPIOperations(object): + """PrivateLinkResourcesAdtAPIOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkResourceListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResourceListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResourceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI/{resourceName}/privateLinkResources'} + + def get( + self, resource_group_name, resource_name, group_name, custom_headers=None, raw=False, **operation_config): + """Gets a private link resource that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param group_name: The name of the private link resource group. + :type 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: PrivateLinkResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'groupName': self._serialize.url("group_name", group_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI/{resourceName}/privateLinkResources/{groupName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_comp_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_comp_operations.py new file mode 100644 index 0000000000000..9fc86063b6f65 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_comp_operations.py @@ -0,0 +1,167 @@ +# 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 PrivateLinkResourcesCompOperations(object): + """PrivateLinkResourcesCompOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkResourceListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResourceListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResourceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter/{resourceName}/privateLinkResources'} + + def get( + self, resource_group_name, resource_name, group_name, custom_headers=None, raw=False, **operation_config): + """Gets a private link resource that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param group_name: The name of the private link resource group. + :type 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: PrivateLinkResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'groupName': self._serialize.url("group_name", group_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter/{resourceName}/privateLinkResources/{groupName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_for_mip_policy_sync_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_for_mip_policy_sync_operations.py new file mode 100644 index 0000000000000..819f98e0cee56 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_for_mip_policy_sync_operations.py @@ -0,0 +1,167 @@ +# 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 PrivateLinkResourcesForMIPPolicySyncOperations(object): + """PrivateLinkResourcesForMIPPolicySyncOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkResourceListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResourceListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResourceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync/{resourceName}/privateLinkResources'} + + def get( + self, resource_group_name, resource_name, group_name, custom_headers=None, raw=False, **operation_config): + """Gets a private link resource that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param group_name: The name of the private link resource group. + :type 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: PrivateLinkResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'groupName': self._serialize.url("group_name", group_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync/{resourceName}/privateLinkResources/{groupName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_for_scc_powershell_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_for_scc_powershell_operations.py new file mode 100644 index 0000000000000..bc639fc91329c --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_for_scc_powershell_operations.py @@ -0,0 +1,167 @@ +# 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 PrivateLinkResourcesForSCCPowershellOperations(object): + """PrivateLinkResourcesForSCCPowershellOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkResourceListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResourceListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResourceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell/{resourceName}/privateLinkResources'} + + def get( + self, resource_group_name, resource_name, group_name, custom_headers=None, raw=False, **operation_config): + """Gets a private link resource that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param group_name: The name of the private link resource group. + :type 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: PrivateLinkResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'groupName': self._serialize.url("group_name", group_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell/{resourceName}/privateLinkResources/{groupName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_operations.py new file mode 100644 index 0000000000000..1a1e5b2064c8d --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_operations.py @@ -0,0 +1,167 @@ +# 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkResourceListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResourceListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResourceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForEDMUpload/{resourceName}/privateLinkResources'} + + def get( + self, resource_group_name, resource_name, group_name, custom_headers=None, raw=False, **operation_config): + """Gets a private link resource that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param group_name: The name of the private link resource group. + :type 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: PrivateLinkResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'groupName': self._serialize.url("group_name", group_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForEDMUpload/{resourceName}/privateLinkResources/{groupName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_sec_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_sec_operations.py new file mode 100644 index 0000000000000..ecd866b460383 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_resources_sec_operations.py @@ -0,0 +1,167 @@ +# 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 PrivateLinkResourcesSecOperations(object): + """PrivateLinkResourcesSecOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkResourceListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResourceListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.list_by_service.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResourceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter/{resourceName}/privateLinkResources'} + + def get( + self, resource_group_name, resource_name, group_name, custom_headers=None, raw=False, **operation_config): + """Gets a private link resource that need to be created for a service. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param group_name: The name of the private link resource group. + :type 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: PrivateLinkResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3), + 'groupName': self._serialize.url("group_name", group_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter/{resourceName}/privateLinkResources/{groupName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_edm_upload_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_edm_upload_operations.py new file mode 100644 index 0000000000000..6295e994af403 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_edm_upload_operations.py @@ -0,0 +1,460 @@ +# 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 PrivateLinkServicesForEDMUploadOperations(object): + """PrivateLinkServicesForEDMUploadOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the metadata of a privateLinkServicesForEDMUpload resource. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkServicesForEDMUploadDescription or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForEDMUploadDescription + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForEDMUploadDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForEDMUpload/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_name, private_link_services_for_edm_upload_description, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(private_link_services_for_edm_upload_description, 'PrivateLinkServicesForEDMUploadDescription') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForEDMUploadDescription', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateLinkServicesForEDMUploadDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_link_services_for_edm_upload_description, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update the metadata of a privateLinkServicesForEDMUpload + instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_link_services_for_edm_upload_description: The service + instance metadata. + :type private_link_services_for_edm_upload_description: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForEDMUploadDescription + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForEDMUploadDescription or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForEDMUploadDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForEDMUploadDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_link_services_for_edm_upload_description=private_link_services_for_edm_upload_description, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForEDMUploadDescription', 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.M365SecurityAndCompliance/privateLinkServicesForEDMUpload/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, **operation_config): + service_patch_description = models.ServicesPatchDescription(tags=tags, public_network_access=public_network_access) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(service_patch_description, 'ServicesPatchDescription') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForEDMUploadDescription', response) + if response.status_code == 202: + deserialized = self._deserialize('PrivateLinkServicesForEDMUploadDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the metadata of a privateLinkServicesForEDMUpload instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param tags: Instance tags + :type tags: dict[str, str] + :param public_network_access: Control permission for data plane + traffic coming from public networks while private endpoint is enabled. + Possible values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.m365securityandcompliance.models.PublicNetworkAccess + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForEDMUploadDescription or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForEDMUploadDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForEDMUploadDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + tags=tags, + public_network_access=public_network_access, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForEDMUploadDescription', 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.M365SecurityAndCompliance/privateLinkServicesForEDMUpload/{resourceName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get all the privateLinkServicesForEDMUpload instances in a + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForEDMUploadDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForEDMUploadDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForEDMUploadDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForEDMUploadDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForEDMUpload'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all the service instances in a resource group. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForEDMUploadDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForEDMUploadDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForEDMUploadDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForEDMUploadDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForEDMUpload'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_m365_compliance_center_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_m365_compliance_center_operations.py new file mode 100644 index 0000000000000..8f3675743fe3a --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_m365_compliance_center_operations.py @@ -0,0 +1,541 @@ +# 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 PrivateLinkServicesForM365ComplianceCenterOperations(object): + """PrivateLinkServicesForM365ComplianceCenterOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the metadata of a privateLinkServicesForM365ComplianceCenter + resource. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkServicesForM365ComplianceCenterDescription or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365ComplianceCenterDescription + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForM365ComplianceCenterDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_name, private_link_services_for_m365_compliance_center_description, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(private_link_services_for_m365_compliance_center_description, 'PrivateLinkServicesForM365ComplianceCenterDescription') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForM365ComplianceCenterDescription', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateLinkServicesForM365ComplianceCenterDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_link_services_for_m365_compliance_center_description, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update the metadata of a + privateLinkServicesForM365ComplianceCenter instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_link_services_for_m365_compliance_center_description: + The service instance metadata. + :type private_link_services_for_m365_compliance_center_description: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365ComplianceCenterDescription + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForM365ComplianceCenterDescription or + ClientRawResponse + if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365ComplianceCenterDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365ComplianceCenterDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_link_services_for_m365_compliance_center_description=private_link_services_for_m365_compliance_center_description, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForM365ComplianceCenterDescription', 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.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, **operation_config): + service_patch_description = models.ServicesPatchDescription(tags=tags, public_network_access=public_network_access) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(service_patch_description, 'ServicesPatchDescription') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForM365ComplianceCenterDescription', response) + if response.status_code == 202: + deserialized = self._deserialize('PrivateLinkServicesForM365ComplianceCenterDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the metadata of a privateLinkServicesForM365ComplianceCenter + instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param tags: Instance tags + :type tags: dict[str, str] + :param public_network_access: Control permission for data plane + traffic coming from public networks while private endpoint is enabled. + Possible values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.m365securityandcompliance.models.PublicNetworkAccess + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForM365ComplianceCenterDescription or + ClientRawResponse + if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365ComplianceCenterDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365ComplianceCenterDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + tags=tags, + public_network_access=public_network_access, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForM365ComplianceCenterDescription', 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.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a service instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter/{resourceName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get all the privateLinkServicesForM365ComplianceCenter instances in a + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForM365ComplianceCenterDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365ComplianceCenterDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365ComplianceCenterDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForM365ComplianceCenterDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all the service instances in a resource group. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForM365ComplianceCenterDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365ComplianceCenterDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365ComplianceCenterDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForM365ComplianceCenterDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365ComplianceCenter'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_m365_security_center_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_m365_security_center_operations.py new file mode 100644 index 0000000000000..7a2e889d865c9 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_m365_security_center_operations.py @@ -0,0 +1,541 @@ +# 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 PrivateLinkServicesForM365SecurityCenterOperations(object): + """PrivateLinkServicesForM365SecurityCenterOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the metadata of a privateLinkServicesForM365SecurityCenter + resource. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkServicesForM365SecurityCenterDescription or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365SecurityCenterDescription + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForM365SecurityCenterDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_name, private_link_services_for_m365_security_center_description, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(private_link_services_for_m365_security_center_description, 'PrivateLinkServicesForM365SecurityCenterDescription') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForM365SecurityCenterDescription', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateLinkServicesForM365SecurityCenterDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_link_services_for_m365_security_center_description, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update the metadata of a + privateLinkServicesForM365SecurityCenter instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_link_services_for_m365_security_center_description: The + service instance metadata. + :type private_link_services_for_m365_security_center_description: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365SecurityCenterDescription + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForM365SecurityCenterDescription or + ClientRawResponse + if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365SecurityCenterDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365SecurityCenterDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_link_services_for_m365_security_center_description=private_link_services_for_m365_security_center_description, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForM365SecurityCenterDescription', 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.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, **operation_config): + service_patch_description = models.ServicesPatchDescription(tags=tags, public_network_access=public_network_access) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(service_patch_description, 'ServicesPatchDescription') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForM365SecurityCenterDescription', response) + if response.status_code == 202: + deserialized = self._deserialize('PrivateLinkServicesForM365SecurityCenterDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the metadata of a privateLinkServicesForM365SecurityCenter + instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param tags: Instance tags + :type tags: dict[str, str] + :param public_network_access: Control permission for data plane + traffic coming from public networks while private endpoint is enabled. + Possible values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.m365securityandcompliance.models.PublicNetworkAccess + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForM365SecurityCenterDescription or + ClientRawResponse + if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365SecurityCenterDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365SecurityCenterDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + tags=tags, + public_network_access=public_network_access, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForM365SecurityCenterDescription', 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.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a service instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter/{resourceName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get all the privateLinkServicesForM365SecurityCenter instances in a + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForM365SecurityCenterDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365SecurityCenterDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365SecurityCenterDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForM365SecurityCenterDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all the service instances in a resource group. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForM365SecurityCenterDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365SecurityCenterDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForM365SecurityCenterDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForM365SecurityCenterDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForM365SecurityCenter'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_mip_policy_sync_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_mip_policy_sync_operations.py new file mode 100644 index 0000000000000..3065e1cea3804 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_mip_policy_sync_operations.py @@ -0,0 +1,539 @@ +# 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 PrivateLinkServicesForMIPPolicySyncOperations(object): + """PrivateLinkServicesForMIPPolicySyncOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the metadata of a privateLinkServicesForMIPPolicySync resource. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkServicesForMIPPolicySyncDescription or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForMIPPolicySyncDescription + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForMIPPolicySyncDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_name, private_link_services_for_mip_policy_sync_description, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(private_link_services_for_mip_policy_sync_description, 'PrivateLinkServicesForMIPPolicySyncDescription') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForMIPPolicySyncDescription', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateLinkServicesForMIPPolicySyncDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_link_services_for_mip_policy_sync_description, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update the metadata of a privateLinkServicesForMIPPolicySync + instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_link_services_for_mip_policy_sync_description: The + service instance metadata. + :type private_link_services_for_mip_policy_sync_description: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForMIPPolicySyncDescription + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForMIPPolicySyncDescription or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForMIPPolicySyncDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForMIPPolicySyncDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_link_services_for_mip_policy_sync_description=private_link_services_for_mip_policy_sync_description, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForMIPPolicySyncDescription', 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.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, **operation_config): + service_patch_description = models.ServicesPatchDescription(tags=tags, public_network_access=public_network_access) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(service_patch_description, 'ServicesPatchDescription') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForMIPPolicySyncDescription', response) + if response.status_code == 202: + deserialized = self._deserialize('PrivateLinkServicesForMIPPolicySyncDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the metadata of a privateLinkServicesForMIPPolicySync instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param tags: Instance tags + :type tags: dict[str, str] + :param public_network_access: Control permission for data plane + traffic coming from public networks while private endpoint is enabled. + Possible values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.m365securityandcompliance.models.PublicNetworkAccess + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForMIPPolicySyncDescription or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForMIPPolicySyncDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForMIPPolicySyncDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + tags=tags, + public_network_access=public_network_access, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForMIPPolicySyncDescription', 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.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a service instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync/{resourceName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get all the privateLinkServicesForMIPPolicySync instances in a + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForMIPPolicySyncDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForMIPPolicySyncDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForMIPPolicySyncDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForMIPPolicySyncDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all the service instances in a resource group. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForMIPPolicySyncDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForMIPPolicySyncDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForMIPPolicySyncDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForMIPPolicySyncDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForMIPPolicySync'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_o365_management_activity_api_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_o365_management_activity_api_operations.py new file mode 100644 index 0000000000000..974ab2da009c5 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_o365_management_activity_api_operations.py @@ -0,0 +1,543 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateLinkServicesForO365ManagementActivityAPIOperations(object): + """PrivateLinkServicesForO365ManagementActivityAPIOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the metadata of a privateLinkServicesForO365ManagementActivityAPI + resource. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkServicesForO365ManagementActivityAPIDescription or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForO365ManagementActivityAPIDescription + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForO365ManagementActivityAPIDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_name, private_link_services_for_o365_management_activity_api_description, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(private_link_services_for_o365_management_activity_api_description, 'PrivateLinkServicesForO365ManagementActivityAPIDescription') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForO365ManagementActivityAPIDescription', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateLinkServicesForO365ManagementActivityAPIDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_link_services_for_o365_management_activity_api_description, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update the metadata of a + privateLinkServicesForO365ManagementActivityAPI instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param + private_link_services_for_o365_management_activity_api_description: + The service instance metadata. + :type + private_link_services_for_o365_management_activity_api_description: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForO365ManagementActivityAPIDescription + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForO365ManagementActivityAPIDescription or + ClientRawResponse + if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForO365ManagementActivityAPIDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForO365ManagementActivityAPIDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_link_services_for_o365_management_activity_api_description=private_link_services_for_o365_management_activity_api_description, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForO365ManagementActivityAPIDescription', 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.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, **operation_config): + service_patch_description = models.ServicesPatchDescription(tags=tags, public_network_access=public_network_access) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(service_patch_description, 'ServicesPatchDescription') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForO365ManagementActivityAPIDescription', response) + if response.status_code == 202: + deserialized = self._deserialize('PrivateLinkServicesForO365ManagementActivityAPIDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the metadata of a + privateLinkServicesForO365ManagementActivityAPI instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param tags: Instance tags + :type tags: dict[str, str] + :param public_network_access: Control permission for data plane + traffic coming from public networks while private endpoint is enabled. + Possible values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.m365securityandcompliance.models.PublicNetworkAccess + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForO365ManagementActivityAPIDescription or + ClientRawResponse + if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForO365ManagementActivityAPIDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForO365ManagementActivityAPIDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + tags=tags, + public_network_access=public_network_access, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForO365ManagementActivityAPIDescription', 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.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a service instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI/{resourceName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get all the privateLinkServicesForO365ManagementActivityAPI instances + in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForO365ManagementActivityAPIDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForO365ManagementActivityAPIDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForO365ManagementActivityAPIDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForO365ManagementActivityAPIDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all the service instances in a resource group. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForO365ManagementActivityAPIDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForO365ManagementActivityAPIDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForO365ManagementActivityAPIDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForO365ManagementActivityAPIDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForO365ManagementActivityAPI'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_scc_powershell_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_scc_powershell_operations.py new file mode 100644 index 0000000000000..19963c0264e36 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_private_link_services_for_scc_powershell_operations.py @@ -0,0 +1,539 @@ +# 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 PrivateLinkServicesForSCCPowershellOperations(object): + """PrivateLinkServicesForSCCPowershellOperations 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: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the metadata of a privateLinkServicesForSCCPowershell resource. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkServicesForSCCPowershellDescription or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForSCCPowershellDescription + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForSCCPowershellDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_name, private_link_services_for_scc_powershell_description, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(private_link_services_for_scc_powershell_description, 'PrivateLinkServicesForSCCPowershellDescription') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForSCCPowershellDescription', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateLinkServicesForSCCPowershellDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, private_link_services_for_scc_powershell_description, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update the metadata of a privateLinkServicesForSCCPowershell + instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param private_link_services_for_scc_powershell_description: The + service instance metadata. + :type private_link_services_for_scc_powershell_description: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForSCCPowershellDescription + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForSCCPowershellDescription or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForSCCPowershellDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForSCCPowershellDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_link_services_for_scc_powershell_description=private_link_services_for_scc_powershell_description, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForSCCPowershellDescription', 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.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, **operation_config): + service_patch_description = models.ServicesPatchDescription(tags=tags, public_network_access=public_network_access) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(service_patch_description, 'ServicesPatchDescription') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServicesForSCCPowershellDescription', response) + if response.status_code == 202: + deserialized = self._deserialize('PrivateLinkServicesForSCCPowershellDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_name, tags=None, public_network_access=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the metadata of a privateLinkServicesForSCCPowershell instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param tags: Instance tags + :type tags: dict[str, str] + :param public_network_access: Control permission for data plane + traffic coming from public networks while private endpoint is enabled. + Possible values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.m365securityandcompliance.models.PublicNetworkAccess + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateLinkServicesForSCCPowershellDescription or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForSCCPowershellDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForSCCPowershellDescription]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + tags=tags, + public_network_access=public_network_access, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateLinkServicesForSCCPowershellDescription', 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.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a service instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell/{resourceName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get all the privateLinkServicesForSCCPowershell instances in a + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForSCCPowershellDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForSCCPowershellDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForSCCPowershellDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForSCCPowershellDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all the service instances in a resource group. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + PrivateLinkServicesForSCCPowershellDescription + :rtype: + ~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForSCCPowershellDescriptionPaged[~azure.mgmt.m365securityandcompliance.models.PrivateLinkServicesForSCCPowershellDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkServicesForSCCPowershellDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForSCCPowershell'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_services_operations.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_services_operations.py new file mode 100644 index 0000000000000..73ff2ba835b4e --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/operations/_services_operations.py @@ -0,0 +1,120 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ServicesOperations(object): + """ServicesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-03-25-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-25-preview" + + self.config = config + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=24, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a service instance. + + :param resource_group_name: The name of the resource group that + contains the service instance. + :type resource_group_name: str + :param resource_name: The name of the service instance. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.M365SecurityAndCompliance/privateLinkServicesForEDMUpload/{resourceName}'} diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/version.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/version.py new file mode 100644 index 0000000000000..53c4c7ea05e89 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/azure/mgmt/m365securityandcompliance/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2.0.0" + diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/sdk_packaging.toml b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/sdk_packaging.toml new file mode 100644 index 0000000000000..c1bd8a196e9d9 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-m365securityandcompliance" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/setup.cfg b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/setup.cfg new file mode 100644 index 0000000000000..3c6e79cf31da1 --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/setup.py b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/setup.py new file mode 100644 index 0000000000000..8c750821b369c --- /dev/null +++ b/sdk/m365securityandcompliance/azure-mgmt-m365securityandcompliance/setup.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-m365securityandcompliance" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.6.21', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) diff --git a/sdk/m365securityandcompliance/ci.yml b/sdk/m365securityandcompliance/ci.yml new file mode 100644 index 0000000000000..3f90f10ba88ed --- /dev/null +++ b/sdk/m365securityandcompliance/ci.yml @@ -0,0 +1,35 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/m365securityandcompliance/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/m365securityandcompliance/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: m365securityandcompliance + Artifacts: + - name: azure-mgmt-m365securityandcompliance + safeName: azuremgmtm365securityandcompliance