
    Vha                        d dl mZmZmZ eZd dlmZ 	 d dlm	Z	 dZ
d dlmZ d dlmZmZ  e       Zej%                   e ed	       ed	       ed	       ed	       ed	       ed
	       ed	       ed
	       ed	       ed	       ed	       ed	       ed	                   g Zg Zg Zg Z G d de      Zy# e$ r dZ
Y w xY w)    )absolute_importdivisionprint_function)
ActionBase)AnsibleArgSpecValidatorTF)AnsibleActionFail)ISESDKise_argument_specstr)typebooldict)idnamedescriptionmac	profileIdstaticProfileAssignmentgroupIdstaticGroupAssignment
portalUseridentityStoreidentityStoreIdmdmAttributescustomAttributesc                   6     e Zd Z fdZd Zd Zd fd	Z xZS )ActionModulec                 x    t         st        d      t        t        |   |i | d| _        d| _        d | _        y )NzYansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'F)ANSIBLE_UTILS_IS_INSTALLEDr   superr   __init___supports_async_supports_check_mode_result)selfargskwargs	__class__s      n/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/cisco/ise/plugins/action/endpoint_register.pyr!   zActionModule.__init__6   sC    )#k  	lD*D;F;$$)!    c                 *   t        | j                  j                  t        t              dt        t
        t        t        t              | j                  j                        }|j                         \  }}| j                  _        |st        |      y )N)argument_specargspec)required_ifrequired_one_ofmutually_exclusiverequired_together)dataschemaschema_formatschema_conditionalsr   )r   _taskr&   r   r,   r.   r/   r0   r1   actionvalidater   )r%   aavvaliderrorss       r)   _check_argspeczActionModule._check_argspecA   sr    %m4# $' /#5"3	! ""
 *-&vtzz#F++ r*   c                    t        |j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  d	      |j                  d
      |j                  d      |j                  d      |j                  d            }|S )Nr   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   
profile_idstatic_profile_assignmentgroup_idstatic_group_assignmentportal_useridentity_storeidentity_store_idmdm_attributescustom_attributes)r   get)r%   params
new_objects      r)   
get_objectzActionModule.get_objectR   s    zz$F#

=1

5!zz+.&,jj1J&KZZ	*$*JJ/F$G

<0!::o6$jj):;!::o6$jj);<

 r*   c                    d| j                   _        t        t        |   ||      | _        d| j
                  d<   | j                          t        | j                   j                        }|j                  dd| j                  | j                   j                              j                  }| j
                  j                  t        |             | j
                  j                  |j                                | j
                  S )NFchanged)rH   endpointregister_endpoint)familyfunctionrH   )ise_response)r6   diffr    r   runr$   r<   r	   r&   execrJ   responseupdater   	exit_json)r%   tmp	task_varsiserU   r(   s        r)   rS   zActionModule.rund   s    

\44S)D"'YDJJOO,88(??4::??3  
 (	 	 	Dh78CMMO,||r*   )NN)__name__
__module____qualname__r!   r<   rJ   rS   __classcell__)r(   s   @r)   r   r   5   s    ,"$ r*   r   N)
__future__r   r   r   r   __metaclass__ansible.plugins.actionr   Nansible_collections.ansible.utils.plugins.module_utils.common.argspec_validater   r   ImportErroransible.errorsr   6ansible_collections.cisco.ise.plugins.plugin_utils.iser	   r
   r,   rV   r   r.   r/   r0   r1   r    r*   r)   <module>rg      s    A @ -& "& , "#   Uue$eE" $& 1% "/U#&%('6*$   ?: ?K  '!&'s   C CC