
    Vhc                     p    d dl mZmZmZ eZd dlmZ d dlm	Z	 d dl
mZ dZ G d de      Z G d d	e      Zy
)    )absolute_importdivisionprint_function)RestAPI)env_fallback)AnsibleModulez/omevv/GatewayService/v1c                   0     e Zd Zdef fd	Z	 	 ddZ xZS )	RestOMEVVhttpsc                     t         |   ||d|       |j                  d      | _        |j                  d      | _        |j                  dd      | _        y )NF)root_urimodule_paramsreq_sessionprotocolvcenter_usernamevcenter_passwordvcenter_uuid )super__init__getusernamepassworduuid)selfr   r   r   	__class__s       q/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/dellemc/openmanage/plugins/module_utils/omevv.pyr   zRestOMEVV.__init__)   s]    '	 	 	
 &))*<=%))*<=!%%nb9	    c           	      r    | j                   r|xs i }| j                   |d<   | j                  |||||||      S )a'  
        Sends a request through the base invoke request method.

        Args:
            method (str): The HTTP method to use for the request.
            path (str): The path to request without query parameter.
            data (dict, optional): The payload to send with the request. Defaults to None.
            query_param (dict, optional): The dictionary of query parameters to send with the request. Defaults to None.
            headers (dict, optional): The dictionary of HTTP headers to send with the request. Defaults to None.
            api_timeout (int, optional): The timeout value for the request. Defaults to None.
            dump (bool, optional): Whether to dump the payload data. Defaults to True.

        Returns:
            Response: The response object from the request.
        zx_omivv-api-vcenter-identifier)r   _base_invoke_request)r   methodpathdataquery_paramheadersapi_timeoutdumps           r   invoke_requestzRestOMEVV.invoke_request5   sE    " 99mG8<		G45((t[')4d< 	<r   )NNNNT)__name__
__module____qualname__root_omevv_urir   r(   __classcell__r   s   @r   r
   r
   (   s    /6(
: QU.2<r   r
   c                   *     e Zd Z	 	 	 	 	 d fd	Z xZS )OMEVVAnsibleModulec                    ddidt         dgfidt         dgfdddd	dd
d	ddiddd	d}|j                  |       |rt         dgfdd|d<   dg}|g }|g }|j                  |       |g }|
i }
t        |   |||||||||	|

       y )NrequiredTfallbackOMEVV_VCENTER_USERNAMEOMEVV_VCENTER_PASSWORD)no_logr3   i  int)defaulttypeboolr9   r"      )hostnamer   r   portvalidate_certsca_pathtimeoutOMEVV_VCENTER_UUIDstr)r3   r9   r   )r   r   )r   updateextendr   r   )r   argument_specbypass_checksr6   mutually_exclusiverequired_togetherrequired_one_ofadd_file_common_argssupports_check_moderequired_ifrequired_byuuid_requiredomevv_argument_specauth_required_togetherr   s                 r   r   zOMEVVAnsibleModule.__init__N   s     $T*!+l=U<V-W X+/lMeLf=g h #U3*.?'#%u5
 	01:FI]H^9_in,oM.)"J!K%!#$ "  !78" OKv+->(*>,k;	Hr   )
FFNNNFFNNT)r)   r*   r+   r   r-   r.   s   @r   r0   r0   M   s    BG<@<AJN#	 H  Hr   r0   N)
__future__r   r   r   r9   __metaclass__Dansible_collections.dellemc.openmanage.plugins.module_utils.rest_apir   &ansible.module_utils.common.parametersr   ansible.module_utils.basicr   r,   r
   r0    r   r   <module>rW      s<   : C B X ? 4+"< "<J!H !Hr   