Source code for azure.synapse.artifacts.operations._link_connection_operations

# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar

from msrest import Serializer

from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict

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

_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False

def build_list_link_connections_by_workspace_request(
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview"))  # type: str
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/linkconnections")

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="GET",
        url=_url,
        params=_params,
        headers=_headers,
        **kwargs
    )


def build_create_or_update_link_connection_request(
    link_connection_name: str,
    *,
    json: Optional[_models.LinkConnectionResource] = None,
    content: Any = None,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview"))  # type: str
    content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None))  # type: Optional[str]
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/linkconnections/{linkConnectionName}")
    path_format_arguments = {
        "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    if content_type is not None:
        _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="PUT",
        url=_url,
        params=_params,
        headers=_headers,
        json=json,
        content=content,
        **kwargs
    )


def build_get_link_connection_request(
    link_connection_name: str,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview"))  # type: str
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/linkconnections/{linkConnectionName}")
    path_format_arguments = {
        "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="GET",
        url=_url,
        params=_params,
        headers=_headers,
        **kwargs
    )


def build_delete_link_connection_request(
    link_connection_name: str,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview"))  # type: str
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/linkconnections/{linkConnectionName}")
    path_format_arguments = {
        "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="DELETE",
        url=_url,
        params=_params,
        headers=_headers,
        **kwargs
    )


def build_edit_tables_request(
    link_connection_name: str,
    *,
    json: Optional[_models.EditTablesRequest] = None,
    content: Any = None,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview"))  # type: str
    content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None))  # type: Optional[str]
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/linkconnections/{linkConnectionName}/edittables")
    path_format_arguments = {
        "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    if content_type is not None:
        _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="POST",
        url=_url,
        params=_params,
        headers=_headers,
        json=json,
        content=content,
        **kwargs
    )


def build_start_request(
    link_connection_name: str,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview"))  # type: str
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/linkconnections/{linkConnectionName}/start")
    path_format_arguments = {
        "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="POST",
        url=_url,
        params=_params,
        headers=_headers,
        **kwargs
    )


def build_stop_request(
    link_connection_name: str,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview"))  # type: str
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/linkconnections/{linkConnectionName}/stop")
    path_format_arguments = {
        "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="POST",
        url=_url,
        params=_params,
        headers=_headers,
        **kwargs
    )


def build_get_detailed_status_request(
    link_connection_name: str,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview"))  # type: str
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/linkconnections/{linkConnectionName}/detailedstatus")
    path_format_arguments = {
        "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="GET",
        url=_url,
        params=_params,
        headers=_headers,
        **kwargs
    )


def build_list_link_tables_request(
    link_connection_name: str,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview"))  # type: str
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/linkconnections/{linkConnectionName}/linktables")
    path_format_arguments = {
        "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="GET",
        url=_url,
        params=_params,
        headers=_headers,
        **kwargs
    )


def build_query_table_status_request(
    link_connection_name: str,
    *,
    json: Optional[_models.QueryTableStatusRequest] = None,
    content: Any = None,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview"))  # type: str
    content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None))  # type: Optional[str]
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/linkconnections/{linkConnectionName}/querytablestatus")
    path_format_arguments = {
        "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    if content_type is not None:
        _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="POST",
        url=_url,
        params=_params,
        headers=_headers,
        json=json,
        content=content,
        **kwargs
    )


def build_update_landing_zone_credential_request(
    link_connection_name: str,
    *,
    json: Optional[_models.UpdateLandingZoneCredential] = None,
    content: Any = None,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview"))  # type: str
    content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None))  # type: Optional[str]
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/linkconnections/{linkConnectionName}/updateLandingZoneCredential")
    path_format_arguments = {
        "linkConnectionName": _SERIALIZER.url("link_connection_name", link_connection_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    if content_type is not None:
        _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="POST",
        url=_url,
        params=_params,
        headers=_headers,
        json=json,
        content=content,
        **kwargs
    )

[docs]class LinkConnectionOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.synapse.artifacts.ArtifactsClient`'s :attr:`link_connection` attribute. """ models = _models def __init__(self, *args, **kwargs): input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") list_link_connections_by_workspace.metadata = {'url': "/linkconnections"} # type: ignore create_or_update_link_connection.metadata = {'url': "/linkconnections/{linkConnectionName}"} # type: ignore get_link_connection.metadata = {'url': "/linkconnections/{linkConnectionName}"} # type: ignore delete_link_connection.metadata = {'url': "/linkconnections/{linkConnectionName}"} # type: ignore
[docs] @distributed_trace def edit_tables( # pylint: disable=inconsistent-return-statements self, link_connection_name: str, link_tables: Optional[List[_models.LinkTableRequest]] = None, **kwargs: Any ) -> None: """Edit tables for a link connection. :param link_connection_name: The link connection name. :type link_connection_name: str :param link_tables: Edit link tables request. Default value is None. :type link_tables: list[~azure.synapse.artifacts.models.LinkTableRequest] :keyword api_version: Api Version. Default value is "2021-12-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview")) # type: str content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] cls = kwargs.pop('cls', None) # type: ClsType[None] _edit_tables_request = _models.EditTablesRequest(link_tables=link_tables) _json = self._serialize.body(_edit_tables_request, 'EditTablesRequest') request = build_edit_tables_request( link_connection_name=link_connection_name, api_version=api_version, content_type=content_type, json=_json, template_url=self.edit_tables.metadata['url'], headers=_headers, params=_params, ) request = _convert_request(request) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CloudError, pipeline_response) raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {})
edit_tables.metadata = {'url': "/linkconnections/{linkConnectionName}/edittables"} # type: ignore
[docs] @distributed_trace def start( # pylint: disable=inconsistent-return-statements self, link_connection_name: str, **kwargs: Any ) -> None: """Start a link connection. :param link_connection_name: The link connection name. :type link_connection_name: str :keyword api_version: Api Version. Default value is "2021-12-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview")) # type: str cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_start_request( link_connection_name=link_connection_name, api_version=api_version, template_url=self.start.metadata['url'], headers=_headers, params=_params, ) request = _convert_request(request) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CloudError, pipeline_response) raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {})
start.metadata = {'url': "/linkconnections/{linkConnectionName}/start"} # type: ignore
[docs] @distributed_trace def stop( # pylint: disable=inconsistent-return-statements self, link_connection_name: str, **kwargs: Any ) -> None: """Stop a link connection. :param link_connection_name: The link connection name. :type link_connection_name: str :keyword api_version: Api Version. Default value is "2021-12-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview")) # type: str cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_stop_request( link_connection_name=link_connection_name, api_version=api_version, template_url=self.stop.metadata['url'], headers=_headers, params=_params, ) request = _convert_request(request) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CloudError, pipeline_response) raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {})
stop.metadata = {'url': "/linkconnections/{linkConnectionName}/stop"} # type: ignore
[docs] @distributed_trace def get_detailed_status( self, link_connection_name: str, **kwargs: Any ) -> _models.LinkConnectionDetailedStatus: """Get the detailed status of a link connection. :param link_connection_name: The link connection name. :type link_connection_name: str :keyword api_version: Api Version. Default value is "2021-12-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LinkConnectionDetailedStatus, or the result of cls(response) :rtype: ~azure.synapse.artifacts.models.LinkConnectionDetailedStatus :raises: ~azure.core.exceptions.HttpResponseError """ error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview")) # type: str cls = kwargs.pop('cls', None) # type: ClsType[_models.LinkConnectionDetailedStatus] request = build_get_detailed_status_request( link_connection_name=link_connection_name, api_version=api_version, template_url=self.get_detailed_status.metadata['url'], headers=_headers, params=_params, ) request = _convert_request(request) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CloudError, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('LinkConnectionDetailedStatus', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized
get_detailed_status.metadata = {'url': "/linkconnections/{linkConnectionName}/detailedstatus"} # type: ignore list_link_tables.metadata = {'url': "/linkconnections/{linkConnectionName}/linktables"} # type: ignore
[docs] @distributed_trace def query_table_status( self, link_connection_name: str, query_table_status_request: _models.QueryTableStatusRequest, **kwargs: Any ) -> _models.LinkConnectionQueryTableStatus: """Query the link table status of a link connection. :param link_connection_name: The link connection name. :type link_connection_name: str :param query_table_status_request: Query table status request. :type query_table_status_request: ~azure.synapse.artifacts.models.QueryTableStatusRequest :keyword api_version: Api Version. Default value is "2021-12-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LinkConnectionQueryTableStatus, or the result of cls(response) :rtype: ~azure.synapse.artifacts.models.LinkConnectionQueryTableStatus :raises: ~azure.core.exceptions.HttpResponseError """ error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview")) # type: str content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] cls = kwargs.pop('cls', None) # type: ClsType[_models.LinkConnectionQueryTableStatus] _json = self._serialize.body(query_table_status_request, 'QueryTableStatusRequest') request = build_query_table_status_request( link_connection_name=link_connection_name, api_version=api_version, content_type=content_type, json=_json, template_url=self.query_table_status.metadata['url'], headers=_headers, params=_params, ) request = _convert_request(request) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CloudError, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('LinkConnectionQueryTableStatus', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized
query_table_status.metadata = {'url': "/linkconnections/{linkConnectionName}/querytablestatus"} # type: ignore
[docs] @distributed_trace def update_landing_zone_credential( # pylint: disable=inconsistent-return-statements self, link_connection_name: str, sas_token: Optional[_models.SecureString] = None, **kwargs: Any ) -> None: """Update landing zone credential of a link connection. :param link_connection_name: The link connection name. :type link_connection_name: str :param sas_token: Landing zone's sas token. Default value is None. :type sas_token: ~azure.synapse.artifacts.models.SecureString :keyword api_version: Api Version. Default value is "2021-12-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version = kwargs.pop('api_version', _params.pop('api-version', "2021-12-01-preview")) # type: str content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] cls = kwargs.pop('cls', None) # type: ClsType[None] _update_landing_zone_credential_request = _models.UpdateLandingZoneCredential(sas_token=sas_token) _json = self._serialize.body(_update_landing_zone_credential_request, 'UpdateLandingZoneCredential') request = build_update_landing_zone_credential_request( link_connection_name=link_connection_name, api_version=api_version, content_type=content_type, json=_json, template_url=self.update_landing_zone_credential.metadata['url'], headers=_headers, params=_params, ) request = _convert_request(request) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CloudError, pipeline_response) raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {})
update_landing_zone_credential.metadata = {'url': "/linkconnections/{linkConnectionName}/updateLandingZoneCredential"} # type: ignore