# coding: utf-8

"""
    Sonatype Lifecycle Public REST API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 1.193.0-01
    Contact: community@sonatype.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictBool, StrictStr, field_validator
from typing import Optional
from typing_extensions import Annotated
from sonatype_iq_api_client.models.api_artifactory_connection_dto import ApiArtifactoryConnectionDTO
from sonatype_iq_api_client.models.api_artifactory_connection_status_request_dto import ApiArtifactoryConnectionStatusRequestDTO
from sonatype_iq_api_client.models.api_owner_artifactory_connection_dto import ApiOwnerArtifactoryConnectionDTO
from sonatype_iq_api_client.models.api_status_dto import ApiStatusDTO

from sonatype_iq_api_client.api_client import ApiClient, RequestSerialized
from sonatype_iq_api_client.api_response import ApiResponse
from sonatype_iq_api_client.rest import RESTResponseType


class ConfigureArtifactoryConnectionApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


    @validate_call
    def add_artifactory_connection(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        api_artifactory_connection_dto: Annotated[ApiArtifactoryConnectionDTO, Field(description="Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul>")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiArtifactoryConnectionDTO:
        """add_artifactory_connection

        Use this method to add a new Artifactory connection.  Permissions required: Edit IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param api_artifactory_connection_dto: Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> (required)
        :type api_artifactory_connection_dto: ApiArtifactoryConnectionDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._add_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            api_artifactory_connection_dto=api_artifactory_connection_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def add_artifactory_connection_with_http_info(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        api_artifactory_connection_dto: Annotated[ApiArtifactoryConnectionDTO, Field(description="Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul>")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ApiArtifactoryConnectionDTO]:
        """add_artifactory_connection

        Use this method to add a new Artifactory connection.  Permissions required: Edit IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param api_artifactory_connection_dto: Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> (required)
        :type api_artifactory_connection_dto: ApiArtifactoryConnectionDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._add_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            api_artifactory_connection_dto=api_artifactory_connection_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def add_artifactory_connection_without_preload_content(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        api_artifactory_connection_dto: Annotated[ApiArtifactoryConnectionDTO, Field(description="Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul>")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """add_artifactory_connection

        Use this method to add a new Artifactory connection.  Permissions required: Edit IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param api_artifactory_connection_dto: Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> (required)
        :type api_artifactory_connection_dto: ApiArtifactoryConnectionDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._add_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            api_artifactory_connection_dto=api_artifactory_connection_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _add_artifactory_connection_serialize(
        self,
        owner_type,
        internal_owner_id,
        api_artifactory_connection_dto,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if owner_type is not None:
            _path_params['ownerType'] = owner_type
        if internal_owner_id is not None:
            _path_params['internalOwnerId'] = internal_owner_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if api_artifactory_connection_dto is not None:
            _body_params = api_artifactory_connection_dto


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'BasicAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v2/config/artifactoryConnection/{ownerType}/{internalOwnerId}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def delete_artifactory_connection(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> None:
        """delete_artifactory_connection

        Use this method to delete an existing Artifactory connection.  Permissions required: Edit IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def delete_artifactory_connection_with_http_info(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[None]:
        """delete_artifactory_connection

        Use this method to delete an existing Artifactory connection.  Permissions required: Edit IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def delete_artifactory_connection_without_preload_content(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """delete_artifactory_connection

        Use this method to delete an existing Artifactory connection.  Permissions required: Edit IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _delete_artifactory_connection_serialize(
        self,
        owner_type,
        internal_owner_id,
        artifactory_connection_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if owner_type is not None:
            _path_params['ownerType'] = owner_type
        if internal_owner_id is not None:
            _path_params['internalOwnerId'] = internal_owner_id
        if artifactory_connection_id is not None:
            _path_params['artifactoryConnectionId'] = artifactory_connection_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter




        # authentication setting
        _auth_settings: List[str] = [
            'BasicAuth'
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/api/v2/config/artifactoryConnection/{ownerType}/{internalOwnerId}/{artifactoryConnectionId}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_artifactory_connection(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiArtifactoryConnectionDTO:
        """get_artifactory_connection

        Use this method to retrieve details for an Artifactory connection.  Permissions required: View IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_artifactory_connection_with_http_info(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ApiArtifactoryConnectionDTO]:
        """get_artifactory_connection

        Use this method to retrieve details for an Artifactory connection.  Permissions required: View IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_artifactory_connection_without_preload_content(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """get_artifactory_connection

        Use this method to retrieve details for an Artifactory connection.  Permissions required: View IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_artifactory_connection_serialize(
        self,
        owner_type,
        internal_owner_id,
        artifactory_connection_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if owner_type is not None:
            _path_params['ownerType'] = owner_type
        if internal_owner_id is not None:
            _path_params['internalOwnerId'] = internal_owner_id
        if artifactory_connection_id is not None:
            _path_params['artifactoryConnectionId'] = artifactory_connection_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'BasicAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v2/config/artifactoryConnection/{ownerType}/{internalOwnerId}/{artifactoryConnectionId}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_owner_artifactory_connection(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        inherit: Annotated[Optional[StrictBool], Field(description="Specify whether to include details from an inherited Artifactory connection.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiOwnerArtifactoryConnectionDTO:
        """get_owner_artifactory_connection

        Use this method to retrieve Artifactory connection details by specifying the owner Id.  Permissions required: View IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param inherit: Specify whether to include details from an inherited Artifactory connection.
        :type inherit: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_owner_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            inherit=inherit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiOwnerArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_owner_artifactory_connection_with_http_info(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        inherit: Annotated[Optional[StrictBool], Field(description="Specify whether to include details from an inherited Artifactory connection.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ApiOwnerArtifactoryConnectionDTO]:
        """get_owner_artifactory_connection

        Use this method to retrieve Artifactory connection details by specifying the owner Id.  Permissions required: View IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param inherit: Specify whether to include details from an inherited Artifactory connection.
        :type inherit: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_owner_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            inherit=inherit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiOwnerArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_owner_artifactory_connection_without_preload_content(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        inherit: Annotated[Optional[StrictBool], Field(description="Specify whether to include details from an inherited Artifactory connection.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """get_owner_artifactory_connection

        Use this method to retrieve Artifactory connection details by specifying the owner Id.  Permissions required: View IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param inherit: Specify whether to include details from an inherited Artifactory connection.
        :type inherit: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_owner_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            inherit=inherit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiOwnerArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_owner_artifactory_connection_serialize(
        self,
        owner_type,
        internal_owner_id,
        inherit,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if owner_type is not None:
            _path_params['ownerType'] = owner_type
        if internal_owner_id is not None:
            _path_params['internalOwnerId'] = internal_owner_id
        # process the query parameters
        if inherit is not None:
            
            _query_params.append(('inherit', inherit))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'BasicAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v2/config/artifactoryConnection/{ownerType}/{internalOwnerId}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def test_artifactory_connection(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        api_artifactory_connection_dto: Annotated[ApiArtifactoryConnectionDTO, Field(description="Enter values for the Artifactory connection.<ul><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul>")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiStatusDTO:
        """test_artifactory_connection

        Use this method to test an Artifactory connection for the specified owner.  Permissons required: View IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param api_artifactory_connection_dto: Enter values for the Artifactory connection.<ul><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> (required)
        :type api_artifactory_connection_dto: ApiArtifactoryConnectionDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._test_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            api_artifactory_connection_dto=api_artifactory_connection_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': "ApiStatusDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def test_artifactory_connection_with_http_info(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        api_artifactory_connection_dto: Annotated[ApiArtifactoryConnectionDTO, Field(description="Enter values for the Artifactory connection.<ul><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul>")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ApiStatusDTO]:
        """test_artifactory_connection

        Use this method to test an Artifactory connection for the specified owner.  Permissons required: View IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param api_artifactory_connection_dto: Enter values for the Artifactory connection.<ul><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> (required)
        :type api_artifactory_connection_dto: ApiArtifactoryConnectionDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._test_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            api_artifactory_connection_dto=api_artifactory_connection_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': "ApiStatusDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def test_artifactory_connection_without_preload_content(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        api_artifactory_connection_dto: Annotated[ApiArtifactoryConnectionDTO, Field(description="Enter values for the Artifactory connection.<ul><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul>")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """test_artifactory_connection

        Use this method to test an Artifactory connection for the specified owner.  Permissons required: View IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param api_artifactory_connection_dto: Enter values for the Artifactory connection.<ul><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> (required)
        :type api_artifactory_connection_dto: ApiArtifactoryConnectionDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._test_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            api_artifactory_connection_dto=api_artifactory_connection_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': "ApiStatusDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _test_artifactory_connection_serialize(
        self,
        owner_type,
        internal_owner_id,
        api_artifactory_connection_dto,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if owner_type is not None:
            _path_params['ownerType'] = owner_type
        if internal_owner_id is not None:
            _path_params['internalOwnerId'] = internal_owner_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if api_artifactory_connection_dto is not None:
            _body_params = api_artifactory_connection_dto


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'BasicAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v2/config/artifactoryConnection/{ownerType}/{internalOwnerId}/test',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def test_artifactory_connection1(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Enter the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiStatusDTO:
        """test_artifactory_connection1

        Use this method to test an existing Artifactory connection using the connection ID.

        :param owner_type: Enter the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._test_artifactory_connection1_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiStatusDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def test_artifactory_connection1_with_http_info(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Enter the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ApiStatusDTO]:
        """test_artifactory_connection1

        Use this method to test an existing Artifactory connection using the connection ID.

        :param owner_type: Enter the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._test_artifactory_connection1_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiStatusDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def test_artifactory_connection1_without_preload_content(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Enter the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """test_artifactory_connection1

        Use this method to test an existing Artifactory connection using the connection ID.

        :param owner_type: Enter the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._test_artifactory_connection1_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiStatusDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _test_artifactory_connection1_serialize(
        self,
        owner_type,
        internal_owner_id,
        artifactory_connection_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if owner_type is not None:
            _path_params['ownerType'] = owner_type
        if internal_owner_id is not None:
            _path_params['internalOwnerId'] = internal_owner_id
        if artifactory_connection_id is not None:
            _path_params['artifactoryConnectionId'] = artifactory_connection_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'BasicAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v2/config/artifactoryConnection/{ownerType}/{internalOwnerId}/{artifactoryConnectionId}/test',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def update_artifactory_connection(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Specify the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        api_artifactory_connection_dto: Annotated[ApiArtifactoryConnectionDTO, Field(description="Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul>")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiArtifactoryConnectionDTO:
        """update_artifactory_connection

        Use this method to update an existing Artifactory connection.  Permissions required: Edit IQ Elements

        :param owner_type: Specify the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param api_artifactory_connection_dto: Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> (required)
        :type api_artifactory_connection_dto: ApiArtifactoryConnectionDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            api_artifactory_connection_dto=api_artifactory_connection_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def update_artifactory_connection_with_http_info(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Specify the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        api_artifactory_connection_dto: Annotated[ApiArtifactoryConnectionDTO, Field(description="Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul>")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ApiArtifactoryConnectionDTO]:
        """update_artifactory_connection

        Use this method to update an existing Artifactory connection.  Permissions required: Edit IQ Elements

        :param owner_type: Specify the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param api_artifactory_connection_dto: Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> (required)
        :type api_artifactory_connection_dto: ApiArtifactoryConnectionDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            api_artifactory_connection_dto=api_artifactory_connection_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def update_artifactory_connection_without_preload_content(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Specify the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        artifactory_connection_id: Annotated[StrictStr, Field(description="Enter the Artifactory connection ID.")],
        api_artifactory_connection_dto: Annotated[ApiArtifactoryConnectionDTO, Field(description="Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul>")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """update_artifactory_connection

        Use this method to update an existing Artifactory connection.  Permissions required: Edit IQ Elements

        :param owner_type: Specify the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param artifactory_connection_id: Enter the Artifactory connection ID. (required)
        :type artifactory_connection_id: str
        :param api_artifactory_connection_dto: Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> (required)
        :type api_artifactory_connection_dto: ApiArtifactoryConnectionDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_artifactory_connection_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            artifactory_connection_id=artifactory_connection_id,
            api_artifactory_connection_dto=api_artifactory_connection_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiArtifactoryConnectionDTO",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _update_artifactory_connection_serialize(
        self,
        owner_type,
        internal_owner_id,
        artifactory_connection_id,
        api_artifactory_connection_dto,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if owner_type is not None:
            _path_params['ownerType'] = owner_type
        if internal_owner_id is not None:
            _path_params['internalOwnerId'] = internal_owner_id
        if artifactory_connection_id is not None:
            _path_params['artifactoryConnectionId'] = artifactory_connection_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if api_artifactory_connection_dto is not None:
            _body_params = api_artifactory_connection_dto


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'BasicAuth'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/api/v2/config/artifactoryConnection/{ownerType}/{internalOwnerId}/{artifactoryConnectionId}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def update_owner_artifactory_connection_status(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        api_artifactory_connection_status_request_dto: Annotated[ApiArtifactoryConnectionStatusRequestDTO, Field(description="Set values for the connection properties `enabled` and `allowOverride`.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> None:
        """update_owner_artifactory_connection_status

        Use this method to enable/disable an existing Artifactory connection for the specified owner.  Permissions required: Edit IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param api_artifactory_connection_status_request_dto: Set values for the connection properties `enabled` and `allowOverride`. (required)
        :type api_artifactory_connection_status_request_dto: ApiArtifactoryConnectionStatusRequestDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_owner_artifactory_connection_status_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            api_artifactory_connection_status_request_dto=api_artifactory_connection_status_request_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def update_owner_artifactory_connection_status_with_http_info(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        api_artifactory_connection_status_request_dto: Annotated[ApiArtifactoryConnectionStatusRequestDTO, Field(description="Set values for the connection properties `enabled` and `allowOverride`.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[None]:
        """update_owner_artifactory_connection_status

        Use this method to enable/disable an existing Artifactory connection for the specified owner.  Permissions required: Edit IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param api_artifactory_connection_status_request_dto: Set values for the connection properties `enabled` and `allowOverride`. (required)
        :type api_artifactory_connection_status_request_dto: ApiArtifactoryConnectionStatusRequestDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_owner_artifactory_connection_status_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            api_artifactory_connection_status_request_dto=api_artifactory_connection_status_request_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def update_owner_artifactory_connection_status_without_preload_content(
        self,
        owner_type: Annotated[str, Field(strict=True, description="Select the owner type.")],
        internal_owner_id: Annotated[StrictStr, Field(description="Enter the internal ID of the owner.")],
        api_artifactory_connection_status_request_dto: Annotated[ApiArtifactoryConnectionStatusRequestDTO, Field(description="Set values for the connection properties `enabled` and `allowOverride`.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """update_owner_artifactory_connection_status

        Use this method to enable/disable an existing Artifactory connection for the specified owner.  Permissions required: Edit IQ Elements

        :param owner_type: Select the owner type. (required)
        :type owner_type: str
        :param internal_owner_id: Enter the internal ID of the owner. (required)
        :type internal_owner_id: str
        :param api_artifactory_connection_status_request_dto: Set values for the connection properties `enabled` and `allowOverride`. (required)
        :type api_artifactory_connection_status_request_dto: ApiArtifactoryConnectionStatusRequestDTO
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_owner_artifactory_connection_status_serialize(
            owner_type=owner_type,
            internal_owner_id=internal_owner_id,
            api_artifactory_connection_status_request_dto=api_artifactory_connection_status_request_dto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _update_owner_artifactory_connection_status_serialize(
        self,
        owner_type,
        internal_owner_id,
        api_artifactory_connection_status_request_dto,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if owner_type is not None:
            _path_params['ownerType'] = owner_type
        if internal_owner_id is not None:
            _path_params['internalOwnerId'] = internal_owner_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if api_artifactory_connection_status_request_dto is not None:
            _body_params = api_artifactory_connection_status_request_dto



        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'BasicAuth'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/api/v2/config/artifactoryConnection/{ownerType}/{internalOwnerId}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


