def main():
    module_args = oci_common_utils.get_common_arg_spec()
    module_args.update(dict(user_id=dict(type='str', required=True), mfa_totp_device_id=dict(aliases=['id'], type='str'), sort_by=dict(type='str', choices=['TIMECREATED', 'NAME']), sort_order=dict(type='str', choices=['ASC', 'DESC'])))
    module = AnsibleModule(argument_spec=module_args)
    if (not HAS_OCI_PY_SDK):
        module.fail_json(msg='oci python sdk required for this module.')
    resource_facts_helper = ResourceFactsHelper(module=module, resource_type='mfa_totp_device', service_client_class=IdentityClient, namespace='identity')
    result = []
    if resource_facts_helper.is_get():
        result = [resource_facts_helper.get()]
    elif resource_facts_helper.is_list():
        result = resource_facts_helper.list()
    else:
        resource_facts_helper.fail()
    module.exit_json(mfa_totp_devices=result)
def main():
    module_args = oci_common_utils.get_common_arg_spec()
    module_args.update(dict(user_id=dict(type='str', required=True), mfa_totp_device_id=dict(aliases=['id'], type='str'), sort_by=dict(type='str', choices=['TIMECREATED', 'NAME']), sort_order=dict(type='str', choices=['ASC', 'DESC'])))
    module = AnsibleModule(argument_spec=module_args)
    if (not HAS_OCI_PY_SDK):
        module.fail_json(msg='oci python sdk required for this module.')
    resource_facts_helper = ResourceFactsHelper(module=module, resource_type='mfa_totp_device', service_client_class=IdentityClient, namespace='identity')
    result = []
    if resource_facts_helper.is_get():
        result = [resource_facts_helper.get()]
    elif resource_facts_helper.is_list():
        result = resource_facts_helper.list()
    else:
        resource_facts_helper.fail()
    module.exit_json(mfa_totp_devices=result)