def main():
    module_args = oci_common_utils.get_common_arg_spec()
    module_args.update(dict(waas_policy_id=dict(type='str', required=True), name=dict(type='str')))
    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='access_rules', service_client_class=WaasClient, namespace='waas')
    result = []
    if resource_facts_helper.is_list():
        result = resource_facts_helper.list()
    else:
        resource_facts_helper.fail()
    module.exit_json(access_rules=result)
def main():
    module_args = oci_common_utils.get_common_arg_spec()
    module_args.update(dict(waas_policy_id=dict(type='str', required=True), name=dict(type='str')))
    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='access_rules', service_client_class=WaasClient, namespace='waas')
    result = []
    if resource_facts_helper.is_list():
        result = resource_facts_helper.list()
    else:
        resource_facts_helper.fail()
    module.exit_json(access_rules=result)