def __init__(
            self, credentials, subscription_id, base_url=None):

        self.config = WebSiteManagementClientConfiguration(credentials, subscription_id, base_url)
        self._client = ServiceClient(self.config.credentials, self.config)

        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.app_service_certificate_orders = AppServiceCertificateOrdersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.domains = DomainsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.top_level_domains = TopLevelDomainsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.certificates = CertificatesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.deleted_web_apps = DeletedWebAppsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.provider = ProviderOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.recommendations = RecommendationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.web_apps = WebAppsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.app_service_environments = AppServiceEnvironmentsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.app_service_plans = AppServicePlansOperations(
            self._client, self.config, self._serialize, self._deserialize)
    def __init__(
        self,
        credentials,
        subscription_id,
        api_version="2016-10-02",
        accept_language="en-US",
        long_running_operation_retry_timeout=30,
        generate_client_request_id=True,
        base_url=None,
        filepath=None,
    ):

        self.config = CdnManagementClientConfiguration(
            credentials,
            subscription_id,
            api_version,
            accept_language,
            long_running_operation_retry_timeout,
            generate_client_request_id,
            base_url,
            filepath,
        )
        self._client = ServiceClient(self.config.credentials, self.config)

        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.profiles = ProfilesOperations(self._client, self.config, self._serialize, self._deserialize)
        self.endpoints = EndpointsOperations(self._client, self.config, self._serialize, self._deserialize)
        self.origins = OriginsOperations(self._client, self.config, self._serialize, self._deserialize)
        self.custom_domains = CustomDomainsOperations(self._client, self.config, self._serialize, self._deserialize)
        self.edge_nodes = EdgeNodesOperations(self._client, self.config, self._serialize, self._deserialize)
class AutoRestReportServiceForAzure(object):
    """Test Infrastructure for AutoRest

    :param config: Configuration for client.
    :type config: AutoRestReportServiceForAzureConfiguration
    """

    def __init__(self, config):

        self._client = ServiceClient(config.credentials, config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self._serialize = Serializer()
        self._deserialize = Deserializer(client_models)

        self.config = config

    def get_report(
            self, custom_headers={}, raw=False, **operation_config):
        """
        Get test coverage report

        :param dict custom_headers: headers that will be added to the request
        :param boolean raw: returns the direct response alongside the
         deserialized response
        :rtype: dict or msrest.pipeline.ClientRawResponse
        """
        # Construct URL
        url = '/report/azure'

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if self.config.generate_client_request_id:
            header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
        if custom_headers:
            header_parameters.update(custom_headers)
        if self.config.accept_language is not None:
            header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

        # Construct and send request
        request = self._client.get(url, query_parameters)
        response = self._client.send(request, header_parameters, **operation_config)

        if response.status_code not in [200]:
            raise models.ErrorException(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('{int}', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    def __init__(
            self, credentials, subscription_id, base_url=None):

        self.config = CdnManagementClientConfiguration(credentials, subscription_id, base_url)
        self._client = ServiceClient(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '2017-04-02'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.profiles = ProfilesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.endpoints = EndpointsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.origins = OriginsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.custom_domains = CustomDomainsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.resource_usage = ResourceUsageOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.operations = Operations(
            self._client, self.config, self._serialize, self._deserialize)
        self.edge_nodes = EdgeNodesOperations(
            self._client, self.config, self._serialize, self._deserialize)
    def __init__(
            self, credentials, subscription_id, base_url=None):

        self.config = FrontDoorManagementClientConfiguration(credentials, subscription_id, base_url)
        super(FrontDoorManagementClient, self).__init__(self.config.credentials, self.config)

        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.front_doors = FrontDoorsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.routing_rules = RoutingRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.health_probe_settings = HealthProbeSettingsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancing_settings = LoadBalancingSettingsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.backend_pools = BackendPoolsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.frontend_endpoints = FrontendEndpointsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.endpoints = EndpointsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.policies = PoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
    def __init__(
            self, credentials, subscription_id, base_url=None):

        self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url)
        self._client = ServiceClient(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '2016-12-01'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.network_interfaces = NetworkInterfacesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.application_gateways = ApplicationGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuits = ExpressRouteCircuitsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_service_providers = ExpressRouteServiceProvidersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancers = LoadBalancersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_security_groups = NetworkSecurityGroupsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.security_rules = SecurityRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_watchers = NetworkWatchersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.packet_captures = PacketCapturesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.public_ip_addresses = PublicIPAddressesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.route_filters = RouteFiltersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.route_filter_rules = RouteFilterRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.route_tables = RouteTablesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.routes = RoutesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.bgp_service_communities = BgpServiceCommunitiesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.usages = UsagesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_networks = VirtualNetworksOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.subnets = SubnetsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_peerings = VirtualNetworkPeeringsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_gateways = VirtualNetworkGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.local_network_gateways = LocalNetworkGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
Пример #7
0
    def __init__(self, base_url=None, filepath=None):

        self.config = SwaggerPetstoreConfiguration(base_url, filepath)
        self._client = ServiceClient(None, self.config)

        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)
    def __init__(self, base_url=None, filepath=None):

        self.config = AutoRestResourceFlatteningTestServiceConfiguration(base_url, filepath)
        self._client = ServiceClient(None, self.config)

        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)
    def __init__(self, subscription_id, api_version, base_url=None, filepath=None):

        self.config = AutoRestValidationTestConfiguration(subscription_id, api_version, base_url, filepath)
        self._client = ServiceClient(None, self.config)

        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)
Пример #10
0
    def test_serialize_datetime(self):

        date_obj = isodate.parse_datetime('2015-01-01T00:00:00')
        date_str = Serializer.serialize_iso(date_obj)

        self.assertEqual(date_str, '2015-01-01T00:00:00.000Z')

        date_obj = isodate.parse_datetime('1999-12-31T23:59:59-12:00')
        date_str = Serializer.serialize_iso(date_obj)

        self.assertEqual(date_str, '2000-01-01T11:59:59.000Z')

        with self.assertRaises(SerializationError):
            date_obj = isodate.parse_datetime('9999-12-31T23:59:59-12:00')
            date_str = Serializer.serialize_iso(date_obj)

        with self.assertRaises(SerializationError):
            date_obj = isodate.parse_datetime('0001-01-01T00:00:00+23:59')
            date_str = Serializer.serialize_iso(date_obj)


        date_obj = isodate.parse_datetime("2015-06-01T16:10:08.0121-07:00")
        date_str = Serializer.serialize_iso(date_obj)

        self.assertEqual(date_str, '2015-06-01T23:10:08.0121Z')

        date_obj = datetime.min
        date_str = Serializer.serialize_iso(date_obj)
        self.assertEqual(date_str, '0001-01-01T00:00:00.000Z')

        date_obj = datetime.max
        date_str = Serializer.serialize_iso(date_obj)
        self.assertEqual(date_str, '9999-12-31T23:59:59.999999Z')
    def __init__(self, config):

        self._client = ServiceClient(None, config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self._serialize = Serializer()
        self._deserialize = Deserializer(client_models)

        self.config = config
    def __init__(
            self, credentials, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):

        self.config = AutoRestResourceFlatteningTestServiceConfiguration(credentials, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath)
        self._client = ServiceClient(self.config.credentials, self.config)

        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)
    def __init__(
            self, endpoint, credentials):

        self.config = FormRecognizerClientConfiguration(endpoint, credentials)
        super(FormRecognizerClient, self).__init__(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '1.0-preview'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)
    def __init__(
            self, endpoint, credentials):

        self.config = TextAnalyticsClientConfiguration(endpoint, credentials)
        super(TextAnalyticsClient, self).__init__(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = 'v2.1'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)
    def __init__(
            self, credentials, base_url=None):

        self.config = SpellCheckAPIConfiguration(credentials, base_url)
        self._client = ServiceClient(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '1.0'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)
    def __init__(
            self, azure_region, credentials):

        self.config = TextAnalyticsAPIConfiguration(azure_region, credentials)
        self._client = ServiceClient(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = 'v2.0'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)
    def __init__(
            self, credentials, base_url=None):

        self.config = LogAnalyticsDataClientConfiguration(credentials, base_url)
        super(LogAnalyticsDataClient, self).__init__(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = 'v1'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)
    def __init__(
            self, credentials):

        self.config = EventGridClientConfiguration(credentials)
        self._client = ServiceClient(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '2018-01-01'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)
    def __init__(
            self, api_key, base_url=None):

        self.config = PredictionEndpointConfiguration(api_key, base_url)
        self._client = ServiceClient(None, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '1.1'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)
    def __init__(
            self, credentials, base_url=None):

        self.config = AutoSuggestSearchAPIConfiguration(credentials, base_url)
        super(AutoSuggestSearchAPI, self).__init__(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '1.0'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)
    def __init__(
            self, api_key, endpoint):

        self.config = CustomVisionPredictionClientConfiguration(api_key, endpoint)
        super(CustomVisionPredictionClient, self).__init__(None, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '3.0'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)
Пример #22
0
    def __init__(
            self, credentials, subscription_id, base_url=None):

        self.config = FeatureClientConfiguration(credentials, subscription_id, base_url)
        super(FeatureClient, self).__init__(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '2015-12-01'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.features = FeaturesOperations(
            self._client, self.config, self._serialize, self._deserialize)
    def __init__(
            self, credentials, base_url=None):

        self.config = ResourceGraphClientConfiguration(credentials, base_url)
        super(ResourceGraphClient, self).__init__(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '2018-09-01-preview'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.operations = Operations(
            self._client, self.config, self._serialize, self._deserialize)
    def __call__(self, request):

        if not request.headers.get('ocp-date'):
            now = datetime.datetime.utcnow()
            now = now.replace(tzinfo=TZ_UTC)
            request.headers['ocp-date'] = Serializer.serialize_rfc(now)

        url = urlparse(request.url)
        uri_path = url.path
        uri_path = uri_path.replace('%5C', '/')
        uri_path = uri_path.replace('%2F', '/')

        # method to sign
        string_to_sign = request.method + '\n'

        # get headers to sign
        request_header_dict = {
            key.lower(): val for key, val in request.headers.items() if val}

        request_headers = [
            str(request_header_dict.get(x, '')) for x in self.headers_to_sign]

        string_to_sign += '\n'.join(request_headers) + '\n'

        # get ocp- header to sign
        ocp_headers = []
        for name, value in request.headers.items():
            if 'ocp-' in name and value:
                ocp_headers.append((name.lower(), value))

        for name, value in sorted(ocp_headers):
            string_to_sign += "{}:{}\n".format(name, value)

        # get account_name and uri path to sign
        string_to_sign += "/{}{}".format(self._account_name, uri_path)

        # get query string to sign if it is not table service
        query_to_sign = parse_qs(url.query)

        for name in sorted(query_to_sign.keys()):
            value = query_to_sign[name][0]
            if value:
                string_to_sign += "\n{}:{}".format(name, value)

        # sign the request
        auth_string = "SharedKey {}:{}".format(
            self._account_name, self._sign_string(string_to_sign))

        request.headers[self._header] = auth_string

        return request
    def __init__(
            self, credentials, api_version='2015-01-14-preview', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):

        self.config = IntuneResourceManagementClientConfiguration(credentials, api_version, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath)
        self._client = ServiceClient(self.config.credentials, self.config)

        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.ios = IosOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.android = AndroidOperations(
            self._client, self.config, self._serialize, self._deserialize)
    def __init__(
            self, credentials, subscription_id, api_version='2016-01-29', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):

        self.config = PowerBIEmbeddedManagementClientConfiguration(credentials, subscription_id, api_version, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath)
        self._client = ServiceClient(self.config.credentials, self.config)

        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.workspace_collections = WorkspaceCollectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.workspaces = WorkspacesOperations(
            self._client, self.config, self._serialize, self._deserialize)
    def __init__(
            self, credentials, subscription_id, base_url=None):

        self.config = PowerBIEmbeddedManagementClientConfiguration(credentials, subscription_id, base_url)
        super(PowerBIEmbeddedManagementClient, self).__init__(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '2016-01-29'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.workspace_collections = WorkspaceCollectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.workspaces = WorkspacesOperations(
            self._client, self.config, self._serialize, self._deserialize)
    def __init__(
            self, credentials, subscription_id, base_url=None):

        self.config = MixedRealityClientConfiguration(credentials, subscription_id, base_url)
        super(MixedRealityClient, self).__init__(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '2019-02-28-preview'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.operations = Operations(
            self._client, self.config, self._serialize, self._deserialize)
        self.spatial_anchors_accounts = SpatialAnchorsAccountsOperations(
            self._client, self.config, self._serialize, self._deserialize)
    def __init__(
            self, credentials, subscription_id, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):

        self.config = NetworkManagementClientConfiguration(credentials, subscription_id, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath)
        self._client = ServiceClient(self.config.credentials, self.config)

        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.application_gateways = ApplicationGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.route_tables = RouteTablesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.routes = RoutesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.public_ip_addresses = PublicIPAddressesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_security_groups = NetworkSecurityGroupsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.security_rules = SecurityRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancers = LoadBalancersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_networks = VirtualNetworksOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.subnets = SubnetsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_peerings = VirtualNetworkPeeringsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_interfaces = NetworkInterfacesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.usages = UsagesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_gateways = VirtualNetworkGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.local_network_gateways = LocalNetworkGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuits = ExpressRouteCircuitsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_service_providers = ExpressRouteServiceProvidersOperations(
            self._client, self.config, self._serialize, self._deserialize)
    def __init__(
            self, credentials, base_url=None):

        self.config = AzureReservationAPIConfiguration(credentials, base_url)
        self._client = ServiceClient(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '2017-11-01'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.reservation_order = ReservationOrderOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.reservation = ReservationOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.operation = OperationOperations(
            self._client, self.config, self._serialize, self._deserialize)
class CosmosDBManagementClient(object):
    """Azure Cosmos DB Database Service Resource Provider REST API.

    :ivar database_accounts: DatabaseAccountsOperations operations
    :vartype database_accounts: azure.mgmt.cosmosdb.operations.DatabaseAccountsOperations
    :ivar operations: Operations operations
    :vartype operations: azure.mgmt.cosmosdb.operations.Operations
    :ivar database: DatabaseOperations operations
    :vartype database: azure.mgmt.cosmosdb.operations.DatabaseOperations
    :ivar collection: CollectionOperations operations
    :vartype collection: azure.mgmt.cosmosdb.operations.CollectionOperations
    :ivar collection_region: CollectionRegionOperations operations
    :vartype collection_region: azure.mgmt.cosmosdb.operations.CollectionRegionOperations
    :ivar database_account_region: DatabaseAccountRegionOperations operations
    :vartype database_account_region: azure.mgmt.cosmosdb.operations.DatabaseAccountRegionOperations
    :ivar percentile_source_target: PercentileSourceTargetOperations operations
    :vartype percentile_source_target: azure.mgmt.cosmosdb.operations.PercentileSourceTargetOperations
    :ivar percentile_target: PercentileTargetOperations operations
    :vartype percentile_target: azure.mgmt.cosmosdb.operations.PercentileTargetOperations
    :ivar percentile: PercentileOperations operations
    :vartype percentile: azure.mgmt.cosmosdb.operations.PercentileOperations
    :ivar collection_partition_region: CollectionPartitionRegionOperations operations
    :vartype collection_partition_region: azure.mgmt.cosmosdb.operations.CollectionPartitionRegionOperations
    :ivar collection_partition: CollectionPartitionOperations operations
    :vartype collection_partition: azure.mgmt.cosmosdb.operations.CollectionPartitionOperations
    :ivar partition_key_range_id: PartitionKeyRangeIdOperations operations
    :vartype partition_key_range_id: azure.mgmt.cosmosdb.operations.PartitionKeyRangeIdOperations
    :ivar partition_key_range_id_region: PartitionKeyRangeIdRegionOperations operations
    :vartype partition_key_range_id_region: azure.mgmt.cosmosdb.operations.PartitionKeyRangeIdRegionOperations
    :ivar sql_resources: SqlResourcesOperations operations
    :vartype sql_resources: azure.mgmt.cosmosdb.operations.SqlResourcesOperations
    :ivar mongo_db_resources: MongoDBResourcesOperations operations
    :vartype mongo_db_resources: azure.mgmt.cosmosdb.operations.MongoDBResourcesOperations
    :ivar table_resources: TableResourcesOperations operations
    :vartype table_resources: azure.mgmt.cosmosdb.operations.TableResourcesOperations
    :ivar cassandra_resources: CassandraResourcesOperations operations
    :vartype cassandra_resources: azure.mgmt.cosmosdb.operations.CassandraResourcesOperations
    :ivar gremlin_resources: GremlinResourcesOperations operations
    :vartype gremlin_resources: azure.mgmt.cosmosdb.operations.GremlinResourcesOperations
    :ivar notebook_workspaces: NotebookWorkspacesOperations operations
    :vartype notebook_workspaces: azure.mgmt.cosmosdb.operations.NotebookWorkspacesOperations
    :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
    :vartype private_endpoint_connections: azure.mgmt.cosmosdb.operations.PrivateEndpointConnectionsOperations
    :ivar private_link_resources: PrivateLinkResourcesOperations operations
    :vartype private_link_resources: azure.mgmt.cosmosdb.operations.PrivateLinkResourcesOperations
    :ivar restorable_database_accounts: RestorableDatabaseAccountsOperations operations
    :vartype restorable_database_accounts: azure.mgmt.cosmosdb.operations.RestorableDatabaseAccountsOperations
    :ivar restorable_sql_databases: RestorableSqlDatabasesOperations operations
    :vartype restorable_sql_databases: azure.mgmt.cosmosdb.operations.RestorableSqlDatabasesOperations
    :ivar restorable_sql_containers: RestorableSqlContainersOperations operations
    :vartype restorable_sql_containers: azure.mgmt.cosmosdb.operations.RestorableSqlContainersOperations
    :ivar restorable_sql_resources: RestorableSqlResourcesOperations operations
    :vartype restorable_sql_resources: azure.mgmt.cosmosdb.operations.RestorableSqlResourcesOperations
    :ivar restorable_mongodb_databases: RestorableMongodbDatabasesOperations operations
    :vartype restorable_mongodb_databases: azure.mgmt.cosmosdb.operations.RestorableMongodbDatabasesOperations
    :ivar restorable_mongodb_collections: RestorableMongodbCollectionsOperations operations
    :vartype restorable_mongodb_collections: azure.mgmt.cosmosdb.operations.RestorableMongodbCollectionsOperations
    :ivar restorable_mongodb_resources: RestorableMongodbResourcesOperations operations
    :vartype restorable_mongodb_resources: azure.mgmt.cosmosdb.operations.RestorableMongodbResourcesOperations
    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials.TokenCredential
    :param subscription_id: The ID of the target subscription.
    :type subscription_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
        base_url=None,  # type: Optional[str]
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = CosmosDBManagementClientConfiguration(credential, subscription_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._serialize.client_side_validation = False
        self._deserialize = Deserializer(client_models)

        self.database_accounts = DatabaseAccountsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.operations = Operations(
            self._client, self._config, self._serialize, self._deserialize)
        self.database = DatabaseOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.collection = CollectionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.collection_region = CollectionRegionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.database_account_region = DatabaseAccountRegionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.percentile_source_target = PercentileSourceTargetOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.percentile_target = PercentileTargetOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.percentile = PercentileOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.collection_partition_region = CollectionPartitionRegionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.collection_partition = CollectionPartitionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.partition_key_range_id = PartitionKeyRangeIdOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.partition_key_range_id_region = PartitionKeyRangeIdRegionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.sql_resources = SqlResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.mongo_db_resources = MongoDBResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.table_resources = TableResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.cassandra_resources = CassandraResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.gremlin_resources = GremlinResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.notebook_workspaces = NotebookWorkspacesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.private_link_resources = PrivateLinkResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_database_accounts = RestorableDatabaseAccountsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_sql_databases = RestorableSqlDatabasesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_sql_containers = RestorableSqlContainersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_sql_resources = RestorableSqlResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_mongodb_databases = RestorableMongodbDatabasesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_mongodb_collections = RestorableMongodbCollectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_mongodb_resources = RestorableMongodbResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)

    def _send_request(self, http_request, **kwargs):
        # type: (HttpRequest, Any) -> HttpResponse
        """Runs the network request through the client's chained policies.

        :param http_request: The network request you want to make. Required.
        :type http_request: ~azure.core.pipeline.transport.HttpRequest
        :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
        :return: The response of your network call. Does not do error handling on your response.
        :rtype: ~azure.core.pipeline.transport.HttpResponse
        """
        path_format_arguments = {
            'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
        }
        http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
        stream = kwargs.pop("stream", True)
        pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
        return pipeline_response.http_response

    def close(self):
        # type: () -> None
        self._client.close()

    def __enter__(self):
        # type: () -> CosmosDBManagementClient
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        # type: (Any) -> None
        self._client.__exit__(*exc_details)
    def begin_generatevirtualwanvpnserverconfigurationvpnprofile(
        self,
        resource_group_name,  # type: str
        virtual_wan_name,  # type: str
        vpn_client_params,  # type: "_models.VirtualWanVpnProfileParameters"
        **kwargs  # type: Any
    ):
        """Generates a unique VPN profile for P2S clients for VirtualWan and associated
        VpnServerConfiguration combination in the specified resource group.

        :param resource_group_name: The resource group name.
        :type resource_group_name: str
        :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is
         needed.
        :type virtual_wan_name: str
        :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation
         operation.
        :type vpn_client_params: ~azure.mgmt.network.v2021_03_01.models.VirtualWanVpnProfileParameters
        :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: By default, your polling method will be ARMPolling.
         Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 VpnProfileResponse or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2021_03_01.models.VpnProfileResponse]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        api_version = self._get_api_version(
            'begin_generatevirtualwanvpnserverconfigurationvpnprofile')
        if api_version == '2019-08-01':
            from .v2019_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-11-01':
            from .v2019_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-12-01':
            from .v2019_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-03-01':
            from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-04-01':
            from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-05-01':
            from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-08-01':
            from .v2020_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation 'begin_generatevirtualwanvpnserverconfigurationvpnprofile'"
                .format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(
            self._models_dict(api_version))
        return mixin_instance.begin_generatevirtualwanvpnserverconfigurationvpnprofile(
            resource_group_name, virtual_wan_name, vpn_client_params, **kwargs)
Пример #33
0
class PipelinesClient(Client):
    """Pipelines
    :param str base_url: Service URL
    :param Authentication creds: Authenticated credentials.
    """
    def __init__(self, base_url=None, creds=None):
        super(PipelinesClient, self).__init__(base_url, creds)
        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)

    resource_area_identifier = None

    def create_pipeline(self, input_parameters, project):
        """CreatePipeline.
        [Preview API]
        :param :class:`<CreatePipelineParameters> <azure.devops.v5_1.pipelines.models.CreatePipelineParameters>` input_parameters:
        :param str project: Project ID or project name
        :rtype: :class:`<Pipeline> <azure.devops.v5_1.pipelines.models.Pipeline>`
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        content = self._serialize.body(input_parameters,
                                       'CreatePipelineParameters')
        response = self._send(
            http_method='POST',
            location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988',
            version='5.1-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('Pipeline', response)

    def get_pipeline(self, project, pipeline_id, pipeline_version=None):
        """GetPipeline.
        [Preview API] Gets a pipeline, optionally at the specified version
        :param str project: Project ID or project name
        :param int pipeline_id: The pipeline id
        :param int pipeline_version: The pipeline version
        :rtype: :class:`<Pipeline> <azure.devops.v5_1.pipelines.models.Pipeline>`
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if pipeline_id is not None:
            route_values['pipelineId'] = self._serialize.url(
                'pipeline_id', pipeline_id, 'int')
        query_parameters = {}
        if pipeline_version is not None:
            query_parameters['pipelineVersion'] = self._serialize.query(
                'pipeline_version', pipeline_version, 'int')
        response = self._send(
            http_method='GET',
            location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988',
            version='5.1-preview.1',
            route_values=route_values,
            query_parameters=query_parameters)
        return self._deserialize('Pipeline', response)

    def list_pipelines(self,
                       project,
                       order_by=None,
                       top=None,
                       continuation_token=None):
        """ListPipelines.
        [Preview API] Gets a list of pipelines.
        :param str project: Project ID or project name
        :param str order_by: A sort expression. Defaults to "name asc"
        :param int top: The maximum number of pipelines to return
        :param str continuation_token: A continuation token from a previous request, to retrieve the next page of results
        :rtype: [Pipeline]
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        query_parameters = {}
        if order_by is not None:
            query_parameters['orderBy'] = self._serialize.query(
                'order_by', order_by, 'str')
        if top is not None:
            query_parameters['$top'] = self._serialize.query('top', top, 'int')
        if continuation_token is not None:
            query_parameters['continuationToken'] = self._serialize.query(
                'continuation_token', continuation_token, 'str')
        response = self._send(
            http_method='GET',
            location_id='28e1305e-2afe-47bf-abaf-cbb0e6a91988',
            version='5.1-preview.1',
            route_values=route_values,
            query_parameters=query_parameters)
        return self._deserialize('[Pipeline]',
                                 self._unwrap_collection(response))

    def get_run(self, project, pipeline_id, run_id):
        """GetRun.
        [Preview API] Gets a run for a particular pipeline.
        :param str project: Project ID or project name
        :param int pipeline_id: The pipeline id
        :param int run_id: The run id
        :rtype: :class:`<Run> <azure.devops.v5_1.pipelines.models.Run>`
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if pipeline_id is not None:
            route_values['pipelineId'] = self._serialize.url(
                'pipeline_id', pipeline_id, 'int')
        if run_id is not None:
            route_values['runId'] = self._serialize.url(
                'run_id', run_id, 'int')
        response = self._send(
            http_method='GET',
            location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d',
            version='5.1-preview.1',
            route_values=route_values)
        return self._deserialize('Run', response)

    def list_runs(self, project, pipeline_id):
        """ListRuns.
        [Preview API] Gets top 10000 runs for a particular pipeline.
        :param str project: Project ID or project name
        :param int pipeline_id: The pipeline id
        :rtype: [Run]
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if pipeline_id is not None:
            route_values['pipelineId'] = self._serialize.url(
                'pipeline_id', pipeline_id, 'int')
        response = self._send(
            http_method='GET',
            location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d',
            version='5.1-preview.1',
            route_values=route_values)
        return self._deserialize('[Run]', self._unwrap_collection(response))

    def run_pipeline(self,
                     run_parameters,
                     project,
                     pipeline_id,
                     pipeline_version=None):
        """RunPipeline.
        [Preview API] Runs a pipeline.
        :param :class:`<RunPipelineParameters> <azure.devops.v5_1.pipelines.models.RunPipelineParameters>` run_parameters: Optional.
        :param str project: Project ID or project name
        :param int pipeline_id: The pipeline id
        :param int pipeline_version: The pipeline version
        :rtype: :class:`<Run> <azure.devops.v5_1.pipelines.models.Run>`
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if pipeline_id is not None:
            route_values['pipelineId'] = self._serialize.url(
                'pipeline_id', pipeline_id, 'int')
        query_parameters = {}
        if pipeline_version is not None:
            query_parameters['pipelineVersion'] = self._serialize.query(
                'pipeline_version', pipeline_version, 'int')
        content = self._serialize.body(run_parameters, 'RunPipelineParameters')
        response = self._send(
            http_method='POST',
            location_id='7859261e-d2e9-4a68-b820-a5d84cc5bb3d',
            version='5.1-preview.1',
            route_values=route_values,
            query_parameters=query_parameters,
            content=content)
        return self._deserialize('Run', response)
    def begin_delete_bastion_shareable_link(
        self,
        resource_group_name,  # type: str
        bastion_host_name,  # type: str
        bsl_request,  # type: "_models.BastionShareableLinkListRequest"
        **kwargs  # type: Any
    ):
        """Deletes the Bastion Shareable Links for all the VMs specified in the request.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param bastion_host_name: The name of the Bastion Host.
        :type bastion_host_name: str
        :param bsl_request: Post request for all the Bastion Shareable Link endpoints.
        :type bsl_request: ~azure.mgmt.network.v2021_03_01.models.BastionShareableLinkListRequest
        :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: By default, your polling method will be ARMPolling.
         Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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:
        """
        api_version = self._get_api_version(
            'begin_delete_bastion_shareable_link')
        if api_version == '2019-09-01':
            from .v2019_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-11-01':
            from .v2019_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-12-01':
            from .v2019_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-03-01':
            from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-04-01':
            from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-05-01':
            from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-08-01':
            from .v2020_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation 'begin_delete_bastion_shareable_link'"
                .format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(
            self._models_dict(api_version))
        return mixin_instance.begin_delete_bastion_shareable_link(
            resource_group_name, bastion_host_name, bsl_request, **kwargs)
Пример #35
0
class WorkItemTrackingClient(VssClient):
    """WorkItemTracking
    :param str base_url: Service URL
    :param Authentication creds: Authenticated credentials.
    """
    def __init__(self, base_url=None, creds=None):
        super(WorkItemTrackingClient, self).__init__(base_url, creds)
        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)

    resource_area_identifier = None

    def create_behavior(self, behavior, process_id):
        """CreateBehavior.
        [Preview API]
        :param :class:`<BehaviorCreateModel> <work-item-tracking.v4_0.models.BehaviorCreateModel>` behavior:
        :param str process_id:
        :rtype: :class:`<BehaviorModel> <work-item-tracking.v4_0.models.BehaviorModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        content = self._serialize.body(behavior, 'BehaviorCreateModel')
        response = self._send(
            http_method='POST',
            location_id='47a651f4-fb70-43bf-b96b-7c0ba947142b',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('BehaviorModel', response)

    def delete_behavior(self, process_id, behavior_id):
        """DeleteBehavior.
        [Preview API]
        :param str process_id:
        :param str behavior_id:
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if behavior_id is not None:
            route_values['behaviorId'] = self._serialize.url(
                'behavior_id', behavior_id, 'str')
        self._send(http_method='DELETE',
                   location_id='47a651f4-fb70-43bf-b96b-7c0ba947142b',
                   version='4.0-preview.1',
                   route_values=route_values)

    def get_behavior(self, process_id, behavior_id):
        """GetBehavior.
        [Preview API]
        :param str process_id:
        :param str behavior_id:
        :rtype: :class:`<BehaviorModel> <work-item-tracking.v4_0.models.BehaviorModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if behavior_id is not None:
            route_values['behaviorId'] = self._serialize.url(
                'behavior_id', behavior_id, 'str')
        response = self._send(
            http_method='GET',
            location_id='47a651f4-fb70-43bf-b96b-7c0ba947142b',
            version='4.0-preview.1',
            route_values=route_values)
        return self._deserialize('BehaviorModel', response)

    def get_behaviors(self, process_id):
        """GetBehaviors.
        [Preview API]
        :param str process_id:
        :rtype: [BehaviorModel]
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        response = self._send(
            http_method='GET',
            location_id='47a651f4-fb70-43bf-b96b-7c0ba947142b',
            version='4.0-preview.1',
            route_values=route_values,
            returns_collection=True)
        return self._deserialize('[BehaviorModel]', response)

    def replace_behavior(self, behavior_data, process_id, behavior_id):
        """ReplaceBehavior.
        [Preview API]
        :param :class:`<BehaviorReplaceModel> <work-item-tracking.v4_0.models.BehaviorReplaceModel>` behavior_data:
        :param str process_id:
        :param str behavior_id:
        :rtype: :class:`<BehaviorModel> <work-item-tracking.v4_0.models.BehaviorModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if behavior_id is not None:
            route_values['behaviorId'] = self._serialize.url(
                'behavior_id', behavior_id, 'str')
        content = self._serialize.body(behavior_data, 'BehaviorReplaceModel')
        response = self._send(
            http_method='PUT',
            location_id='47a651f4-fb70-43bf-b96b-7c0ba947142b',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('BehaviorModel', response)

    def add_control_to_group(self, control, process_id, wit_ref_name,
                             group_id):
        """AddControlToGroup.
        [Preview API] Creates a control, giving it an id, and adds it to the group. So far, the only controls that don't know how to generate their own ids are control extensions.
        :param :class:`<Control> <work-item-tracking.v4_0.models.Control>` control:
        :param str process_id:
        :param str wit_ref_name:
        :param str group_id:
        :rtype: :class:`<Control> <work-item-tracking.v4_0.models.Control>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if group_id is not None:
            route_values['groupId'] = self._serialize.url(
                'group_id', group_id, 'str')
        content = self._serialize.body(control, 'Control')
        response = self._send(
            http_method='POST',
            location_id='e2e3166a-627a-4e9b-85b2-d6a097bbd731',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('Control', response)

    def edit_control(self, control, process_id, wit_ref_name, group_id,
                     control_id):
        """EditControl.
        [Preview API]
        :param :class:`<Control> <work-item-tracking.v4_0.models.Control>` control:
        :param str process_id:
        :param str wit_ref_name:
        :param str group_id:
        :param str control_id:
        :rtype: :class:`<Control> <work-item-tracking.v4_0.models.Control>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if group_id is not None:
            route_values['groupId'] = self._serialize.url(
                'group_id', group_id, 'str')
        if control_id is not None:
            route_values['controlId'] = self._serialize.url(
                'control_id', control_id, 'str')
        content = self._serialize.body(control, 'Control')
        response = self._send(
            http_method='PATCH',
            location_id='e2e3166a-627a-4e9b-85b2-d6a097bbd731',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('Control', response)

    def remove_control_from_group(self, process_id, wit_ref_name, group_id,
                                  control_id):
        """RemoveControlFromGroup.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name:
        :param str group_id:
        :param str control_id:
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if group_id is not None:
            route_values['groupId'] = self._serialize.url(
                'group_id', group_id, 'str')
        if control_id is not None:
            route_values['controlId'] = self._serialize.url(
                'control_id', control_id, 'str')
        self._send(http_method='DELETE',
                   location_id='e2e3166a-627a-4e9b-85b2-d6a097bbd731',
                   version='4.0-preview.1',
                   route_values=route_values)

    def set_control_in_group(self,
                             control,
                             process_id,
                             wit_ref_name,
                             group_id,
                             control_id,
                             remove_from_group_id=None):
        """SetControlInGroup.
        [Preview API] Puts a control withan id into a group. Controls backed by fields can generate their own id.
        :param :class:`<Control> <work-item-tracking.v4_0.models.Control>` control:
        :param str process_id:
        :param str wit_ref_name:
        :param str group_id:
        :param str control_id:
        :param str remove_from_group_id:
        :rtype: :class:`<Control> <work-item-tracking.v4_0.models.Control>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if group_id is not None:
            route_values['groupId'] = self._serialize.url(
                'group_id', group_id, 'str')
        if control_id is not None:
            route_values['controlId'] = self._serialize.url(
                'control_id', control_id, 'str')
        query_parameters = {}
        if remove_from_group_id is not None:
            query_parameters['removeFromGroupId'] = self._serialize.query(
                'remove_from_group_id', remove_from_group_id, 'str')
        content = self._serialize.body(control, 'Control')
        response = self._send(
            http_method='PUT',
            location_id='e2e3166a-627a-4e9b-85b2-d6a097bbd731',
            version='4.0-preview.1',
            route_values=route_values,
            query_parameters=query_parameters,
            content=content)
        return self._deserialize('Control', response)

    def create_field(self, field, process_id):
        """CreateField.
        [Preview API]
        :param :class:`<FieldModel> <work-item-tracking.v4_0.models.FieldModel>` field:
        :param str process_id:
        :rtype: :class:`<FieldModel> <work-item-tracking.v4_0.models.FieldModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        content = self._serialize.body(field, 'FieldModel')
        response = self._send(
            http_method='POST',
            location_id='f36c66c7-911d-4163-8938-d3c5d0d7f5aa',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('FieldModel', response)

    def update_field(self, field, process_id):
        """UpdateField.
        [Preview API]
        :param :class:`<FieldUpdate> <work-item-tracking.v4_0.models.FieldUpdate>` field:
        :param str process_id:
        :rtype: :class:`<FieldModel> <work-item-tracking.v4_0.models.FieldModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        content = self._serialize.body(field, 'FieldUpdate')
        response = self._send(
            http_method='PATCH',
            location_id='f36c66c7-911d-4163-8938-d3c5d0d7f5aa',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('FieldModel', response)

    def add_group(self, group, process_id, wit_ref_name, page_id, section_id):
        """AddGroup.
        [Preview API]
        :param :class:`<Group> <work-item-tracking.v4_0.models.Group>` group:
        :param str process_id:
        :param str wit_ref_name:
        :param str page_id:
        :param str section_id:
        :rtype: :class:`<Group> <work-item-tracking.v4_0.models.Group>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if page_id is not None:
            route_values['pageId'] = self._serialize.url(
                'page_id', page_id, 'str')
        if section_id is not None:
            route_values['sectionId'] = self._serialize.url(
                'section_id', section_id, 'str')
        content = self._serialize.body(group, 'Group')
        response = self._send(
            http_method='POST',
            location_id='2617828b-e850-4375-a92a-04855704d4c3',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('Group', response)

    def edit_group(self, group, process_id, wit_ref_name, page_id, section_id,
                   group_id):
        """EditGroup.
        [Preview API]
        :param :class:`<Group> <work-item-tracking.v4_0.models.Group>` group:
        :param str process_id:
        :param str wit_ref_name:
        :param str page_id:
        :param str section_id:
        :param str group_id:
        :rtype: :class:`<Group> <work-item-tracking.v4_0.models.Group>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if page_id is not None:
            route_values['pageId'] = self._serialize.url(
                'page_id', page_id, 'str')
        if section_id is not None:
            route_values['sectionId'] = self._serialize.url(
                'section_id', section_id, 'str')
        if group_id is not None:
            route_values['groupId'] = self._serialize.url(
                'group_id', group_id, 'str')
        content = self._serialize.body(group, 'Group')
        response = self._send(
            http_method='PATCH',
            location_id='2617828b-e850-4375-a92a-04855704d4c3',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('Group', response)

    def remove_group(self, process_id, wit_ref_name, page_id, section_id,
                     group_id):
        """RemoveGroup.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name:
        :param str page_id:
        :param str section_id:
        :param str group_id:
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if page_id is not None:
            route_values['pageId'] = self._serialize.url(
                'page_id', page_id, 'str')
        if section_id is not None:
            route_values['sectionId'] = self._serialize.url(
                'section_id', section_id, 'str')
        if group_id is not None:
            route_values['groupId'] = self._serialize.url(
                'group_id', group_id, 'str')
        self._send(http_method='DELETE',
                   location_id='2617828b-e850-4375-a92a-04855704d4c3',
                   version='4.0-preview.1',
                   route_values=route_values)

    def set_group_in_page(self, group, process_id, wit_ref_name, page_id,
                          section_id, group_id, remove_from_page_id,
                          remove_from_section_id):
        """SetGroupInPage.
        [Preview API]
        :param :class:`<Group> <work-item-tracking.v4_0.models.Group>` group:
        :param str process_id:
        :param str wit_ref_name:
        :param str page_id:
        :param str section_id:
        :param str group_id:
        :param str remove_from_page_id:
        :param str remove_from_section_id:
        :rtype: :class:`<Group> <work-item-tracking.v4_0.models.Group>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if page_id is not None:
            route_values['pageId'] = self._serialize.url(
                'page_id', page_id, 'str')
        if section_id is not None:
            route_values['sectionId'] = self._serialize.url(
                'section_id', section_id, 'str')
        if group_id is not None:
            route_values['groupId'] = self._serialize.url(
                'group_id', group_id, 'str')
        query_parameters = {}
        if remove_from_page_id is not None:
            query_parameters['removeFromPageId'] = self._serialize.query(
                'remove_from_page_id', remove_from_page_id, 'str')
        if remove_from_section_id is not None:
            query_parameters['removeFromSectionId'] = self._serialize.query(
                'remove_from_section_id', remove_from_section_id, 'str')
        content = self._serialize.body(group, 'Group')
        response = self._send(
            http_method='PUT',
            location_id='2617828b-e850-4375-a92a-04855704d4c3',
            version='4.0-preview.1',
            route_values=route_values,
            query_parameters=query_parameters,
            content=content)
        return self._deserialize('Group', response)

    def set_group_in_section(self, group, process_id, wit_ref_name, page_id,
                             section_id, group_id, remove_from_section_id):
        """SetGroupInSection.
        [Preview API]
        :param :class:`<Group> <work-item-tracking.v4_0.models.Group>` group:
        :param str process_id:
        :param str wit_ref_name:
        :param str page_id:
        :param str section_id:
        :param str group_id:
        :param str remove_from_section_id:
        :rtype: :class:`<Group> <work-item-tracking.v4_0.models.Group>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if page_id is not None:
            route_values['pageId'] = self._serialize.url(
                'page_id', page_id, 'str')
        if section_id is not None:
            route_values['sectionId'] = self._serialize.url(
                'section_id', section_id, 'str')
        if group_id is not None:
            route_values['groupId'] = self._serialize.url(
                'group_id', group_id, 'str')
        query_parameters = {}
        if remove_from_section_id is not None:
            query_parameters['removeFromSectionId'] = self._serialize.query(
                'remove_from_section_id', remove_from_section_id, 'str')
        content = self._serialize.body(group, 'Group')
        response = self._send(
            http_method='PUT',
            location_id='2617828b-e850-4375-a92a-04855704d4c3',
            version='4.0-preview.1',
            route_values=route_values,
            query_parameters=query_parameters,
            content=content)
        return self._deserialize('Group', response)

    def get_form_layout(self, process_id, wit_ref_name):
        """GetFormLayout.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name:
        :rtype: :class:`<FormLayout> <work-item-tracking.v4_0.models.FormLayout>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        response = self._send(
            http_method='GET',
            location_id='3eacc80a-ddca-4404-857a-6331aac99063',
            version='4.0-preview.1',
            route_values=route_values)
        return self._deserialize('FormLayout', response)

    def get_lists_metadata(self):
        """GetListsMetadata.
        [Preview API]
        :rtype: [PickListMetadataModel]
        """
        response = self._send(
            http_method='GET',
            location_id='b45cc931-98e3-44a1-b1cd-2e8e9c6dc1c6',
            version='4.0-preview.1',
            returns_collection=True)
        return self._deserialize('[PickListMetadataModel]', response)

    def create_list(self, picklist):
        """CreateList.
        [Preview API]
        :param :class:`<PickListModel> <work-item-tracking.v4_0.models.PickListModel>` picklist:
        :rtype: :class:`<PickListModel> <work-item-tracking.v4_0.models.PickListModel>`
        """
        content = self._serialize.body(picklist, 'PickListModel')
        response = self._send(
            http_method='POST',
            location_id='0b6179e2-23ce-46b2-b094-2ffa5ee70286',
            version='4.0-preview.1',
            content=content)
        return self._deserialize('PickListModel', response)

    def delete_list(self, list_id):
        """DeleteList.
        [Preview API]
        :param str list_id:
        """
        route_values = {}
        if list_id is not None:
            route_values['listId'] = self._serialize.url(
                'list_id', list_id, 'str')
        self._send(http_method='DELETE',
                   location_id='0b6179e2-23ce-46b2-b094-2ffa5ee70286',
                   version='4.0-preview.1',
                   route_values=route_values)

    def get_list(self, list_id):
        """GetList.
        [Preview API]
        :param str list_id:
        :rtype: :class:`<PickListModel> <work-item-tracking.v4_0.models.PickListModel>`
        """
        route_values = {}
        if list_id is not None:
            route_values['listId'] = self._serialize.url(
                'list_id', list_id, 'str')
        response = self._send(
            http_method='GET',
            location_id='0b6179e2-23ce-46b2-b094-2ffa5ee70286',
            version='4.0-preview.1',
            route_values=route_values)
        return self._deserialize('PickListModel', response)

    def update_list(self, picklist, list_id):
        """UpdateList.
        [Preview API]
        :param :class:`<PickListModel> <work-item-tracking.v4_0.models.PickListModel>` picklist:
        :param str list_id:
        :rtype: :class:`<PickListModel> <work-item-tracking.v4_0.models.PickListModel>`
        """
        route_values = {}
        if list_id is not None:
            route_values['listId'] = self._serialize.url(
                'list_id', list_id, 'str')
        content = self._serialize.body(picklist, 'PickListModel')
        response = self._send(
            http_method='PUT',
            location_id='0b6179e2-23ce-46b2-b094-2ffa5ee70286',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('PickListModel', response)

    def add_page(self, page, process_id, wit_ref_name):
        """AddPage.
        [Preview API]
        :param :class:`<Page> <work-item-tracking.v4_0.models.Page>` page:
        :param str process_id:
        :param str wit_ref_name:
        :rtype: :class:`<Page> <work-item-tracking.v4_0.models.Page>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        content = self._serialize.body(page, 'Page')
        response = self._send(
            http_method='POST',
            location_id='1b4ac126-59b2-4f37-b4df-0a48ba807edb',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('Page', response)

    def edit_page(self, page, process_id, wit_ref_name):
        """EditPage.
        [Preview API]
        :param :class:`<Page> <work-item-tracking.v4_0.models.Page>` page:
        :param str process_id:
        :param str wit_ref_name:
        :rtype: :class:`<Page> <work-item-tracking.v4_0.models.Page>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        content = self._serialize.body(page, 'Page')
        response = self._send(
            http_method='PATCH',
            location_id='1b4ac126-59b2-4f37-b4df-0a48ba807edb',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('Page', response)

    def remove_page(self, process_id, wit_ref_name, page_id):
        """RemovePage.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name:
        :param str page_id:
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if page_id is not None:
            route_values['pageId'] = self._serialize.url(
                'page_id', page_id, 'str')
        self._send(http_method='DELETE',
                   location_id='1b4ac126-59b2-4f37-b4df-0a48ba807edb',
                   version='4.0-preview.1',
                   route_values=route_values)

    def create_state_definition(self, state_model, process_id, wit_ref_name):
        """CreateStateDefinition.
        [Preview API]
        :param :class:`<WorkItemStateInputModel> <work-item-tracking.v4_0.models.WorkItemStateInputModel>` state_model:
        :param str process_id:
        :param str wit_ref_name:
        :rtype: :class:`<WorkItemStateResultModel> <work-item-tracking.v4_0.models.WorkItemStateResultModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        content = self._serialize.body(state_model, 'WorkItemStateInputModel')
        response = self._send(
            http_method='POST',
            location_id='4303625d-08f4-4461-b14b-32c65bba5599',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('WorkItemStateResultModel', response)

    def delete_state_definition(self, process_id, wit_ref_name, state_id):
        """DeleteStateDefinition.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name:
        :param str state_id:
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if state_id is not None:
            route_values['stateId'] = self._serialize.url(
                'state_id', state_id, 'str')
        self._send(http_method='DELETE',
                   location_id='4303625d-08f4-4461-b14b-32c65bba5599',
                   version='4.0-preview.1',
                   route_values=route_values)

    def get_state_definition(self, process_id, wit_ref_name, state_id):
        """GetStateDefinition.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name:
        :param str state_id:
        :rtype: :class:`<WorkItemStateResultModel> <work-item-tracking.v4_0.models.WorkItemStateResultModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if state_id is not None:
            route_values['stateId'] = self._serialize.url(
                'state_id', state_id, 'str')
        response = self._send(
            http_method='GET',
            location_id='4303625d-08f4-4461-b14b-32c65bba5599',
            version='4.0-preview.1',
            route_values=route_values)
        return self._deserialize('WorkItemStateResultModel', response)

    def get_state_definitions(self, process_id, wit_ref_name):
        """GetStateDefinitions.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name:
        :rtype: [WorkItemStateResultModel]
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        response = self._send(
            http_method='GET',
            location_id='4303625d-08f4-4461-b14b-32c65bba5599',
            version='4.0-preview.1',
            route_values=route_values,
            returns_collection=True)
        return self._deserialize('[WorkItemStateResultModel]', response)

    def hide_state_definition(self, hide_state_model, process_id, wit_ref_name,
                              state_id):
        """HideStateDefinition.
        [Preview API]
        :param :class:`<HideStateModel> <work-item-tracking.v4_0.models.HideStateModel>` hide_state_model:
        :param str process_id:
        :param str wit_ref_name:
        :param str state_id:
        :rtype: :class:`<WorkItemStateResultModel> <work-item-tracking.v4_0.models.WorkItemStateResultModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if state_id is not None:
            route_values['stateId'] = self._serialize.url(
                'state_id', state_id, 'str')
        content = self._serialize.body(hide_state_model, 'HideStateModel')
        response = self._send(
            http_method='PUT',
            location_id='4303625d-08f4-4461-b14b-32c65bba5599',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('WorkItemStateResultModel', response)

    def update_state_definition(self, state_model, process_id, wit_ref_name,
                                state_id):
        """UpdateStateDefinition.
        [Preview API]
        :param :class:`<WorkItemStateInputModel> <work-item-tracking.v4_0.models.WorkItemStateInputModel>` state_model:
        :param str process_id:
        :param str wit_ref_name:
        :param str state_id:
        :rtype: :class:`<WorkItemStateResultModel> <work-item-tracking.v4_0.models.WorkItemStateResultModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        if state_id is not None:
            route_values['stateId'] = self._serialize.url(
                'state_id', state_id, 'str')
        content = self._serialize.body(state_model, 'WorkItemStateInputModel')
        response = self._send(
            http_method='PATCH',
            location_id='4303625d-08f4-4461-b14b-32c65bba5599',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('WorkItemStateResultModel', response)

    def add_behavior_to_work_item_type(self, behavior, process_id,
                                       wit_ref_name_for_behaviors):
        """AddBehaviorToWorkItemType.
        [Preview API]
        :param :class:`<WorkItemTypeBehavior> <work-item-tracking.v4_0.models.WorkItemTypeBehavior>` behavior:
        :param str process_id:
        :param str wit_ref_name_for_behaviors:
        :rtype: :class:`<WorkItemTypeBehavior> <work-item-tracking.v4_0.models.WorkItemTypeBehavior>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name_for_behaviors is not None:
            route_values['witRefNameForBehaviors'] = self._serialize.url(
                'wit_ref_name_for_behaviors', wit_ref_name_for_behaviors,
                'str')
        content = self._serialize.body(behavior, 'WorkItemTypeBehavior')
        response = self._send(
            http_method='POST',
            location_id='921dfb88-ef57-4c69-94e5-dd7da2d7031d',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('WorkItemTypeBehavior', response)

    def get_behavior_for_work_item_type(self, process_id,
                                        wit_ref_name_for_behaviors,
                                        behavior_ref_name):
        """GetBehaviorForWorkItemType.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name_for_behaviors:
        :param str behavior_ref_name:
        :rtype: :class:`<WorkItemTypeBehavior> <work-item-tracking.v4_0.models.WorkItemTypeBehavior>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name_for_behaviors is not None:
            route_values['witRefNameForBehaviors'] = self._serialize.url(
                'wit_ref_name_for_behaviors', wit_ref_name_for_behaviors,
                'str')
        if behavior_ref_name is not None:
            route_values['behaviorRefName'] = self._serialize.url(
                'behavior_ref_name', behavior_ref_name, 'str')
        response = self._send(
            http_method='GET',
            location_id='921dfb88-ef57-4c69-94e5-dd7da2d7031d',
            version='4.0-preview.1',
            route_values=route_values)
        return self._deserialize('WorkItemTypeBehavior', response)

    def get_behaviors_for_work_item_type(self, process_id,
                                         wit_ref_name_for_behaviors):
        """GetBehaviorsForWorkItemType.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name_for_behaviors:
        :rtype: [WorkItemTypeBehavior]
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name_for_behaviors is not None:
            route_values['witRefNameForBehaviors'] = self._serialize.url(
                'wit_ref_name_for_behaviors', wit_ref_name_for_behaviors,
                'str')
        response = self._send(
            http_method='GET',
            location_id='921dfb88-ef57-4c69-94e5-dd7da2d7031d',
            version='4.0-preview.1',
            route_values=route_values,
            returns_collection=True)
        return self._deserialize('[WorkItemTypeBehavior]', response)

    def remove_behavior_from_work_item_type(self, process_id,
                                            wit_ref_name_for_behaviors,
                                            behavior_ref_name):
        """RemoveBehaviorFromWorkItemType.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name_for_behaviors:
        :param str behavior_ref_name:
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name_for_behaviors is not None:
            route_values['witRefNameForBehaviors'] = self._serialize.url(
                'wit_ref_name_for_behaviors', wit_ref_name_for_behaviors,
                'str')
        if behavior_ref_name is not None:
            route_values['behaviorRefName'] = self._serialize.url(
                'behavior_ref_name', behavior_ref_name, 'str')
        self._send(http_method='DELETE',
                   location_id='921dfb88-ef57-4c69-94e5-dd7da2d7031d',
                   version='4.0-preview.1',
                   route_values=route_values)

    def update_behavior_to_work_item_type(self, behavior, process_id,
                                          wit_ref_name_for_behaviors):
        """UpdateBehaviorToWorkItemType.
        [Preview API]
        :param :class:`<WorkItemTypeBehavior> <work-item-tracking.v4_0.models.WorkItemTypeBehavior>` behavior:
        :param str process_id:
        :param str wit_ref_name_for_behaviors:
        :rtype: :class:`<WorkItemTypeBehavior> <work-item-tracking.v4_0.models.WorkItemTypeBehavior>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name_for_behaviors is not None:
            route_values['witRefNameForBehaviors'] = self._serialize.url(
                'wit_ref_name_for_behaviors', wit_ref_name_for_behaviors,
                'str')
        content = self._serialize.body(behavior, 'WorkItemTypeBehavior')
        response = self._send(
            http_method='PATCH',
            location_id='921dfb88-ef57-4c69-94e5-dd7da2d7031d',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('WorkItemTypeBehavior', response)

    def create_work_item_type(self, work_item_type, process_id):
        """CreateWorkItemType.
        [Preview API]
        :param :class:`<WorkItemTypeModel> <work-item-tracking.v4_0.models.WorkItemTypeModel>` work_item_type:
        :param str process_id:
        :rtype: :class:`<WorkItemTypeModel> <work-item-tracking.v4_0.models.WorkItemTypeModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        content = self._serialize.body(work_item_type, 'WorkItemTypeModel')
        response = self._send(
            http_method='POST',
            location_id='1ce0acad-4638-49c3-969c-04aa65ba6bea',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('WorkItemTypeModel', response)

    def delete_work_item_type(self, process_id, wit_ref_name):
        """DeleteWorkItemType.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name:
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        self._send(http_method='DELETE',
                   location_id='1ce0acad-4638-49c3-969c-04aa65ba6bea',
                   version='4.0-preview.1',
                   route_values=route_values)

    def get_work_item_type(self, process_id, wit_ref_name, expand=None):
        """GetWorkItemType.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name:
        :param str expand:
        :rtype: :class:`<WorkItemTypeModel> <work-item-tracking.v4_0.models.WorkItemTypeModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        query_parameters = {}
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query(
                'expand', expand, 'str')
        response = self._send(
            http_method='GET',
            location_id='1ce0acad-4638-49c3-969c-04aa65ba6bea',
            version='4.0-preview.1',
            route_values=route_values,
            query_parameters=query_parameters)
        return self._deserialize('WorkItemTypeModel', response)

    def get_work_item_types(self, process_id, expand=None):
        """GetWorkItemTypes.
        [Preview API]
        :param str process_id:
        :param str expand:
        :rtype: [WorkItemTypeModel]
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        query_parameters = {}
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query(
                'expand', expand, 'str')
        response = self._send(
            http_method='GET',
            location_id='1ce0acad-4638-49c3-969c-04aa65ba6bea',
            version='4.0-preview.1',
            route_values=route_values,
            query_parameters=query_parameters,
            returns_collection=True)
        return self._deserialize('[WorkItemTypeModel]', response)

    def update_work_item_type(self, work_item_type_update, process_id,
                              wit_ref_name):
        """UpdateWorkItemType.
        [Preview API]
        :param :class:`<WorkItemTypeUpdateModel> <work-item-tracking.v4_0.models.WorkItemTypeUpdateModel>` work_item_type_update:
        :param str process_id:
        :param str wit_ref_name:
        :rtype: :class:`<WorkItemTypeModel> <work-item-tracking.v4_0.models.WorkItemTypeModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name is not None:
            route_values['witRefName'] = self._serialize.url(
                'wit_ref_name', wit_ref_name, 'str')
        content = self._serialize.body(work_item_type_update,
                                       'WorkItemTypeUpdateModel')
        response = self._send(
            http_method='PATCH',
            location_id='1ce0acad-4638-49c3-969c-04aa65ba6bea',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('WorkItemTypeModel', response)

    def add_field_to_work_item_type(self, field, process_id,
                                    wit_ref_name_for_fields):
        """AddFieldToWorkItemType.
        [Preview API]
        :param :class:`<WorkItemTypeFieldModel> <work-item-tracking.v4_0.models.WorkItemTypeFieldModel>` field:
        :param str process_id:
        :param str wit_ref_name_for_fields:
        :rtype: :class:`<WorkItemTypeFieldModel> <work-item-tracking.v4_0.models.WorkItemTypeFieldModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name_for_fields is not None:
            route_values['witRefNameForFields'] = self._serialize.url(
                'wit_ref_name_for_fields', wit_ref_name_for_fields, 'str')
        content = self._serialize.body(field, 'WorkItemTypeFieldModel')
        response = self._send(
            http_method='POST',
            location_id='976713b4-a62e-499e-94dc-eeb869ea9126',
            version='4.0-preview.1',
            route_values=route_values,
            content=content)
        return self._deserialize('WorkItemTypeFieldModel', response)

    def get_work_item_type_field(self, process_id, wit_ref_name_for_fields,
                                 field_ref_name):
        """GetWorkItemTypeField.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name_for_fields:
        :param str field_ref_name:
        :rtype: :class:`<WorkItemTypeFieldModel> <work-item-tracking.v4_0.models.WorkItemTypeFieldModel>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name_for_fields is not None:
            route_values['witRefNameForFields'] = self._serialize.url(
                'wit_ref_name_for_fields', wit_ref_name_for_fields, 'str')
        if field_ref_name is not None:
            route_values['fieldRefName'] = self._serialize.url(
                'field_ref_name', field_ref_name, 'str')
        response = self._send(
            http_method='GET',
            location_id='976713b4-a62e-499e-94dc-eeb869ea9126',
            version='4.0-preview.1',
            route_values=route_values)
        return self._deserialize('WorkItemTypeFieldModel', response)

    def get_work_item_type_fields(self, process_id, wit_ref_name_for_fields):
        """GetWorkItemTypeFields.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name_for_fields:
        :rtype: [WorkItemTypeFieldModel]
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name_for_fields is not None:
            route_values['witRefNameForFields'] = self._serialize.url(
                'wit_ref_name_for_fields', wit_ref_name_for_fields, 'str')
        response = self._send(
            http_method='GET',
            location_id='976713b4-a62e-499e-94dc-eeb869ea9126',
            version='4.0-preview.1',
            route_values=route_values,
            returns_collection=True)
        return self._deserialize('[WorkItemTypeFieldModel]', response)

    def remove_field_from_work_item_type(self, process_id,
                                         wit_ref_name_for_fields,
                                         field_ref_name):
        """RemoveFieldFromWorkItemType.
        [Preview API]
        :param str process_id:
        :param str wit_ref_name_for_fields:
        :param str field_ref_name:
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url(
                'process_id', process_id, 'str')
        if wit_ref_name_for_fields is not None:
            route_values['witRefNameForFields'] = self._serialize.url(
                'wit_ref_name_for_fields', wit_ref_name_for_fields, 'str')
        if field_ref_name is not None:
            route_values['fieldRefName'] = self._serialize.url(
                'field_ref_name', field_ref_name, 'str')
        self._send(http_method='DELETE',
                   location_id='976713b4-a62e-499e-94dc-eeb869ea9126',
                   version='4.0-preview.1',
                   route_values=route_values)
    def check_dns_name_availability(
            self,
            location,  # type: str
            domain_name_label,  # type: str
            **kwargs  # type: Any
    ):
        """Checks whether a domain name in the cloudapp.azure.com zone is available for use.

        :param location: The location of the domain name.
        :type location: str
        :param domain_name_label: The domain name to be verified. It must conform to the following
         regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.
        :type domain_name_label: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: DnsNameAvailabilityResult, or the result of cls(response)
        :rtype: ~azure.mgmt.network.v2021_03_01.models.DnsNameAvailabilityResult
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('check_dns_name_availability')
        if api_version == '2015-06-15':
            from .v2015_06_15.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2016-09-01':
            from .v2016_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2016-12-01':
            from .v2016_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2017-03-01':
            from .v2017_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2017-06-01':
            from .v2017_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2017-08-01':
            from .v2017_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2017-09-01':
            from .v2017_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2017-10-01':
            from .v2017_10_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2017-11-01':
            from .v2017_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-01-01':
            from .v2018_01_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from .v2018_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-04-01':
            from .v2018_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-06-01':
            from .v2018_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-07-01':
            from .v2018_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-08-01':
            from .v2018_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-10-01':
            from .v2018_10_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-11-01':
            from .v2018_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-12-01':
            from .v2018_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-02-01':
            from .v2019_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-07-01':
            from .v2019_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from .v2019_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-11-01':
            from .v2019_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-12-01':
            from .v2019_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-03-01':
            from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-04-01':
            from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-05-01':
            from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-08-01':
            from .v2020_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation 'check_dns_name_availability'"
                .format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(
            self._models_dict(api_version))
        return mixin_instance.check_dns_name_availability(
            location, domain_name_label, **kwargs)
    def __init__(self,
                 credential: "AsyncTokenCredential",
                 subscription_id: str,
                 base_url: Optional[str] = None,
                 **kwargs: Any) -> None:
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = ApiManagementClientConfiguration(
            credential, subscription_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._serialize.client_side_validation = False
        self._deserialize = Deserializer(client_models)

        self.api = ApiOperations(self._client, self._config, self._serialize,
                                 self._deserialize)
        self.api_revision = ApiRevisionOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.api_release = ApiReleaseOperations(self._client, self._config,
                                                self._serialize,
                                                self._deserialize)
        self.api_operation = ApiOperationOperations(self._client, self._config,
                                                    self._serialize,
                                                    self._deserialize)
        self.api_operation_policy = ApiOperationPolicyOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.tag = TagOperations(self._client, self._config, self._serialize,
                                 self._deserialize)
        self.api_product = ApiProductOperations(self._client, self._config,
                                                self._serialize,
                                                self._deserialize)
        self.api_policy = ApiPolicyOperations(self._client, self._config,
                                              self._serialize,
                                              self._deserialize)
        self.api_schema = ApiSchemaOperations(self._client, self._config,
                                              self._serialize,
                                              self._deserialize)
        self.api_diagnostic = ApiDiagnosticOperations(self._client,
                                                      self._config,
                                                      self._serialize,
                                                      self._deserialize)
        self.api_issue = ApiIssueOperations(self._client, self._config,
                                            self._serialize, self._deserialize)
        self.api_issue_comment = ApiIssueCommentOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.api_issue_attachment = ApiIssueAttachmentOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.api_tag_description = ApiTagDescriptionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.operation = OperationOperations(self._client, self._config,
                                             self._serialize,
                                             self._deserialize)
        self.api_export = ApiExportOperations(self._client, self._config,
                                              self._serialize,
                                              self._deserialize)
        self.api_version_set = ApiVersionSetOperations(self._client,
                                                       self._config,
                                                       self._serialize,
                                                       self._deserialize)
        self.authorization_server = AuthorizationServerOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.backend = BackendOperations(self._client, self._config,
                                         self._serialize, self._deserialize)
        self.cache = CacheOperations(self._client, self._config,
                                     self._serialize, self._deserialize)
        self.certificate = CertificateOperations(self._client, self._config,
                                                 self._serialize,
                                                 self._deserialize)
        self.content_type = ContentTypeOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.content_item = ContentItemOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.deleted_services = DeletedServicesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.api_management_operations = ApiManagementOperationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.api_management_service_skus = ApiManagementServiceSkusOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.api_management_service = ApiManagementServiceOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.diagnostic = DiagnosticOperations(self._client, self._config,
                                               self._serialize,
                                               self._deserialize)
        self.email_template = EmailTemplateOperations(self._client,
                                                      self._config,
                                                      self._serialize,
                                                      self._deserialize)
        self.gateway = GatewayOperations(self._client, self._config,
                                         self._serialize, self._deserialize)
        self.gateway_hostname_configuration = GatewayHostnameConfigurationOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.gateway_api = GatewayApiOperations(self._client, self._config,
                                                self._serialize,
                                                self._deserialize)
        self.group = GroupOperations(self._client, self._config,
                                     self._serialize, self._deserialize)
        self.group_user = GroupUserOperations(self._client, self._config,
                                              self._serialize,
                                              self._deserialize)
        self.identity_provider = IdentityProviderOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.issue = IssueOperations(self._client, self._config,
                                     self._serialize, self._deserialize)
        self.logger = LoggerOperations(self._client, self._config,
                                       self._serialize, self._deserialize)
        self.named_value = NamedValueOperations(self._client, self._config,
                                                self._serialize,
                                                self._deserialize)
        self.network_status = NetworkStatusOperations(self._client,
                                                      self._config,
                                                      self._serialize,
                                                      self._deserialize)
        self.notification = NotificationOperations(self._client, self._config,
                                                   self._serialize,
                                                   self._deserialize)
        self.notification_recipient_user = NotificationRecipientUserOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.notification_recipient_email = NotificationRecipientEmailOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.open_id_connect_provider = OpenIdConnectProviderOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.policy = PolicyOperations(self._client, self._config,
                                       self._serialize, self._deserialize)
        self.policy_description = PolicyDescriptionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.portal_revision = PortalRevisionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.sign_in_settings = SignInSettingsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.sign_up_settings = SignUpSettingsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.delegation_settings = DelegationSettingsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.product = ProductOperations(self._client, self._config,
                                         self._serialize, self._deserialize)
        self.product_api = ProductApiOperations(self._client, self._config,
                                                self._serialize,
                                                self._deserialize)
        self.product_group = ProductGroupOperations(self._client, self._config,
                                                    self._serialize,
                                                    self._deserialize)
        self.product_subscriptions = ProductSubscriptionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.product_policy = ProductPolicyOperations(self._client,
                                                      self._config,
                                                      self._serialize,
                                                      self._deserialize)
        self.quota_by_counter_keys = QuotaByCounterKeysOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.quota_by_period_keys = QuotaByPeriodKeysOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.region = RegionOperations(self._client, self._config,
                                       self._serialize, self._deserialize)
        self.reports = ReportsOperations(self._client, self._config,
                                         self._serialize, self._deserialize)
        self.subscription = SubscriptionOperations(self._client, self._config,
                                                   self._serialize,
                                                   self._deserialize)
        self.tag_resource = TagResourceOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.tenant_access = TenantAccessOperations(self._client, self._config,
                                                    self._serialize,
                                                    self._deserialize)
        self.tenant_access_git = TenantAccessGitOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.tenant_configuration = TenantConfigurationOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.user = UserOperations(self._client, self._config, self._serialize,
                                   self._deserialize)
        self.user_group = UserGroupOperations(self._client, self._config,
                                              self._serialize,
                                              self._deserialize)
        self.user_subscription = UserSubscriptionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.user_identities = UserIdentitiesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.user_confirmation_password = UserConfirmationPasswordOperations(
            self._client, self._config, self._serialize, self._deserialize)
    def supported_security_providers(
            self,
            resource_group_name,  # type: str
            virtual_wan_name,  # type: str
            **kwargs  # type: Any
    ):
        """Gives the supported security providers for the virtual wan.

        :param resource_group_name: The resource group name.
        :type resource_group_name: str
        :param virtual_wan_name: The name of the VirtualWAN for which supported security providers are
         needed.
        :type virtual_wan_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: VirtualWanSecurityProviders, or the result of cls(response)
        :rtype: ~azure.mgmt.network.v2021_03_01.models.VirtualWanSecurityProviders
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('supported_security_providers')
        if api_version == '2018-08-01':
            from .v2018_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-10-01':
            from .v2018_10_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-11-01':
            from .v2018_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-12-01':
            from .v2018_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-02-01':
            from .v2019_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-04-01':
            from .v2019_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-06-01':
            from .v2019_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-07-01':
            from .v2019_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from .v2019_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-09-01':
            from .v2019_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-11-01':
            from .v2019_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-12-01':
            from .v2019_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-03-01':
            from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-04-01':
            from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-05-01':
            from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-07-01':
            from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-08-01':
            from .v2020_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-11-01':
            from .v2020_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-02-01':
            from .v2021_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from .v2021_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError(
                "API version {} does not have operation 'supported_security_providers'"
                .format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(
            self._models_dict(api_version))
        return mixin_instance.supported_security_providers(
            resource_group_name, virtual_wan_name, **kwargs)
class NetworkManagementClient(NetworkManagementClientOperationsMixin):
    """Network Client.

    :ivar application_gateways: ApplicationGatewaysOperations operations
    :vartype application_gateways: azure.mgmt.network.v2017_10_01.aio.operations.ApplicationGatewaysOperations
    :ivar application_security_groups: ApplicationSecurityGroupsOperations operations
    :vartype application_security_groups: azure.mgmt.network.v2017_10_01.aio.operations.ApplicationSecurityGroupsOperations
    :ivar available_endpoint_services: AvailableEndpointServicesOperations operations
    :vartype available_endpoint_services: azure.mgmt.network.v2017_10_01.aio.operations.AvailableEndpointServicesOperations
    :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizationsOperations operations
    :vartype express_route_circuit_authorizations: azure.mgmt.network.v2017_10_01.aio.operations.ExpressRouteCircuitAuthorizationsOperations
    :ivar express_route_circuit_peerings: ExpressRouteCircuitPeeringsOperations operations
    :vartype express_route_circuit_peerings: azure.mgmt.network.v2017_10_01.aio.operations.ExpressRouteCircuitPeeringsOperations
    :ivar express_route_circuits: ExpressRouteCircuitsOperations operations
    :vartype express_route_circuits: azure.mgmt.network.v2017_10_01.aio.operations.ExpressRouteCircuitsOperations
    :ivar express_route_service_providers: ExpressRouteServiceProvidersOperations operations
    :vartype express_route_service_providers: azure.mgmt.network.v2017_10_01.aio.operations.ExpressRouteServiceProvidersOperations
    :ivar load_balancers: LoadBalancersOperations operations
    :vartype load_balancers: azure.mgmt.network.v2017_10_01.aio.operations.LoadBalancersOperations
    :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPoolsOperations operations
    :vartype load_balancer_backend_address_pools: azure.mgmt.network.v2017_10_01.aio.operations.LoadBalancerBackendAddressPoolsOperations
    :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurationsOperations operations
    :vartype load_balancer_frontend_ip_configurations: azure.mgmt.network.v2017_10_01.aio.operations.LoadBalancerFrontendIPConfigurationsOperations
    :ivar inbound_nat_rules: InboundNatRulesOperations operations
    :vartype inbound_nat_rules: azure.mgmt.network.v2017_10_01.aio.operations.InboundNatRulesOperations
    :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRulesOperations operations
    :vartype load_balancer_load_balancing_rules: azure.mgmt.network.v2017_10_01.aio.operations.LoadBalancerLoadBalancingRulesOperations
    :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfacesOperations operations
    :vartype load_balancer_network_interfaces: azure.mgmt.network.v2017_10_01.aio.operations.LoadBalancerNetworkInterfacesOperations
    :ivar load_balancer_probes: LoadBalancerProbesOperations operations
    :vartype load_balancer_probes: azure.mgmt.network.v2017_10_01.aio.operations.LoadBalancerProbesOperations
    :ivar network_interfaces: NetworkInterfacesOperations operations
    :vartype network_interfaces: azure.mgmt.network.v2017_10_01.aio.operations.NetworkInterfacesOperations
    :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurationsOperations operations
    :vartype network_interface_ip_configurations: azure.mgmt.network.v2017_10_01.aio.operations.NetworkInterfaceIPConfigurationsOperations
    :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancersOperations operations
    :vartype network_interface_load_balancers: azure.mgmt.network.v2017_10_01.aio.operations.NetworkInterfaceLoadBalancersOperations
    :ivar network_security_groups: NetworkSecurityGroupsOperations operations
    :vartype network_security_groups: azure.mgmt.network.v2017_10_01.aio.operations.NetworkSecurityGroupsOperations
    :ivar security_rules: SecurityRulesOperations operations
    :vartype security_rules: azure.mgmt.network.v2017_10_01.aio.operations.SecurityRulesOperations
    :ivar default_security_rules: DefaultSecurityRulesOperations operations
    :vartype default_security_rules: azure.mgmt.network.v2017_10_01.aio.operations.DefaultSecurityRulesOperations
    :ivar network_watchers: NetworkWatchersOperations operations
    :vartype network_watchers: azure.mgmt.network.v2017_10_01.aio.operations.NetworkWatchersOperations
    :ivar packet_captures: PacketCapturesOperations operations
    :vartype packet_captures: azure.mgmt.network.v2017_10_01.aio.operations.PacketCapturesOperations
    :ivar connection_monitors: ConnectionMonitorsOperations operations
    :vartype connection_monitors: azure.mgmt.network.v2017_10_01.aio.operations.ConnectionMonitorsOperations
    :ivar operations: Operations operations
    :vartype operations: azure.mgmt.network.v2017_10_01.aio.operations.Operations
    :ivar public_ip_addresses: PublicIPAddressesOperations operations
    :vartype public_ip_addresses: azure.mgmt.network.v2017_10_01.aio.operations.PublicIPAddressesOperations
    :ivar route_filters: RouteFiltersOperations operations
    :vartype route_filters: azure.mgmt.network.v2017_10_01.aio.operations.RouteFiltersOperations
    :ivar route_filter_rules: RouteFilterRulesOperations operations
    :vartype route_filter_rules: azure.mgmt.network.v2017_10_01.aio.operations.RouteFilterRulesOperations
    :ivar route_tables: RouteTablesOperations operations
    :vartype route_tables: azure.mgmt.network.v2017_10_01.aio.operations.RouteTablesOperations
    :ivar routes: RoutesOperations operations
    :vartype routes: azure.mgmt.network.v2017_10_01.aio.operations.RoutesOperations
    :ivar bgp_service_communities: BgpServiceCommunitiesOperations operations
    :vartype bgp_service_communities: azure.mgmt.network.v2017_10_01.aio.operations.BgpServiceCommunitiesOperations
    :ivar usages: UsagesOperations operations
    :vartype usages: azure.mgmt.network.v2017_10_01.aio.operations.UsagesOperations
    :ivar virtual_networks: VirtualNetworksOperations operations
    :vartype virtual_networks: azure.mgmt.network.v2017_10_01.aio.operations.VirtualNetworksOperations
    :ivar subnets: SubnetsOperations operations
    :vartype subnets: azure.mgmt.network.v2017_10_01.aio.operations.SubnetsOperations
    :ivar virtual_network_peerings: VirtualNetworkPeeringsOperations operations
    :vartype virtual_network_peerings: azure.mgmt.network.v2017_10_01.aio.operations.VirtualNetworkPeeringsOperations
    :ivar virtual_network_gateways: VirtualNetworkGatewaysOperations operations
    :vartype virtual_network_gateways: azure.mgmt.network.v2017_10_01.aio.operations.VirtualNetworkGatewaysOperations
    :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnectionsOperations operations
    :vartype virtual_network_gateway_connections: azure.mgmt.network.v2017_10_01.aio.operations.VirtualNetworkGatewayConnectionsOperations
    :ivar local_network_gateways: LocalNetworkGatewaysOperations operations
    :vartype local_network_gateways: azure.mgmt.network.v2017_10_01.aio.operations.LocalNetworkGatewaysOperations
    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
    :type subscription_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,
                 base_url: Optional[str] = None,
                 **kwargs: Any) -> None:
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = NetworkManagementClientConfiguration(
            credential, subscription_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._serialize.client_side_validation = False
        self._deserialize = Deserializer(client_models)

        self.application_gateways = ApplicationGatewaysOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.application_security_groups = ApplicationSecurityGroupsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.available_endpoint_services = AvailableEndpointServicesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_circuits = ExpressRouteCircuitsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_service_providers = ExpressRouteServiceProvidersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancers = LoadBalancersOperations(self._client,
                                                      self._config,
                                                      self._serialize,
                                                      self._deserialize)
        self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.inbound_nat_rules = InboundNatRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_probes = LoadBalancerProbesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_interfaces = NetworkInterfacesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_security_groups = NetworkSecurityGroupsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.security_rules = SecurityRulesOperations(self._client,
                                                      self._config,
                                                      self._serialize,
                                                      self._deserialize)
        self.default_security_rules = DefaultSecurityRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_watchers = NetworkWatchersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.packet_captures = PacketCapturesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.connection_monitors = ConnectionMonitorsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.operations = Operations(self._client, self._config,
                                     self._serialize, self._deserialize)
        self.public_ip_addresses = PublicIPAddressesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.route_filters = RouteFiltersOperations(self._client, self._config,
                                                    self._serialize,
                                                    self._deserialize)
        self.route_filter_rules = RouteFilterRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.route_tables = RouteTablesOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.routes = RoutesOperations(self._client, self._config,
                                       self._serialize, self._deserialize)
        self.bgp_service_communities = BgpServiceCommunitiesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.usages = UsagesOperations(self._client, self._config,
                                       self._serialize, self._deserialize)
        self.virtual_networks = VirtualNetworksOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.subnets = SubnetsOperations(self._client, self._config,
                                         self._serialize, self._deserialize)
        self.virtual_network_peerings = VirtualNetworkPeeringsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_network_gateways = VirtualNetworkGatewaysOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.local_network_gateways = LocalNetworkGatewaysOperations(
            self._client, self._config, self._serialize, self._deserialize)

    async def _send_request(self, http_request: HttpRequest,
                            **kwargs: Any) -> AsyncHttpResponse:
        """Runs the network request through the client's chained policies.

        :param http_request: The network request you want to make. Required.
        :type http_request: ~azure.core.pipeline.transport.HttpRequest
        :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
        :return: The response of your network call. Does not do error handling on your response.
        :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
        """
        path_format_arguments = {
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
        }
        http_request.url = self._client.format_url(http_request.url,
                                                   **path_format_arguments)
        stream = kwargs.pop("stream", True)
        pipeline_response = await self._client._pipeline.run(http_request,
                                                             stream=stream,
                                                             **kwargs)
        return pipeline_response.http_response

    async def close(self) -> None:
        await self._client.close()

    async def __aenter__(self) -> "NetworkManagementClient":
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details) -> None:
        await self._client.__aexit__(*exc_details)
Пример #40
0
    def __init__(self,
                 credential: "AsyncTokenCredential",
                 subscription_id: str,
                 base_url: Optional[str] = None,
                 **kwargs: Any) -> None:
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = NetworkManagementClientConfiguration(
            credential, subscription_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.application_gateways = ApplicationGatewaysOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.application_security_groups = ApplicationSecurityGroupsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.available_endpoint_services = AvailableEndpointServicesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_circuits = ExpressRouteCircuitsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_service_providers = ExpressRouteServiceProvidersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancers = LoadBalancersOperations(self._client,
                                                      self._config,
                                                      self._serialize,
                                                      self._deserialize)
        self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.inbound_nat_rules = InboundNatRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_probes = LoadBalancerProbesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_interfaces = NetworkInterfacesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_security_groups = NetworkSecurityGroupsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.security_rules = SecurityRulesOperations(self._client,
                                                      self._config,
                                                      self._serialize,
                                                      self._deserialize)
        self.default_security_rules = DefaultSecurityRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_watchers = NetworkWatchersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.packet_captures = PacketCapturesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.operations = Operations(self._client, self._config,
                                     self._serialize, self._deserialize)
        self.public_ip_addresses = PublicIPAddressesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.route_filters = RouteFiltersOperations(self._client, self._config,
                                                    self._serialize,
                                                    self._deserialize)
        self.route_filter_rules = RouteFilterRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.route_tables = RouteTablesOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.routes = RoutesOperations(self._client, self._config,
                                       self._serialize, self._deserialize)
        self.bgp_service_communities = BgpServiceCommunitiesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.usages = UsagesOperations(self._client, self._config,
                                       self._serialize, self._deserialize)
        self.virtual_networks = VirtualNetworksOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.subnets = SubnetsOperations(self._client, self._config,
                                         self._serialize, self._deserialize)
        self.virtual_network_peerings = VirtualNetworkPeeringsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_network_gateways = VirtualNetworkGatewaysOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.local_network_gateways = LocalNetworkGatewaysOperations(
            self._client, self._config, self._serialize, self._deserialize)
Пример #41
0
class PolicyClient(VssClient):
    """Policy
    :param str base_url: Service URL
    :param Authentication creds: Authenticated credentials.
    """
    def __init__(self, base_url=None, creds=None):
        super(PolicyClient, self).__init__(base_url, creds)
        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)

    resource_area_identifier = 'fb13a388-40dd-4a04-b530-013a739c72ef'

    def create_policy_configuration(self,
                                    configuration,
                                    project,
                                    configuration_id=None):
        """CreatePolicyConfiguration.
        :param :class:`<PolicyConfiguration> <policy.v4_0.models.PolicyConfiguration>` configuration:
        :param str project: Project ID or project name
        :param int configuration_id:
        :rtype: :class:`<PolicyConfiguration> <policy.v4_0.models.PolicyConfiguration>`
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if configuration_id is not None:
            route_values['configurationId'] = self._serialize.url(
                'configuration_id', configuration_id, 'int')
        content = self._serialize.body(configuration, 'PolicyConfiguration')
        response = self._send(
            http_method='POST',
            location_id='dad91cbe-d183-45f8-9c6e-9c1164472121',
            version='4.0',
            route_values=route_values,
            content=content)
        return self._deserialize('PolicyConfiguration', response)

    def delete_policy_configuration(self, project, configuration_id):
        """DeletePolicyConfiguration.
        :param str project: Project ID or project name
        :param int configuration_id:
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if configuration_id is not None:
            route_values['configurationId'] = self._serialize.url(
                'configuration_id', configuration_id, 'int')
        self._send(http_method='DELETE',
                   location_id='dad91cbe-d183-45f8-9c6e-9c1164472121',
                   version='4.0',
                   route_values=route_values)

    def get_policy_configuration(self, project, configuration_id):
        """GetPolicyConfiguration.
        :param str project: Project ID or project name
        :param int configuration_id:
        :rtype: :class:`<PolicyConfiguration> <policy.v4_0.models.PolicyConfiguration>`
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if configuration_id is not None:
            route_values['configurationId'] = self._serialize.url(
                'configuration_id', configuration_id, 'int')
        response = self._send(
            http_method='GET',
            location_id='dad91cbe-d183-45f8-9c6e-9c1164472121',
            version='4.0',
            route_values=route_values)
        return self._deserialize('PolicyConfiguration', response)

    def get_policy_configurations(self, project, scope=None):
        """GetPolicyConfigurations.
        :param str project: Project ID or project name
        :param str scope:
        :rtype: [PolicyConfiguration]
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        query_parameters = {}
        if scope is not None:
            query_parameters['scope'] = self._serialize.query(
                'scope', scope, 'str')
        response = self._send(
            http_method='GET',
            location_id='dad91cbe-d183-45f8-9c6e-9c1164472121',
            version='4.0',
            route_values=route_values,
            query_parameters=query_parameters)
        return self._deserialize('[PolicyConfiguration]',
                                 self._unwrap_collection(response))

    def update_policy_configuration(self, configuration, project,
                                    configuration_id):
        """UpdatePolicyConfiguration.
        :param :class:`<PolicyConfiguration> <policy.v4_0.models.PolicyConfiguration>` configuration:
        :param str project: Project ID or project name
        :param int configuration_id:
        :rtype: :class:`<PolicyConfiguration> <policy.v4_0.models.PolicyConfiguration>`
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if configuration_id is not None:
            route_values['configurationId'] = self._serialize.url(
                'configuration_id', configuration_id, 'int')
        content = self._serialize.body(configuration, 'PolicyConfiguration')
        response = self._send(
            http_method='PUT',
            location_id='dad91cbe-d183-45f8-9c6e-9c1164472121',
            version='4.0',
            route_values=route_values,
            content=content)
        return self._deserialize('PolicyConfiguration', response)

    def get_policy_evaluation(self, project, evaluation_id):
        """GetPolicyEvaluation.
        [Preview API]
        :param str project: Project ID or project name
        :param str evaluation_id:
        :rtype: :class:`<PolicyEvaluationRecord> <policy.v4_0.models.PolicyEvaluationRecord>`
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if evaluation_id is not None:
            route_values['evaluationId'] = self._serialize.url(
                'evaluation_id', evaluation_id, 'str')
        response = self._send(
            http_method='GET',
            location_id='46aecb7a-5d2c-4647-897b-0209505a9fe4',
            version='4.0-preview.1',
            route_values=route_values)
        return self._deserialize('PolicyEvaluationRecord', response)

    def requeue_policy_evaluation(self, project, evaluation_id):
        """RequeuePolicyEvaluation.
        [Preview API]
        :param str project: Project ID or project name
        :param str evaluation_id:
        :rtype: :class:`<PolicyEvaluationRecord> <policy.v4_0.models.PolicyEvaluationRecord>`
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if evaluation_id is not None:
            route_values['evaluationId'] = self._serialize.url(
                'evaluation_id', evaluation_id, 'str')
        response = self._send(
            http_method='PATCH',
            location_id='46aecb7a-5d2c-4647-897b-0209505a9fe4',
            version='4.0-preview.1',
            route_values=route_values)
        return self._deserialize('PolicyEvaluationRecord', response)

    def get_policy_evaluations(self,
                               project,
                               artifact_id,
                               include_not_applicable=None,
                               top=None,
                               skip=None):
        """GetPolicyEvaluations.
        [Preview API]
        :param str project: Project ID or project name
        :param str artifact_id:
        :param bool include_not_applicable:
        :param int top:
        :param int skip:
        :rtype: [PolicyEvaluationRecord]
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        query_parameters = {}
        if artifact_id is not None:
            query_parameters['artifactId'] = self._serialize.query(
                'artifact_id', artifact_id, 'str')
        if include_not_applicable is not None:
            query_parameters['includeNotApplicable'] = self._serialize.query(
                'include_not_applicable', include_not_applicable, 'bool')
        if top is not None:
            query_parameters['$top'] = self._serialize.query('top', top, 'int')
        if skip is not None:
            query_parameters['$skip'] = self._serialize.query(
                'skip', skip, 'int')
        response = self._send(
            http_method='GET',
            location_id='c23ddff5-229c-4d04-a80b-0fdce9f360c8',
            version='4.0-preview.1',
            route_values=route_values,
            query_parameters=query_parameters)
        return self._deserialize('[PolicyEvaluationRecord]',
                                 self._unwrap_collection(response))

    def get_policy_configuration_revision(self, project, configuration_id,
                                          revision_id):
        """GetPolicyConfigurationRevision.
        :param str project: Project ID or project name
        :param int configuration_id:
        :param int revision_id:
        :rtype: :class:`<PolicyConfiguration> <policy.v4_0.models.PolicyConfiguration>`
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if configuration_id is not None:
            route_values['configurationId'] = self._serialize.url(
                'configuration_id', configuration_id, 'int')
        if revision_id is not None:
            route_values['revisionId'] = self._serialize.url(
                'revision_id', revision_id, 'int')
        response = self._send(
            http_method='GET',
            location_id='fe1e68a2-60d3-43cb-855b-85e41ae97c95',
            version='4.0',
            route_values=route_values)
        return self._deserialize('PolicyConfiguration', response)

    def get_policy_configuration_revisions(self,
                                           project,
                                           configuration_id,
                                           top=None,
                                           skip=None):
        """GetPolicyConfigurationRevisions.
        :param str project: Project ID or project name
        :param int configuration_id:
        :param int top:
        :param int skip:
        :rtype: [PolicyConfiguration]
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if configuration_id is not None:
            route_values['configurationId'] = self._serialize.url(
                'configuration_id', configuration_id, 'int')
        query_parameters = {}
        if top is not None:
            query_parameters['$top'] = self._serialize.query('top', top, 'int')
        if skip is not None:
            query_parameters['$skip'] = self._serialize.query(
                'skip', skip, 'int')
        response = self._send(
            http_method='GET',
            location_id='fe1e68a2-60d3-43cb-855b-85e41ae97c95',
            version='4.0',
            route_values=route_values,
            query_parameters=query_parameters)
        return self._deserialize('[PolicyConfiguration]',
                                 self._unwrap_collection(response))

    def get_policy_type(self, project, type_id):
        """GetPolicyType.
        :param str project: Project ID or project name
        :param str type_id:
        :rtype: :class:`<PolicyType> <policy.v4_0.models.PolicyType>`
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        if type_id is not None:
            route_values['typeId'] = self._serialize.url(
                'type_id', type_id, 'str')
        response = self._send(
            http_method='GET',
            location_id='44096322-2d3d-466a-bb30-d1b7de69f61f',
            version='4.0',
            route_values=route_values)
        return self._deserialize('PolicyType', response)

    def get_policy_types(self, project):
        """GetPolicyTypes.
        :param str project: Project ID or project name
        :rtype: [PolicyType]
        """
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url(
                'project', project, 'str')
        response = self._send(
            http_method='GET',
            location_id='44096322-2d3d-466a-bb30-d1b7de69f61f',
            version='4.0',
            route_values=route_values)
        return self._deserialize('[PolicyType]',
                                 self._unwrap_collection(response))
    def __init__(self,
                 credential: "AsyncTokenCredential",
                 subscription_id: str,
                 base_url: Optional[str] = None,
                 **kwargs: Any) -> None:
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = NetworkManagementClientConfiguration(
            credential, subscription_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._serialize.client_side_validation = False
        self._deserialize = Deserializer(client_models)

        self.application_gateways = ApplicationGatewaysOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.application_gateway_private_link_resources = ApplicationGatewayPrivateLinkResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.application_gateway_private_endpoint_connections = ApplicationGatewayPrivateEndpointConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.application_security_groups = ApplicationSecurityGroupsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.available_delegations = AvailableDelegationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.available_resource_group_delegations = AvailableResourceGroupDelegationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.available_service_aliases = AvailableServiceAliasesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.azure_firewalls = AzureFirewallsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.azure_firewall_fqdn_tags = AzureFirewallFqdnTagsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.bastion_hosts = BastionHostsOperations(self._client, self._config,
                                                    self._serialize,
                                                    self._deserialize)
        self.ddos_custom_policies = DdosCustomPoliciesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.ddos_protection_plans = DdosProtectionPlansOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.available_endpoint_services = AvailableEndpointServicesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_circuit_connections = ExpressRouteCircuitConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.peer_express_route_circuit_connections = PeerExpressRouteCircuitConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_circuits = ExpressRouteCircuitsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_service_providers = ExpressRouteServiceProvidersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_cross_connections = ExpressRouteCrossConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_cross_connection_peerings = ExpressRouteCrossConnectionPeeringsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_ports_locations = ExpressRoutePortsLocationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_ports = ExpressRoutePortsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_links = ExpressRouteLinksOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.firewall_policies = FirewallPoliciesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.firewall_policy_rule_collection_groups = FirewallPolicyRuleCollectionGroupsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.ip_allocations = IpAllocationsOperations(self._client,
                                                      self._config,
                                                      self._serialize,
                                                      self._deserialize)
        self.ip_groups = IpGroupsOperations(self._client, self._config,
                                            self._serialize, self._deserialize)
        self.load_balancers = LoadBalancersOperations(self._client,
                                                      self._config,
                                                      self._serialize,
                                                      self._deserialize)
        self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.inbound_nat_rules = InboundNatRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_outbound_rules = LoadBalancerOutboundRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.load_balancer_probes = LoadBalancerProbesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.nat_gateways = NatGatewaysOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.network_interfaces = NetworkInterfacesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_interface_tap_configurations = NetworkInterfaceTapConfigurationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_profiles = NetworkProfilesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_security_groups = NetworkSecurityGroupsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.security_rules = SecurityRulesOperations(self._client,
                                                      self._config,
                                                      self._serialize,
                                                      self._deserialize)
        self.default_security_rules = DefaultSecurityRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_virtual_appliances = NetworkVirtualAppliancesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_appliance_sites = VirtualApplianceSitesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_appliance_skus = VirtualApplianceSkusOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.network_watchers = NetworkWatchersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.packet_captures = PacketCapturesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.connection_monitors = ConnectionMonitorsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.flow_logs = FlowLogsOperations(self._client, self._config,
                                            self._serialize, self._deserialize)
        self.operations = Operations(self._client, self._config,
                                     self._serialize, self._deserialize)
        self.private_endpoints = PrivateEndpointsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.available_private_endpoint_types = AvailablePrivateEndpointTypesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.private_dns_zone_groups = PrivateDnsZoneGroupsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.private_link_services = PrivateLinkServicesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.public_ip_addresses = PublicIPAddressesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.public_ip_prefixes = PublicIPPrefixesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.route_filters = RouteFiltersOperations(self._client, self._config,
                                                    self._serialize,
                                                    self._deserialize)
        self.route_filter_rules = RouteFilterRulesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.route_tables = RouteTablesOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.routes = RoutesOperations(self._client, self._config,
                                       self._serialize, self._deserialize)
        self.security_partner_providers = SecurityPartnerProvidersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.bgp_service_communities = BgpServiceCommunitiesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.service_endpoint_policies = ServiceEndpointPoliciesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.service_endpoint_policy_definitions = ServiceEndpointPolicyDefinitionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.service_tags = ServiceTagsOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.usages = UsagesOperations(self._client, self._config,
                                       self._serialize, self._deserialize)
        self.virtual_networks = VirtualNetworksOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.subnets = SubnetsOperations(self._client, self._config,
                                         self._serialize, self._deserialize)
        self.resource_navigation_links = ResourceNavigationLinksOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.service_association_links = ServiceAssociationLinksOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_network_peerings = VirtualNetworkPeeringsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_network_gateways = VirtualNetworkGatewaysOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.local_network_gateways = LocalNetworkGatewaysOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_network_taps = VirtualNetworkTapsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_routers = VirtualRoutersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_router_peerings = VirtualRouterPeeringsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_wans = VirtualWansOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.vpn_sites = VpnSitesOperations(self._client, self._config,
                                            self._serialize, self._deserialize)
        self.vpn_site_links = VpnSiteLinksOperations(self._client,
                                                     self._config,
                                                     self._serialize,
                                                     self._deserialize)
        self.vpn_sites_configuration = VpnSitesConfigurationOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.vpn_server_configurations = VpnServerConfigurationsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_hubs = VirtualHubsOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.hub_virtual_network_connections = HubVirtualNetworkConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.vpn_gateways = VpnGatewaysOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.vpn_connections = VpnConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.vpn_site_link_connections = VpnSiteLinkConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.vpn_link_connections = VpnLinkConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.p2_svpn_gateways = P2SVpnGatewaysOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.vpn_server_configurations_associated_with_virtual_wan = VpnServerConfigurationsAssociatedWithVirtualWanOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_hub_route_table_v2_s = VirtualHubRouteTableV2SOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_gateways = ExpressRouteGatewaysOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.express_route_connections = ExpressRouteConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_hub_bgp_connection = VirtualHubBgpConnectionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_hub_bgp_connections = VirtualHubBgpConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.virtual_hub_ip_configuration = VirtualHubIpConfigurationOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.hub_route_tables = HubRouteTablesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.web_application_firewall_policies = WebApplicationFirewallPoliciesOperations(
            self._client, self._config, self._serialize, self._deserialize)
    def __init__(self, credentials, subscription_id, base_url=None):

        self.config = NetworkManagementClientConfiguration(
            credentials, subscription_id, base_url)
        super(NetworkManagementClient, self).__init__(self.config.credentials,
                                                      self.config)

        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.application_gateways = ApplicationGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.application_security_groups = ApplicationSecurityGroupsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.available_delegations = AvailableDelegationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.available_resource_group_delegations = AvailableResourceGroupDelegationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.azure_firewalls = AzureFirewallsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.azure_firewall_fqdn_tags = AzureFirewallFqdnTagsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.ddos_custom_policies = DdosCustomPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.ddos_protection_plans = DdosProtectionPlansOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.available_endpoint_services = AvailableEndpointServicesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuit_connections = ExpressRouteCircuitConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.peer_express_route_circuit_connections = PeerExpressRouteCircuitConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuits = ExpressRouteCircuitsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_service_providers = ExpressRouteServiceProvidersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_cross_connections = ExpressRouteCrossConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_cross_connection_peerings = ExpressRouteCrossConnectionPeeringsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_gateways = ExpressRouteGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_connections = ExpressRouteConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_ports_locations = ExpressRoutePortsLocationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_ports = ExpressRoutePortsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_links = ExpressRouteLinksOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.interface_endpoints = InterfaceEndpointsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancers = LoadBalancersOperations(self._client,
                                                      self.config,
                                                      self._serialize,
                                                      self._deserialize)
        self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.inbound_nat_rules = InboundNatRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancer_outbound_rules = LoadBalancerOutboundRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancer_probes = LoadBalancerProbesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.nat_gateways = NatGatewaysOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.network_interfaces = NetworkInterfacesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_interface_tap_configurations = NetworkInterfaceTapConfigurationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_profiles = NetworkProfilesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_security_groups = NetworkSecurityGroupsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.security_rules = SecurityRulesOperations(self._client,
                                                      self.config,
                                                      self._serialize,
                                                      self._deserialize)
        self.default_security_rules = DefaultSecurityRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_watchers = NetworkWatchersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.packet_captures = PacketCapturesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.connection_monitors = ConnectionMonitorsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.operations = Operations(self._client, self.config,
                                     self._serialize, self._deserialize)
        self.public_ip_addresses = PublicIPAddressesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.public_ip_prefixes = PublicIPPrefixesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.route_filters = RouteFiltersOperations(self._client, self.config,
                                                    self._serialize,
                                                    self._deserialize)
        self.route_filter_rules = RouteFilterRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.route_tables = RouteTablesOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.routes = RoutesOperations(self._client, self.config,
                                       self._serialize, self._deserialize)
        self.bgp_service_communities = BgpServiceCommunitiesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.service_endpoint_policies = ServiceEndpointPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.service_endpoint_policy_definitions = ServiceEndpointPolicyDefinitionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.usages = UsagesOperations(self._client, self.config,
                                       self._serialize, self._deserialize)
        self.virtual_networks = VirtualNetworksOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.subnets = SubnetsOperations(self._client, self.config,
                                         self._serialize, self._deserialize)
        self.virtual_network_peerings = VirtualNetworkPeeringsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_gateways = VirtualNetworkGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.local_network_gateways = LocalNetworkGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_taps = VirtualNetworkTapsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_wans = VirtualWansOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.vpn_sites = VpnSitesOperations(self._client, self.config,
                                            self._serialize, self._deserialize)
        self.vpn_sites_configuration = VpnSitesConfigurationOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_hubs = VirtualHubsOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.hub_virtual_network_connections = HubVirtualNetworkConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.vpn_gateways = VpnGatewaysOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.vpn_connections = VpnConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.p2s_vpn_server_configurations = P2sVpnServerConfigurationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.p2s_vpn_gateways = P2sVpnGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.web_application_firewall_policies = WebApplicationFirewallPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
class NotificationClient(Client):
    """Notification
    :param str base_url: Service URL
    :param Authentication creds: Authenticated credentials.
    """
    def __init__(self, base_url=None, creds=None):
        super(NotificationClient, self).__init__(base_url, creds)
        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)

    resource_area_identifier = None

    def list_logs(self, source, entry_id=None, start_time=None, end_time=None):
        """ListLogs.
        Get a list of diagnostic logs for this service.
        :param str source: ID specifying which type of logs to check diagnostics for.
        :param str entry_id: The ID of the specific log to query for.
        :param datetime start_time: Start time for the time range to query in.
        :param datetime end_time: End time for the time range to query in.
        :rtype: [INotificationDiagnosticLog]
        """
        route_values = {}
        if source is not None:
            route_values['source'] = self._serialize.url(
                'source', source, 'str')
        if entry_id is not None:
            route_values['entryId'] = self._serialize.url(
                'entry_id', entry_id, 'str')
        query_parameters = {}
        if start_time is not None:
            query_parameters['startTime'] = self._serialize.query(
                'start_time', start_time, 'iso-8601')
        if end_time is not None:
            query_parameters['endTime'] = self._serialize.query(
                'end_time', end_time, 'iso-8601')
        response = self._send(
            http_method='GET',
            location_id='991842f3-eb16-4aea-ac81-81353ef2b75c',
            version='5.1',
            route_values=route_values,
            query_parameters=query_parameters)
        return self._deserialize('[INotificationDiagnosticLog]',
                                 self._unwrap_collection(response))

    def get_subscription_diagnostics(self, subscription_id):
        """GetSubscriptionDiagnostics.
        Get the diagnostics settings for a subscription.
        :param str subscription_id: The id of the notifications subscription.
        :rtype: :class:`<SubscriptionDiagnostics> <azure.devops.v5_1.notification.models.SubscriptionDiagnostics>`
        """
        route_values = {}
        if subscription_id is not None:
            route_values['subscriptionId'] = self._serialize.url(
                'subscription_id', subscription_id, 'str')
        response = self._send(
            http_method='GET',
            location_id='20f1929d-4be7-4c2e-a74e-d47640ff3418',
            version='5.1',
            route_values=route_values)
        return self._deserialize('SubscriptionDiagnostics', response)

    def update_subscription_diagnostics(self, update_parameters,
                                        subscription_id):
        """UpdateSubscriptionDiagnostics.
        Update the diagnostics settings for a subscription.
        :param :class:`<UpdateSubscripitonDiagnosticsParameters> <azure.devops.v5_1.notification.models.UpdateSubscripitonDiagnosticsParameters>` update_parameters:
        :param str subscription_id: The id of the notifications subscription.
        :rtype: :class:`<SubscriptionDiagnostics> <azure.devops.v5_1.notification.models.SubscriptionDiagnostics>`
        """
        route_values = {}
        if subscription_id is not None:
            route_values['subscriptionId'] = self._serialize.url(
                'subscription_id', subscription_id, 'str')
        content = self._serialize.body(
            update_parameters, 'UpdateSubscripitonDiagnosticsParameters')
        response = self._send(
            http_method='PUT',
            location_id='20f1929d-4be7-4c2e-a74e-d47640ff3418',
            version='5.1',
            route_values=route_values,
            content=content)
        return self._deserialize('SubscriptionDiagnostics', response)

    def get_event_type(self, event_type):
        """GetEventType.
        Get a specific event type.
        :param str event_type: The ID of the event type.
        :rtype: :class:`<NotificationEventType> <azure.devops.v5_1.notification.models.NotificationEventType>`
        """
        route_values = {}
        if event_type is not None:
            route_values['eventType'] = self._serialize.url(
                'event_type', event_type, 'str')
        response = self._send(
            http_method='GET',
            location_id='cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21',
            version='5.1',
            route_values=route_values)
        return self._deserialize('NotificationEventType', response)

    def list_event_types(self, publisher_id=None):
        """ListEventTypes.
        List available event types for this service. Optionally filter by only event types for the specified publisher.
        :param str publisher_id: Limit to event types for this publisher
        :rtype: [NotificationEventType]
        """
        query_parameters = {}
        if publisher_id is not None:
            query_parameters['publisherId'] = self._serialize.query(
                'publisher_id', publisher_id, 'str')
        response = self._send(
            http_method='GET',
            location_id='cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21',
            version='5.1',
            query_parameters=query_parameters)
        return self._deserialize('[NotificationEventType]',
                                 self._unwrap_collection(response))

    def get_settings(self):
        """GetSettings.
        :rtype: :class:`<NotificationAdminSettings> <azure.devops.v5_1.notification.models.NotificationAdminSettings>`
        """
        response = self._send(
            http_method='GET',
            location_id='cbe076d8-2803-45ff-8d8d-44653686ea2a',
            version='5.1')
        return self._deserialize('NotificationAdminSettings', response)

    def update_settings(self, update_parameters):
        """UpdateSettings.
        :param :class:`<NotificationAdminSettingsUpdateParameters> <azure.devops.v5_1.notification.models.NotificationAdminSettingsUpdateParameters>` update_parameters:
        :rtype: :class:`<NotificationAdminSettings> <azure.devops.v5_1.notification.models.NotificationAdminSettings>`
        """
        content = self._serialize.body(
            update_parameters, 'NotificationAdminSettingsUpdateParameters')
        response = self._send(
            http_method='PATCH',
            location_id='cbe076d8-2803-45ff-8d8d-44653686ea2a',
            version='5.1',
            content=content)
        return self._deserialize('NotificationAdminSettings', response)

    def get_subscriber(self, subscriber_id):
        """GetSubscriber.
        Get delivery preferences of a notifications subscriber.
        :param str subscriber_id: ID of the user or group.
        :rtype: :class:`<NotificationSubscriber> <azure.devops.v5_1.notification.models.NotificationSubscriber>`
        """
        route_values = {}
        if subscriber_id is not None:
            route_values['subscriberId'] = self._serialize.url(
                'subscriber_id', subscriber_id, 'str')
        response = self._send(
            http_method='GET',
            location_id='4d5caff1-25ba-430b-b808-7a1f352cc197',
            version='5.1',
            route_values=route_values)
        return self._deserialize('NotificationSubscriber', response)

    def update_subscriber(self, update_parameters, subscriber_id):
        """UpdateSubscriber.
        Update delivery preferences of a notifications subscriber.
        :param :class:`<NotificationSubscriberUpdateParameters> <azure.devops.v5_1.notification.models.NotificationSubscriberUpdateParameters>` update_parameters:
        :param str subscriber_id: ID of the user or group.
        :rtype: :class:`<NotificationSubscriber> <azure.devops.v5_1.notification.models.NotificationSubscriber>`
        """
        route_values = {}
        if subscriber_id is not None:
            route_values['subscriberId'] = self._serialize.url(
                'subscriber_id', subscriber_id, 'str')
        content = self._serialize.body(
            update_parameters, 'NotificationSubscriberUpdateParameters')
        response = self._send(
            http_method='PATCH',
            location_id='4d5caff1-25ba-430b-b808-7a1f352cc197',
            version='5.1',
            route_values=route_values,
            content=content)
        return self._deserialize('NotificationSubscriber', response)

    def query_subscriptions(self, subscription_query):
        """QuerySubscriptions.
        Query for subscriptions. A subscription is returned if it matches one or more of the specified conditions.
        :param :class:`<SubscriptionQuery> <azure.devops.v5_1.notification.models.SubscriptionQuery>` subscription_query:
        :rtype: [NotificationSubscription]
        """
        content = self._serialize.body(subscription_query, 'SubscriptionQuery')
        response = self._send(
            http_method='POST',
            location_id='6864db85-08c0-4006-8e8e-cc1bebe31675',
            version='5.1',
            content=content)
        return self._deserialize('[NotificationSubscription]',
                                 self._unwrap_collection(response))

    def create_subscription(self, create_parameters):
        """CreateSubscription.
        Create a new subscription.
        :param :class:`<NotificationSubscriptionCreateParameters> <azure.devops.v5_1.notification.models.NotificationSubscriptionCreateParameters>` create_parameters:
        :rtype: :class:`<NotificationSubscription> <azure.devops.v5_1.notification.models.NotificationSubscription>`
        """
        content = self._serialize.body(
            create_parameters, 'NotificationSubscriptionCreateParameters')
        response = self._send(
            http_method='POST',
            location_id='70f911d6-abac-488c-85b3-a206bf57e165',
            version='5.1',
            content=content)
        return self._deserialize('NotificationSubscription', response)

    def delete_subscription(self, subscription_id):
        """DeleteSubscription.
        Delete a subscription.
        :param str subscription_id:
        """
        route_values = {}
        if subscription_id is not None:
            route_values['subscriptionId'] = self._serialize.url(
                'subscription_id', subscription_id, 'str')
        self._send(http_method='DELETE',
                   location_id='70f911d6-abac-488c-85b3-a206bf57e165',
                   version='5.1',
                   route_values=route_values)

    def get_subscription(self, subscription_id, query_flags=None):
        """GetSubscription.
        Get a notification subscription by its ID.
        :param str subscription_id:
        :param str query_flags:
        :rtype: :class:`<NotificationSubscription> <azure.devops.v5_1.notification.models.NotificationSubscription>`
        """
        route_values = {}
        if subscription_id is not None:
            route_values['subscriptionId'] = self._serialize.url(
                'subscription_id', subscription_id, 'str')
        query_parameters = {}
        if query_flags is not None:
            query_parameters['queryFlags'] = self._serialize.query(
                'query_flags', query_flags, 'str')
        response = self._send(
            http_method='GET',
            location_id='70f911d6-abac-488c-85b3-a206bf57e165',
            version='5.1',
            route_values=route_values,
            query_parameters=query_parameters)
        return self._deserialize('NotificationSubscription', response)

    def list_subscriptions(self, target_id=None, ids=None, query_flags=None):
        """ListSubscriptions.
        Get a list of notification subscriptions, either by subscription IDs or by all subscriptions for a given user or group.
        :param str target_id: User or Group ID
        :param [str] ids: List of subscription IDs
        :param str query_flags:
        :rtype: [NotificationSubscription]
        """
        query_parameters = {}
        if target_id is not None:
            query_parameters['targetId'] = self._serialize.query(
                'target_id', target_id, 'str')
        if ids is not None:
            ids = ",".join(ids)
            query_parameters['ids'] = self._serialize.query('ids', ids, 'str')
        if query_flags is not None:
            query_parameters['queryFlags'] = self._serialize.query(
                'query_flags', query_flags, 'str')
        response = self._send(
            http_method='GET',
            location_id='70f911d6-abac-488c-85b3-a206bf57e165',
            version='5.1',
            query_parameters=query_parameters)
        return self._deserialize('[NotificationSubscription]',
                                 self._unwrap_collection(response))

    def update_subscription(self, update_parameters, subscription_id):
        """UpdateSubscription.
        Update an existing subscription. Depending on the type of subscription and permissions, the caller can update the description, filter settings, channel (delivery) settings and more.
        :param :class:`<NotificationSubscriptionUpdateParameters> <azure.devops.v5_1.notification.models.NotificationSubscriptionUpdateParameters>` update_parameters:
        :param str subscription_id:
        :rtype: :class:`<NotificationSubscription> <azure.devops.v5_1.notification.models.NotificationSubscription>`
        """
        route_values = {}
        if subscription_id is not None:
            route_values['subscriptionId'] = self._serialize.url(
                'subscription_id', subscription_id, 'str')
        content = self._serialize.body(
            update_parameters, 'NotificationSubscriptionUpdateParameters')
        response = self._send(
            http_method='PATCH',
            location_id='70f911d6-abac-488c-85b3-a206bf57e165',
            version='5.1',
            route_values=route_values,
            content=content)
        return self._deserialize('NotificationSubscription', response)

    def get_subscription_templates(self):
        """GetSubscriptionTemplates.
        Get available subscription templates.
        :rtype: [NotificationSubscriptionTemplate]
        """
        response = self._send(
            http_method='GET',
            location_id='fa5d24ba-7484-4f3d-888d-4ec6b1974082',
            version='5.1')
        return self._deserialize('[NotificationSubscriptionTemplate]',
                                 self._unwrap_collection(response))

    def update_subscription_user_settings(self, user_settings, subscription_id,
                                          user_id):
        """UpdateSubscriptionUserSettings.
        Update the specified user's settings for the specified subscription. This API is typically used to opt in or out of a shared subscription. User settings can only be applied to shared subscriptions, like team subscriptions or default subscriptions.
        :param :class:`<SubscriptionUserSettings> <azure.devops.v5_1.notification.models.SubscriptionUserSettings>` user_settings:
        :param str subscription_id:
        :param str user_id: ID of the user
        :rtype: :class:`<SubscriptionUserSettings> <azure.devops.v5_1.notification.models.SubscriptionUserSettings>`
        """
        route_values = {}
        if subscription_id is not None:
            route_values['subscriptionId'] = self._serialize.url(
                'subscription_id', subscription_id, 'str')
        if user_id is not None:
            route_values['userId'] = self._serialize.url(
                'user_id', user_id, 'str')
        content = self._serialize.body(user_settings,
                                       'SubscriptionUserSettings')
        response = self._send(
            http_method='PUT',
            location_id='ed5a3dff-aeb5-41b1-b4f7-89e66e58b62e',
            version='5.1',
            route_values=route_values,
            content=content)
        return self._deserialize('SubscriptionUserSettings', response)
    def __init__(
            self,
            credential,  # type: "TokenCredential"
            subscription_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 = DataFactoryManagementClientConfiguration(
            credential, subscription_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.factories = FactoriesOperations(self._client, self._config,
                                             self._serialize,
                                             self._deserialize)
        self.exposure_control = ExposureControlOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.integration_runtimes = IntegrationRuntimesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.integration_runtime_object_metadata = IntegrationRuntimeObjectMetadataOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.integration_runtime_nodes = IntegrationRuntimeNodesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.linked_services = LinkedServicesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.datasets = DatasetsOperations(self._client, self._config,
                                           self._serialize, self._deserialize)
        self.pipelines = PipelinesOperations(self._client, self._config,
                                             self._serialize,
                                             self._deserialize)
        self.pipeline_runs = PipelineRunsOperations(self._client, self._config,
                                                    self._serialize,
                                                    self._deserialize)
        self.activity_runs = ActivityRunsOperations(self._client, self._config,
                                                    self._serialize,
                                                    self._deserialize)
        self.triggers = TriggersOperations(self._client, self._config,
                                           self._serialize, self._deserialize)
        self.trigger_runs = TriggerRunsOperations(self._client, self._config,
                                                  self._serialize,
                                                  self._deserialize)
        self.data_flows = DataFlowsOperations(self._client, self._config,
                                              self._serialize,
                                              self._deserialize)
        self.data_flow_debug_session = DataFlowDebugSessionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.managed_virtual_networks = ManagedVirtualNetworksOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.managed_private_endpoints = ManagedPrivateEndpointsOperations(
            self._client, self._config, self._serialize, self._deserialize)
Пример #46
0
class ContainerServiceClient(object):
    """The Container Service Client.

    :ivar operations: Operations operations
    :vartype operations: azure.mgmt.containerservice.v2020_09_01.operations.Operations
    :ivar managed_clusters: ManagedClustersOperations operations
    :vartype managed_clusters: azure.mgmt.containerservice.v2020_09_01.operations.ManagedClustersOperations
    :ivar agent_pools: AgentPoolsOperations operations
    :vartype agent_pools: azure.mgmt.containerservice.v2020_09_01.operations.AgentPoolsOperations
    :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
    :vartype private_endpoint_connections: azure.mgmt.containerservice.v2020_09_01.operations.PrivateEndpointConnectionsOperations
    :ivar private_link_resources: PrivateLinkResourcesOperations operations
    :vartype private_link_resources: azure.mgmt.containerservice.v2020_09_01.operations.PrivateLinkResourcesOperations
    :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations
    :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2020_09_01.operations.ResolvePrivateLinkServiceIdOperations
    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials.TokenCredential
    :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
    :type subscription_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
            base_url=None,  # type: Optional[str]
            **kwargs  # type: Any
    ):
        # type: (...) -> None
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = ContainerServiceClientConfiguration(
            credential, subscription_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._serialize.client_side_validation = False
        self._deserialize = Deserializer(client_models)

        self.operations = Operations(self._client, self._config,
                                     self._serialize, self._deserialize)
        self.managed_clusters = ManagedClustersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.agent_pools = AgentPoolsOperations(self._client, self._config,
                                                self._serialize,
                                                self._deserialize)
        self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.private_link_resources = PrivateLinkResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(
            self._client, self._config, self._serialize, self._deserialize)

    def _send_request(self, http_request, **kwargs):
        # type: (HttpRequest, Any) -> HttpResponse
        """Runs the network request through the client's chained policies.

        :param http_request: The network request you want to make. Required.
        :type http_request: ~azure.core.pipeline.transport.HttpRequest
        :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
        :return: The response of your network call. Does not do error handling on your response.
        :rtype: ~azure.core.pipeline.transport.HttpResponse
        """
        path_format_arguments = {
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
        }
        http_request.url = self._client.format_url(http_request.url,
                                                   **path_format_arguments)
        stream = kwargs.pop("stream", True)
        pipeline_response = self._client._pipeline.run(http_request,
                                                       stream=stream,
                                                       **kwargs)
        return pipeline_response.http_response

    def close(self):
        # type: () -> None
        self._client.close()

    def __enter__(self):
        # type: () -> ContainerServiceClient
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        # type: (Any) -> None
        self._client.__exit__(*exc_details)
Пример #47
0
class ContainerRegistryManagementClient(object):
    """ContainerRegistryManagementClient.

    :ivar registries: RegistriesOperations operations
    :vartype registries: azure.mgmt.containerregistry.v2018_09_01.aio.operations.RegistriesOperations
    :ivar runs: RunsOperations operations
    :vartype runs: azure.mgmt.containerregistry.v2018_09_01.aio.operations.RunsOperations
    :ivar tasks: TasksOperations operations
    :vartype tasks: azure.mgmt.containerregistry.v2018_09_01.aio.operations.TasksOperations
    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param subscription_id: The Microsoft Azure subscription ID.
    :type subscription_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,
                 base_url: Optional[str] = None,
                 **kwargs: Any) -> None:
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = ContainerRegistryManagementClientConfiguration(
            credential, subscription_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._serialize.client_side_validation = False
        self._deserialize = Deserializer(client_models)

        self.registries = RegistriesOperations(self._client, self._config,
                                               self._serialize,
                                               self._deserialize)
        self.runs = RunsOperations(self._client, self._config, self._serialize,
                                   self._deserialize)
        self.tasks = TasksOperations(self._client, self._config,
                                     self._serialize, self._deserialize)

    async def _send_request(self, http_request: HttpRequest,
                            **kwargs: Any) -> AsyncHttpResponse:
        """Runs the network request through the client's chained policies.

        :param http_request: The network request you want to make. Required.
        :type http_request: ~azure.core.pipeline.transport.HttpRequest
        :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
        :return: The response of your network call. Does not do error handling on your response.
        :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
        """
        path_format_arguments = {
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
        }
        http_request.url = self._client.format_url(http_request.url,
                                                   **path_format_arguments)
        stream = kwargs.pop("stream", True)
        pipeline_response = await self._client._pipeline.run(http_request,
                                                             stream=stream,
                                                             **kwargs)
        return pipeline_response.http_response

    async def close(self) -> None:
        await self._client.close()

    async def __aenter__(self) -> "ContainerRegistryManagementClient":
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details) -> None:
        await self._client.__aexit__(*exc_details)
class AzureReservationAPI(SDKClient):
    """This API describe Azure Reservation

    :ivar config: Configuration for client.
    :vartype config: AzureReservationAPIConfiguration

    :ivar reservation_order: ReservationOrder operations
    :vartype reservation_order: azure.mgmt.reservations.operations.ReservationOrderOperations
    :ivar reservation: Reservation operations
    :vartype reservation: azure.mgmt.reservations.operations.ReservationOperations
    :ivar operation: Operation operations
    :vartype operation: azure.mgmt.reservations.operations.OperationOperations

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param str base_url: Service URL
    """
    def __init__(self, credentials, base_url=None):

        self.config = AzureReservationAPIConfiguration(credentials, base_url)
        super(AzureReservationAPI, self).__init__(self.config.credentials,
                                                  self.config)

        client_models = {
            k: v
            for k, v in models.__dict__.items() if isinstance(v, type)
        }
        self.api_version = '2018-06-01'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.reservation_order = ReservationOrderOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.reservation = ReservationOperations(self._client, self.config,
                                                 self._serialize,
                                                 self._deserialize)
        self.operation = OperationOperations(self._client, self.config,
                                             self._serialize,
                                             self._deserialize)

    def get_catalog(self,
                    subscription_id,
                    reserved_resource_type,
                    location=None,
                    custom_headers=None,
                    raw=False,
                    **operation_config):
        """Get the regions and skus that are available for RI purchase for the
        specified Azure subscription.

        :param subscription_id: Id of the subscription
        :type subscription_id: str
        :param reserved_resource_type: The type of the resource for which the
         skus should be provided.
        :type reserved_resource_type: str
        :param location: Filters the skus based on the location specified in
         this parameter. This can be an azure region or global
        :type location: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: list or ClientRawResponse if raw=true
        :rtype: list[~azure.mgmt.reservations.models.Catalog] or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorException<azure.mgmt.reservations.models.ErrorException>`
        """
        # Construct URL
        url = self.get_catalog.metadata['url']
        path_format_arguments = {
            'subscriptionId':
            self._serialize.url("subscription_id", subscription_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}
        query_parameters['api-version'] = self._serialize.query(
            "self.api_version", self.api_version, 'str')
        query_parameters['reservedResourceType'] = self._serialize.query(
            "reserved_resource_type", reserved_resource_type, 'str')
        if location is not None:
            query_parameters['location'] = self._serialize.query(
                "location", location, 'str')

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if self.config.generate_client_request_id:
            header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
        if custom_headers:
            header_parameters.update(custom_headers)
        if self.config.accept_language is not None:
            header_parameters['accept-language'] = self._serialize.header(
                "self.config.accept_language", self.config.accept_language,
                'str')

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200]:
            raise models.ErrorException(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('[Catalog]', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized

    get_catalog.metadata = {
        'url':
        '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs'
    }

    def get_applied_reservation_list(self,
                                     subscription_id,
                                     custom_headers=None,
                                     raw=False,
                                     **operation_config):
        """Get list of applicable `Reservation`s.

        Get applicable `Reservation`s that are applied to this subscription.

        :param subscription_id: Id of the subscription
        :type subscription_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: AppliedReservations or ClientRawResponse if raw=true
        :rtype: ~azure.mgmt.reservations.models.AppliedReservations or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorException<azure.mgmt.reservations.models.ErrorException>`
        """
        # Construct URL
        url = self.get_applied_reservation_list.metadata['url']
        path_format_arguments = {
            'subscriptionId':
            self._serialize.url("subscription_id", subscription_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}
        query_parameters['api-version'] = self._serialize.query(
            "self.api_version", self.api_version, 'str')

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if self.config.generate_client_request_id:
            header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
        if custom_headers:
            header_parameters.update(custom_headers)
        if self.config.accept_language is not None:
            header_parameters['accept-language'] = self._serialize.header(
                "self.config.accept_language", self.config.accept_language,
                'str')

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200]:
            raise models.ErrorException(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('AppliedReservations', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized

    get_applied_reservation_list.metadata = {
        'url':
        '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations'
    }
    def __init__(
        self,
        credential,  # type: "TokenCredential"
        subscription_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 = CosmosDBManagementClientConfiguration(credential, subscription_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._serialize.client_side_validation = False
        self._deserialize = Deserializer(client_models)

        self.database_accounts = DatabaseAccountsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.operations = Operations(
            self._client, self._config, self._serialize, self._deserialize)
        self.database = DatabaseOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.collection = CollectionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.collection_region = CollectionRegionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.database_account_region = DatabaseAccountRegionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.percentile_source_target = PercentileSourceTargetOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.percentile_target = PercentileTargetOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.percentile = PercentileOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.collection_partition_region = CollectionPartitionRegionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.collection_partition = CollectionPartitionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.partition_key_range_id = PartitionKeyRangeIdOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.partition_key_range_id_region = PartitionKeyRangeIdRegionOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.sql_resources = SqlResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.mongo_db_resources = MongoDBResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.table_resources = TableResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.cassandra_resources = CassandraResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.gremlin_resources = GremlinResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.notebook_workspaces = NotebookWorkspacesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.private_link_resources = PrivateLinkResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_database_accounts = RestorableDatabaseAccountsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_sql_databases = RestorableSqlDatabasesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_sql_containers = RestorableSqlContainersOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_sql_resources = RestorableSqlResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_mongodb_databases = RestorableMongodbDatabasesOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_mongodb_collections = RestorableMongodbCollectionsOperations(
            self._client, self._config, self._serialize, self._deserialize)
        self.restorable_mongodb_resources = RestorableMongodbResourcesOperations(
            self._client, self._config, self._serialize, self._deserialize)
 def __init__(self, base_url=None, creds=None):
     super(CoreClient, self).__init__(base_url, creds)
     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)
class AnomalyDetectorClient(AnomalyDetectorClientOperationsMixin):
    """The Anomaly Detector API detects anomalies automatically in time series data. It supports two kinds of mode, one is for stateless using, another is for stateful using. In stateless mode, there are three functionalities. Entire Detect is for detecting the whole series with model trained by the time series, Last Detect is detecting last point with model trained by points before. ChangePoint Detect is for detecting trend changes in time series. In stateful mode, user can store time series, the stored time series will be used for detection anomalies. Under this mode, user can still use the above three functionalities by only giving a time range without preparing time series in client side. Besides the above three functionalities, stateful model also provide group based detection and labeling service. By leveraging labeling service user can provide labels for each detection result, these labels will be used for retuning or regenerating detection models. Inconsistency detection is a kind of group based detection, this detection will find inconsistency ones in a set of time series. By using anomaly detector service, business customers can discover incidents and establish a logic flow for root cause analysis.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials.AzureKeyCredential
    :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
     https://westus2.api.cognitive.microsoft.com).
    :type endpoint: str
    :keyword api_version: Anomaly Detector API version (for example, v1.0). The default value is
     "v1.1-preview.1". Note that overriding this default value may result in unsupported behavior.
    :paramtype api_version: str
    """
    def __init__(self, credential: AzureKeyCredential, endpoint: str,
                 **kwargs: Any) -> None:
        _base_url = '{Endpoint}/anomalydetector/{ApiVersion}'
        self._config = AnomalyDetectorClientConfiguration(
            credential=credential, endpoint=endpoint, **kwargs)
        self._client = AsyncPipelineClient(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._serialize.client_side_validation = False

    def _send_request(self, request: HttpRequest,
                      **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
        """Runs the network request through the client's chained policies.

        >>> from azure.core.rest import HttpRequest
        >>> request = HttpRequest("GET", "https://www.example.org/")
        <HttpRequest [GET], url: 'https://www.example.org/'>
        >>> response = await client._send_request(request)
        <AsyncHttpResponse: 200 OK>

        For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart

        :param request: The network request you want to make. Required.
        :type request: ~azure.core.rest.HttpRequest
        :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
        :return: The response of your network call. Does not do error handling on your response.
        :rtype: ~azure.core.rest.AsyncHttpResponse
        """

        request_copy = deepcopy(request)
        path_format_arguments = {
            "Endpoint":
            self._serialize.url("self._config.endpoint",
                                self._config.endpoint,
                                'str',
                                skip_quote=True),
        }

        request_copy.url = self._client.format_url(request_copy.url,
                                                   **path_format_arguments)
        return self._client.send_request(request_copy, **kwargs)

    async def close(self) -> None:
        await self._client.close()

    async def __aenter__(self) -> "AnomalyDetectorClient":
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details) -> None:
        await self._client.__aexit__(*exc_details)
class CoreClient(VssClient):
    """Core
    :param str base_url: Service URL
    :param Authentication creds: Authenticated credentials.
    """

    def __init__(self, base_url=None, creds=None):
        super(CoreClient, self).__init__(base_url, creds)
        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)

    resource_area_identifier = '79134c72-4a58-4b42-976c-04e7115f32bf'

    def create_connected_service(self, connected_service_creation_data, project_id):
        """CreateConnectedService.
        [Preview API]
        :param :class:`<WebApiConnectedServiceDetails> <core.v4_0.models.WebApiConnectedServiceDetails>` connected_service_creation_data:
        :param str project_id:
        :rtype: :class:`<WebApiConnectedService> <core.v4_0.models.WebApiConnectedService>`
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        content = self._serialize.body(connected_service_creation_data, 'WebApiConnectedServiceDetails')
        response = self._send(http_method='POST',
                              location_id='b4f70219-e18b-42c5-abe3-98b07d35525e',
                              version='4.0-preview.1',
                              route_values=route_values,
                              content=content)
        return self._deserialize('WebApiConnectedService', response)

    def get_connected_service_details(self, project_id, name):
        """GetConnectedServiceDetails.
        [Preview API]
        :param str project_id:
        :param str name:
        :rtype: :class:`<WebApiConnectedServiceDetails> <core.v4_0.models.WebApiConnectedServiceDetails>`
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        if name is not None:
            route_values['name'] = self._serialize.url('name', name, 'str')
        response = self._send(http_method='GET',
                              location_id='b4f70219-e18b-42c5-abe3-98b07d35525e',
                              version='4.0-preview.1',
                              route_values=route_values)
        return self._deserialize('WebApiConnectedServiceDetails', response)

    def get_connected_services(self, project_id, kind=None):
        """GetConnectedServices.
        [Preview API]
        :param str project_id:
        :param str kind:
        :rtype: [WebApiConnectedService]
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        query_parameters = {}
        if kind is not None:
            query_parameters['kind'] = self._serialize.query('kind', kind, 'str')
        response = self._send(http_method='GET',
                              location_id='b4f70219-e18b-42c5-abe3-98b07d35525e',
                              version='4.0-preview.1',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('[WebApiConnectedService]', self._unwrap_collection(response))

    def create_identity_mru(self, mru_data, mru_name):
        """CreateIdentityMru.
        [Preview API]
        :param :class:`<IdentityData> <core.v4_0.models.IdentityData>` mru_data:
        :param str mru_name:
        """
        route_values = {}
        if mru_name is not None:
            route_values['mruName'] = self._serialize.url('mru_name', mru_name, 'str')
        content = self._serialize.body(mru_data, 'IdentityData')
        self._send(http_method='POST',
                   location_id='5ead0b70-2572-4697-97e9-f341069a783a',
                   version='4.0-preview.1',
                   route_values=route_values,
                   content=content)

    def get_identity_mru(self, mru_name):
        """GetIdentityMru.
        [Preview API]
        :param str mru_name:
        :rtype: [IdentityRef]
        """
        route_values = {}
        if mru_name is not None:
            route_values['mruName'] = self._serialize.url('mru_name', mru_name, 'str')
        response = self._send(http_method='GET',
                              location_id='5ead0b70-2572-4697-97e9-f341069a783a',
                              version='4.0-preview.1',
                              route_values=route_values)
        return self._deserialize('[IdentityRef]', self._unwrap_collection(response))

    def update_identity_mru(self, mru_data, mru_name):
        """UpdateIdentityMru.
        [Preview API]
        :param :class:`<IdentityData> <core.v4_0.models.IdentityData>` mru_data:
        :param str mru_name:
        """
        route_values = {}
        if mru_name is not None:
            route_values['mruName'] = self._serialize.url('mru_name', mru_name, 'str')
        content = self._serialize.body(mru_data, 'IdentityData')
        self._send(http_method='PATCH',
                   location_id='5ead0b70-2572-4697-97e9-f341069a783a',
                   version='4.0-preview.1',
                   route_values=route_values,
                   content=content)

    def get_team_members(self, project_id, team_id, top=None, skip=None):
        """GetTeamMembers.
        :param str project_id:
        :param str team_id:
        :param int top:
        :param int skip:
        :rtype: [IdentityRef]
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        if team_id is not None:
            route_values['teamId'] = self._serialize.url('team_id', team_id, 'str')
        query_parameters = {}
        if top is not None:
            query_parameters['$top'] = self._serialize.query('top', top, 'int')
        if skip is not None:
            query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
        response = self._send(http_method='GET',
                              location_id='294c494c-2600-4d7e-b76c-3dd50c3c95be',
                              version='4.0',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('[IdentityRef]', self._unwrap_collection(response))

    def get_process_by_id(self, process_id):
        """GetProcessById.
        Retrieve process by id
        :param str process_id:
        :rtype: :class:`<Process> <core.v4_0.models.Process>`
        """
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url('process_id', process_id, 'str')
        response = self._send(http_method='GET',
                              location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8',
                              version='4.0',
                              route_values=route_values)
        return self._deserialize('Process', response)

    def get_processes(self):
        """GetProcesses.
        Retrieve all processes
        :rtype: [Process]
        """
        response = self._send(http_method='GET',
                              location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8',
                              version='4.0')
        return self._deserialize('[Process]', self._unwrap_collection(response))

    def get_project_collection(self, collection_id):
        """GetProjectCollection.
        Get project collection with the specified id or name.
        :param str collection_id:
        :rtype: :class:`<TeamProjectCollection> <core.v4_0.models.TeamProjectCollection>`
        """
        route_values = {}
        if collection_id is not None:
            route_values['collectionId'] = self._serialize.url('collection_id', collection_id, 'str')
        response = self._send(http_method='GET',
                              location_id='8031090f-ef1d-4af6-85fc-698cd75d42bf',
                              version='4.0',
                              route_values=route_values)
        return self._deserialize('TeamProjectCollection', response)

    def get_project_collections(self, top=None, skip=None):
        """GetProjectCollections.
        Get project collection references for this application.
        :param int top:
        :param int skip:
        :rtype: [TeamProjectCollectionReference]
        """
        query_parameters = {}
        if top is not None:
            query_parameters['$top'] = self._serialize.query('top', top, 'int')
        if skip is not None:
            query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
        response = self._send(http_method='GET',
                              location_id='8031090f-ef1d-4af6-85fc-698cd75d42bf',
                              version='4.0',
                              query_parameters=query_parameters)
        return self._deserialize('[TeamProjectCollectionReference]', self._unwrap_collection(response))

    def get_project_history_entries(self, min_revision=None):
        """GetProjectHistoryEntries.
        [Preview API]
        :param long min_revision:
        :rtype: [ProjectInfo]
        """
        query_parameters = {}
        if min_revision is not None:
            query_parameters['minRevision'] = self._serialize.query('min_revision', min_revision, 'long')
        response = self._send(http_method='GET',
                              location_id='6488a877-4749-4954-82ea-7340d36be9f2',
                              version='4.0-preview.2',
                              query_parameters=query_parameters)
        return self._deserialize('[ProjectInfo]', self._unwrap_collection(response))

    def get_project(self, project_id, include_capabilities=None, include_history=None):
        """GetProject.
        Get project with the specified id or name, optionally including capabilities.
        :param str project_id:
        :param bool include_capabilities: Include capabilities (such as source control) in the team project result (default: false).
        :param bool include_history: Search within renamed projects (that had such name in the past).
        :rtype: :class:`<TeamProject> <core.v4_0.models.TeamProject>`
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        query_parameters = {}
        if include_capabilities is not None:
            query_parameters['includeCapabilities'] = self._serialize.query('include_capabilities', include_capabilities, 'bool')
        if include_history is not None:
            query_parameters['includeHistory'] = self._serialize.query('include_history', include_history, 'bool')
        response = self._send(http_method='GET',
                              location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1',
                              version='4.0',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('TeamProject', response)

    def get_projects(self, state_filter=None, top=None, skip=None, continuation_token=None):
        """GetProjects.
        Get project references with the specified state
        :param str state_filter: Filter on team projects in a specific team project state (default: WellFormed).
        :param int top:
        :param int skip:
        :param str continuation_token:
        :rtype: [TeamProjectReference]
        """
        query_parameters = {}
        if state_filter is not None:
            query_parameters['stateFilter'] = self._serialize.query('state_filter', state_filter, 'str')
        if top is not None:
            query_parameters['$top'] = self._serialize.query('top', top, 'int')
        if skip is not None:
            query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
        if continuation_token is not None:
            query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str')
        response = self._send(http_method='GET',
                              location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1',
                              version='4.0',
                              query_parameters=query_parameters)
        return self._deserialize('[TeamProjectReference]', self._unwrap_collection(response))

    def queue_create_project(self, project_to_create):
        """QueueCreateProject.
        Queue a project creation.
        :param :class:`<TeamProject> <core.v4_0.models.TeamProject>` project_to_create: The project to create.
        :rtype: :class:`<OperationReference> <core.v4_0.models.OperationReference>`
        """
        content = self._serialize.body(project_to_create, 'TeamProject')
        response = self._send(http_method='POST',
                              location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1',
                              version='4.0',
                              content=content)
        return self._deserialize('OperationReference', response)

    def queue_delete_project(self, project_id):
        """QueueDeleteProject.
        Queue a project deletion.
        :param str project_id: The project id of the project to delete.
        :rtype: :class:`<OperationReference> <core.v4_0.models.OperationReference>`
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        response = self._send(http_method='DELETE',
                              location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1',
                              version='4.0',
                              route_values=route_values)
        return self._deserialize('OperationReference', response)

    def update_project(self, project_update, project_id):
        """UpdateProject.
        Update an existing project's name, abbreviation, or description.
        :param :class:`<TeamProject> <core.v4_0.models.TeamProject>` project_update: The updates for the project.
        :param str project_id: The project id of the project to update.
        :rtype: :class:`<OperationReference> <core.v4_0.models.OperationReference>`
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        content = self._serialize.body(project_update, 'TeamProject')
        response = self._send(http_method='PATCH',
                              location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1',
                              version='4.0',
                              route_values=route_values,
                              content=content)
        return self._deserialize('OperationReference', response)

    def get_project_properties(self, project_id, keys=None):
        """GetProjectProperties.
        [Preview API] Get a collection of team project properties.
        :param str project_id: The team project ID.
        :param [str] keys: A comma-delimited string of team project property names. Wildcard characters ("?" and "*") are supported. If no key is specified, all properties will be returned.
        :rtype: [ProjectProperty]
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        query_parameters = {}
        if keys is not None:
            keys = ",".join(keys)
            query_parameters['keys'] = self._serialize.query('keys', keys, 'str')
        response = self._send(http_method='GET',
                              location_id='4976a71a-4487-49aa-8aab-a1eda469037a',
                              version='4.0-preview.1',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('[ProjectProperty]', self._unwrap_collection(response))

    def set_project_properties(self, project_id, patch_document):
        """SetProjectProperties.
        [Preview API] Create, update, and delete team project properties.
        :param str project_id: The team project ID.
        :param :class:`<[JsonPatchOperation]> <core.v4_0.models.[JsonPatchOperation]>` patch_document: A JSON Patch document that represents an array of property operations. See RFC 6902 for more details on JSON Patch. The accepted operation verbs are Add and Remove, where Add is used for both creating and updating properties. The path consists of a forward slash and a property name.
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        content = self._serialize.body(patch_document, '[JsonPatchOperation]')
        self._send(http_method='PATCH',
                   location_id='4976a71a-4487-49aa-8aab-a1eda469037a',
                   version='4.0-preview.1',
                   route_values=route_values,
                   content=content,
                   media_type='application/json-patch+json')

    def create_or_update_proxy(self, proxy):
        """CreateOrUpdateProxy.
        [Preview API]
        :param :class:`<Proxy> <core.v4_0.models.Proxy>` proxy:
        :rtype: :class:`<Proxy> <core.v4_0.models.Proxy>`
        """
        content = self._serialize.body(proxy, 'Proxy')
        response = self._send(http_method='PUT',
                              location_id='ec1f4311-f2b4-4c15-b2b8-8990b80d2908',
                              version='4.0-preview.2',
                              content=content)
        return self._deserialize('Proxy', response)

    def delete_proxy(self, proxy_url, site=None):
        """DeleteProxy.
        [Preview API]
        :param str proxy_url:
        :param str site:
        """
        query_parameters = {}
        if proxy_url is not None:
            query_parameters['proxyUrl'] = self._serialize.query('proxy_url', proxy_url, 'str')
        if site is not None:
            query_parameters['site'] = self._serialize.query('site', site, 'str')
        self._send(http_method='DELETE',
                   location_id='ec1f4311-f2b4-4c15-b2b8-8990b80d2908',
                   version='4.0-preview.2',
                   query_parameters=query_parameters)

    def get_proxies(self, proxy_url=None):
        """GetProxies.
        [Preview API]
        :param str proxy_url:
        :rtype: [Proxy]
        """
        query_parameters = {}
        if proxy_url is not None:
            query_parameters['proxyUrl'] = self._serialize.query('proxy_url', proxy_url, 'str')
        response = self._send(http_method='GET',
                              location_id='ec1f4311-f2b4-4c15-b2b8-8990b80d2908',
                              version='4.0-preview.2',
                              query_parameters=query_parameters)
        return self._deserialize('[Proxy]', self._unwrap_collection(response))

    def create_team(self, team, project_id):
        """CreateTeam.
        Creates a team
        :param :class:`<WebApiTeam> <core.v4_0.models.WebApiTeam>` team: The team data used to create the team.
        :param str project_id: The name or id (GUID) of the team project in which to create the team.
        :rtype: :class:`<WebApiTeam> <core.v4_0.models.WebApiTeam>`
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        content = self._serialize.body(team, 'WebApiTeam')
        response = self._send(http_method='POST',
                              location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59',
                              version='4.0',
                              route_values=route_values,
                              content=content)
        return self._deserialize('WebApiTeam', response)

    def delete_team(self, project_id, team_id):
        """DeleteTeam.
        Deletes a team
        :param str project_id: The name or id (GUID) of the team project containing the team to delete.
        :param str team_id: The name of id of the team to delete.
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        if team_id is not None:
            route_values['teamId'] = self._serialize.url('team_id', team_id, 'str')
        self._send(http_method='DELETE',
                   location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59',
                   version='4.0',
                   route_values=route_values)

    def get_team(self, project_id, team_id):
        """GetTeam.
        Gets a team
        :param str project_id:
        :param str team_id:
        :rtype: :class:`<WebApiTeam> <core.v4_0.models.WebApiTeam>`
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        if team_id is not None:
            route_values['teamId'] = self._serialize.url('team_id', team_id, 'str')
        response = self._send(http_method='GET',
                              location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59',
                              version='4.0',
                              route_values=route_values)
        return self._deserialize('WebApiTeam', response)

    def get_teams(self, project_id, top=None, skip=None):
        """GetTeams.
        :param str project_id:
        :param int top:
        :param int skip:
        :rtype: [WebApiTeam]
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        query_parameters = {}
        if top is not None:
            query_parameters['$top'] = self._serialize.query('top', top, 'int')
        if skip is not None:
            query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
        response = self._send(http_method='GET',
                              location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59',
                              version='4.0',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('[WebApiTeam]', self._unwrap_collection(response))

    def update_team(self, team_data, project_id, team_id):
        """UpdateTeam.
        Updates a team's name and/or description
        :param :class:`<WebApiTeam> <core.v4_0.models.WebApiTeam>` team_data:
        :param str project_id: The name or id (GUID) of the team project containing the team to update.
        :param str team_id: The name of id of the team to update.
        :rtype: :class:`<WebApiTeam> <core.v4_0.models.WebApiTeam>`
        """
        route_values = {}
        if project_id is not None:
            route_values['projectId'] = self._serialize.url('project_id', project_id, 'str')
        if team_id is not None:
            route_values['teamId'] = self._serialize.url('team_id', team_id, 'str')
        content = self._serialize.body(team_data, 'WebApiTeam')
        response = self._send(http_method='PATCH',
                              location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59',
                              version='4.0',
                              route_values=route_values,
                              content=content)
        return self._deserialize('WebApiTeam', response)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from msrest import Serializer

from .._vendor import _convert_request, _format_url_section

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]]

_SERIALIZER = Serializer()
# fmt: off

def build_metadata_roles_list_request(
    **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    api_version = "2021-07-01-preview"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop("template_url", '/metadataRoles')

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
Пример #54
0
    def __init__(self, credentials, subscription_id, base_url=None):

        self.config = SqlManagementClientConfiguration(credentials,
                                                       subscription_id,
                                                       base_url)
        super(SqlManagementClient, self).__init__(self.config.credentials,
                                                  self.config)

        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.recoverable_databases = RecoverableDatabasesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.restorable_dropped_databases = RestorableDroppedDatabasesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.servers = ServersOperations(self._client, self.config,
                                         self._serialize, self._deserialize)
        self.server_connection_policies = ServerConnectionPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.database_threat_detection_policies = DatabaseThreatDetectionPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.data_masking_policies = DataMaskingPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.data_masking_rules = DataMaskingRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.firewall_rules = FirewallRulesOperations(self._client,
                                                      self.config,
                                                      self._serialize,
                                                      self._deserialize)
        self.geo_backup_policies = GeoBackupPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.databases = DatabasesOperations(self._client, self.config,
                                             self._serialize,
                                             self._deserialize)
        self.elastic_pools = ElasticPoolsOperations(self._client, self.config,
                                                    self._serialize,
                                                    self._deserialize)
        self.recommended_elastic_pools = RecommendedElasticPoolsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.replication_links = ReplicationLinksOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.server_communication_links = ServerCommunicationLinksOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.service_objectives = ServiceObjectivesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.elastic_pool_activities = ElasticPoolActivitiesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.elastic_pool_database_activities = ElasticPoolDatabaseActivitiesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.service_tier_advisors = ServiceTierAdvisorsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.transparent_data_encryptions = TransparentDataEncryptionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.transparent_data_encryption_activities = TransparentDataEncryptionActivitiesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.server_usages = ServerUsagesOperations(self._client, self.config,
                                                    self._serialize,
                                                    self._deserialize)
        self.database_usages = DatabaseUsagesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.database_automatic_tuning = DatabaseAutomaticTuningOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.encryption_protectors = EncryptionProtectorsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.failover_groups = FailoverGroupsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.managed_instances = ManagedInstancesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.operations = Operations(self._client, self.config,
                                     self._serialize, self._deserialize)
        self.server_keys = ServerKeysOperations(self._client, self.config,
                                                self._serialize,
                                                self._deserialize)
        self.sync_agents = SyncAgentsOperations(self._client, self.config,
                                                self._serialize,
                                                self._deserialize)
        self.sync_groups = SyncGroupsOperations(self._client, self.config,
                                                self._serialize,
                                                self._deserialize)
        self.sync_members = SyncMembersOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.subscription_usages = SubscriptionUsagesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_rules = VirtualNetworkRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.database_vulnerability_assessment_rule_baselines = DatabaseVulnerabilityAssessmentRuleBaselinesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.job_agents = JobAgentsOperations(self._client, self.config,
                                              self._serialize,
                                              self._deserialize)
        self.job_credentials = JobCredentialsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.job_executions = JobExecutionsOperations(self._client,
                                                      self.config,
                                                      self._serialize,
                                                      self._deserialize)
        self.jobs = JobsOperations(self._client, self.config, self._serialize,
                                   self._deserialize)
        self.job_step_executions = JobStepExecutionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.job_steps = JobStepsOperations(self._client, self.config,
                                            self._serialize, self._deserialize)
        self.job_target_executions = JobTargetExecutionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.job_target_groups = JobTargetGroupsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.job_versions = JobVersionsOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.long_term_retention_backups = LongTermRetentionBackupsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.backup_long_term_retention_policies = BackupLongTermRetentionPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.managed_databases = ManagedDatabasesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.server_automatic_tuning = ServerAutomaticTuningOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.server_dns_aliases = ServerDnsAliasesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.restore_points = RestorePointsOperations(self._client,
                                                      self.config,
                                                      self._serialize,
                                                      self._deserialize)
        self.database_operations = DatabaseOperations(self._client,
                                                      self.config,
                                                      self._serialize,
                                                      self._deserialize)
        self.elastic_pool_operations = ElasticPoolOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.capabilities = CapabilitiesOperations(self._client, self.config,
                                                   self._serialize,
                                                   self._deserialize)
        self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.managed_database_vulnerability_assessment_rule_baselines = ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.managed_database_vulnerability_assessment_scans = ManagedDatabaseVulnerabilityAssessmentScansOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.managed_database_vulnerability_assessments = ManagedDatabaseVulnerabilityAssessmentsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.instance_failover_groups = InstanceFailoverGroupsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.tde_certificates = TdeCertificatesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.managed_instance_keys = ManagedInstanceKeysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.managed_instance_encryption_protectors = ManagedInstanceEncryptionProtectorsOperations(
            self._client, self.config, self._serialize, self._deserialize)
class AzureDataLakeStorageRESTAPI(object):
    """Azure Data Lake Storage provides storage for Hadoop and other big data workloads.

    :ivar service: ServiceOperations operations
    :vartype service: azure.storage.filedatalake.operations.ServiceOperations
    :ivar file_system: FileSystemOperations operations
    :vartype file_system: azure.storage.filedatalake.operations.FileSystemOperations
    :ivar path: PathOperations operations
    :vartype path: azure.storage.filedatalake.operations.PathOperations
    :param url: The URL of the service account, container, or blob that is the target of the desired operation.
    :type url: str
    """
    def __init__(
            self,
            url,  # type: str
            **kwargs  # type: Any
    ):
        # type: (...) -> None
        base_url = '{url}'
        self._config = AzureDataLakeStorageRESTAPIConfiguration(url, **kwargs)
        self._client = PipelineClient(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._serialize.client_side_validation = False
        self._deserialize = Deserializer(client_models)

        self.service = ServiceOperations(self._client, self._config,
                                         self._serialize, self._deserialize)
        self.file_system = FileSystemOperations(self._client, self._config,
                                                self._serialize,
                                                self._deserialize)
        self.path = PathOperations(self._client, self._config, self._serialize,
                                   self._deserialize)

    def _send_request(self, http_request, **kwargs):
        # type: (HttpRequest, Any) -> HttpResponse
        """Runs the network request through the client's chained policies.

        :param http_request: The network request you want to make. Required.
        :type http_request: ~azure.core.pipeline.transport.HttpRequest
        :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
        :return: The response of your network call. Does not do error handling on your response.
        :rtype: ~azure.core.pipeline.transport.HttpResponse
        """
        path_format_arguments = {
            'url':
            self._serialize.url("self._config.url",
                                self._config.url,
                                'str',
                                skip_quote=True),
        }
        http_request.url = self._client.format_url(http_request.url,
                                                   **path_format_arguments)
        stream = kwargs.pop("stream", True)
        pipeline_response = self._client._pipeline.run(http_request,
                                                       stream=stream,
                                                       **kwargs)
        return pipeline_response.http_response

    def close(self):
        # type: () -> None
        self._client.close()

    def __enter__(self):
        # type: () -> AzureDataLakeStorageRESTAPI
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        # type: (Any) -> None
        self._client.__exit__(*exc_details)
Пример #56
0
class PhoneNumbersClient(object):
    """The phone numbers client uses Azure Communication Services to acquire and manage phone numbers.

    :ivar phone_numbers: PhoneNumbersOperations operations
    :vartype phone_numbers: azure.communication.phonenumbers.operations.PhoneNumbersOperations
    :param endpoint: The communication resource, for example https://resourcename.communication.azure.com.
    :type endpoint: str
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
    """
    def __init__(
            self,
            endpoint,  # type: str
            **kwargs  # type: Any
    ):
        # type: (...) -> None
        base_url = '{endpoint}'
        self._config = PhoneNumbersClientConfiguration(endpoint, **kwargs)
        self._client = PipelineClient(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.phone_numbers = PhoneNumbersOperations(self._client, self._config,
                                                    self._serialize,
                                                    self._deserialize)

    def _send_request(self, http_request, **kwargs):
        # type: (HttpRequest, Any) -> HttpResponse
        """Runs the network request through the client's chained policies.

        :param http_request: The network request you want to make. Required.
        :type http_request: ~azure.core.pipeline.transport.HttpRequest
        :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
        :return: The response of your network call. Does not do error handling on your response.
        :rtype: ~azure.core.pipeline.transport.HttpResponse
        """
        path_format_arguments = {
            'endpoint':
            self._serialize.url("self._config.endpoint",
                                self._config.endpoint,
                                'str',
                                skip_quote=True),
        }
        http_request.url = self._client.format_url(http_request.url,
                                                   **path_format_arguments)
        stream = kwargs.pop("stream", True)
        pipeline_response = self._client._pipeline.run(http_request,
                                                       stream=stream,
                                                       **kwargs)
        return pipeline_response.http_response

    def close(self):
        # type: () -> None
        self._client.close()

    def __enter__(self):
        # type: () -> PhoneNumbersClient
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        # type: (Any) -> None
        self._client.__exit__(*exc_details)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling

from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
JSONType = Any
ClsType = Optional[Callable[
    [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]

_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False


def build_get_request(subscription_id: str, resource_group_name: str,
                      registry_name: str, connected_registry_name: str,
                      **kwargs: Any) -> HttpRequest:
    api_version = kwargs.pop('api_version', "2021-06-01-preview")  # type: str

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}")  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "resourceGroupName":
class FormRecognizerClient(FormRecognizerClientOperationsMixin):
    """Extracts information from forms and images into structured data.

    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
     https://westus2.api.cognitive.microsoft.com).
    :type endpoint: str
    :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",
        endpoint: str,
        **kwargs: Any
    ) -> None:
        _base_url = '{endpoint}/formrecognizer/v2.0'
        self._config = FormRecognizerClientConfiguration(credential=credential, endpoint=endpoint, **kwargs)
        self._client = AsyncPipelineClient(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._serialize.client_side_validation = False


    def _send_request(
        self,
        request: HttpRequest,
        **kwargs: Any
    ) -> Awaitable[AsyncHttpResponse]:
        """Runs the network request through the client's chained policies.

        >>> from azure.core.rest import HttpRequest
        >>> request = HttpRequest("GET", "https://www.example.org/")
        <HttpRequest [GET], url: 'https://www.example.org/'>
        >>> response = await client._send_request(request)
        <AsyncHttpResponse: 200 OK>

        For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart

        :param request: The network request you want to make. Required.
        :type request: ~azure.core.rest.HttpRequest
        :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
        :return: The response of your network call. Does not do error handling on your response.
        :rtype: ~azure.core.rest.AsyncHttpResponse
        """

        request_copy = deepcopy(request)
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
        }

        request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
        return self._client.send_request(request_copy, **kwargs)

    async def close(self) -> None:
        await self._client.close()

    async def __aenter__(self) -> "FormRecognizerClient":
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details) -> None:
        await self._client.__aexit__(*exc_details)
class NetworkManagementClient(SDKClient):
    """Network Client

    :ivar config: Configuration for client.
    :vartype config: NetworkManagementClientConfiguration

    :ivar application_gateways: ApplicationGateways operations
    :vartype application_gateways: azure.mgmt.network.v2019_02_01.operations.ApplicationGatewaysOperations
    :ivar application_security_groups: ApplicationSecurityGroups operations
    :vartype application_security_groups: azure.mgmt.network.v2019_02_01.operations.ApplicationSecurityGroupsOperations
    :ivar available_delegations: AvailableDelegations operations
    :vartype available_delegations: azure.mgmt.network.v2019_02_01.operations.AvailableDelegationsOperations
    :ivar available_resource_group_delegations: AvailableResourceGroupDelegations operations
    :vartype available_resource_group_delegations: azure.mgmt.network.v2019_02_01.operations.AvailableResourceGroupDelegationsOperations
    :ivar azure_firewalls: AzureFirewalls operations
    :vartype azure_firewalls: azure.mgmt.network.v2019_02_01.operations.AzureFirewallsOperations
    :ivar azure_firewall_fqdn_tags: AzureFirewallFqdnTags operations
    :vartype azure_firewall_fqdn_tags: azure.mgmt.network.v2019_02_01.operations.AzureFirewallFqdnTagsOperations
    :ivar ddos_custom_policies: DdosCustomPolicies operations
    :vartype ddos_custom_policies: azure.mgmt.network.v2019_02_01.operations.DdosCustomPoliciesOperations
    :ivar ddos_protection_plans: DdosProtectionPlans operations
    :vartype ddos_protection_plans: azure.mgmt.network.v2019_02_01.operations.DdosProtectionPlansOperations
    :ivar available_endpoint_services: AvailableEndpointServices operations
    :vartype available_endpoint_services: azure.mgmt.network.v2019_02_01.operations.AvailableEndpointServicesOperations
    :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizations operations
    :vartype express_route_circuit_authorizations: azure.mgmt.network.v2019_02_01.operations.ExpressRouteCircuitAuthorizationsOperations
    :ivar express_route_circuit_peerings: ExpressRouteCircuitPeerings operations
    :vartype express_route_circuit_peerings: azure.mgmt.network.v2019_02_01.operations.ExpressRouteCircuitPeeringsOperations
    :ivar express_route_circuit_connections: ExpressRouteCircuitConnections operations
    :vartype express_route_circuit_connections: azure.mgmt.network.v2019_02_01.operations.ExpressRouteCircuitConnectionsOperations
    :ivar peer_express_route_circuit_connections: PeerExpressRouteCircuitConnections operations
    :vartype peer_express_route_circuit_connections: azure.mgmt.network.v2019_02_01.operations.PeerExpressRouteCircuitConnectionsOperations
    :ivar express_route_circuits: ExpressRouteCircuits operations
    :vartype express_route_circuits: azure.mgmt.network.v2019_02_01.operations.ExpressRouteCircuitsOperations
    :ivar express_route_service_providers: ExpressRouteServiceProviders operations
    :vartype express_route_service_providers: azure.mgmt.network.v2019_02_01.operations.ExpressRouteServiceProvidersOperations
    :ivar express_route_cross_connections: ExpressRouteCrossConnections operations
    :vartype express_route_cross_connections: azure.mgmt.network.v2019_02_01.operations.ExpressRouteCrossConnectionsOperations
    :ivar express_route_cross_connection_peerings: ExpressRouteCrossConnectionPeerings operations
    :vartype express_route_cross_connection_peerings: azure.mgmt.network.v2019_02_01.operations.ExpressRouteCrossConnectionPeeringsOperations
    :ivar express_route_gateways: ExpressRouteGateways operations
    :vartype express_route_gateways: azure.mgmt.network.v2019_02_01.operations.ExpressRouteGatewaysOperations
    :ivar express_route_connections: ExpressRouteConnections operations
    :vartype express_route_connections: azure.mgmt.network.v2019_02_01.operations.ExpressRouteConnectionsOperations
    :ivar express_route_ports_locations: ExpressRoutePortsLocations operations
    :vartype express_route_ports_locations: azure.mgmt.network.v2019_02_01.operations.ExpressRoutePortsLocationsOperations
    :ivar express_route_ports: ExpressRoutePorts operations
    :vartype express_route_ports: azure.mgmt.network.v2019_02_01.operations.ExpressRoutePortsOperations
    :ivar express_route_links: ExpressRouteLinks operations
    :vartype express_route_links: azure.mgmt.network.v2019_02_01.operations.ExpressRouteLinksOperations
    :ivar interface_endpoints: InterfaceEndpoints operations
    :vartype interface_endpoints: azure.mgmt.network.v2019_02_01.operations.InterfaceEndpointsOperations
    :ivar load_balancers: LoadBalancers operations
    :vartype load_balancers: azure.mgmt.network.v2019_02_01.operations.LoadBalancersOperations
    :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPools operations
    :vartype load_balancer_backend_address_pools: azure.mgmt.network.v2019_02_01.operations.LoadBalancerBackendAddressPoolsOperations
    :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurations operations
    :vartype load_balancer_frontend_ip_configurations: azure.mgmt.network.v2019_02_01.operations.LoadBalancerFrontendIPConfigurationsOperations
    :ivar inbound_nat_rules: InboundNatRules operations
    :vartype inbound_nat_rules: azure.mgmt.network.v2019_02_01.operations.InboundNatRulesOperations
    :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRules operations
    :vartype load_balancer_load_balancing_rules: azure.mgmt.network.v2019_02_01.operations.LoadBalancerLoadBalancingRulesOperations
    :ivar load_balancer_outbound_rules: LoadBalancerOutboundRules operations
    :vartype load_balancer_outbound_rules: azure.mgmt.network.v2019_02_01.operations.LoadBalancerOutboundRulesOperations
    :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfaces operations
    :vartype load_balancer_network_interfaces: azure.mgmt.network.v2019_02_01.operations.LoadBalancerNetworkInterfacesOperations
    :ivar load_balancer_probes: LoadBalancerProbes operations
    :vartype load_balancer_probes: azure.mgmt.network.v2019_02_01.operations.LoadBalancerProbesOperations
    :ivar nat_gateways: NatGateways operations
    :vartype nat_gateways: azure.mgmt.network.v2019_02_01.operations.NatGatewaysOperations
    :ivar network_interfaces: NetworkInterfaces operations
    :vartype network_interfaces: azure.mgmt.network.v2019_02_01.operations.NetworkInterfacesOperations
    :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurations operations
    :vartype network_interface_ip_configurations: azure.mgmt.network.v2019_02_01.operations.NetworkInterfaceIPConfigurationsOperations
    :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancers operations
    :vartype network_interface_load_balancers: azure.mgmt.network.v2019_02_01.operations.NetworkInterfaceLoadBalancersOperations
    :ivar network_interface_tap_configurations: NetworkInterfaceTapConfigurations operations
    :vartype network_interface_tap_configurations: azure.mgmt.network.v2019_02_01.operations.NetworkInterfaceTapConfigurationsOperations
    :ivar network_profiles: NetworkProfiles operations
    :vartype network_profiles: azure.mgmt.network.v2019_02_01.operations.NetworkProfilesOperations
    :ivar network_security_groups: NetworkSecurityGroups operations
    :vartype network_security_groups: azure.mgmt.network.v2019_02_01.operations.NetworkSecurityGroupsOperations
    :ivar security_rules: SecurityRules operations
    :vartype security_rules: azure.mgmt.network.v2019_02_01.operations.SecurityRulesOperations
    :ivar default_security_rules: DefaultSecurityRules operations
    :vartype default_security_rules: azure.mgmt.network.v2019_02_01.operations.DefaultSecurityRulesOperations
    :ivar network_watchers: NetworkWatchers operations
    :vartype network_watchers: azure.mgmt.network.v2019_02_01.operations.NetworkWatchersOperations
    :ivar packet_captures: PacketCaptures operations
    :vartype packet_captures: azure.mgmt.network.v2019_02_01.operations.PacketCapturesOperations
    :ivar connection_monitors: ConnectionMonitors operations
    :vartype connection_monitors: azure.mgmt.network.v2019_02_01.operations.ConnectionMonitorsOperations
    :ivar operations: Operations operations
    :vartype operations: azure.mgmt.network.v2019_02_01.operations.Operations
    :ivar public_ip_addresses: PublicIPAddresses operations
    :vartype public_ip_addresses: azure.mgmt.network.v2019_02_01.operations.PublicIPAddressesOperations
    :ivar public_ip_prefixes: PublicIPPrefixes operations
    :vartype public_ip_prefixes: azure.mgmt.network.v2019_02_01.operations.PublicIPPrefixesOperations
    :ivar route_filters: RouteFilters operations
    :vartype route_filters: azure.mgmt.network.v2019_02_01.operations.RouteFiltersOperations
    :ivar route_filter_rules: RouteFilterRules operations
    :vartype route_filter_rules: azure.mgmt.network.v2019_02_01.operations.RouteFilterRulesOperations
    :ivar route_tables: RouteTables operations
    :vartype route_tables: azure.mgmt.network.v2019_02_01.operations.RouteTablesOperations
    :ivar routes: Routes operations
    :vartype routes: azure.mgmt.network.v2019_02_01.operations.RoutesOperations
    :ivar bgp_service_communities: BgpServiceCommunities operations
    :vartype bgp_service_communities: azure.mgmt.network.v2019_02_01.operations.BgpServiceCommunitiesOperations
    :ivar service_endpoint_policies: ServiceEndpointPolicies operations
    :vartype service_endpoint_policies: azure.mgmt.network.v2019_02_01.operations.ServiceEndpointPoliciesOperations
    :ivar service_endpoint_policy_definitions: ServiceEndpointPolicyDefinitions operations
    :vartype service_endpoint_policy_definitions: azure.mgmt.network.v2019_02_01.operations.ServiceEndpointPolicyDefinitionsOperations
    :ivar usages: Usages operations
    :vartype usages: azure.mgmt.network.v2019_02_01.operations.UsagesOperations
    :ivar virtual_networks: VirtualNetworks operations
    :vartype virtual_networks: azure.mgmt.network.v2019_02_01.operations.VirtualNetworksOperations
    :ivar subnets: Subnets operations
    :vartype subnets: azure.mgmt.network.v2019_02_01.operations.SubnetsOperations
    :ivar virtual_network_peerings: VirtualNetworkPeerings operations
    :vartype virtual_network_peerings: azure.mgmt.network.v2019_02_01.operations.VirtualNetworkPeeringsOperations
    :ivar virtual_network_gateways: VirtualNetworkGateways operations
    :vartype virtual_network_gateways: azure.mgmt.network.v2019_02_01.operations.VirtualNetworkGatewaysOperations
    :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnections operations
    :vartype virtual_network_gateway_connections: azure.mgmt.network.v2019_02_01.operations.VirtualNetworkGatewayConnectionsOperations
    :ivar local_network_gateways: LocalNetworkGateways operations
    :vartype local_network_gateways: azure.mgmt.network.v2019_02_01.operations.LocalNetworkGatewaysOperations
    :ivar virtual_network_taps: VirtualNetworkTaps operations
    :vartype virtual_network_taps: azure.mgmt.network.v2019_02_01.operations.VirtualNetworkTapsOperations
    :ivar virtual_wans: VirtualWans operations
    :vartype virtual_wans: azure.mgmt.network.v2019_02_01.operations.VirtualWansOperations
    :ivar vpn_sites: VpnSites operations
    :vartype vpn_sites: azure.mgmt.network.v2019_02_01.operations.VpnSitesOperations
    :ivar vpn_sites_configuration: VpnSitesConfiguration operations
    :vartype vpn_sites_configuration: azure.mgmt.network.v2019_02_01.operations.VpnSitesConfigurationOperations
    :ivar virtual_hubs: VirtualHubs operations
    :vartype virtual_hubs: azure.mgmt.network.v2019_02_01.operations.VirtualHubsOperations
    :ivar hub_virtual_network_connections: HubVirtualNetworkConnections operations
    :vartype hub_virtual_network_connections: azure.mgmt.network.v2019_02_01.operations.HubVirtualNetworkConnectionsOperations
    :ivar vpn_gateways: VpnGateways operations
    :vartype vpn_gateways: azure.mgmt.network.v2019_02_01.operations.VpnGatewaysOperations
    :ivar vpn_connections: VpnConnections operations
    :vartype vpn_connections: azure.mgmt.network.v2019_02_01.operations.VpnConnectionsOperations
    :ivar p2s_vpn_server_configurations: P2sVpnServerConfigurations operations
    :vartype p2s_vpn_server_configurations: azure.mgmt.network.v2019_02_01.operations.P2sVpnServerConfigurationsOperations
    :ivar p2s_vpn_gateways: P2sVpnGateways operations
    :vartype p2s_vpn_gateways: azure.mgmt.network.v2019_02_01.operations.P2sVpnGatewaysOperations
    :ivar web_application_firewall_policies: WebApplicationFirewallPolicies operations
    :vartype web_application_firewall_policies: azure.mgmt.network.v2019_02_01.operations.WebApplicationFirewallPoliciesOperations

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: The subscription credentials which uniquely
     identify the Microsoft Azure subscription. The subscription ID forms part
     of the URI for every service call.
    :type subscription_id: str
    :param str base_url: Service URL
    """
    def __init__(self, credentials, subscription_id, base_url=None):

        self.config = NetworkManagementClientConfiguration(
            credentials, subscription_id, base_url)
        super(NetworkManagementClient, self).__init__(self.config.credentials,
                                                      self.config)

        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.application_gateways = ApplicationGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.application_security_groups = ApplicationSecurityGroupsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.available_delegations = AvailableDelegationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.available_resource_group_delegations = AvailableResourceGroupDelegationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.azure_firewalls = AzureFirewallsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.azure_firewall_fqdn_tags = AzureFirewallFqdnTagsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.ddos_custom_policies = DdosCustomPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.ddos_protection_plans = DdosProtectionPlansOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.available_endpoint_services = AvailableEndpointServicesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuit_connections = ExpressRouteCircuitConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.peer_express_route_circuit_connections = PeerExpressRouteCircuitConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_circuits = ExpressRouteCircuitsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_service_providers = ExpressRouteServiceProvidersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_cross_connections = ExpressRouteCrossConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_cross_connection_peerings = ExpressRouteCrossConnectionPeeringsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_gateways = ExpressRouteGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_connections = ExpressRouteConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_ports_locations = ExpressRoutePortsLocationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_ports = ExpressRoutePortsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.express_route_links = ExpressRouteLinksOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.interface_endpoints = InterfaceEndpointsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancers = LoadBalancersOperations(self._client,
                                                      self.config,
                                                      self._serialize,
                                                      self._deserialize)
        self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.inbound_nat_rules = InboundNatRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancer_outbound_rules = LoadBalancerOutboundRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.load_balancer_probes = LoadBalancerProbesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.nat_gateways = NatGatewaysOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.network_interfaces = NetworkInterfacesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_interface_tap_configurations = NetworkInterfaceTapConfigurationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_profiles = NetworkProfilesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_security_groups = NetworkSecurityGroupsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.security_rules = SecurityRulesOperations(self._client,
                                                      self.config,
                                                      self._serialize,
                                                      self._deserialize)
        self.default_security_rules = DefaultSecurityRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.network_watchers = NetworkWatchersOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.packet_captures = PacketCapturesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.connection_monitors = ConnectionMonitorsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.operations = Operations(self._client, self.config,
                                     self._serialize, self._deserialize)
        self.public_ip_addresses = PublicIPAddressesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.public_ip_prefixes = PublicIPPrefixesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.route_filters = RouteFiltersOperations(self._client, self.config,
                                                    self._serialize,
                                                    self._deserialize)
        self.route_filter_rules = RouteFilterRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.route_tables = RouteTablesOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.routes = RoutesOperations(self._client, self.config,
                                       self._serialize, self._deserialize)
        self.bgp_service_communities = BgpServiceCommunitiesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.service_endpoint_policies = ServiceEndpointPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.service_endpoint_policy_definitions = ServiceEndpointPolicyDefinitionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.usages = UsagesOperations(self._client, self.config,
                                       self._serialize, self._deserialize)
        self.virtual_networks = VirtualNetworksOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.subnets = SubnetsOperations(self._client, self.config,
                                         self._serialize, self._deserialize)
        self.virtual_network_peerings = VirtualNetworkPeeringsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_gateways = VirtualNetworkGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.local_network_gateways = LocalNetworkGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_network_taps = VirtualNetworkTapsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_wans = VirtualWansOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.vpn_sites = VpnSitesOperations(self._client, self.config,
                                            self._serialize, self._deserialize)
        self.vpn_sites_configuration = VpnSitesConfigurationOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.virtual_hubs = VirtualHubsOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.hub_virtual_network_connections = HubVirtualNetworkConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.vpn_gateways = VpnGatewaysOperations(self._client, self.config,
                                                  self._serialize,
                                                  self._deserialize)
        self.vpn_connections = VpnConnectionsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.p2s_vpn_server_configurations = P2sVpnServerConfigurationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.p2s_vpn_gateways = P2sVpnGatewaysOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.web_application_firewall_policies = WebApplicationFirewallPoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)

    def check_dns_name_availability(self,
                                    location,
                                    domain_name_label,
                                    custom_headers=None,
                                    raw=False,
                                    **operation_config):
        """Checks whether a domain name in the cloudapp.azure.com zone is
        available for use.

        :param location: The location of the domain name.
        :type location: str
        :param domain_name_label: The domain name to be verified. It must
         conform to the following regular expression:
         ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.
        :type domain_name_label: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: DnsNameAvailabilityResult or ClientRawResponse if raw=true
        :rtype:
         ~azure.mgmt.network.v2019_02_01.models.DnsNameAvailabilityResult or
         ~msrest.pipeline.ClientRawResponse
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        api_version = "2019-02-01"

        # Construct URL
        url = self.check_dns_name_availability.metadata['url']
        path_format_arguments = {
            'location':
            self._serialize.url("location", location, 'str'),
            'subscriptionId':
            self._serialize.url("self.config.subscription_id",
                                self.config.subscription_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}
        query_parameters['domainNameLabel'] = self._serialize.query(
            "domain_name_label", domain_name_label, 'str')
        query_parameters['api-version'] = self._serialize.query(
            "api_version", api_version, 'str')

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if self.config.generate_client_request_id:
            header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
        if custom_headers:
            header_parameters.update(custom_headers)
        if self.config.accept_language is not None:
            header_parameters['accept-language'] = self._serialize.header(
                "self.config.accept_language", self.config.accept_language,
                'str')

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200]:
            exp = CloudError(response)
            exp.request_id = response.headers.get('x-ms-request-id')
            raise exp

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('DnsNameAvailabilityResult',
                                             response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized

    check_dns_name_availability.metadata = {
        'url':
        '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'
    }

    def supported_security_providers(self,
                                     resource_group_name,
                                     virtual_wan_name,
                                     custom_headers=None,
                                     raw=False,
                                     **operation_config):
        """Gives the supported security providers for the virtual wan.

        :param resource_group_name: The resource group name.
        :type resource_group_name: str
        :param virtual_wan_name: The name of the VirtualWAN for which
         supported security providers are needed.
        :type virtual_wan_name: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: VirtualWanSecurityProviders or ClientRawResponse if raw=true
        :rtype:
         ~azure.mgmt.network.v2019_02_01.models.VirtualWanSecurityProviders or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorException<azure.mgmt.network.v2019_02_01.models.ErrorException>`
        """
        api_version = "2019-02-01"

        # Construct URL
        url = self.supported_security_providers.metadata['url']
        path_format_arguments = {
            'subscriptionId':
            self._serialize.url("self.config.subscription_id",
                                self.config.subscription_id, 'str'),
            'resourceGroupName':
            self._serialize.url("resource_group_name", resource_group_name,
                                'str'),
            'virtualWANName':
            self._serialize.url("virtual_wan_name", virtual_wan_name, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}
        query_parameters['api-version'] = self._serialize.query(
            "api_version", api_version, 'str')

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if self.config.generate_client_request_id:
            header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
        if custom_headers:
            header_parameters.update(custom_headers)
        if self.config.accept_language is not None:
            header_parameters['accept-language'] = self._serialize.header(
                "self.config.accept_language", self.config.accept_language,
                'str')

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200]:
            raise models.ErrorException(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('VirtualWanSecurityProviders',
                                             response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized

    supported_security_providers.metadata = {
        'url':
        '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders'
    }
class AzureRedHatOpenShift4Client(object):
    """Rest API for Azure Red Hat OpenShift 4.

    :ivar operations: Operations operations
    :vartype operations: azure.mgmt.redhatopenshift.v2020_04_30.operations.Operations
    :ivar open_shift_clusters: OpenShiftClustersOperations operations
    :vartype open_shift_clusters: azure.mgmt.redhatopenshift.v2020_04_30.operations.OpenShiftClustersOperations
    :param credential: Credential needed for the client to connect to Azure.
    :type credential: ~azure.core.credentials.TokenCredential
    :param subscription_id: The ID of the target subscription.
    :type subscription_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
            base_url=None,  # type: Optional[str]
            **kwargs  # type: Any
    ):
        # type: (...) -> None
        if not base_url:
            base_url = 'https://management.azure.com'
        self._config = AzureRedHatOpenShift4ClientConfiguration(
            credential, subscription_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._serialize.client_side_validation = False
        self._deserialize = Deserializer(client_models)

        self.operations = Operations(self._client, self._config,
                                     self._serialize, self._deserialize)
        self.open_shift_clusters = OpenShiftClustersOperations(
            self._client, self._config, self._serialize, self._deserialize)

    def _send_request(self, http_request, **kwargs):
        # type: (HttpRequest, Any) -> HttpResponse
        """Runs the network request through the client's chained policies.

        :param http_request: The network request you want to make. Required.
        :type http_request: ~azure.core.pipeline.transport.HttpRequest
        :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
        :return: The response of your network call. Does not do error handling on your response.
        :rtype: ~azure.core.pipeline.transport.HttpResponse
        """
        path_format_arguments = {
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id,
                                'str',
                                min_length=1),
        }
        http_request.url = self._client.format_url(http_request.url,
                                                   **path_format_arguments)
        stream = kwargs.pop("stream", True)
        pipeline_response = self._client._pipeline.run(http_request,
                                                       stream=stream,
                                                       **kwargs)
        return pipeline_response.http_response

    def close(self):
        # type: () -> None
        self._client.close()

    def __enter__(self):
        # type: () -> AzureRedHatOpenShift4Client
        self._client.__enter__()
        return self

    def __exit__(self, *exc_details):
        # type: (Any) -> None
        self._client.__exit__(*exc_details)