
    Vh8                     T    d Z dZdZddlmZ ddlmZ ddlmZ d Z	e
dk(  r e	        y	y	)
a  
module: waf_info
short_description: Retrieve information for WAF ACLs, Rules, Conditions and Filters
version_added: 1.0.0
description:
  - Retrieve information for WAF ACLs, Rules, Conditions and Filters.
  - Prior to release 5.0.0 this module was called C(community.aws.aws_waf_info).
    The usage did not change.
options:
  name:
    description:
      - The name of a Web Application Firewall.
    type: str
  waf_regional:
    description: Whether to use the C(waf-regional) module.
    default: false
    required: false
    type: bool

author:
  - Mike Mochan (@mmochan)
  - Will Thames (@willthames)
extends_documentation_fragment:
  - amazon.aws.common.modules
  - amazon.aws.region.modules
  - amazon.aws.boto3
a  
- name: obtain all WAF information
  community.aws.waf_info:

- name: obtain all information for a single WAF
  community.aws.waf_info:
    name: test_waf

- name: obtain all information for a single WAF Regional
  community.aws.waf_info:
    name: test_waf
    waf_regional: true
a`  
wafs:
  description: The WAFs that match the passed arguments.
  returned: success
  type: complex
  contains:
    name:
      description: A friendly name or description of the WebACL.
      returned: always
      type: str
      sample: test_waf
    default_action:
      description: The action to perform if none of the Rules contained in the WebACL match.
      returned: always
      type: int
      sample: BLOCK
    metric_name:
      description: A friendly name or description for the metrics for this WebACL.
      returned: always
      type: str
      sample: test_waf_metric
    rules:
      description: An array that contains the action for each Rule in a WebACL , the priority of the Rule.
      returned: always
      type: complex
      contains:
        action:
          description: The action to perform if the Rule matches.
          returned: always
          type: str
          sample: BLOCK
        metric_name:
          description: A friendly name or description for the metrics for this Rule.
          returned: always
          type: str
          sample: ipblockrule
        name:
          description: A friendly name or description of the Rule.
          returned: always
          type: str
          sample: ip_block_rule
        predicates:
          description: The Predicates list contains a Predicate for each
            ByteMatchSet, IPSet, SizeConstraintSet, SqlInjectionMatchSet or XssMatchSet
            object in a Rule.
          returned: always
          type: list
          sample:
            [
              {
                "byte_match_set_id": "47b822b5-abcd-1234-faaf-1234567890",
                "byte_match_tuples": [
                  {
                    "field_to_match": {
                      "type": "QUERY_STRING"
                    },
                    "positional_constraint": "STARTS_WITH",
                    "target_string": "bobbins",
                    "text_transformation": "NONE"
                  }
                ],
                "name": "bobbins",
                "negated": false,
                "type": "ByteMatch"
              }
            ]
    )get_web_acl)list_web_acls)AnsibleCommunityAWSModulec                     t        t        d      t        dd            } t        | d      }|j                  d   sd	nd
}|j                  |      }t	        ||      }|j                  d   }|r0|D cg c]  }|d   |k(  s| }}|s|j                  d| d       |j                  |D cg c]  }t        |||d          c}       y c c}w c c}w )NF)requiredbool)typedefault)namewaf_regionalT)argument_specsupports_check_moder   wafzwaf-regionalr   Namez
WAF named z
 not found)msgWebACLId)wafs)dictAnsibleAWSModuleparamsclientr   	fail_json	exit_jsonr   )r   moduleresourcer   web_aclsr   web_acls          j/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/community/aws/plugins/modules/waf_info.pymainr   {   s    5!vu5M MtTF"MM.9u~H]]8$FVV,H== D+3Owv$7NGOO:dV:!>?
[cdPW;vvwz7JKde P es   5CC0C__main__N)DOCUMENTATIONEXAMPLESRETURN7ansible_collections.amazon.aws.plugins.module_utils.wafr   r   >ansible_collections.community.aws.plugins.module_utils.modulesr   r   r   __name__     r   <module>r)      sB   8B
H P Q xf$ zF r(   