---
- name: Create or update an network_access_time_date_conditions
  hosts: ise_servers
  gather_facts: false
  tasks:
    # - name: Get all
    #   cisco.ise.network_access_time_date_conditions_info:
    #     ise_hostname: "{{ ise_hostname }}"
    #     ise_username: "{{ ise_username }}"
    #     ise_password: "{{ ise_password }}"
    #     ise_verify: "{{ ise_verify }}"
    #   register: result

    # - name: Print all
    #   ansible.builtin.debug:
    #     var: result

    # - name: Get by id
    #   cisco.ise.network_access_time_date_conditions_info:
    #     ise_hostname: "{{ ise_hostname }}"
    #     ise_username: "{{ ise_username }}"
    #     ise_password: "{{ ise_password }}"
    #     ise_verify: "{{ ise_verify }}"
    #     id: d704e911-a916-11eb-8830-2ec507028ea8
    #   register: result

    - name: Create or update an network_access_time_date_conditions
      cisco.ise.network_access_time_date_conditions:
        ise_hostname: "{{ ise_hostname }}"
        ise_username: "{{ ise_username }}"
        ise_password: "{{ ise_password }}"
        ise_verify: "{{ ise_verify }}"
        state: present
        conditionType: TimeAndDateCondition
        isNegate: false
        name: Test1
        description:
        hoursRange:
          startTime: "22:02"
          endTime: "13:02"
        hoursRangeException:
          startTime: "23:02"
          endTime: "23:50"
        weekDays:
          - Saturday
          - Sunday
        weekDaysException:
          - Sunday
        datesRange:
          startDate: "2021-06-30"
          endDate: "2021-07-03"
        datesRangeException:
          startDate: "2021-06-30"
          endDate: "2021-06-30"
      register: result

    - name: Print result
      ansible.builtin.debug:
        var: result
