Skip to content

Commit

Permalink
Validate priority arg and doc fixes
Browse files Browse the repository at this point in the history
Validate the two possible priorities with choices.
Add priority arg to one example and add version_added
field for the arg docs.
  • Loading branch information
bluikko authored Oct 31, 2024
1 parent d0ffc5d commit fae0f98
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/modules/mattermost.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@
priority:
type: str
description:
- Set a priority for the message. For supported values, see mattermost doc.
- Set a priority for the message.
choices: [ important, urgent ]
version_added: 10.0.0
validate_certs:
description:
- If V(false), SSL certificates will not be validated. This should only be used
Expand All @@ -96,6 +98,7 @@
channel: notifications
username: 'Ansible on {{ inventory_hostname }}'
icon_url: http://www.example.com/some-image-file.png
priority: important
- name: Send attachments message via Mattermost
community.general.mattermost:
Expand Down Expand Up @@ -139,7 +142,7 @@ def main():
channel=dict(type='str', default=None),
username=dict(type='str', default='Ansible'),
icon_url=dict(type='str', default='https://docs.ansible.com/favicon.ico'),
priority=dict(type='str', default=None),
priority=dict(type='str', default=None, choices=['important', 'urgent']),
validate_certs=dict(default=True, type='bool'),
attachments=dict(type='list', elements='dict'),
),
Expand Down

0 comments on commit fae0f98

Please sign in to comment.