diff --git a/src/powerbiprivatelinks/HISTORY.rst b/src/powerbiprivatelinks/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/powerbiprivatelinks/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/powerbiprivatelinks/README.md b/src/powerbiprivatelinks/README.md new file mode 100644 index 00000000000..050b03c441f --- /dev/null +++ b/src/powerbiprivatelinks/README.md @@ -0,0 +1,88 @@ +# Azure CLI powerbiprivatelinks Extension # +This is the extension for powerbiprivatelinks + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name powerbiprivatelinks +``` + +### Included Features ### +#### powerbiprivatelinks private-link-service-for-power-bi #### +##### List ##### +``` +az powerbiprivatelinks private-link-service-for-power-bi list +``` +#### powerbiprivatelinks private-link-service-resource-operation-result #### +##### Show ##### +``` +az powerbiprivatelinks private-link-service-resource-operation-result show +``` +#### powerbiprivatelinks private-link-service #### +##### List ##### +``` +az powerbiprivatelinks private-link-service list +``` +#### powerbiprivatelinks power-bi-resource #### +##### Create ##### +``` +az powerbiprivatelinks power-bi-resource create --location "global" --tenant-id "ac2bc297-8a3e-46f3-972d-87c2b4ae6e2f" \ + --tags tag1="value1" tag2="value2" +``` +##### List ##### +``` +az powerbiprivatelinks power-bi-resource list +``` +##### Delete ##### +``` +az powerbiprivatelinks power-bi-resource delete +``` +#### powerbiprivatelinks private-link-resource #### +##### List ##### +``` +az powerbiprivatelinks private-link-resource list +``` +#### powerbiprivatelinks private-endpoint-connection-proxy #### +##### Create ##### +``` +az powerbiprivatelinks private-endpoint-connection-proxy create \ + --connection-details group-id="tenant" id="10001" link-identifier="1253" member-name="tenant" private-ip-address="10.0.1.4" \ + --remote-private-endpoint-id "/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpointName" \ + --private-link-service-connections name="myPrivateEndpointConnection" group-ids="tenant" request-message="opt msg" \ + --private-link-service-proxies "[{\\"groupConnectivityInformation\\":[{\\"customerVisibleFqdns\\":[\\"91cb8a3f79e644bea2dedce59f8c0107-api.analysis.windows.net\\"],\\"groupId\\":\\"tenant\\",\\"internalFqdn\\":\\"91cb8a3f79e644bea2dedce59f8c0107-api.analysis.windows.net\\",\\"memberName\\":\\"tenant\\",\\"privateLinkServiceArmRegion\\":\\"\\"}],\\"id\\":\\"/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpointName/privateLinkServiceProxies/azureResourceName-proxy.58ffb8de-89ad-41eb-9f8f-de0a7db9d721\\",\\"remotePrivateEndpointConnection\\":{\\"id\\":\\"/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/azureResourceName/privateEndpointConnections/myPrivateEndpointName.58ffb8de-89ad-41eb-9f8f-de0a7db9d721\\"},\\"remotePrivateLinkServiceConnectionState\\":{\\"description\\":\\"please approve\\",\\"actionsRequired\\":\\"None\\",\\"status\\":\\"Pending\\"}}]" +``` +##### Show ##### +``` +az powerbiprivatelinks private-endpoint-connection-proxy show +``` +##### Validate ##### +``` +az powerbiprivatelinks private-endpoint-connection-proxy validate \ + --remote-private-endpoint-id "/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpointName" \ + --private-link-service-connections name="myPrivateEndpointConnection" group-ids="tenant" request-message="opt msg" \ + --private-link-service-proxies "[{\\"groupConnectivityInformation\\":[],\\"id\\":\\"/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpointName/privateLinkServiceProxies/azureResourceName-proxy.58ffb8de-89ad-41eb-9f8f-de0a7db9d721\\"}]" +``` +##### Delete ##### +``` +az powerbiprivatelinks private-endpoint-connection-proxy delete +``` +#### powerbiprivatelinks private-endpoint-connection #### +##### Create ##### +``` +az powerbiprivatelinks private-endpoint-connection create \ + --id "/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpointName" \ + --private-link-service-connection-state description="" actions-required="None" status="Approved " +``` +##### Show ##### +``` +az powerbiprivatelinks private-endpoint-connection show +``` +##### List ##### +``` +az powerbiprivatelinks private-endpoint-connection list --azure-resource-name "azureResourceName" \ + --resource-group "resourceGroup" +``` +##### Delete ##### +``` +az powerbiprivatelinks private-endpoint-connection delete +``` \ No newline at end of file diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/__init__.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/__init__.py new file mode 100644 index 00000000000..1b932da5ddb --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/__init__.py @@ -0,0 +1,50 @@ +# -------------------------------------------------------------------------- +# 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 azure.cli.core import AzCommandsLoader +from azext_powerbiprivatelinks.generated._help import helps # pylint: disable=unused-import +try: + from azext_powerbiprivatelinks.manual._help import helps # pylint: disable=reimported +except ImportError: + pass + + +class PrivateLinkServicesForPowerBIClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_powerbiprivatelinks.generated._client_factory import cf_powerbiprivatelinks_cl + powerbiprivatelinks_custom = CliCommandType( + operations_tmpl='azext_powerbiprivatelinks.custom#{}', + client_factory=cf_powerbiprivatelinks_cl) + parent = super(PrivateLinkServicesForPowerBIClientCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=powerbiprivatelinks_custom) + + def load_command_table(self, args): + from azext_powerbiprivatelinks.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_powerbiprivatelinks.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + from azext_powerbiprivatelinks.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_powerbiprivatelinks.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = PrivateLinkServicesForPowerBIClientCommandsLoader diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/action.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/action.py new file mode 100644 index 00000000000..d95d53bf711 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/action.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/azext_metadata.json b/src/powerbiprivatelinks/azext_powerbiprivatelinks/azext_metadata.json new file mode 100644 index 00000000000..cfc30c747c7 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.15.0" +} \ No newline at end of file diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/custom.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/custom.py new file mode 100644 index 00000000000..dbe9d5f9742 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/custom.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/__init__.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_client_factory.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_client_factory.py new file mode 100644 index 00000000000..d44929b3572 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_client_factory.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + + +def cf_powerbiprivatelinks_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_powerbiprivatelinks.vendored_sdks.powerbiprivatelinks import PrivateLinkServicesForPowerBIClient + return get_mgmt_service_client(cli_ctx, + PrivateLinkServicesForPowerBIClient) + + +def cf_private_link_service_for_power_bi(cli_ctx, *_): + return cf_powerbiprivatelinks_cl(cli_ctx).private_link_services_for_power_bi + + +def cf_private_link_service_resource_operation_result(cli_ctx, *_): + return cf_powerbiprivatelinks_cl(cli_ctx).private_link_service_resource_operation_results + + +def cf_private_link_service(cli_ctx, *_): + return cf_powerbiprivatelinks_cl(cli_ctx).private_link_services + + +def cf_power_bi_resource(cli_ctx, *_): + return cf_powerbiprivatelinks_cl(cli_ctx).power_bi_resources + + +def cf_private_link_resource(cli_ctx, *_): + return cf_powerbiprivatelinks_cl(cli_ctx).private_link_resources + + +def cf_private_endpoint_connection_proxy(cli_ctx, *_): + return cf_powerbiprivatelinks_cl(cli_ctx).private_endpoint_connection_proxies + + +def cf_private_endpoint_connection(cli_ctx, *_): + return cf_powerbiprivatelinks_cl(cli_ctx).private_endpoint_connections diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_help.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_help.py new file mode 100644 index 00000000000..203a9ef0630 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_help.py @@ -0,0 +1,309 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['powerbiprivatelinks private-link-service-for-power-bi'] = """ + type: group + short-summary: Manage private link service for power bi with powerbiprivatelinks +""" + +helps['powerbiprivatelinks private-link-service-for-power-bi list'] = """ + type: command + short-summary: "Gets all the private link resources for the given subscription id." + examples: + - name: List private link resources in a subscription + text: |- + az powerbiprivatelinks private-link-service-for-power-bi list +""" + +helps['powerbiprivatelinks private-link-service-resource-operation-result'] = """ + type: group + short-summary: Manage private link service resource operation result with powerbiprivatelinks +""" + +helps['powerbiprivatelinks private-link-service-resource-operation-result show'] = """ + type: command + short-summary: "Gets operation result of Private Link Service Resources for Power BI." + examples: + - name: Result of operation on private link resources + text: |- + az powerbiprivatelinks private-link-service-resource-operation-result show +""" + +helps['powerbiprivatelinks private-link-service'] = """ + type: group + short-summary: Manage private link service with powerbiprivatelinks +""" + +helps['powerbiprivatelinks private-link-service list'] = """ + type: command + short-summary: "Gets all the private link resources for the given resource group." + examples: + - name: List private link resources in a resource group + text: |- + az powerbiprivatelinks private-link-service list +""" + +helps['powerbiprivatelinks power-bi-resource'] = """ + type: group + short-summary: Manage power bi resource with powerbiprivatelinks +""" + +helps['powerbiprivatelinks power-bi-resource list'] = """ + type: command + short-summary: "Gets all the private link resources for the given Azure resource." + examples: + - name: List private link resources in a Azure resource + text: |- + az powerbiprivatelinks power-bi-resource list +""" + +helps['powerbiprivatelinks power-bi-resource create'] = """ + type: command + short-summary: "Creates or updates a Private Link Service Resource for Power BI." + examples: + - name: Creates or updates private link service resource + text: |- + az powerbiprivatelinks power-bi-resource create --location "global" --tenant-id \ +"ac2bc297-8a3e-46f3-972d-87c2b4ae6e2f" --tags tag1="value1" tag2="value2" +""" + +helps['powerbiprivatelinks power-bi-resource delete'] = """ + type: command + short-summary: "Deletes a Private Link Service Resource for Power BI." + examples: + - name: Deletes private link service resource + text: |- + az powerbiprivatelinks power-bi-resource delete +""" + +helps['powerbiprivatelinks private-link-resource'] = """ + type: group + short-summary: Manage private link resource with powerbiprivatelinks +""" + +helps['powerbiprivatelinks private-link-resource list'] = """ + type: command + short-summary: "List private link resources under a specific Power BI resource." + examples: + - name: Gets private link resources in a Azure resource + text: |- + az powerbiprivatelinks private-link-resource list +""" + +helps['powerbiprivatelinks private-endpoint-connection-proxy'] = """ + type: group + short-summary: Manage private endpoint connection proxy with powerbiprivatelinks +""" + +helps['powerbiprivatelinks private-endpoint-connection-proxy show'] = """ + type: command + short-summary: "Gets private endpoint connection proxy for Power BI by private endpoint name." + examples: + - name: Gets private endpoint connection proxy + text: |- + az powerbiprivatelinks private-endpoint-connection-proxy show +""" + +helps['powerbiprivatelinks private-endpoint-connection-proxy create'] = """ + type: command + short-summary: "Creates or updates private endpoint connection proxy for Power BI by private endpoint name." + parameters: + - name: --manual-private-link-service-connections + short-summary: "Specifies the private link service connections of the private endpoint." + long-summary: | + Usage: --manual-private-link-service-connections name=XX group-ids=XX request-message=XX + + name: Specifies the name of the private link service connection. + group-ids: Specifies the group ids of the private link service connection. + request-message: Specifies the request message of the private link service connection. + + Multiple actions can be specified by using more than one --manual-private-link-service-connections \ +argument. + - name: --private-link-service-connections + short-summary: "Specifies the private link service connections of the private endpoint." + long-summary: | + Usage: --private-link-service-connections name=XX group-ids=XX request-message=XX + + name: Specifies the name of the private link service connection. + group-ids: Specifies the group ids of the private link service connection. + request-message: Specifies the request message of the private link service connection. + + Multiple actions can be specified by using more than one --private-link-service-connections argument. + - name: --connection-details + short-summary: "Specifies the connection details of the private endpoint." + long-summary: | + Usage: --connection-details id=XX member-name=XX private-ip-address=XX link-identifier=XX group-id=XX + + id: Specifies the type of the connection detail. + member-name: Specifies the member name of the connection detail. + private-ip-address: Specifies the private ip address of the connection detail. + link-identifier: Specifies the link id of the connection detail. + group-id: Specifies the group id of the connection detail. + + Multiple actions can be specified by using more than one --connection-details argument. + examples: + - name: Creates or updates private endpoint connection proxy + text: |- + az powerbiprivatelinks private-endpoint-connection-proxy create --connection-details group-id="tenant" \ +id="10001" link-identifier="1253" member-name="tenant" private-ip-address="10.0.1.4" --remote-private-endpoint-id \ +"/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/privateEn\ +dpoints/myPrivateEndpointName" --private-link-service-connections name="myPrivateEndpointConnection" \ +group-ids="tenant" request-message="opt msg" --private-link-service-proxies "[{\\"groupConnectivityInformation\\":[{\\"\ +customerVisibleFqdns\\":[\\"91cb8a3f79e644bea2dedce59f8c0107-api.analysis.windows.net\\"],\\"groupId\\":\\"tenant\\",\\\ +"internalFqdn\\":\\"91cb8a3f79e644bea2dedce59f8c0107-api.analysis.windows.net\\",\\"memberName\\":\\"tenant\\",\\"priva\ +teLinkServiceArmRegion\\":\\"\\"}],\\"id\\":\\"/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resou\ +rceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpointName/privateLinkServiceProxies/azureResourceName\ +-proxy.58ffb8de-89ad-41eb-9f8f-de0a7db9d721\\",\\"remotePrivateEndpointConnection\\":{\\"id\\":\\"/subscriptions/a00208\ +69-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/a\ +zureResourceName/privateEndpointConnections/myPrivateEndpointName.58ffb8de-89ad-41eb-9f8f-de0a7db9d721\\"},\\"remotePri\ +vateLinkServiceConnectionState\\":{\\"description\\":\\"please approve\\",\\"actionsRequired\\":\\"None\\",\\"status\\"\ +:\\"Pending\\"}}]" +""" + +helps['powerbiprivatelinks private-endpoint-connection-proxy delete'] = """ + type: command + short-summary: "Deletes a private endpoint connection proxy for Power BI by private endpoint name." + examples: + - name: Deletes a private endpoint connection proxy + text: |- + az powerbiprivatelinks private-endpoint-connection-proxy delete +""" + +helps['powerbiprivatelinks private-endpoint-connection-proxy validate'] = """ + type: command + short-summary: "Validates a private endpoint connection before create or update." + parameters: + - name: --manual-private-link-service-connections + short-summary: "Specifies the private link service connections of the private endpoint." + long-summary: | + Usage: --manual-private-link-service-connections name=XX group-ids=XX request-message=XX + + name: Specifies the name of the private link service connection. + group-ids: Specifies the group ids of the private link service connection. + request-message: Specifies the request message of the private link service connection. + + Multiple actions can be specified by using more than one --manual-private-link-service-connections \ +argument. + - name: --private-link-service-connections + short-summary: "Specifies the private link service connections of the private endpoint." + long-summary: | + Usage: --private-link-service-connections name=XX group-ids=XX request-message=XX + + name: Specifies the name of the private link service connection. + group-ids: Specifies the group ids of the private link service connection. + request-message: Specifies the request message of the private link service connection. + + Multiple actions can be specified by using more than one --private-link-service-connections argument. + - name: --connection-details + short-summary: "Specifies the connection details of the private endpoint." + long-summary: | + Usage: --connection-details id=XX member-name=XX private-ip-address=XX link-identifier=XX group-id=XX + + id: Specifies the type of the connection detail. + member-name: Specifies the member name of the connection detail. + private-ip-address: Specifies the private ip address of the connection detail. + link-identifier: Specifies the link id of the connection detail. + group-id: Specifies the group id of the connection detail. + + Multiple actions can be specified by using more than one --connection-details argument. + examples: + - name: Validates a private endpoint connection + text: |- + az powerbiprivatelinks private-endpoint-connection-proxy validate --remote-private-endpoint-id \ +"/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/privateEn\ +dpoints/myPrivateEndpointName" --private-link-service-connections name="myPrivateEndpointConnection" \ +group-ids="tenant" request-message="opt msg" --private-link-service-proxies "[{\\"groupConnectivityInformation\\":[],\\\ +"id\\":\\"/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/\ +privateEndpoints/myPrivateEndpointName/privateLinkServiceProxies/azureResourceName-proxy.58ffb8de-89ad-41eb-9f8f-de0a7d\ +b9d721\\"}]" +""" + +helps['powerbiprivatelinks private-endpoint-connection-proxy wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the powerbiprivatelinks \ +private-endpoint-connection-proxy is met. + examples: + - name: Pause executing next line of CLI script until the powerbiprivatelinks private-endpoint-connection-proxy \ +is successfully created. + text: |- + az powerbiprivatelinks private-endpoint-connection-proxy show --created + - name: Pause executing next line of CLI script until the powerbiprivatelinks private-endpoint-connection-proxy \ +is successfully deleted. + text: |- + az powerbiprivatelinks private-endpoint-connection-proxy show --deleted +""" + +helps['powerbiprivatelinks private-endpoint-connection'] = """ + type: group + short-summary: Manage private endpoint connection with powerbiprivatelinks +""" + +helps['powerbiprivatelinks private-endpoint-connection list'] = """ + type: command + short-summary: "Gets private endpoint connection for Power BI." + examples: + - name: Gets private endpoint connections + text: |- + az powerbiprivatelinks private-endpoint-connection list --azure-resource-name "azureResourceName" \ +--resource-group "resourceGroup" +""" + +helps['powerbiprivatelinks private-endpoint-connection show'] = """ + type: command + short-summary: "Get a specific private endpoint connection for Power BI by private endpoint name." + examples: + - name: Gets private endpoint connection + text: |- + az powerbiprivatelinks private-endpoint-connection show +""" + +helps['powerbiprivatelinks private-endpoint-connection create'] = """ + type: command + short-summary: "Updates the status of Private Endpoint Connection object. Used to approve or reject a connection." + parameters: + - name: --private-link-service-connection-state + short-summary: "Specifies the connection state." + long-summary: | + Usage: --private-link-service-connection-state status=XX description=XX actions-required=XX + + status: Status of the connection. + description: Description of the connection state. + actions-required: Actions required (if any). + examples: + - name: Updates status of private endpoint connection + text: |- + az powerbiprivatelinks private-endpoint-connection create --id "/subscriptions/a0020869-4d28-422a-89f4-c\ +2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpointName" \ +--private-link-service-connection-state description="" actions-required="None" status="Approved " +""" + +helps['powerbiprivatelinks private-endpoint-connection delete'] = """ + type: command + short-summary: "Deletes a private endpoint connection for Power BI by private endpoint name." + examples: + - name: Deletes private endpoint connection + text: |- + az powerbiprivatelinks private-endpoint-connection delete +""" + +helps['powerbiprivatelinks private-endpoint-connection wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the powerbiprivatelinks \ +private-endpoint-connection is met. + examples: + - name: Pause executing next line of CLI script until the powerbiprivatelinks private-endpoint-connection is \ +successfully deleted. + text: |- + az powerbiprivatelinks private-endpoint-connection show --deleted +""" diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_params.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_params.py new file mode 100644 index 00000000000..b0fa996d676 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_params.py @@ -0,0 +1,88 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import validate_file_or_dict +from azext_powerbiprivatelinks.action import ( + AddManualPrivateLinkServiceConnections, + AddPrivateLinkServiceConnections, + AddConnectionDetails, + AddPrivateLinkServiceConnectionState +) + + +def load_arguments(self, _): + + with self.argument_context('powerbiprivatelinks power-bi-resource create') as c: + c.argument('client_tenant_id', type=str, help='The client tenant id in header. This is a GUID-formatted string ' + '(e.g. 00000000-0000-0000-0000-000000000000).') + c.argument('location', arg_type=get_location_type(self.cli_ctx)) + c.argument('tags', tags_type) + c.argument('tenant_id', type=str, help='Specifies the tenant id of the resource.') + c.argument('private_endpoint_connections', type=validate_file_or_dict, help='Specifies the private endpoint ' + 'connections of the resource. Expected value: json-string/@json-file.') + + with self.argument_context('powerbiprivatelinks private-endpoint-connection-proxy create') as c: + c.argument('client_tenant_id', type=str, help='The client tenant id in header. This is a GUID-formatted string ' + '(e.g. 00000000-0000-0000-0000-000000000000).') + c.argument('id_', options_list=['--id'], type=str, help='Specifies the id of the resource.') + c.argument('name', type=str, help='Specifies the name of the resource.') + c.argument('type_', options_list=['--type'], type=str, help='Specifies the type of the resource.') + c.argument('location', arg_type=get_location_type(self.cli_ctx)) + c.argument('etag', type=str, help='Specifies the etag of the resource.') + c.argument('remote_private_endpoint_id', type=str, help='Specifies the id of the private endpoint.', + arg_group='Remote Private Endpoint') + c.argument('manual_private_link_service_connections', action=AddManualPrivateLinkServiceConnections, nargs='+', + help='Specifies the private link service connections of the private endpoint.', arg_group='Remote ' + 'Private Endpoint') + c.argument('private_link_service_connections', action=AddPrivateLinkServiceConnections, nargs='+', + help='Specifies the private link service connections of the private endpoint.', arg_group='Remote ' + 'Private Endpoint') + c.argument('private_link_service_proxies', type=validate_file_or_dict, help='Specifies the private link ' + 'service proxies of the private endpoint. Expected value: json-string/@json-file.', + arg_group='Remote Private Endpoint') + c.argument('connection_details', action=AddConnectionDetails, nargs='+', help='Specifies the connection ' + 'details of the private endpoint.', arg_group='Remote Private Endpoint') + + with self.argument_context('powerbiprivatelinks private-endpoint-connection-proxy validate') as c: + c.argument('id_', options_list=['--id'], type=str, help='Specifies the id of the resource.') + c.argument('name', type=str, help='Specifies the name of the resource.') + c.argument('type_', options_list=['--type'], type=str, help='Specifies the type of the resource.') + c.argument('location', arg_type=get_location_type(self.cli_ctx)) + c.argument('etag', type=str, help='Specifies the etag of the resource.') + c.argument('remote_private_endpoint_id', type=str, help='Specifies the id of the private endpoint.', + arg_group='Remote Private Endpoint') + c.argument('manual_private_link_service_connections', action=AddManualPrivateLinkServiceConnections, nargs='+', + help='Specifies the private link service connections of the private endpoint.', arg_group='Remote ' + 'Private Endpoint') + c.argument('private_link_service_connections', action=AddPrivateLinkServiceConnections, nargs='+', + help='Specifies the private link service connections of the private endpoint.', arg_group='Remote ' + 'Private Endpoint') + c.argument('private_link_service_proxies', type=validate_file_or_dict, help='Specifies the private link ' + 'service proxies of the private endpoint. Expected value: json-string/@json-file.', + arg_group='Remote Private Endpoint') + c.argument('connection_details', action=AddConnectionDetails, nargs='+', help='Specifies the connection ' + 'details of the private endpoint.', arg_group='Remote Private Endpoint') + + with self.argument_context('powerbiprivatelinks private-endpoint-connection list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('azure_resource_name', type=str, help='The name of the powerbi resource.') + + with self.argument_context('powerbiprivatelinks private-endpoint-connection create') as c: + c.argument('private_link_service_connection_state', action=AddPrivateLinkServiceConnectionState, nargs='+', + help='Specifies the connection state.') + c.argument('id_', options_list=['--id'], type=str, help='Specifies the id of private endpoint.', + arg_group='Private Endpoint') diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_validators.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_validators.py new file mode 100644 index 00000000000..b33a44c1ebf --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/_validators.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/action.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/action.py new file mode 100644 index 00000000000..e2e97a5b638 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/action.py @@ -0,0 +1,134 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from collections import defaultdict +from knack.util import CLIError + + +class AddManualPrivateLinkServiceConnections(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddManualPrivateLinkServiceConnections, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + elif kl == 'group-ids': + d['group_ids'] = v + elif kl == 'request-message': + d['request_message'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter manual_private_link_service_connections. ' + 'All possible keys are: name, group-ids, request-message'.format(k)) + return d + + +class AddPrivateLinkServiceConnections(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddPrivateLinkServiceConnections, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + elif kl == 'group-ids': + d['group_ids'] = v + elif kl == 'request-message': + d['request_message'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter private_link_service_connections. All ' + 'possible keys are: name, group-ids, request-message'.format(k)) + return d + + +class AddConnectionDetails(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddConnectionDetails, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'id': + d['id'] = v[0] + elif kl == 'member-name': + d['member_name'] = v[0] + elif kl == 'private-ip-address': + d['private_ip_address'] = v[0] + elif kl == 'link-identifier': + d['link_identifier'] = v[0] + elif kl == 'group-id': + d['group_id'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter connection_details. All possible keys ' + 'are: id, member-name, private-ip-address, link-identifier, group-id'.format(k)) + return d + + +class AddPrivateLinkServiceConnectionState(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.private_link_service_connection_state = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'status': + d['status'] = v[0] + elif kl == 'description': + d['description'] = v[0] + elif kl == 'actions-required': + d['actions_required'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter private_link_service_connection_state. ' + 'All possible keys are: status, description, actions-required'.format(k)) + return d diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/commands.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/commands.py new file mode 100644 index 00000000000..be4a85cd383 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/commands.py @@ -0,0 +1,99 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_powerbiprivatelinks.generated._client_factory import cf_private_link_service_for_power_bi + powerbiprivatelinks_private_link_service_for_power_bi = CliCommandType( + operations_tmpl='azext_powerbiprivatelinks.vendored_sdks.powerbiprivatelinks.operations._private_link_services_' + 'for_power_bi_operations#PrivateLinkServicesForPowerBiOperations.{}', + client_factory=cf_private_link_service_for_power_bi) + with self.command_group('powerbiprivatelinks private-link-service-for-power-bi', + powerbiprivatelinks_private_link_service_for_power_bi, + client_factory=cf_private_link_service_for_power_bi) as g: + g.custom_command('list', 'powerbiprivatelinks_private_link_service_for_power_bi_list') + + from azext_powerbiprivatelinks.generated._client_factory import cf_private_link_service_resource_operation_result + powerbiprivatelinks_private_link_service_resource_operation_result = CliCommandType( + operations_tmpl='azext_powerbiprivatelinks.vendored_sdks.powerbiprivatelinks.operations._private_link_service_r' + 'esource_operation_results_operations#PrivateLinkServiceResourceOperationResultsOperations.{}', + client_factory=cf_private_link_service_resource_operation_result) + with self.command_group('powerbiprivatelinks private-link-service-resource-operation-result', + powerbiprivatelinks_private_link_service_resource_operation_result, + client_factory=cf_private_link_service_resource_operation_result) as g: + g.custom_show_command('show', 'powerbiprivatelinks_private_link_service_resource_operation_result_show') + + from azext_powerbiprivatelinks.generated._client_factory import cf_private_link_service + powerbiprivatelinks_private_link_service = CliCommandType( + operations_tmpl='azext_powerbiprivatelinks.vendored_sdks.powerbiprivatelinks.operations._private_link_services_' + 'operations#PrivateLinkServicesOperations.{}', + client_factory=cf_private_link_service) + with self.command_group('powerbiprivatelinks private-link-service', powerbiprivatelinks_private_link_service, + client_factory=cf_private_link_service) as g: + g.custom_command('list', 'powerbiprivatelinks_private_link_service_list') + + from azext_powerbiprivatelinks.generated._client_factory import cf_power_bi_resource + powerbiprivatelinks_power_bi_resource = CliCommandType( + operations_tmpl='azext_powerbiprivatelinks.vendored_sdks.powerbiprivatelinks.operations._power_bi_resources_ope' + 'rations#PowerBiResourcesOperations.{}', + client_factory=cf_power_bi_resource) + with self.command_group('powerbiprivatelinks power-bi-resource', powerbiprivatelinks_power_bi_resource, + client_factory=cf_power_bi_resource) as g: + g.custom_command('list', 'powerbiprivatelinks_power_bi_resource_list') + g.custom_command('create', 'powerbiprivatelinks_power_bi_resource_create') + g.custom_command('delete', 'powerbiprivatelinks_power_bi_resource_delete', confirmation=True) + + from azext_powerbiprivatelinks.generated._client_factory import cf_private_link_resource + powerbiprivatelinks_private_link_resource = CliCommandType( + operations_tmpl='azext_powerbiprivatelinks.vendored_sdks.powerbiprivatelinks.operations._private_link_resources' + '_operations#PrivateLinkResourcesOperations.{}', + client_factory=cf_private_link_resource) + with self.command_group('powerbiprivatelinks private-link-resource', powerbiprivatelinks_private_link_resource, + client_factory=cf_private_link_resource) as g: + g.custom_command('list', 'powerbiprivatelinks_private_link_resource_list') + + from azext_powerbiprivatelinks.generated._client_factory import cf_private_endpoint_connection_proxy + powerbiprivatelinks_private_endpoint_connection_proxy = CliCommandType( + operations_tmpl='azext_powerbiprivatelinks.vendored_sdks.powerbiprivatelinks.operations._private_endpoint_conne' + 'ction_proxies_operations#PrivateEndpointConnectionProxiesOperations.{}', + client_factory=cf_private_endpoint_connection_proxy) + with self.command_group('powerbiprivatelinks private-endpoint-connection-proxy', + powerbiprivatelinks_private_endpoint_connection_proxy, + client_factory=cf_private_endpoint_connection_proxy) as g: + g.custom_show_command('show', 'powerbiprivatelinks_private_endpoint_connection_proxy_show') + g.custom_command('create', 'powerbiprivatelinks_private_endpoint_connection_proxy_create', + supports_no_wait=True) + g.custom_command('delete', 'powerbiprivatelinks_private_endpoint_connection_proxy_delete', + supports_no_wait=True, confirmation=True) + g.custom_command('validate', 'powerbiprivatelinks_private_endpoint_connection_proxy_validate') + g.custom_wait_command('wait', 'powerbiprivatelinks_private_endpoint_connection_proxy_show') + + from azext_powerbiprivatelinks.generated._client_factory import cf_private_endpoint_connection + powerbiprivatelinks_private_endpoint_connection = CliCommandType( + operations_tmpl='azext_powerbiprivatelinks.vendored_sdks.powerbiprivatelinks.operations._private_endpoint_conne' + 'ctions_operations#PrivateEndpointConnectionsOperations.{}', + client_factory=cf_private_endpoint_connection) + with self.command_group('powerbiprivatelinks private-endpoint-connection', + powerbiprivatelinks_private_endpoint_connection, + client_factory=cf_private_endpoint_connection) as g: + g.custom_command('list', 'powerbiprivatelinks_private_endpoint_connection_list') + g.custom_show_command('show', 'powerbiprivatelinks_private_endpoint_connection_show') + g.custom_command('create', 'powerbiprivatelinks_private_endpoint_connection_create') + g.custom_command('delete', 'powerbiprivatelinks_private_endpoint_connection_delete', supports_no_wait=True, + confirmation=True) + g.custom_wait_command('wait', 'powerbiprivatelinks_private_endpoint_connection_show') + + with self.command_group('powerbiprivatelinks', is_experimental=True): + pass diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/custom.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/custom.py new file mode 100644 index 00000000000..130ff29433d --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/generated/custom.py @@ -0,0 +1,145 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from azure.cli.core.util import sdk_no_wait + + +def powerbiprivatelinks_private_link_service_for_power_bi_list(client): + return client.list_by_subscription_id() + + +def powerbiprivatelinks_private_link_service_resource_operation_result_show(client): + return client.get() + + +def powerbiprivatelinks_private_link_service_list(client): + return client.list_by_resource_group() + + +def powerbiprivatelinks_power_bi_resource_list(client): + return client.list_by_resource_name() + + +def powerbiprivatelinks_power_bi_resource_create(client, + client_tenant_id=None, + location=None, + tags=None, + tenant_id=None, + private_endpoint_connections=None): + body = {} + body['location'] = location + body['tags'] = tags + body['tenant_id'] = tenant_id + body['private_endpoint_connections'] = private_endpoint_connections + return client.create(client_tenant_id=client_tenant_id, + body=body) + + +def powerbiprivatelinks_power_bi_resource_delete(client): + return client.delete() + + +def powerbiprivatelinks_private_link_resource_list(client): + return client.list_by_resource() + + +def powerbiprivatelinks_private_endpoint_connection_proxy_show(client): + return client.get() + + +def powerbiprivatelinks_private_endpoint_connection_proxy_create(client, + client_tenant_id=None, + id_=None, + name=None, + type_=None, + location=None, + etag=None, + remote_private_endpoint_id=None, + manual_private_link_service_connections=None, + private_link_service_connections=None, + private_link_service_proxies=None, + connection_details=None, + no_wait=False): + body = {} + body['id'] = id_ + body['name'] = name + body['type'] = type_ + body['location'] = location + body['etag'] = etag + body['remote_private_endpoint'] = {} + body['remote_private_endpoint']['id'] = remote_private_endpoint_id + body['remote_private_endpoint']['manual_private_link_service_connections'] = manual_private_link_service_connections + body['remote_private_endpoint']['private_link_service_connections'] = private_link_service_connections + body['remote_private_endpoint']['private_link_service_proxies'] = private_link_service_proxies + body['remote_private_endpoint']['connection_details'] = connection_details + return sdk_no_wait(no_wait, + client.begin_create, + client_tenant_id=client_tenant_id, + body=body) + + +def powerbiprivatelinks_private_endpoint_connection_proxy_delete(client, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete) + + +def powerbiprivatelinks_private_endpoint_connection_proxy_validate(client, + id_=None, + name=None, + type_=None, + location=None, + etag=None, + remote_private_endpoint_id=None, + manual_private_link_service_connections=None, + private_link_service_connections=None, + private_link_service_proxies=None, + connection_details=None): + body = {} + body['id'] = id_ + body['name'] = name + body['type'] = type_ + body['location'] = location + body['etag'] = etag + body['remote_private_endpoint'] = {} + body['remote_private_endpoint']['id'] = remote_private_endpoint_id + body['remote_private_endpoint']['manual_private_link_service_connections'] = manual_private_link_service_connections + body['remote_private_endpoint']['private_link_service_connections'] = private_link_service_connections + body['remote_private_endpoint']['private_link_service_proxies'] = private_link_service_proxies + body['remote_private_endpoint']['connection_details'] = connection_details + return client.validate(body=body) + + +def powerbiprivatelinks_private_endpoint_connection_list(client, + resource_group_name, + azure_resource_name): + return client.list_by_resource(resource_group_name=resource_group_name, + azure_resource_name=azure_resource_name) + + +def powerbiprivatelinks_private_endpoint_connection_show(client): + return client.get() + + +def powerbiprivatelinks_private_endpoint_connection_create(client, + private_link_service_connection_state=None, + id_=None): + private_endpoint_connection = {} + private_endpoint_connection['private_link_service_connection_state'] = private_link_service_connection_state + private_endpoint_connection['private_endpoint'] = {} + private_endpoint_connection['private_endpoint']['id'] = id_ + return client.create(private_endpoint_connection=private_endpoint_connection) + + +def powerbiprivatelinks_private_endpoint_connection_delete(client, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete) diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/manual/__init__.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/manual/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/__init__.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/__init__.py new file mode 100644 index 00000000000..70488e93851 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/__init__.py @@ -0,0 +1,116 @@ +# 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 inspect +import logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func).lower() + module_path = __path__[0].lower() + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") + if use_exception_cache is None or use_exception_cache.lower() != "true": + raise + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/latest/__init__.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/latest/example_steps.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/latest/example_steps.py new file mode 100644 index 00000000000..d0094dcca80 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/latest/example_steps.py @@ -0,0 +1,179 @@ +# -------------------------------------------------------------------------- +# 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 .. import try_manual + + +# EXAMPLE: /PowerBIResources/put/Creates or updates private link service resource +@try_manual +def step_power_bi_resource_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks power-bi-resource create ' + '--location "global" ' + '--tenant-id "ac2bc297-8a3e-46f3-972d-87c2b4ae6e2f" ' + '--tags tag1="value1" tag2="value2"', + checks=checks) + + +# EXAMPLE: /PowerBIResources/get/List private link resources in a Azure resource +@try_manual +def step_power_bi_resource_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks power-bi-resource list', + checks=checks) + + +# EXAMPLE: /PowerBIResources/delete/Deletes private link service resource +@try_manual +def step_power_bi_resource_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks power-bi-resource delete -y', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnections/put/Updates status of private endpoint connection +@try_manual +def step_private_endpoint_connection_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-endpoint-connection create ' + '--id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Network/privateEndpoints/m' + 'yPrivateEndpointName" ' + '--private-link-service-connection-state description="" actions-required="None" status="Approved "', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnections/get/Gets private endpoint connection +@try_manual +def step_private_endpoint_connection_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-endpoint-connection show', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnections/get/Gets private endpoint connections +@try_manual +def step_private_endpoint_connection_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-endpoint-connection list ' + '--azure-resource-name "{myPrivateLinkServicesForPowerBi}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnectionProxies/put/Creates or updates private endpoint connection proxy +@try_manual +def step_private_endpoint_connection_proxy_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-endpoint-connection-proxy create ' + '--connection-details group-id="tenant" id="10001" link-identifier="1253" member-name="tenant" ' + 'private-ip-address="10.0.1.4" ' + '--remote-private-endpoint-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Ne' + 'twork/privateEndpoints/myPrivateEndpointName" ' + '--private-link-service-connections name="myPrivateEndpointConnection" group-ids="tenant" ' + 'request-message="opt msg" ' + '--private-link-service-proxies "[{{\\"groupConnectivityInformation\\":[{{\\"customerVisibleFqdns\\":[\\"9' + '1cb8a3f79e644bea2dedce59f8c0107-api.analysis.windows.net\\"],\\"groupId\\":\\"tenant\\",\\"internalFqdn\\' + '":\\"91cb8a3f79e644bea2dedce59f8c0107-api.analysis.windows.net\\",\\"memberName\\":\\"tenant\\",\\"privat' + 'eLinkServiceArmRegion\\":\\"\\"}}],\\"id\\":\\"/subscriptions/{subscription_id}/resourceGroups/{rg}/provi' + 'ders/Microsoft.Network/privateEndpoints/myPrivateEndpointName/privateLinkServiceProxies/azureResourceName' + '-proxy.58ffb8de-89ad-41eb-9f8f-de0a7db9d721\\",\\"remotePrivateEndpointConnection\\":{{\\"id\\":\\"/subsc' + 'riptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/' + '{myPrivateLinkServicesForPowerBi}/privateEndpointConnections/{myPrivateEndpointConnection}\\"}},\\"remote' + 'PrivateLinkServiceConnectionState\\":{{\\"description\\":\\"please approve\\",\\"actionsRequired\\":\\"No' + 'ne\\",\\"status\\":\\"Pending\\"}}}}]"', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnectionProxies/get/Gets private endpoint connection proxy +@try_manual +def step_private_endpoint_connection_proxy_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-endpoint-connection-proxy show', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnectionProxies/post/Validates a private endpoint connection +@try_manual +def step_private_endpoint_connection_proxy_validate(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-endpoint-connection-proxy validate ' + '--remote-private-endpoint-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Ne' + 'twork/privateEndpoints/myPrivateEndpointName" ' + '--private-link-service-connections name="myPrivateEndpointConnection" group-ids="tenant" ' + 'request-message="opt msg" ' + '--private-link-service-proxies "[{{\\"groupConnectivityInformation\\":[],\\"id\\":\\"/subscriptions/{subs' + 'cription_id}/resourceGroups/{rg}/providers/Microsoft.Network/privateEndpoints/myPrivateEndpointName/priva' + 'teLinkServiceProxies/azureResourceName-proxy.58ffb8de-89ad-41eb-9f8f-de0a7db9d721\\"}}]"', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnectionProxies/delete/Deletes a private endpoint connection proxy +@try_manual +def step_private_endpoint_connection_proxy_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-endpoint-connection-proxy delete -y', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnections/delete/Deletes private endpoint connection +@try_manual +def step_private_endpoint_connection_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-endpoint-connection delete -y', + checks=checks) + + +# EXAMPLE: /PrivateLinkResources/get/Gets private link resources in a Azure resource +@try_manual +def step_private_link_resource_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-link-resource list', + checks=checks) + + +# EXAMPLE: /PrivateLinkServiceResourceOperationResults/get/Result of operation on private link resources +@try_manual +def step_private_link_service(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-link-service-resource-operation-result show', + checks=checks) + + +# EXAMPLE: /PrivateLinkServices/get/List private link resources in a resource group +@try_manual +def step_private_link_service_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-link-service list', + checks=checks) + + +# EXAMPLE: /privateLinkServicesForPowerBI/get/List private link resources in a subscription +@try_manual +def step_private_link_service_for_power_bi_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az powerbiprivatelinks private-link-service-for-power-bi list', + checks=checks) + diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/latest/test_powerbiprivatelinks_scenario.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/latest/test_powerbiprivatelinks_scenario.py new file mode 100644 index 00000000000..94066b17da8 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/tests/latest/test_powerbiprivatelinks_scenario.py @@ -0,0 +1,94 @@ +# -------------------------------------------------------------------------- +# 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 os +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_power_bi_resource_create +from .example_steps import step_power_bi_resource_list +from .example_steps import step_power_bi_resource_delete +from .example_steps import step_private_endpoint_connection_create +from .example_steps import step_private_endpoint_connection_show +from .example_steps import step_private_endpoint_connection_list +from .example_steps import step_private_endpoint_connection_proxy_create +from .example_steps import step_private_endpoint_connection_proxy_show +from .example_steps import step_private_endpoint_connection_proxy_validate +from .example_steps import step_private_endpoint_connection_proxy_delete +from .example_steps import step_private_endpoint_connection_delete +from .example_steps import step_private_link_resource_list +from .example_steps import step_private_link_service +from .example_steps import step_private_link_service_list +from .example_steps import step_private_link_service_for_power_bi_list +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test, rg): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg): + pass + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg): + setup_scenario(test, rg) + step_power_bi_resource_create(test, rg, checks=[]) + step_power_bi_resource_list(test, rg, checks=[]) + step_power_bi_resource_delete(test, rg, checks=[]) + step_private_endpoint_connection_create(test, rg, checks=[]) + step_private_endpoint_connection_show(test, rg, checks=[]) + step_private_endpoint_connection_list(test, rg, checks=[]) + step_private_endpoint_connection_proxy_create(test, rg, checks=[]) + step_private_endpoint_connection_proxy_show(test, rg, checks=[]) + step_private_endpoint_connection_proxy_validate(test, rg, checks=[]) + step_private_endpoint_connection_proxy_delete(test, rg, checks=[]) + step_private_endpoint_connection_delete(test, rg, checks=[]) + step_private_link_resource_list(test, rg, checks=[]) + step_private_link_service(test, rg, checks=[]) + step_private_link_service_list(test, rg, checks=[]) + step_private_link_service_for_power_bi_list(test, rg, checks=[]) + cleanup_scenario(test, rg) + + +# Test class for Scenario +@try_manual +class PowerbiprivatelinksScenarioTest(ScenarioTest): + + def __init__(self, *args, **kwargs): + super(PowerbiprivatelinksScenarioTest, self).__init__(*args, **kwargs) + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'myPrivateLinkServicesForPowerBi': 'azureResourceName', + 'myPrivateEndpointConnection': 'myPrivateEndpointName.58ffb8de-89ad-41eb-9f8f-de0a7db9d721', + }) + + + @ResourceGroupPreparer(name_prefix='clitestpowerbiprivatelinks_resourceGroup'[:7], key='rg', parameter_name='rg') + def test_powerbiprivatelinks_Scenario(self, rg): + call_scenario(self, rg) + calc_coverage(__file__) + raise_if() + diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/__init__.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/__init__.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/__init__.py new file mode 100644 index 00000000000..4e4dfe6c4cd --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/__init__.py @@ -0,0 +1,16 @@ +# 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 ._private_link_services_for_power_bi_client import PrivateLinkServicesForPowerBIClient +__all__ = ['PrivateLinkServicesForPowerBIClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/_configuration.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/_configuration.py new file mode 100644 index 00000000000..fa5d5aef732 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/_configuration.py @@ -0,0 +1,94 @@ +# 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 typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class PrivateLinkServicesForPowerBIClientConfiguration(Configuration): + """Configuration for PrivateLinkServicesForPowerBIClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_resource_name: The name of the Azure resource. + :type azure_resource_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param operation_id: The id of Azure async operation. + :type operation_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + resource_group_name, # type: str + azure_resource_name, # type: str + private_endpoint_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if resource_group_name is None: + raise ValueError("Parameter 'resource_group_name' must not be None.") + if azure_resource_name is None: + raise ValueError("Parameter 'azure_resource_name' must not be None.") + if private_endpoint_name is None: + raise ValueError("Parameter 'private_endpoint_name' must not be None.") + if operation_id is None: + raise ValueError("Parameter 'operation_id' must not be None.") + super(PrivateLinkServicesForPowerBIClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.azure_resource_name = azure_resource_name + self.private_endpoint_name = private_endpoint_name + self.operation_id = operation_id + self.api_version = "2020-06-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'privatelinkservicesforpowerbiclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/_private_link_services_for_power_bi_client.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/_private_link_services_for_power_bi_client.py new file mode 100644 index 00000000000..ba5ae6959ef --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/_private_link_services_for_power_bi_client.py @@ -0,0 +1,116 @@ +# 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 typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import PrivateLinkServicesForPowerBIClientConfiguration +from .operations import Operations +from .operations import PrivateLinkServicesForPowerBiOperations +from .operations import PrivateLinkServiceResourceOperationResultsOperations +from .operations import PrivateLinkServicesOperations +from .operations import PowerBiResourcesOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionProxiesOperations +from .operations import PrivateEndpointConnectionsOperations +from . import models + + +class PrivateLinkServicesForPowerBIClient(object): + """Client to manage Power BI Private Link Service resources and connection members. + + :ivar operations: Operations operations + :vartype operations: private_link_services_for_power_bi_client.operations.Operations + :ivar private_link_services_for_power_bi: PrivateLinkServicesForPowerBiOperations operations + :vartype private_link_services_for_power_bi: private_link_services_for_power_bi_client.operations.PrivateLinkServicesForPowerBiOperations + :ivar private_link_service_resource_operation_results: PrivateLinkServiceResourceOperationResultsOperations operations + :vartype private_link_service_resource_operation_results: private_link_services_for_power_bi_client.operations.PrivateLinkServiceResourceOperationResultsOperations + :ivar private_link_services: PrivateLinkServicesOperations operations + :vartype private_link_services: private_link_services_for_power_bi_client.operations.PrivateLinkServicesOperations + :ivar power_bi_resources: PowerBiResourcesOperations operations + :vartype power_bi_resources: private_link_services_for_power_bi_client.operations.PowerBiResourcesOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: private_link_services_for_power_bi_client.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connection_proxies: PrivateEndpointConnectionProxiesOperations operations + :vartype private_endpoint_connection_proxies: private_link_services_for_power_bi_client.operations.PrivateEndpointConnectionProxiesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: private_link_services_for_power_bi_client.operations.PrivateEndpointConnectionsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_resource_name: The name of the Azure resource. + :type azure_resource_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param operation_id: The id of Azure async operation. + :type operation_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + resource_group_name, # type: str + azure_resource_name, # type: str + private_endpoint_name, # type: str + operation_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = PrivateLinkServicesForPowerBIClientConfiguration(credential, subscription_id, resource_group_name, azure_resource_name, private_endpoint_name, operation_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_services_for_power_bi = PrivateLinkServicesForPowerBiOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_service_resource_operation_results = PrivateLinkServiceResourceOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_services = PrivateLinkServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.power_bi_resources = PowerBiResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connection_proxies = PrivateEndpointConnectionProxiesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> PrivateLinkServicesForPowerBIClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/__init__.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/__init__.py new file mode 100644 index 00000000000..8867e0da7f0 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/__init__.py @@ -0,0 +1,10 @@ +# 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 ._private_link_services_for_power_bi_client import PrivateLinkServicesForPowerBIClient +__all__ = ['PrivateLinkServicesForPowerBIClient'] diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/_configuration.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/_configuration.py new file mode 100644 index 00000000000..9b6d7cfdcde --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/_configuration.py @@ -0,0 +1,90 @@ +# 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 typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class PrivateLinkServicesForPowerBIClientConfiguration(Configuration): + """Configuration for PrivateLinkServicesForPowerBIClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_resource_name: The name of the Azure resource. + :type azure_resource_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param operation_id: The id of Azure async operation. + :type operation_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + resource_group_name: str, + azure_resource_name: str, + private_endpoint_name: str, + operation_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if resource_group_name is None: + raise ValueError("Parameter 'resource_group_name' must not be None.") + if azure_resource_name is None: + raise ValueError("Parameter 'azure_resource_name' must not be None.") + if private_endpoint_name is None: + raise ValueError("Parameter 'private_endpoint_name' must not be None.") + if operation_id is None: + raise ValueError("Parameter 'operation_id' must not be None.") + super(PrivateLinkServicesForPowerBIClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.azure_resource_name = azure_resource_name + self.private_endpoint_name = private_endpoint_name + self.operation_id = operation_id + self.api_version = "2020-06-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'privatelinkservicesforpowerbiclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/_private_link_services_for_power_bi_client.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/_private_link_services_for_power_bi_client.py new file mode 100644 index 00000000000..74cec924ad9 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/_private_link_services_for_power_bi_client.py @@ -0,0 +1,110 @@ +# 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 typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import PrivateLinkServicesForPowerBIClientConfiguration +from .operations import Operations +from .operations import PrivateLinkServicesForPowerBiOperations +from .operations import PrivateLinkServiceResourceOperationResultsOperations +from .operations import PrivateLinkServicesOperations +from .operations import PowerBiResourcesOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionProxiesOperations +from .operations import PrivateEndpointConnectionsOperations +from .. import models + + +class PrivateLinkServicesForPowerBIClient(object): + """Client to manage Power BI Private Link Service resources and connection members. + + :ivar operations: Operations operations + :vartype operations: private_link_services_for_power_bi_client.aio.operations.Operations + :ivar private_link_services_for_power_bi: PrivateLinkServicesForPowerBiOperations operations + :vartype private_link_services_for_power_bi: private_link_services_for_power_bi_client.aio.operations.PrivateLinkServicesForPowerBiOperations + :ivar private_link_service_resource_operation_results: PrivateLinkServiceResourceOperationResultsOperations operations + :vartype private_link_service_resource_operation_results: private_link_services_for_power_bi_client.aio.operations.PrivateLinkServiceResourceOperationResultsOperations + :ivar private_link_services: PrivateLinkServicesOperations operations + :vartype private_link_services: private_link_services_for_power_bi_client.aio.operations.PrivateLinkServicesOperations + :ivar power_bi_resources: PowerBiResourcesOperations operations + :vartype power_bi_resources: private_link_services_for_power_bi_client.aio.operations.PowerBiResourcesOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: private_link_services_for_power_bi_client.aio.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connection_proxies: PrivateEndpointConnectionProxiesOperations operations + :vartype private_endpoint_connection_proxies: private_link_services_for_power_bi_client.aio.operations.PrivateEndpointConnectionProxiesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: private_link_services_for_power_bi_client.aio.operations.PrivateEndpointConnectionsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_resource_name: The name of the Azure resource. + :type azure_resource_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param operation_id: The id of Azure async operation. + :type operation_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + resource_group_name: str, + azure_resource_name: str, + private_endpoint_name: str, + operation_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = PrivateLinkServicesForPowerBIClientConfiguration(credential, subscription_id, resource_group_name, azure_resource_name, private_endpoint_name, operation_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_services_for_power_bi = PrivateLinkServicesForPowerBiOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_service_resource_operation_results = PrivateLinkServiceResourceOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_services = PrivateLinkServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.power_bi_resources = PowerBiResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connection_proxies = PrivateEndpointConnectionProxiesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "PrivateLinkServicesForPowerBIClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/__init__.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/__init__.py new file mode 100644 index 00000000000..6d712f253aa --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/__init__.py @@ -0,0 +1,27 @@ +# 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 ._private_link_services_for_power_bi_operations import PrivateLinkServicesForPowerBiOperations +from ._private_link_service_resource_operation_results_operations import PrivateLinkServiceResourceOperationResultsOperations +from ._private_link_services_operations import PrivateLinkServicesOperations +from ._power_bi_resources_operations import PowerBiResourcesOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connection_proxies_operations import PrivateEndpointConnectionProxiesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'Operations', + 'PrivateLinkServicesForPowerBiOperations', + 'PrivateLinkServiceResourceOperationResultsOperations', + 'PrivateLinkServicesOperations', + 'PowerBiResourcesOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionProxiesOperations', + 'PrivateEndpointConnectionsOperations', +] diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_operations.py new file mode 100644 index 00000000000..5f803f6e0a8 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.AvailableOperations"]: + """Lists all of the available Power BI RP operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableOperations or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~private_link_services_for_power_bi_client.models.AvailableOperations] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableOperations"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableOperations', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.PowerBI/operations'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_power_bi_resources_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_power_bi_resources_operations.py new file mode 100644 index 00000000000..2b179aa8d6c --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_power_bi_resources_operations.py @@ -0,0 +1,211 @@ +# 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 typing import Any, Callable, Dict, Generic, List, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PowerBiResourcesOperations: + """PowerBiResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list_by_resource_name( + self, + **kwargs + ) -> List["models.TenantResource"]: + """Gets all the private link resources for the given Azure resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of TenantResource, or the result of cls(response) + :rtype: list[~private_link_services_for_power_bi_client.models.TenantResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.TenantResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_by_resource_name.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[TenantResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_resource_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}'} # type: ignore + + async def create( + self, + body: "models.TenantResource", + client_tenant_id: Optional[str] = None, + **kwargs + ) -> "models.TenantResource": + """Creates or updates a Private Link Service Resource for Power BI. + + :param body: Tenant resource to be created or updated. + :type body: ~private_link_services_for_power_bi_client.models.TenantResource + :param client_tenant_id: The client tenant id in header. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000). + :type client_tenant_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TenantResource, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.TenantResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TenantResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_tenant_id is not None: + header_parameters['x-ms-client-tenant-id'] = self._serialize.header("client_tenant_id", client_tenant_id, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(body, 'TenantResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TenantResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}'} # type: ignore + + async def delete( + self, + **kwargs + ) -> None: + """Deletes a Private Link Service Resource for Power BI. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_endpoint_connection_proxies_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_endpoint_connection_proxies_operations.py new file mode 100644 index 00000000000..e9766a37a2a --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_endpoint_connection_proxies_operations.py @@ -0,0 +1,396 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionProxiesOperations: + """PrivateEndpointConnectionProxiesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + **kwargs + ) -> "models.PrivateEndpointConnectionProxy": + """Synchronous API called by NRP to get private endpoint connection proxy for Power BI by private endpoint name. + + Gets private endpoint connection proxy for Power BI by private endpoint name. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionProxy, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionProxy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionProxy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionProxy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}'} # type: ignore + + async def _create_initial( + self, + body: "models.PrivateEndpointConnectionProxy", + client_tenant_id: Optional[str] = None, + **kwargs + ) -> "models.PrivateEndpointConnectionProxyResource": + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionProxyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_tenant_id is not None: + header_parameters['x-ms-client-tenant-id'] = self._serialize.header("client_tenant_id", client_tenant_id, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(body, 'PrivateEndpointConnectionProxy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('PrivateEndpointConnectionProxyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}'} # type: ignore + + async def begin_create( + self, + body: "models.PrivateEndpointConnectionProxy", + client_tenant_id: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["models.PrivateEndpointConnectionProxyResource"]: + """Creates or updates private endpoint connection proxy for Power BI by private endpoint name. + + :param body: The PrivateEndpointConnectionProxy to be created or updated. + :type body: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionProxy + :param client_tenant_id: The client tenant id in header. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000). + :type client_tenant_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnectionProxyResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionProxyResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionProxyResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + body=body, + client_tenant_id=client_tenant_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('PrivateEndpointConnectionProxyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}'} # type: ignore + + async def _delete_initial( + self, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}'} # type: ignore + + async def begin_delete( + self, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection proxy for Power BI by private endpoint name. + + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}'} # type: ignore + + async def validate( + self, + body: "models.PrivateEndpointConnectionProxy", + **kwargs + ) -> "models.PrivateEndpointConnectionProxy": + """Synchronous API called by NRP to validate a private endpoint before create or update. + + Validates a private endpoint connection before create or update. + + :param body: The PrivateEndpointConnectionProxy to be created or updated. + :type body: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionProxy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionProxy, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionProxy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionProxy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(body, 'PrivateEndpointConnectionProxy') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionProxy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}/validate'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_endpoint_connections_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 00000000000..0c6d5bb66ac --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,349 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource( + self, + resource_group_name: str, + azure_resource_name: str, + **kwargs + ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + """Lists all private endpoint connections under a resource. + + Gets private endpoint connection for Power BI. + + :param resource_group_name: The name of the resource group within the user's subscription. + :type resource_group_name: str + :param azure_resource_name: The name of the powerbi resource. + :type azure_resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] # type: ignore + 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'), + 'azureResourceName': self._serialize.url("azure_resource_name", azure_resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections'} # type: ignore + + async def get( + self, + **kwargs + ) -> "models.PrivateEndpointConnection": + """Get a specific private endpoint connection. + + Get a specific private endpoint connection for Power BI by private endpoint name. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}'} # type: ignore + + async def create( + self, + private_endpoint_connection: "models.PrivateEndpointConnection", + **kwargs + ) -> "models.PrivateEndpointConnection": + """Update a specific private endpoint connection. + + Updates the status of Private Endpoint Connection object. Used to approve or reject a + connection. + + :param private_endpoint_connection: Private endpoint connection object to update. + :type private_endpoint_connection: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}'} # type: ignore + + async def _delete_initial( + self, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}'} # type: ignore + + async def begin_delete( + self, + **kwargs + ) -> AsyncLROPoller[None]: + """Asynchronous API to delete a private endpoint connection for Power BI by private endpoint name. + + Deletes a private endpoint connection for Power BI by private endpoint name. + + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_resources_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_resources_operations.py new file mode 100644 index 00000000000..557963bc769 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,113 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource( + self, + **kwargs + ) -> AsyncIterable["models.PrivateLinkResourcesListResult"]: + """List private link Power BI resource. + + List private link resources under a specific Power BI resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkResourcesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~private_link_services_for_power_bi_client.models.PrivateLinkResourcesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateLinkResourcesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateLinkResources'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_service_resource_operation_results_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_service_resource_operation_results_operations.py new file mode 100644 index 00000000000..e638bf1f37c --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_service_resource_operation_results_operations.py @@ -0,0 +1,93 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkServiceResourceOperationResultsOperations: + """PrivateLinkServiceResourceOperationResultsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + **kwargs + ) -> "models.AsyncOperationDetail": + """Gets operation result of Private Link Service Resources for Power BI. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationDetail, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.AsyncOperationDetail + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AsyncOperationDetail"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'operationId': self._serialize.url("self._config.operation_id", self._config.operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationDetail', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/operationResults/{operationId}'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_services_for_power_bi_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_services_for_power_bi_operations.py new file mode 100644 index 00000000000..da6fa554085 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_services_for_power_bi_operations.py @@ -0,0 +1,92 @@ +# 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 typing import Any, Callable, Dict, Generic, List, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkServicesForPowerBiOperations: + """PrivateLinkServicesForPowerBiOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list_by_subscription_id( + self, + **kwargs + ) -> List["models.TenantResource"]: + """Gets all the private link resources for the given subscription id. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of TenantResource, or the result of cls(response) + :rtype: list[~private_link_services_for_power_bi_client.models.TenantResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.TenantResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_by_subscription_id.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[TenantResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_subscription_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_services_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_services_operations.py new file mode 100644 index 00000000000..29d17f1d368 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/aio/operations/_private_link_services_operations.py @@ -0,0 +1,93 @@ +# 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 typing import Any, Callable, Dict, Generic, List, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkServicesOperations: + """PrivateLinkServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list_by_resource_group( + self, + **kwargs + ) -> List["models.TenantResource"]: + """Gets all the private link resources for the given resource group. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of TenantResource, or the result of cls(response) + :rtype: list[~private_link_services_for_power_bi_client.models.TenantResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.TenantResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[TenantResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/__init__.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/__init__.py new file mode 100644 index 00000000000..7e6f2e43348 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/__init__.py @@ -0,0 +1,106 @@ +# 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 AsyncOperationDetail + from ._models_py3 import AvailableOperations + from ._models_py3 import ConnectionState + from ._models_py3 import Display + from ._models_py3 import Error + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponseError + from ._models_py3 import GroupConnectivityInformation + from ._models_py3 import Operation + from ._models_py3 import OperationDetail + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationDisplayautogenerated + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateEndpointConnectionProxy + from ._models_py3 import PrivateEndpointConnectionProxyResource + from ._models_py3 import PrivateLinkConnectionDetail + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourcesListResult + from ._models_py3 import PrivateLinkServiceConnection + from ._models_py3 import PrivateLinkServiceProxy + from ._models_py3 import RemotePrivateEndpoint + from ._models_py3 import RemotePrivateEndpointConnection + from ._models_py3 import Resource + from ._models_py3 import SystemData + from ._models_py3 import TenantResource +except (SyntaxError, ImportError): + from ._models import AsyncOperationDetail # type: ignore + from ._models import AvailableOperations # type: ignore + from ._models import ConnectionState # type: ignore + from ._models import Display # type: ignore + from ._models import Error # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import ErrorResponseError # type: ignore + from ._models import GroupConnectivityInformation # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDetail # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationDisplayautogenerated # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateEndpointConnectionProxy # type: ignore + from ._models import PrivateEndpointConnectionProxyResource # type: ignore + from ._models import PrivateLinkConnectionDetail # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourcesListResult # type: ignore + from ._models import PrivateLinkServiceConnection # type: ignore + from ._models import PrivateLinkServiceProxy # type: ignore + from ._models import RemotePrivateEndpoint # type: ignore + from ._models import RemotePrivateEndpointConnection # type: ignore + from ._models import Resource # type: ignore + from ._models import SystemData # type: ignore + from ._models import TenantResource # type: ignore + +from ._private_link_services_for_power_bi_client_enums import ( + ActionsRequired, + IdentityType, + PersistedConnectionStatus, +) + +__all__ = [ + 'AsyncOperationDetail', + 'AvailableOperations', + 'ConnectionState', + 'Display', + 'Error', + 'ErrorDetail', + 'ErrorResponse', + 'ErrorResponseError', + 'GroupConnectivityInformation', + 'Operation', + 'OperationDetail', + 'OperationDisplay', + 'OperationDisplayautogenerated', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateEndpointConnectionProxy', + 'PrivateEndpointConnectionProxyResource', + 'PrivateLinkConnectionDetail', + 'PrivateLinkResource', + 'PrivateLinkResourcesListResult', + 'PrivateLinkServiceConnection', + 'PrivateLinkServiceProxy', + 'RemotePrivateEndpoint', + 'RemotePrivateEndpointConnection', + 'Resource', + 'SystemData', + 'TenantResource', + 'ActionsRequired', + 'IdentityType', + 'PersistedConnectionStatus', +] diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/_models.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/_models.py new file mode 100644 index 00000000000..0b6f73e1b76 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/_models.py @@ -0,0 +1,977 @@ +# 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 azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AsyncOperationDetail(msrest.serialization.Model): + """AsyncOperationDetail. + + :param id: The operation id. + :type id: str + :param name: The operation name. + :type name: str + :param status: The operation status. + :type status: str + :param start_time: The operation start time. + :type start_time: str + :param end_time: The operation end time. + :type end_time: str + :param error: The error. + :type error: ~private_link_services_for_power_bi_client.models.Error + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__( + self, + **kwargs + ): + super(AsyncOperationDetail, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.status = kwargs.get('status', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.error = kwargs.get('error', None) + + +class AvailableOperations(msrest.serialization.Model): + """Available operations of the service. + + :param value: Collection of available operation details. + :type value: list[~private_link_services_for_power_bi_client.models.OperationDetail] + :param next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationDetail]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableOperations, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ConnectionState(msrest.serialization.Model): + """ConnectionState information. + + :param status: Status of the connection. Possible values include: "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or + ~private_link_services_for_power_bi_client.models.PersistedConnectionStatus + :param description: Description of the connection state. + :type description: str + :param actions_required: Actions required (if any). + :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(ConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class Display(msrest.serialization.Model): + """Display. + + :param provider: The localized friendly form of the resource provider name. This form is also + expected to include the publisher/company responsible. Use Title Casing. Begin with "Microsoft" + for 1st party services. + :type provider: str + :param resource: The localized friendly form of the resource type related to this + action/operation. This form should match the public documentation for the resource provider. + Use Title Casing. For examples, refer to the "name" section. + :type resource: str + :param operation: The localized friendly name for the operation as shown to the user. This name + should be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and + include the entity/resource to which it applies. + :type operation: str + :param description: The localized friendly description for the operation as shown to the user. + This description should be thorough, yet concise. It will be used in tool-tips and detailed + views. + :type description: str + :param origin: The intended executor of the operation; governs the display of the operation in + the RBAC UX and the audit logs UX. Default value is 'user,system'. + :type origin: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Display, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + self.origin = kwargs.get('origin', None) + + +class Error(msrest.serialization.Model): + """Error. + + :param code: Specifies the error code. + :type code: str + :param message: Specifies the error message. + :type message: str + :param target: Specifies the error target. + :type target: str + :param details: Specifies the error details. + :type details: list[~private_link_services_for_power_bi_client.models.ErrorDetail] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class ErrorDetail(msrest.serialization.Model): + """ErrorDetail. + + :param code: Specifies the error code. + :type code: str + :param message: Specifies the error message. + :type message: str + :param target: Specifies the error target. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + + +class ErrorResponse(msrest.serialization.Model): + """Describes the format of Error response. + + :param error: The error object. + :type error: ~private_link_services_for_power_bi_client.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseError(msrest.serialization.Model): + """The error object. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class GroupConnectivityInformation(msrest.serialization.Model): + """GroupConnectivityInformation. + + :param group_id: Specifies the group id of the group connectivity information. + :type group_id: str + :param member_name: Specifies the member name of the group connectivity information. + :type member_name: str + :param internal_fqdn: Specifies the internal FQDN of the group connectivity information. + :type internal_fqdn: str + :param customer_visible_fqdns: Specifies the customer visible FQDNs of the group connectivity + information. + :type customer_visible_fqdns: list[str] + :param private_link_service_arm_region: Specifies the ARM region of the group connectivity + information. + :type private_link_service_arm_region: str + """ + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'member_name': {'key': 'memberName', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'customer_visible_fqdns': {'key': 'customerVisibleFqdns', 'type': '[str]'}, + 'private_link_service_arm_region': {'key': 'privateLinkServiceArmRegion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GroupConnectivityInformation, self).__init__(**kwargs) + self.group_id = kwargs.get('group_id', None) + self.member_name = kwargs.get('member_name', None) + self.internal_fqdn = kwargs.get('internal_fqdn', None) + self.customer_visible_fqdns = kwargs.get('customer_visible_fqdns', None) + self.private_link_service_arm_region = kwargs.get('private_link_service_arm_region', None) + + +class Operation(msrest.serialization.Model): + """PowerBI Private link REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The object that represents the operation. + :type display: ~private_link_services_for_power_bi_client.models.OperationDisplayautogenerated + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayautogenerated'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class OperationDetail(msrest.serialization.Model): + """Operation detail payload. + + :param name: Name of the operation. + :type name: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: str + :param display: Display of the operation. + :type display: ~private_link_services_for_power_bi_client.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDetail, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + + +class OperationDisplay(msrest.serialization.Model): + """Operation display payload. + + :param provider: Resource provider of the operation. + :type provider: str + :param resource: Resource of the operation. + :type resource: str + :param operation: Localized friendly name for the operation. + :type operation: str + :param description: Localized friendly description for the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationDisplayautogenerated(msrest.serialization.Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.PowerBI. + :type provider: str + :param resource: Resource on which the operation is performed: private endpoint, etc. + :type resource: str + :param operation: Operation type: create, update, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplayautogenerated, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + + +class PrivateEndpoint(msrest.serialization.Model): + """PrivateEndpoint. + + :param id: Specifies the id of private endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class PrivateEndpointConnection(msrest.serialization.Model): + """PrivateEndpointConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Specifies the id of the resource. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~private_link_services_for_power_bi_client.models.SystemData + :param private_endpoint: Specifies the private endpoint. + :type private_endpoint: ~private_link_services_for_power_bi_client.models.PrivateEndpoint + :param private_link_service_connection_state: Specifies the connection state. + :type private_link_service_connection_state: + ~private_link_services_for_power_bi_client.models.ConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'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'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ConnectionState'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.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) + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connections. + + :param value: Specifies the name of the private endpoint connection. + :type value: list[~private_link_services_for_power_bi_client.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateEndpointConnectionProxy(msrest.serialization.Model): + """PrivateEndpointConnectionProxy. + + :param id: Specifies the id of the resource. + :type id: str + :param name: Specifies the name of the resource. + :type name: str + :param type: Specifies the type of the resource. + :type type: str + :param location: Specifies the location of the resource. + :type location: str + :param etag: Specifies the etag of the resource. + :type etag: str + :param remote_private_endpoint: Specifies the remote private endpoint of the resource. + :type remote_private_endpoint: + ~private_link_services_for_power_bi_client.models.RemotePrivateEndpoint + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'remote_private_endpoint': {'key': 'remotePrivateEndpoint', 'type': 'RemotePrivateEndpoint'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionProxy, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.location = kwargs.get('location', None) + self.etag = kwargs.get('etag', None) + self.remote_private_endpoint = kwargs.get('remote_private_endpoint', None) + + +class PrivateEndpointConnectionProxyResource(msrest.serialization.Model): + """PrivateEndpointConnectionProxyResource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Specifies the id of the resource. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param location: Specifies the location of the resource. + :type location: str + :param etag: Specifies the etag of the resource. + :type etag: str + :param id_properties_id: Specifies the id of the resource. + :type id_properties_id: str + :param name_properties_name: Specifies the name of the resource. + :type name_properties_name: str + :param type_properties_type: Specifies the type of the resource. + :type type_properties_type: str + :param location_properties_location: Specifies the location of the resource. + :type location_properties_location: str + :param etag_properties_etag: Specifies the etag of the resource. + :type etag_properties_etag: str + :param remote_private_endpoint: Specifies the remote private endpoint of the resource. + :type remote_private_endpoint: + ~private_link_services_for_power_bi_client.models.RemotePrivateEndpoint + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'id_properties_id': {'key': 'properties.id', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'location_properties_location': {'key': 'properties.location', 'type': 'str'}, + 'etag_properties_etag': {'key': 'properties.etag', 'type': 'str'}, + 'remote_private_endpoint': {'key': 'properties.remotePrivateEndpoint', 'type': 'RemotePrivateEndpoint'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.etag = kwargs.get('etag', None) + self.id_properties_id = kwargs.get('id_properties_id', None) + self.name_properties_name = kwargs.get('name_properties_name', None) + self.type_properties_type = kwargs.get('type_properties_type', None) + self.location_properties_location = kwargs.get('location_properties_location', None) + self.etag_properties_etag = kwargs.get('etag_properties_etag', None) + self.remote_private_endpoint = kwargs.get('remote_private_endpoint', None) + + +class PrivateLinkConnectionDetail(msrest.serialization.Model): + """PrivateLinkConnectionDetail. + + :param id: Specifies the type of the connection detail. + :type id: str + :param member_name: Specifies the member name of the connection detail. + :type member_name: str + :param private_ip_address: Specifies the private ip address of the connection detail. + :type private_ip_address: str + :param link_identifier: Specifies the link id of the connection detail. + :type link_identifier: str + :param group_id: Specifies the group id of the connection detail. + :type group_id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'member_name': {'key': 'memberName', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'link_identifier': {'key': 'linkIdentifier', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkConnectionDetail, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.member_name = kwargs.get('member_name', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.link_identifier = kwargs.get('link_identifier', None) + self.group_id = kwargs.get('group_id', None) + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Fully qualified identifier of the resource. + :type id: str + :param name: Name of the resource. + :type name: str + :param type: Type of the resource. + :type type: str + :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 = { + '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'}, + '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.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourcesListResult(msrest.serialization.Model): + """Specifies the private link resource. + + :param value: A collection of private endpoint connection resources. + :type value: list[~private_link_services_for_power_bi_client.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnection(msrest.serialization.Model): + """PrivateLinkServiceConnection. + + :param name: Specifies the name of the private link service connection. + :type name: str + :param group_ids: Specifies the group ids of the private link service connection. + :type group_ids: list[str] + :param request_message: Specifies the request message of the private link service connection. + :type request_message: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'group_ids': {'key': 'groupIds', 'type': '[str]'}, + 'request_message': {'key': 'requestMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.group_ids = kwargs.get('group_ids', None) + self.request_message = kwargs.get('request_message', None) + + +class PrivateLinkServiceProxy(msrest.serialization.Model): + """PrivateLinkServiceProxy. + + :param id: Specifies the id of the private link service proxy. + :type id: str + :param group_connectivity_information: Specifies the group connectivity information of the + private link service proxy. + :type group_connectivity_information: + list[~private_link_services_for_power_bi_client.models.GroupConnectivityInformation] + :param remote_private_link_service_connection_state: Specifies the connection state of the + private link service proxy. + :type remote_private_link_service_connection_state: + ~private_link_services_for_power_bi_client.models.ConnectionState + :param remote_private_endpoint_connection: Specifies the private endpoint connection of the + private link service proxy. + :type remote_private_endpoint_connection: + ~private_link_services_for_power_bi_client.models.RemotePrivateEndpointConnection + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'group_connectivity_information': {'key': 'groupConnectivityInformation', 'type': '[GroupConnectivityInformation]'}, + 'remote_private_link_service_connection_state': {'key': 'remotePrivateLinkServiceConnectionState', 'type': 'ConnectionState'}, + 'remote_private_endpoint_connection': {'key': 'remotePrivateEndpointConnection', 'type': 'RemotePrivateEndpointConnection'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceProxy, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.group_connectivity_information = kwargs.get('group_connectivity_information', None) + self.remote_private_link_service_connection_state = kwargs.get('remote_private_link_service_connection_state', None) + self.remote_private_endpoint_connection = kwargs.get('remote_private_endpoint_connection', None) + + +class RemotePrivateEndpoint(msrest.serialization.Model): + """RemotePrivateEndpoint. + + :param id: Specifies the id of the private endpoint. + :type id: str + :param manual_private_link_service_connections: Specifies the private link service connections + of the private endpoint. + :type manual_private_link_service_connections: + list[~private_link_services_for_power_bi_client.models.PrivateLinkServiceConnection] + :param private_link_service_connections: Specifies the private link service connections of the + private endpoint. + :type private_link_service_connections: + list[~private_link_services_for_power_bi_client.models.PrivateLinkServiceConnection] + :param private_link_service_proxies: Specifies the private link service proxies of the private + endpoint. + :type private_link_service_proxies: + list[~private_link_services_for_power_bi_client.models.PrivateLinkServiceProxy] + :param connection_details: Specifies the connection details of the private endpoint. + :type connection_details: + list[~private_link_services_for_power_bi_client.models.PrivateLinkConnectionDetail] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'manual_private_link_service_connections': {'key': 'manualPrivateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'private_link_service_connections': {'key': 'privateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'private_link_service_proxies': {'key': 'privateLinkServiceProxies', 'type': '[PrivateLinkServiceProxy]'}, + 'connection_details': {'key': 'connectionDetails', 'type': '[PrivateLinkConnectionDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(RemotePrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.manual_private_link_service_connections = kwargs.get('manual_private_link_service_connections', None) + self.private_link_service_connections = kwargs.get('private_link_service_connections', None) + self.private_link_service_proxies = kwargs.get('private_link_service_proxies', None) + self.connection_details = kwargs.get('connection_details', None) + + +class RemotePrivateEndpointConnection(msrest.serialization.Model): + """RemotePrivateEndpointConnection. + + :param id: Specifies the id of private endpoint connection. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RemotePrivateEndpointConnection, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class Resource(msrest.serialization.Model): + """Represents an instance of an PowerBI 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: An identifier that represents the PowerBI resource. + :vartype id: str + :ivar name: The name of the PowerBI resource. + :vartype name: str + :ivar type: The type of the PowerBI resource. + :vartype type: str + :param location: Required. Location of the PowerBI resource. + :type location: str + :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. + :type tags: dict[str, str] + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~private_link_services_for_power_bi_client.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + self.system_data = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_by: An identifier for the identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~private_link_services_for_power_bi_client.models.IdentityType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: An identifier for the identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or + ~private_link_services_for_power_bi_client.models.IdentityType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _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 = None + self.created_by_type = None + self.created_at = None + self.last_modified_by = None + self.last_modified_by_type = None + self.last_modified_at = None + + +class TenantResource(msrest.serialization.Model): + """TenantResource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Specifies the resource identifier of the resource. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~private_link_services_for_power_bi_client.models.SystemData + :param location: Specifies the location of the resource. + :type location: str + :param tags: A set of tags. Specifies the tags of the resource. + :type tags: dict[str, str] + :param tenant_id: Specifies the tenant id of the resource. + :type tenant_id: str + :param private_endpoint_connections: Specifies the private endpoint connections of the + resource. + :type private_endpoint_connections: + list[~private_link_services_for_power_bi_client.models.PrivateEndpointConnection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(TenantResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/_models_py3.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/_models_py3.py new file mode 100644 index 00000000000..7fe603dd9a9 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/_models_py3.py @@ -0,0 +1,1099 @@ +# 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 typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._private_link_services_for_power_bi_client_enums import * + + +class AsyncOperationDetail(msrest.serialization.Model): + """AsyncOperationDetail. + + :param id: The operation id. + :type id: str + :param name: The operation name. + :type name: str + :param status: The operation status. + :type status: str + :param start_time: The operation start time. + :type start_time: str + :param end_time: The operation end time. + :type end_time: str + :param error: The error. + :type error: ~private_link_services_for_power_bi_client.models.Error + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + status: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + error: Optional["Error"] = None, + **kwargs + ): + super(AsyncOperationDetail, self).__init__(**kwargs) + self.id = id + self.name = name + self.status = status + self.start_time = start_time + self.end_time = end_time + self.error = error + + +class AvailableOperations(msrest.serialization.Model): + """Available operations of the service. + + :param value: Collection of available operation details. + :type value: list[~private_link_services_for_power_bi_client.models.OperationDetail] + :param next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationDetail]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["OperationDetail"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(AvailableOperations, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ConnectionState(msrest.serialization.Model): + """ConnectionState information. + + :param status: Status of the connection. Possible values include: "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or + ~private_link_services_for_power_bi_client.models.PersistedConnectionStatus + :param description: Description of the connection state. + :type description: str + :param actions_required: Actions required (if any). + :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: Optional[Union[str, "PersistedConnectionStatus"]] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, + **kwargs + ): + super(ConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class Display(msrest.serialization.Model): + """Display. + + :param provider: The localized friendly form of the resource provider name. This form is also + expected to include the publisher/company responsible. Use Title Casing. Begin with "Microsoft" + for 1st party services. + :type provider: str + :param resource: The localized friendly form of the resource type related to this + action/operation. This form should match the public documentation for the resource provider. + Use Title Casing. For examples, refer to the "name" section. + :type resource: str + :param operation: The localized friendly name for the operation as shown to the user. This name + should be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and + include the entity/resource to which it applies. + :type operation: str + :param description: The localized friendly description for the operation as shown to the user. + This description should be thorough, yet concise. It will be used in tool-tips and detailed + views. + :type description: str + :param origin: The intended executor of the operation; governs the display of the operation in + the RBAC UX and the audit logs UX. Default value is 'user,system'. + :type origin: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + origin: Optional[str] = None, + **kwargs + ): + super(Display, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + self.origin = origin + + +class Error(msrest.serialization.Model): + """Error. + + :param code: Specifies the error code. + :type code: str + :param message: Specifies the error message. + :type message: str + :param target: Specifies the error target. + :type target: str + :param details: Specifies the error details. + :type details: list[~private_link_services_for_power_bi_client.models.ErrorDetail] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["ErrorDetail"]] = None, + **kwargs + ): + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ErrorDetail(msrest.serialization.Model): + """ErrorDetail. + + :param code: Specifies the error code. + :type code: str + :param message: Specifies the error message. + :type message: str + :param target: Specifies the error target. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + + +class ErrorResponse(msrest.serialization.Model): + """Describes the format of Error response. + + :param error: The error object. + :type error: ~private_link_services_for_power_bi_client.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__( + self, + *, + error: Optional["ErrorResponseError"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseError(msrest.serialization.Model): + """The error object. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorResponseError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class GroupConnectivityInformation(msrest.serialization.Model): + """GroupConnectivityInformation. + + :param group_id: Specifies the group id of the group connectivity information. + :type group_id: str + :param member_name: Specifies the member name of the group connectivity information. + :type member_name: str + :param internal_fqdn: Specifies the internal FQDN of the group connectivity information. + :type internal_fqdn: str + :param customer_visible_fqdns: Specifies the customer visible FQDNs of the group connectivity + information. + :type customer_visible_fqdns: list[str] + :param private_link_service_arm_region: Specifies the ARM region of the group connectivity + information. + :type private_link_service_arm_region: str + """ + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'member_name': {'key': 'memberName', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'customer_visible_fqdns': {'key': 'customerVisibleFqdns', 'type': '[str]'}, + 'private_link_service_arm_region': {'key': 'privateLinkServiceArmRegion', 'type': 'str'}, + } + + def __init__( + self, + *, + group_id: Optional[str] = None, + member_name: Optional[str] = None, + internal_fqdn: Optional[str] = None, + customer_visible_fqdns: Optional[List[str]] = None, + private_link_service_arm_region: Optional[str] = None, + **kwargs + ): + super(GroupConnectivityInformation, self).__init__(**kwargs) + self.group_id = group_id + self.member_name = member_name + self.internal_fqdn = internal_fqdn + self.customer_visible_fqdns = customer_visible_fqdns + self.private_link_service_arm_region = private_link_service_arm_region + + +class Operation(msrest.serialization.Model): + """PowerBI Private link REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The object that represents the operation. + :type display: ~private_link_services_for_power_bi_client.models.OperationDisplayautogenerated + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayautogenerated'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplayautogenerated"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class OperationDetail(msrest.serialization.Model): + """Operation detail payload. + + :param name: Name of the operation. + :type name: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: str + :param display: Display of the operation. + :type display: ~private_link_services_for_power_bi_client.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + is_data_action: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + **kwargs + ): + super(OperationDetail, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + + +class OperationDisplay(msrest.serialization.Model): + """Operation display payload. + + :param provider: Resource provider of the operation. + :type provider: str + :param resource: Resource of the operation. + :type resource: str + :param operation: Localized friendly name for the operation. + :type operation: str + :param description: Localized friendly description for the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationDisplayautogenerated(msrest.serialization.Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.PowerBI. + :type provider: str + :param resource: Resource on which the operation is performed: private endpoint, etc. + :type resource: str + :param operation: Operation type: create, update, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + **kwargs + ): + super(OperationDisplayautogenerated, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + + +class PrivateEndpoint(msrest.serialization.Model): + """PrivateEndpoint. + + :param id: Specifies the id of private endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = id + + +class PrivateEndpointConnection(msrest.serialization.Model): + """PrivateEndpointConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Specifies the id of the resource. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~private_link_services_for_power_bi_client.models.SystemData + :param private_endpoint: Specifies the private endpoint. + :type private_endpoint: ~private_link_services_for_power_bi_client.models.PrivateEndpoint + :param private_link_service_connection_state: Specifies the connection state. + :type private_link_service_connection_state: + ~private_link_services_for_power_bi_client.models.ConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'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'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ConnectionState'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["ConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connections. + + :param value: Specifies the name of the private endpoint connection. + :type value: list[~private_link_services_for_power_bi_client.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateEndpointConnectionProxy(msrest.serialization.Model): + """PrivateEndpointConnectionProxy. + + :param id: Specifies the id of the resource. + :type id: str + :param name: Specifies the name of the resource. + :type name: str + :param type: Specifies the type of the resource. + :type type: str + :param location: Specifies the location of the resource. + :type location: str + :param etag: Specifies the etag of the resource. + :type etag: str + :param remote_private_endpoint: Specifies the remote private endpoint of the resource. + :type remote_private_endpoint: + ~private_link_services_for_power_bi_client.models.RemotePrivateEndpoint + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'remote_private_endpoint': {'key': 'remotePrivateEndpoint', 'type': 'RemotePrivateEndpoint'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + location: Optional[str] = None, + etag: Optional[str] = None, + remote_private_endpoint: Optional["RemotePrivateEndpoint"] = None, + **kwargs + ): + super(PrivateEndpointConnectionProxy, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.location = location + self.etag = etag + self.remote_private_endpoint = remote_private_endpoint + + +class PrivateEndpointConnectionProxyResource(msrest.serialization.Model): + """PrivateEndpointConnectionProxyResource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Specifies the id of the resource. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param location: Specifies the location of the resource. + :type location: str + :param etag: Specifies the etag of the resource. + :type etag: str + :param id_properties_id: Specifies the id of the resource. + :type id_properties_id: str + :param name_properties_name: Specifies the name of the resource. + :type name_properties_name: str + :param type_properties_type: Specifies the type of the resource. + :type type_properties_type: str + :param location_properties_location: Specifies the location of the resource. + :type location_properties_location: str + :param etag_properties_etag: Specifies the etag of the resource. + :type etag_properties_etag: str + :param remote_private_endpoint: Specifies the remote private endpoint of the resource. + :type remote_private_endpoint: + ~private_link_services_for_power_bi_client.models.RemotePrivateEndpoint + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'id_properties_id': {'key': 'properties.id', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'location_properties_location': {'key': 'properties.location', 'type': 'str'}, + 'etag_properties_etag': {'key': 'properties.etag', 'type': 'str'}, + 'remote_private_endpoint': {'key': 'properties.remotePrivateEndpoint', 'type': 'RemotePrivateEndpoint'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + etag: Optional[str] = None, + id_properties_id: Optional[str] = None, + name_properties_name: Optional[str] = None, + type_properties_type: Optional[str] = None, + location_properties_location: Optional[str] = None, + etag_properties_etag: Optional[str] = None, + remote_private_endpoint: Optional["RemotePrivateEndpoint"] = None, + **kwargs + ): + super(PrivateEndpointConnectionProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.etag = etag + self.id_properties_id = id_properties_id + self.name_properties_name = name_properties_name + self.type_properties_type = type_properties_type + self.location_properties_location = location_properties_location + self.etag_properties_etag = etag_properties_etag + self.remote_private_endpoint = remote_private_endpoint + + +class PrivateLinkConnectionDetail(msrest.serialization.Model): + """PrivateLinkConnectionDetail. + + :param id: Specifies the type of the connection detail. + :type id: str + :param member_name: Specifies the member name of the connection detail. + :type member_name: str + :param private_ip_address: Specifies the private ip address of the connection detail. + :type private_ip_address: str + :param link_identifier: Specifies the link id of the connection detail. + :type link_identifier: str + :param group_id: Specifies the group id of the connection detail. + :type group_id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'member_name': {'key': 'memberName', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'link_identifier': {'key': 'linkIdentifier', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + member_name: Optional[str] = None, + private_ip_address: Optional[str] = None, + link_identifier: Optional[str] = None, + group_id: Optional[str] = None, + **kwargs + ): + super(PrivateLinkConnectionDetail, self).__init__(**kwargs) + self.id = id + self.member_name = member_name + self.private_ip_address = private_ip_address + self.link_identifier = link_identifier + self.group_id = group_id + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Fully qualified identifier of the resource. + :type id: str + :param name: Name of the resource. + :type name: str + :param type: Type of the resource. + :type type: str + :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 = { + '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'}, + '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, + *, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourcesListResult(msrest.serialization.Model): + """Specifies the private link resource. + + :param value: A collection of private endpoint connection resources. + :type value: list[~private_link_services_for_power_bi_client.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnection(msrest.serialization.Model): + """PrivateLinkServiceConnection. + + :param name: Specifies the name of the private link service connection. + :type name: str + :param group_ids: Specifies the group ids of the private link service connection. + :type group_ids: list[str] + :param request_message: Specifies the request message of the private link service connection. + :type request_message: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'group_ids': {'key': 'groupIds', 'type': '[str]'}, + 'request_message': {'key': 'requestMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + group_ids: Optional[List[str]] = None, + request_message: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnection, self).__init__(**kwargs) + self.name = name + self.group_ids = group_ids + self.request_message = request_message + + +class PrivateLinkServiceProxy(msrest.serialization.Model): + """PrivateLinkServiceProxy. + + :param id: Specifies the id of the private link service proxy. + :type id: str + :param group_connectivity_information: Specifies the group connectivity information of the + private link service proxy. + :type group_connectivity_information: + list[~private_link_services_for_power_bi_client.models.GroupConnectivityInformation] + :param remote_private_link_service_connection_state: Specifies the connection state of the + private link service proxy. + :type remote_private_link_service_connection_state: + ~private_link_services_for_power_bi_client.models.ConnectionState + :param remote_private_endpoint_connection: Specifies the private endpoint connection of the + private link service proxy. + :type remote_private_endpoint_connection: + ~private_link_services_for_power_bi_client.models.RemotePrivateEndpointConnection + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'group_connectivity_information': {'key': 'groupConnectivityInformation', 'type': '[GroupConnectivityInformation]'}, + 'remote_private_link_service_connection_state': {'key': 'remotePrivateLinkServiceConnectionState', 'type': 'ConnectionState'}, + 'remote_private_endpoint_connection': {'key': 'remotePrivateEndpointConnection', 'type': 'RemotePrivateEndpointConnection'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + group_connectivity_information: Optional[List["GroupConnectivityInformation"]] = None, + remote_private_link_service_connection_state: Optional["ConnectionState"] = None, + remote_private_endpoint_connection: Optional["RemotePrivateEndpointConnection"] = None, + **kwargs + ): + super(PrivateLinkServiceProxy, self).__init__(**kwargs) + self.id = id + self.group_connectivity_information = group_connectivity_information + self.remote_private_link_service_connection_state = remote_private_link_service_connection_state + self.remote_private_endpoint_connection = remote_private_endpoint_connection + + +class RemotePrivateEndpoint(msrest.serialization.Model): + """RemotePrivateEndpoint. + + :param id: Specifies the id of the private endpoint. + :type id: str + :param manual_private_link_service_connections: Specifies the private link service connections + of the private endpoint. + :type manual_private_link_service_connections: + list[~private_link_services_for_power_bi_client.models.PrivateLinkServiceConnection] + :param private_link_service_connections: Specifies the private link service connections of the + private endpoint. + :type private_link_service_connections: + list[~private_link_services_for_power_bi_client.models.PrivateLinkServiceConnection] + :param private_link_service_proxies: Specifies the private link service proxies of the private + endpoint. + :type private_link_service_proxies: + list[~private_link_services_for_power_bi_client.models.PrivateLinkServiceProxy] + :param connection_details: Specifies the connection details of the private endpoint. + :type connection_details: + list[~private_link_services_for_power_bi_client.models.PrivateLinkConnectionDetail] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'manual_private_link_service_connections': {'key': 'manualPrivateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'private_link_service_connections': {'key': 'privateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'private_link_service_proxies': {'key': 'privateLinkServiceProxies', 'type': '[PrivateLinkServiceProxy]'}, + 'connection_details': {'key': 'connectionDetails', 'type': '[PrivateLinkConnectionDetail]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + manual_private_link_service_connections: Optional[List["PrivateLinkServiceConnection"]] = None, + private_link_service_connections: Optional[List["PrivateLinkServiceConnection"]] = None, + private_link_service_proxies: Optional[List["PrivateLinkServiceProxy"]] = None, + connection_details: Optional[List["PrivateLinkConnectionDetail"]] = None, + **kwargs + ): + super(RemotePrivateEndpoint, self).__init__(**kwargs) + self.id = id + self.manual_private_link_service_connections = manual_private_link_service_connections + self.private_link_service_connections = private_link_service_connections + self.private_link_service_proxies = private_link_service_proxies + self.connection_details = connection_details + + +class RemotePrivateEndpointConnection(msrest.serialization.Model): + """RemotePrivateEndpointConnection. + + :param id: Specifies the id of private endpoint connection. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(RemotePrivateEndpointConnection, self).__init__(**kwargs) + self.id = id + + +class Resource(msrest.serialization.Model): + """Represents an instance of an PowerBI 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: An identifier that represents the PowerBI resource. + :vartype id: str + :ivar name: The name of the PowerBI resource. + :vartype name: str + :ivar type: The type of the PowerBI resource. + :vartype type: str + :param location: Required. Location of the PowerBI resource. + :type location: str + :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. + :type tags: dict[str, str] + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~private_link_services_for_power_bi_client.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.system_data = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_by: An identifier for the identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~private_link_services_for_power_bi_client.models.IdentityType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: An identifier for the identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or + ~private_link_services_for_power_bi_client.models.IdentityType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _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 = None + self.created_by_type = None + self.created_at = None + self.last_modified_by = None + self.last_modified_by_type = None + self.last_modified_at = None + + +class TenantResource(msrest.serialization.Model): + """TenantResource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Specifies the resource identifier of the resource. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~private_link_services_for_power_bi_client.models.SystemData + :param location: Specifies the location of the resource. + :type location: str + :param tags: A set of tags. Specifies the tags of the resource. + :type tags: dict[str, str] + :param tenant_id: Specifies the tenant id of the resource. + :type tenant_id: str + :param private_endpoint_connections: Specifies the private endpoint connections of the + resource. + :type private_endpoint_connections: + list[~private_link_services_for_power_bi_client.models.PrivateEndpointConnection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + tenant_id: Optional[str] = None, + private_endpoint_connections: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + super(TenantResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + self.location = location + self.tags = tags + self.tenant_id = tenant_id + self.private_endpoint_connections = private_endpoint_connections diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/_private_link_services_for_power_bi_client_enums.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/_private_link_services_for_power_bi_client_enums.py new file mode 100644 index 00000000000..7726568c1a7 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/models/_private_link_services_for_power_bi_client_enums.py @@ -0,0 +1,52 @@ +# 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, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ActionsRequired(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ActionsRequired + """ + + NONE = "None" + RECREATE = "Recreate" + +class IdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created/modified the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class PersistedConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the connection. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/__init__.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/__init__.py new file mode 100644 index 00000000000..6d712f253aa --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/__init__.py @@ -0,0 +1,27 @@ +# 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 ._private_link_services_for_power_bi_operations import PrivateLinkServicesForPowerBiOperations +from ._private_link_service_resource_operation_results_operations import PrivateLinkServiceResourceOperationResultsOperations +from ._private_link_services_operations import PrivateLinkServicesOperations +from ._power_bi_resources_operations import PowerBiResourcesOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connection_proxies_operations import PrivateEndpointConnectionProxiesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'Operations', + 'PrivateLinkServicesForPowerBiOperations', + 'PrivateLinkServiceResourceOperationResultsOperations', + 'PrivateLinkServicesOperations', + 'PowerBiResourcesOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionProxiesOperations', + 'PrivateEndpointConnectionsOperations', +] diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_operations.py new file mode 100644 index 00000000000..20d4cf1c145 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_operations.py @@ -0,0 +1,110 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AvailableOperations"] + """Lists all of the available Power BI RP operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableOperations or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~private_link_services_for_power_bi_client.models.AvailableOperations] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableOperations"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableOperations', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.PowerBI/operations'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_power_bi_resources_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_power_bi_resources_operations.py new file mode 100644 index 00000000000..ae5bfcc7fa0 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_power_bi_resources_operations.py @@ -0,0 +1,218 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PowerBiResourcesOperations(object): + """PowerBiResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource_name( + self, + **kwargs # type: Any + ): + # type: (...) -> List["models.TenantResource"] + """Gets all the private link resources for the given Azure resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of TenantResource, or the result of cls(response) + :rtype: list[~private_link_services_for_power_bi_client.models.TenantResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.TenantResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_by_resource_name.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[TenantResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_resource_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}'} # type: ignore + + def create( + self, + body, # type: "models.TenantResource" + client_tenant_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.TenantResource" + """Creates or updates a Private Link Service Resource for Power BI. + + :param body: Tenant resource to be created or updated. + :type body: ~private_link_services_for_power_bi_client.models.TenantResource + :param client_tenant_id: The client tenant id in header. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000). + :type client_tenant_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TenantResource, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.TenantResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TenantResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_tenant_id is not None: + header_parameters['x-ms-client-tenant-id'] = self._serialize.header("client_tenant_id", client_tenant_id, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(body, 'TenantResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TenantResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}'} # type: ignore + + def delete( + self, + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a Private Link Service Resource for Power BI. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_endpoint_connection_proxies_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_endpoint_connection_proxies_operations.py new file mode 100644 index 00000000000..36a56d07dc5 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_endpoint_connection_proxies_operations.py @@ -0,0 +1,406 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionProxiesOperations(object): + """PrivateEndpointConnectionProxiesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnectionProxy" + """Synchronous API called by NRP to get private endpoint connection proxy for Power BI by private endpoint name. + + Gets private endpoint connection proxy for Power BI by private endpoint name. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionProxy, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionProxy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionProxy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionProxy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}'} # type: ignore + + def _create_initial( + self, + body, # type: "models.PrivateEndpointConnectionProxy" + client_tenant_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnectionProxyResource" + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionProxyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_tenant_id is not None: + header_parameters['x-ms-client-tenant-id'] = self._serialize.header("client_tenant_id", client_tenant_id, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(body, 'PrivateEndpointConnectionProxy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('PrivateEndpointConnectionProxyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}'} # type: ignore + + def begin_create( + self, + body, # type: "models.PrivateEndpointConnectionProxy" + client_tenant_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.PrivateEndpointConnectionProxyResource"] + """Creates or updates private endpoint connection proxy for Power BI by private endpoint name. + + :param body: The PrivateEndpointConnectionProxy to be created or updated. + :type body: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionProxy + :param client_tenant_id: The client tenant id in header. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000). + :type client_tenant_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateEndpointConnectionProxyResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionProxyResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionProxyResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + body=body, + client_tenant_id=client_tenant_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('PrivateEndpointConnectionProxyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}'} # type: ignore + + def _delete_initial( + self, + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}'} # type: ignore + + def begin_delete( + self, + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a private endpoint connection proxy for Power BI by private endpoint name. + + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}'} # type: ignore + + def validate( + self, + body, # type: "models.PrivateEndpointConnectionProxy" + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnectionProxy" + """Synchronous API called by NRP to validate a private endpoint before create or update. + + Validates a private endpoint connection before create or update. + + :param body: The PrivateEndpointConnectionProxy to be created or updated. + :type body: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionProxy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionProxy, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionProxy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionProxy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(body, 'PrivateEndpointConnectionProxy') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionProxy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnectionProxies/{privateEndpointName}/validate'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_endpoint_connections_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_endpoint_connections_operations.py new file mode 100644 index 00000000000..07d0ed96908 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,358 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource( + self, + resource_group_name, # type: str + azure_resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + """Lists all private endpoint connections under a resource. + + Gets private endpoint connection for Power BI. + + :param resource_group_name: The name of the resource group within the user's subscription. + :type resource_group_name: str + :param azure_resource_name: The name of the powerbi resource. + :type azure_resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~private_link_services_for_power_bi_client.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] # type: ignore + 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'), + 'azureResourceName': self._serialize.url("azure_resource_name", azure_resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections'} # type: ignore + + def get( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + """Get a specific private endpoint connection. + + Get a specific private endpoint connection for Power BI by private endpoint name. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}'} # type: ignore + + def create( + self, + private_endpoint_connection, # type: "models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + """Update a specific private endpoint connection. + + Updates the status of Private Endpoint Connection object. Used to approve or reject a + connection. + + :param private_endpoint_connection: Private endpoint connection object to update. + :type private_endpoint_connection: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}'} # type: ignore + + def _delete_initial( + self, + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}'} # type: ignore + + def begin_delete( + self, + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Asynchronous API to delete a private endpoint connection for Power BI by private endpoint name. + + Deletes a private endpoint connection for Power BI by private endpoint name. + + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + 'privateEndpointName': self._serialize.url("self._config.private_endpoint_name", self._config.private_endpoint_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_resources_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_resources_operations.py new file mode 100644 index 00000000000..098b1f00da5 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_resources_operations.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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.PrivateLinkResourcesListResult"] + """List private link Power BI resource. + + List private link resources under a specific Power BI resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkResourcesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~private_link_services_for_power_bi_client.models.PrivateLinkResourcesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + 'azureResourceName': self._serialize.url("self._config.azure_resource_name", self._config.azure_resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateLinkResourcesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateLinkResources'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_service_resource_operation_results_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_service_resource_operation_results_operations.py new file mode 100644 index 00000000000..c0f04aebe2a --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_service_resource_operation_results_operations.py @@ -0,0 +1,98 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkServiceResourceOperationResultsOperations(object): + """PrivateLinkServiceResourceOperationResultsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.AsyncOperationDetail" + """Gets operation result of Private Link Service Resources for Power BI. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationDetail, or the result of cls(response) + :rtype: ~private_link_services_for_power_bi_client.models.AsyncOperationDetail + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AsyncOperationDetail"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'operationId': self._serialize.url("self._config.operation_id", self._config.operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationDetail', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/operationResults/{operationId}'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_services_for_power_bi_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_services_for_power_bi_operations.py new file mode 100644 index 00000000000..78b678248a4 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_services_for_power_bi_operations.py @@ -0,0 +1,97 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkServicesForPowerBiOperations(object): + """PrivateLinkServicesForPowerBiOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription_id( + self, + **kwargs # type: Any + ): + # type: (...) -> List["models.TenantResource"] + """Gets all the private link resources for the given subscription id. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of TenantResource, or the result of cls(response) + :rtype: list[~private_link_services_for_power_bi_client.models.TenantResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.TenantResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_by_subscription_id.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[TenantResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_subscription_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_services_operations.py b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_services_operations.py new file mode 100644 index 00000000000..5acad751d70 --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/operations/_private_link_services_operations.py @@ -0,0 +1,98 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkServicesOperations(object): + """PrivateLinkServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~private_link_services_for_power_bi_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource_group( + self, + **kwargs # type: Any + ): + # type: (...) -> List["models.TenantResource"] + """Gets all the private link resources for the given resource group. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of TenantResource, or the result of cls(response) + :rtype: list[~private_link_services_for_power_bi_client.models.TenantResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.TenantResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[TenantResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI'} # type: ignore diff --git a/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/py.typed b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/powerbiprivatelinks/azext_powerbiprivatelinks/vendored_sdks/powerbiprivatelinks/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/powerbiprivatelinks/report.md b/src/powerbiprivatelinks/report.md new file mode 100644 index 00000000000..bbf0b839bfa --- /dev/null +++ b/src/powerbiprivatelinks/report.md @@ -0,0 +1,266 @@ +# Azure CLI Module Creation Report + +## EXTENSION +|CLI Extension|Command Groups| +|---------|------------| +|az powerbiprivatelinks|[groups](#CommandGroups) + +## GROUPS +### Command groups in `az powerbiprivatelinks` extension +|CLI Command Group|Group Swagger name|Commands| +|---------|------------|--------| +|az powerbiprivatelinks private-link-service-for-power-bi|privateLinkServicesForPowerBI|[commands](#CommandsInprivateLinkServicesForPowerBI)| +|az powerbiprivatelinks private-link-service-resource-operation-result|PrivateLinkServiceResourceOperationResults|[commands](#CommandsInPrivateLinkServiceResourceOperationResults)| +|az powerbiprivatelinks private-link-service|PrivateLinkServices|[commands](#CommandsInPrivateLinkServices)| +|az powerbiprivatelinks power-bi-resource|PowerBIResources|[commands](#CommandsInPowerBIResources)| +|az powerbiprivatelinks private-link-resource|PrivateLinkResources|[commands](#CommandsInPrivateLinkResources)| +|az powerbiprivatelinks private-endpoint-connection-proxy|PrivateEndpointConnectionProxies|[commands](#CommandsInPrivateEndpointConnectionProxies)| +|az powerbiprivatelinks private-endpoint-connection|PrivateEndpointConnections|[commands](#CommandsInPrivateEndpointConnections)| + +## COMMANDS +### Commands in `az powerbiprivatelinks power-bi-resource` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az powerbiprivatelinks power-bi-resource list](#PowerBIResourcesListByResourceName)|ListByResourceName|[Parameters](#ParametersPowerBIResourcesListByResourceName)|[Example](#ExamplesPowerBIResourcesListByResourceName)| +|[az powerbiprivatelinks power-bi-resource create](#PowerBIResourcesCreate)|Create|[Parameters](#ParametersPowerBIResourcesCreate)|[Example](#ExamplesPowerBIResourcesCreate)| +|[az powerbiprivatelinks power-bi-resource delete](#PowerBIResourcesDelete)|Delete|[Parameters](#ParametersPowerBIResourcesDelete)|[Example](#ExamplesPowerBIResourcesDelete)| + +### Commands in `az powerbiprivatelinks private-endpoint-connection` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az powerbiprivatelinks private-endpoint-connection list](#PrivateEndpointConnectionsListByResource)|ListByResource|[Parameters](#ParametersPrivateEndpointConnectionsListByResource)|[Example](#ExamplesPrivateEndpointConnectionsListByResource)| +|[az powerbiprivatelinks private-endpoint-connection show](#PrivateEndpointConnectionsGet)|Get|[Parameters](#ParametersPrivateEndpointConnectionsGet)|[Example](#ExamplesPrivateEndpointConnectionsGet)| +|[az powerbiprivatelinks private-endpoint-connection create](#PrivateEndpointConnectionsCreate)|Create|[Parameters](#ParametersPrivateEndpointConnectionsCreate)|[Example](#ExamplesPrivateEndpointConnectionsCreate)| +|[az powerbiprivatelinks private-endpoint-connection delete](#PrivateEndpointConnectionsDelete)|Delete|[Parameters](#ParametersPrivateEndpointConnectionsDelete)|[Example](#ExamplesPrivateEndpointConnectionsDelete)| + +### Commands in `az powerbiprivatelinks private-endpoint-connection-proxy` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az powerbiprivatelinks private-endpoint-connection-proxy show](#PrivateEndpointConnectionProxiesGet)|Get|[Parameters](#ParametersPrivateEndpointConnectionProxiesGet)|[Example](#ExamplesPrivateEndpointConnectionProxiesGet)| +|[az powerbiprivatelinks private-endpoint-connection-proxy create](#PrivateEndpointConnectionProxiesCreate)|Create|[Parameters](#ParametersPrivateEndpointConnectionProxiesCreate)|[Example](#ExamplesPrivateEndpointConnectionProxiesCreate)| +|[az powerbiprivatelinks private-endpoint-connection-proxy delete](#PrivateEndpointConnectionProxiesDelete)|Delete|[Parameters](#ParametersPrivateEndpointConnectionProxiesDelete)|[Example](#ExamplesPrivateEndpointConnectionProxiesDelete)| +|[az powerbiprivatelinks private-endpoint-connection-proxy validate](#PrivateEndpointConnectionProxiesValidate)|Validate|[Parameters](#ParametersPrivateEndpointConnectionProxiesValidate)|[Example](#ExamplesPrivateEndpointConnectionProxiesValidate)| + +### Commands in `az powerbiprivatelinks private-link-resource` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az powerbiprivatelinks private-link-resource list](#PrivateLinkResourcesListByResource)|ListByResource|[Parameters](#ParametersPrivateLinkResourcesListByResource)|[Example](#ExamplesPrivateLinkResourcesListByResource)| + +### Commands in `az powerbiprivatelinks private-link-service` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az powerbiprivatelinks private-link-service list](#PrivateLinkServicesListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersPrivateLinkServicesListByResourceGroup)|[Example](#ExamplesPrivateLinkServicesListByResourceGroup)| + +### Commands in `az powerbiprivatelinks private-link-service-for-power-bi` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az powerbiprivatelinks private-link-service-for-power-bi list](#privateLinkServicesForPowerBIListBySubscriptionId)|ListBySubscriptionId|[Parameters](#ParametersprivateLinkServicesForPowerBIListBySubscriptionId)|[Example](#ExamplesprivateLinkServicesForPowerBIListBySubscriptionId)| + +### Commands in `az powerbiprivatelinks private-link-service-resource-operation-result` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az powerbiprivatelinks private-link-service-resource-operation-result show](#PrivateLinkServiceResourceOperationResultsGet)|Get|[Parameters](#ParametersPrivateLinkServiceResourceOperationResultsGet)|[Example](#ExamplesPrivateLinkServiceResourceOperationResultsGet)| + + +## COMMAND DETAILS + +### group `az powerbiprivatelinks power-bi-resource` +#### Command `az powerbiprivatelinks power-bi-resource list` + +##### Example +``` +az powerbiprivatelinks power-bi-resource list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az powerbiprivatelinks power-bi-resource create` + +##### Example +``` +az powerbiprivatelinks power-bi-resource create --location "global" --tenant-id "ac2bc297-8a3e-46f3-972d-87c2b4ae6e2f" \ +--tags tag1="value1" tag2="value2" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--client-tenant-id**|string|The client tenant id in header. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).|client_tenant_id|ClientTenantId| +|**--location**|string|Specifies the location of the resource.|location|location| +|**--tags**|dictionary|Specifies the tags of the resource.|tags|tags| +|**--tenant-id**|string|Specifies the tenant id of the resource.|tenant_id|tenantId| +|**--private-endpoint-connections**|array|Specifies the private endpoint connections of the resource.|private_endpoint_connections|privateEndpointConnections| + +#### Command `az powerbiprivatelinks power-bi-resource delete` + +##### Example +``` +az powerbiprivatelinks power-bi-resource delete +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +### group `az powerbiprivatelinks private-endpoint-connection` +#### Command `az powerbiprivatelinks private-endpoint-connection list` + +##### Example +``` +az powerbiprivatelinks private-endpoint-connection list --azure-resource-name "azureResourceName" --resource-group \ +"resourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group within the user's subscription.|resource_group_name|resourceGroupName| +|**--azure-resource-name**|string|The name of the powerbi resource.|azure_resource_name|azureResourceName| + +#### Command `az powerbiprivatelinks private-endpoint-connection show` + +##### Example +``` +az powerbiprivatelinks private-endpoint-connection show +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az powerbiprivatelinks private-endpoint-connection create` + +##### Example +``` +az powerbiprivatelinks private-endpoint-connection create --id "/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/res\ +ourceGroups/resourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpointName" \ +--private-link-service-connection-state description="" actions-required="None" status="Approved " +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--private-link-service-connection-state**|object|Specifies the connection state.|private_link_service_connection_state|privateLinkServiceConnectionState| +|**--id**|string|Specifies the id of private endpoint.|id|id| + +#### Command `az powerbiprivatelinks private-endpoint-connection delete` + +##### Example +``` +az powerbiprivatelinks private-endpoint-connection delete +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +### group `az powerbiprivatelinks private-endpoint-connection-proxy` +#### Command `az powerbiprivatelinks private-endpoint-connection-proxy show` + +##### Example +``` +az powerbiprivatelinks private-endpoint-connection-proxy show +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az powerbiprivatelinks private-endpoint-connection-proxy create` + +##### Example +``` +az powerbiprivatelinks private-endpoint-connection-proxy create --connection-details group-id="tenant" id="10001" \ +link-identifier="1253" member-name="tenant" private-ip-address="10.0.1.4" --remote-private-endpoint-id \ +"/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/privateEn\ +dpoints/myPrivateEndpointName" --private-link-service-connections name="myPrivateEndpointConnection" \ +group-ids="tenant" request-message="opt msg" --private-link-service-proxies "[{\\"groupConnectivityInformation\\":[{\\"\ +customerVisibleFqdns\\":[\\"91cb8a3f79e644bea2dedce59f8c0107-api.analysis.windows.net\\"],\\"groupId\\":\\"tenant\\",\\\ +"internalFqdn\\":\\"91cb8a3f79e644bea2dedce59f8c0107-api.analysis.windows.net\\",\\"memberName\\":\\"tenant\\",\\"priva\ +teLinkServiceArmRegion\\":\\"\\"}],\\"id\\":\\"/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resou\ +rceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpointName/privateLinkServiceProxies/azureResourceName\ +-proxy.58ffb8de-89ad-41eb-9f8f-de0a7db9d721\\",\\"remotePrivateEndpointConnection\\":{\\"id\\":\\"/subscriptions/a00208\ +69-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/a\ +zureResourceName/privateEndpointConnections/myPrivateEndpointName.58ffb8de-89ad-41eb-9f8f-de0a7db9d721\\"},\\"remotePri\ +vateLinkServiceConnectionState\\":{\\"description\\":\\"please approve\\",\\"actionsRequired\\":\\"None\\",\\"status\\"\ +:\\"Pending\\"}}]" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--client-tenant-id**|string|The client tenant id in header. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).|client_tenant_id|ClientTenantId| +|**--id**|string|Specifies the id of the resource.|id|id| +|**--name**|string|Specifies the name of the resource.|name|name| +|**--type**|string|Specifies the type of the resource.|type|type| +|**--location**|string|Specifies the location of the resource.|location|location| +|**--etag**|string|Specifies the etag of the resource.|etag|etag| +|**--remote-private-endpoint-id**|string|Specifies the id of the private endpoint.|remote_private_endpoint_id|id| +|**--manual-private-link-service-connections**|array|Specifies the private link service connections of the private endpoint.|manual_private_link_service_connections|manualPrivateLinkServiceConnections| +|**--private-link-service-connections**|array|Specifies the private link service connections of the private endpoint.|private_link_service_connections|privateLinkServiceConnections| +|**--private-link-service-proxies**|array|Specifies the private link service proxies of the private endpoint.|private_link_service_proxies|privateLinkServiceProxies| +|**--connection-details**|array|Specifies the connection details of the private endpoint.|connection_details|connectionDetails| + +#### Command `az powerbiprivatelinks private-endpoint-connection-proxy delete` + +##### Example +``` +az powerbiprivatelinks private-endpoint-connection-proxy delete +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az powerbiprivatelinks private-endpoint-connection-proxy validate` + +##### Example +``` +az powerbiprivatelinks private-endpoint-connection-proxy validate --remote-private-endpoint-id \ +"/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/privateEn\ +dpoints/myPrivateEndpointName" --private-link-service-connections name="myPrivateEndpointConnection" \ +group-ids="tenant" request-message="opt msg" --private-link-service-proxies "[{\\"groupConnectivityInformation\\":[],\\\ +"id\\":\\"/subscriptions/a0020869-4d28-422a-89f4-c2413130d73c/resourceGroups/resourceGroup/providers/Microsoft.Network/\ +privateEndpoints/myPrivateEndpointName/privateLinkServiceProxies/azureResourceName-proxy.58ffb8de-89ad-41eb-9f8f-de0a7d\ +b9d721\\"}]" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--id**|string|Specifies the id of the resource.|id|id| +|**--name**|string|Specifies the name of the resource.|name|name| +|**--type**|string|Specifies the type of the resource.|type|type| +|**--location**|string|Specifies the location of the resource.|location|location| +|**--etag**|string|Specifies the etag of the resource.|etag|etag| +|**--remote-private-endpoint-id**|string|Specifies the id of the private endpoint.|remote_private_endpoint_id|id| +|**--manual-private-link-service-connections**|array|Specifies the private link service connections of the private endpoint.|manual_private_link_service_connections|manualPrivateLinkServiceConnections| +|**--private-link-service-connections**|array|Specifies the private link service connections of the private endpoint.|private_link_service_connections|privateLinkServiceConnections| +|**--private-link-service-proxies**|array|Specifies the private link service proxies of the private endpoint.|private_link_service_proxies|privateLinkServiceProxies| +|**--connection-details**|array|Specifies the connection details of the private endpoint.|connection_details|connectionDetails| + +### group `az powerbiprivatelinks private-link-resource` +#### Command `az powerbiprivatelinks private-link-resource list` + +##### Example +``` +az powerbiprivatelinks private-link-resource list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +### group `az powerbiprivatelinks private-link-service` +#### Command `az powerbiprivatelinks private-link-service list` + +##### Example +``` +az powerbiprivatelinks private-link-service list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +### group `az powerbiprivatelinks private-link-service-for-power-bi` +#### Command `az powerbiprivatelinks private-link-service-for-power-bi list` + +##### Example +``` +az powerbiprivatelinks private-link-service-for-power-bi list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +### group `az powerbiprivatelinks private-link-service-resource-operation-result` +#### Command `az powerbiprivatelinks private-link-service-resource-operation-result show` + +##### Example +``` +az powerbiprivatelinks private-link-service-resource-operation-result show +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| \ No newline at end of file diff --git a/src/powerbiprivatelinks/setup.cfg b/src/powerbiprivatelinks/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/powerbiprivatelinks/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/powerbiprivatelinks/setup.py b/src/powerbiprivatelinks/setup.py new file mode 100644 index 00000000000..d707a84a150 --- /dev/null +++ b/src/powerbiprivatelinks/setup.py @@ -0,0 +1,58 @@ +#!/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. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +# HISTORY.rst entry. +VERSION = '0.1.0' +try: + from azext_powerbiprivatelinks.manual.version import VERSION +except ImportError: + pass + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +try: + from azext_powerbiprivatelinks.manual.dependency import DEPENDENCIES +except ImportError: + pass + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='powerbiprivatelinks', + version=VERSION, + description='Microsoft Azure Command-Line Tools PrivateLinkServicesForPowerBIClient Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/powerbiprivatelinks', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_powerbiprivatelinks': ['azext_metadata.json']}, +)