# Path: ansible/module_utils/hashivault.py
# def hashivault_argspec():
#     argument_spec = dict(
#         url=dict(required=False, default=os.environ.get('VAULT_ADDR', ''), type='str'),
#         ca_cert=dict(required=False, default=os.environ.get('VAULT_CACERT', ''), type='str'),
#         ca_path=dict(required=False, default=os.environ.get('VAULT_CAPATH', ''), type='str'),
#         client_cert=dict(required=False, default=os.environ.get('VAULT_CLIENT_CERT', ''), type='str'),
#         client_key=dict(required=False, default=os.environ.get('VAULT_CLIENT_KEY', ''), type='str'),
#         verify=dict(required=False, default=(not os.environ.get('VAULT_SKIP_VERIFY', '')), type='bool'),
#         authtype=dict(required=False, default=os.environ.get('VAULT_AUTHTYPE', 'token'), type='str'),
#         login_mount_point=dict(required=False, default=os.environ.get('VAULT_LOGIN_MOUNT_POINT', None), type='str'),
#         token=dict(required=False, fallback=(hashivault_default_token, ''), type='str', no_log=True),
#         username=dict(required=False, default=os.environ.get('VAULT_USER', ''), type='str'),
#         password=dict(required=False, fallback=(env_fallback, ['VAULT_PASSWORD']), type='str', no_log=True),
#         role_id=dict(required=False, fallback=(env_fallback, ['VAULT_ROLE_ID']), type='str', no_log=True),
#         secret_id=dict(required=False, fallback=(env_fallback, ['VAULT_SECRET_ID']), type='str', no_log=True),
#         aws_header=dict(required=False, fallback=(env_fallback, ['VAULT_AWS_HEADER']), type='str', no_log=True),
#         namespace=dict(required=False, default=os.environ.get('VAULT_NAMESPACE', None), type='str')
#     )
#     return argument_spec
# 
# Path: ansible/module_utils/hashivault.py
# def hashivault_auth_client(params):
#     client = hashivault_client(params)
#     return hashivault_auth(client, params)
# 
# Path: ansible/module_utils/hashivault.py
# def hashivault_init(argument_spec, supports_check_mode=False, required_if=None, required_together=None,
#                     required_one_of=None, mutually_exclusive=None):
#     module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=supports_check_mode,
#                            required_if=required_if, required_together=required_together,
#                            required_one_of=required_one_of, mutually_exclusive=mutually_exclusive)
#     module.no_log_values.discard('0')
#     module.no_log_values.discard(0)
#     module.no_log_values.discard('1')
#     module.no_log_values.discard(1)
#     module.no_log_values.discard(True)
#     module.no_log_values.discard(False)
#     module.no_log_values.discard('ttl')
#     return module
# 
# Path: ansible/module_utils/hashivault.py
# def hashiwrapper(function):
#     def wrapper(*args, **kwargs):
#         result = {"changed": False, "rc": 0}
#         result.update(function(*args, **kwargs))
#         return result
#     return wrapper


from ansible.module_utils.hashivault import hashivault_argspec
from ansible.module_utils.hashivault import hashivault_auth_client
from ansible.module_utils.hashivault import hashivault_init
from ansible.module_utils.hashivault import hashiwrapper
            from requests.models import Response
                                                group_metadata, group_policies, group_member_group_ids,
                                                group_member_entity_ids, mount_point)
    elif group_name is not None:
        try:
            group_details = client.secrets.identity.read_group_by_name(name=group_name)
        except Exception:
            response = client.secrets.identity.create_or_update_group_by_name(
                name=group_name,
                group_type=group_type,
                metadata=group_metadata,
                policies=group_policies,
                member_group_ids=group_member_group_ids,
                member_entity_ids=group_member_entity_ids,
                mount_point=mount_point
            )
            if isinstance(response, Response):
                response = response.json()
            return {'changed': True, 'data': response['data']}
        return hashivault_identity_group_update(group_details['data'], client, group_name=group_name,
                                                group_id=group_details['data']['id'],
                                                group_type=group_type,
                                                group_metadata=group_metadata,
                                                group_policies=group_policies,
                                                group_member_group_ids=group_member_group_ids,
                                                group_member_entity_ids=group_member_entity_ids,
                                                mount_point=mount_point)
    return {'failed': True, 'msg': "Either name or id must be provided"}


def hashivault_identity_group_delete(params):

# Path: ansible/module_utils/hashivault.py
# def hashivault_argspec():
#     argument_spec = dict(
#         url=dict(required=False, default=os.environ.get('VAULT_ADDR', ''), type='str'),
#         ca_cert=dict(required=False, default=os.environ.get('VAULT_CACERT', ''), type='str'),
#         ca_path=dict(required=False, default=os.environ.get('VAULT_CAPATH', ''), type='str'),
#         client_cert=dict(required=False, default=os.environ.get('VAULT_CLIENT_CERT', ''), type='str'),
#         client_key=dict(required=False, default=os.environ.get('VAULT_CLIENT_KEY', ''), type='str'),
#         verify=dict(required=False, default=(not os.environ.get('VAULT_SKIP_VERIFY', '')), type='bool'),
#         authtype=dict(required=False, default=os.environ.get('VAULT_AUTHTYPE', 'token'), type='str'),
#         login_mount_point=dict(required=False, default=os.environ.get('VAULT_LOGIN_MOUNT_POINT', None), type='str'),
#         token=dict(required=False, fallback=(hashivault_default_token, ''), type='str', no_log=True),
#         username=dict(required=False, default=os.environ.get('VAULT_USER', ''), type='str'),
#         password=dict(required=False, fallback=(env_fallback, ['VAULT_PASSWORD']), type='str', no_log=True),
#         role_id=dict(required=False, fallback=(env_fallback, ['VAULT_ROLE_ID']), type='str', no_log=True),
#         secret_id=dict(required=False, fallback=(env_fallback, ['VAULT_SECRET_ID']), type='str', no_log=True),
#         aws_header=dict(required=False, fallback=(env_fallback, ['VAULT_AWS_HEADER']), type='str', no_log=True),
#         namespace=dict(required=False, default=os.environ.get('VAULT_NAMESPACE', None), type='str')
#     )
#     return argument_spec
# 
# Path: ansible/module_utils/hashivault.py
# def hashivault_auth_client(params):
#     client = hashivault_client(params)
#     return hashivault_auth(client, params)
# 
# Path: ansible/module_utils/hashivault.py
# def hashivault_init(argument_spec, supports_check_mode=False, required_if=None, required_together=None,
#                     required_one_of=None, mutually_exclusive=None):
#     module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=supports_check_mode,
#                            required_if=required_if, required_together=required_together,
#                            required_one_of=required_one_of, mutually_exclusive=mutually_exclusive)
#     module.no_log_values.discard('0')
#     module.no_log_values.discard(0)
#     module.no_log_values.discard('1')
#     module.no_log_values.discard(1)
#     module.no_log_values.discard(True)
#     module.no_log_values.discard(False)
#     module.no_log_values.discard('ttl')
#     return module
# 
# Path: ansible/module_utils/hashivault.py
# def hashiwrapper(function):
#     def wrapper(*args, **kwargs):
#         result = {"changed": False, "rc": 0}
#         result.update(function(*args, **kwargs))
#         return result
#     return wrapper


# Path: ansible/modules/hashivault/hashivault_identity_group.py
from ansible.module_utils.hashivault import hashivault_argspec
from ansible.module_utils.hashivault import hashivault_auth_client
from ansible.module_utils.hashivault import hashivault_init
from ansible.module_utils.hashivault import hashiwrapper
            from requests.models import Response

                                                group_metadata, group_policies, group_member_group_ids,
                                                group_member_entity_ids, mount_point)
    elif group_name is not None:
        try:
            group_details = client.secrets.identity.read_group_by_name(name=group_name)
        except Exception:
            response = client.secrets.identity.create_or_update_group_by_name(
                name=group_name,
                group_type=group_type,
                metadata=group_metadata,
                policies=group_policies,
                member_group_ids=group_member_group_ids,
                member_entity_ids=group_member_entity_ids,
                mount_point=mount_point
            )
            if isinstance(response, Response):
                response = response.json()
            return {'changed': True, 'data': response['data']}
        return hashivault_identity_group_update(group_details['data'], client, group_name=group_name,
                                                group_id=group_details['data']['id'],
                                                group_type=group_type,
                                                group_metadata=group_metadata,
                                                group_policies=group_policies,
                                                group_member_group_ids=group_member_group_ids,
                                                group_member_entity_ids=group_member_entity_ids,
                                                mount_point=mount_point)
    return {'failed': True, 'msg': "Either name or id must be provided"}


def hashivault_identity_group_delete(params):

    client = hashivault_auth_client(params)