def main():
    module_args = oci_common_utils.get_common_arg_spec()
    module_args.update(dict(certificate_id=dict(aliases=['id'], type='str'), compartment_id=dict(type='str'), sort_by=dict(type='str', choices=['id', 'compartmentId', 'displayName', 'notValidAfter', 'timeCreated']), sort_order=dict(type='str', choices=['ASC', 'DESC']), display_name=dict(aliases=['name'], type='list'), lifecycle_state=dict(type='list', choices=['CREATING', 'ACTIVE', 'FAILED', 'UPDATING', 'DELETING', 'DELETED']), time_created_greater_than_or_equal_to=dict(type='str'), time_created_less_than=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='waas_certificate', service_client_class=WaasClient, namespace='waas')
    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(waas_certificates=result)
def main():
    module_args = oci_common_utils.get_common_arg_spec()
    module_args.update(dict(certificate_id=dict(aliases=['id'], type='str'), compartment_id=dict(type='str'), sort_by=dict(type='str', choices=['id', 'compartmentId', 'displayName', 'notValidAfter', 'timeCreated']), sort_order=dict(type='str', choices=['ASC', 'DESC']), display_name=dict(aliases=['name'], type='list'), lifecycle_state=dict(type='list', choices=['CREATING', 'ACTIVE', 'FAILED', 'UPDATING', 'DELETING', 'DELETED']), time_created_greater_than_or_equal_to=dict(type='str'), time_created_less_than=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='waas_certificate', service_client_class=WaasClient, namespace='waas')
    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(waas_certificates=result)