
    Vh                     ^    d Z dZdZddlmZ ddlmZ  G d de      Zd Ze	d	k(  r e        y
y
)a  
---
module: identity_domain
short_description: Manage OpenStack identity (Keystone) domains
author: OpenStack Ansible SIG
description:
  - Create, update or delete OpenStack identity (Keystone) domains.
options:
  description:
    description:
      - Domain description.
    type: str
  is_enabled:
    description:
      - Whether this domain is enabled or not.
    type: bool
    aliases: ['enabled']
  name:
    description:
      - Domain name.
    required: true
    type: str
  state:
    description:
      - Should the resource be present or absent.
    choices: ['present', 'absent']
    default: present
    type: str
extends_documentation_fragment:
  - openstack.cloud.openstack
z
- name: Create a domain
  openstack.cloud.identity_domain:
    cloud: mycloud
    state: present
    name: demo
    description: Demo Domain

- name: Delete a domain
  openstack.cloud.identity_domain:
    cloud: mycloud
    state: absent
    name: demo
aX  
domain:
  description: Dictionary describing the domain.
  returned: On success when I(state) is C(present).
  type: dict
  contains:
    description:
      description: Domain description.
      type: str
      sample: "Demo Domain"
    id:
      description: Domain ID.
      type: str
      sample: "474acfe5-be34-494c-b339-50f06aa143e4"
    is_enabled:
      description: Domain description.
      type: bool
      sample: True
    links:
      description: The links related to the domain resource
      type: list
    name:
      description: Domain name.
      type: str
      sample: "demo"
    )OpenStackModule)StateMachinec            
           e Zd Z e e        eddg       ed       edddg      	      Z ed
      Z G d de      Zd Zy)IdentityDomainModuleboolenabled)typealiasesT)requiredpresentabsent)defaultchoices)description
is_enablednamestate)supports_check_modec                       e Zd Zd Zy)"IdentityDomainModule._StateMachinec                 @    | j                   j                  |d          y )Nid)
connectiondelete_domain)selfresource
attributestimeoutwaitkwargss         s/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/openstack/cloud/plugins/modules/identity_domain.py_deletez*IdentityDomainModule._StateMachine._deleteb   s     OO))(4.9    N)__name__
__module____qualname__r"    r#   r!   _StateMachiner   a   s    	:r#   r(   c                 f     j                   j                  dd j                        }t         fddD              }t         fddD              |d<    |d j                  j
                  d d d	d
|\  }}| j                  |       y  j                  ||j                  d	             y )Nidentitydomain)r   service_name	type_namesdkc              3   ^   K   | ]$  }j                   |   |j                   |   f & y wNparams.0kr   s     r!   	<genexpr>z+IdentityDomainModule.run.<locals>.<genexpr>m   s4      5Q3 $++a.) 5   *-)r   r   c              3   ^   K   | ]$  }j                   |   |j                   |   f & y wr0   r1   r3   s     r!   r6   z+IdentityDomainModule.run.<locals>.<genexpr>r   s4      0KKN. T[[^$ 0r7   )r   r   r   r   F)
check_modeupdateable_attributesnon_updateable_attributesr   )changed)computed)r<   r+   r'   )r(   connr.   dictansibler9   	exit_jsonto_dict)r   smr    r+   
is_changeds   `    r!   runzIdentityDomainModule.rung   s    499-7*2$(HH   .
  535 5
  0?0 0 	|
   *4<<+B+B6::>%** #)	*
 >NN:N.NN:"(..%."@  Br#   N)	r$   r%   r&   r?   argument_specmodule_kwargsr   r(   rE   r'   r#   r!   r   r   U   sU    FVi[94 9x.CD	M  M: :Br#   r   c                  &    t               }  |         y r0   )r   )modules    r!   mainrJ      s    !#F
Hr#   __main__N)
DOCUMENTATIONEXAMPLESRETURNBansible_collections.openstack.cloud.plugins.module_utils.openstackr   Aansible_collections.openstack.cloud.plugins.module_utils.resourcer   r   rJ   r$   r'   r#   r!   <module>rQ      sL   @
6 _ Z+B? +B\
 zF r#   