Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/notification/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/notification/office_365_connector_card.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
lmZdZdZdZdZd�Zd�Zd�Zddddddd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
module: office_365_connector_card
short_description: Use webhooks to create Connector Card messages within an Office 365 group
description:
  - Creates Connector Card messages through
  - Office 365 Connectors U(https://dev.outlook.com/Connectors)
version_added: "2.4"
author: "Marc Sensenich (@marc-sensenich)"
notes:
  - This module is not idempotent, therefore if the same task is run twice
    there will be two Connector Cards created
options:
  webhook:
    description:
      - The webhook URL is given to you when you create a new Connector.
    required: true
  summary:
    description:
      - A string used for summarizing card content.
      - This will be shown as the message subject.
      - This is required if the text parameter isn't populated.
  color:
    description:
      - Accent color used for branding or indicating status in the card.
  title:
    description:
      - A title for the Connector message. Shown at the top of the message.
  text:
    description:
      - The main text of the card.
      - This will be rendered below the sender information and optional title,
      - and above any sections or actions present.
  actions:
    description:
      - This array of objects will power the action links
      - found at the bottom of the card.
  sections:
    description:
      - Contains a list of sections to display in the card.
      - For more information see https://dev.outlook.com/Connectors/reference.
s�
- name: Create a simple Connector Card
  office_365_connector_card:
    webhook: https://outlook.office.com/webhook/GUID/IncomingWebhook/GUID/GUID
    text: 'Hello, World!'

- name: Create a Connector Card with the full format
  office_365_connector_card:
    webhook: https://outlook.office.com/webhook/GUID/IncomingWebhook/GUID/GUID
    summary: This is the summary property
    title: This is the **card's title** property
    text: This is the **card's text** property. Lorem ipsum dolor sit amet, consectetur
      adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    color: E81123
    sections:
    - title: This is the **section's title** property
      activity_image: http://connectorsdemo.azurewebsites.net/images/MSC12_Oscar_002.jpg
      activity_title: This is the section's **activityTitle** property
      activity_subtitle: This is the section's **activitySubtitle** property
      activity_text: This is the section's **activityText** property.
      hero_image:
        image: http://connectorsdemo.azurewebsites.net/images/WIN12_Scene_01.jpg
        title: This is the image's alternate text
      text: This is the section's text property. Lorem ipsum dolor sit amet, consectetur
        adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
      facts:
      - name: This is a fact name
        value: This is a fact value
      - name: This is a fact name
        value: This is a fact value
      - name: This is a fact name
        value: This is a fact value
      images:
      - image: http://connectorsdemo.azurewebsites.net/images/MicrosoftSurface_024_Cafe_OH-06315_VS_R1c.jpg
        title: This is the image's alternate text
      - image: http://connectorsdemo.azurewebsites.net/images/WIN12_Scene_01.jpg
        title: This is the image's alternate text
      - image: http://connectorsdemo.azurewebsites.net/images/WIN12_Anthony_02.jpg
        title: This is the image's alternate text
      actions:
      - "@type": ActionCard
        name: Comment
        inputs:
        - "@type": TextInput
          id: comment
          is_multiline: true
          title: Input's title property
        actions:
        - "@type": HttpPOST
          name: Save
          target: http://...
      - "@type": ActionCard
        name: Due Date
        inputs:
        - "@type": DateInput
          id: dueDate
          title: Input's title property
        actions:
        - "@type": HttpPOST
          name: Save
          target: http://...
      - "@type": HttpPOST
        name: Action's name prop.
        target: http://...
      - "@type": OpenUri
        name: Action's name prop
        targets:
        - os: default
          uri: http://...
    - start_group: true
      title: This is the title of a **second section**
      text: This second section is visually separated from the first one by setting its
        **startGroup** property to true.
t
(t
AnsibleModule(t	fetch_url(tsnake_dict_to_camel_dictshttp://schema.org/extensionstMessageCardsSummary or Text is required.s'The Incoming Webhook was not reachable.cC`s4g}x'|D]}t|�}|j|�q
W|S(N(Rtappend(tactionstaction_itemstactiontaction_item((sZ/usr/lib/python2.7/site-packages/ansible/modules/notification/office_365_connector_card.pyt
build_actions�s

cC`s.g}x!|D]}|jt|��q
W|S(N(R
t
build_section(tsectionstsections_createdtsection((sZ/usr/lib/python2.7/site-packages/ansible/modules/notification/office_365_connector_card.pytbuild_sections�s
cC`sRt�}d|kr&|d|d<nd|krC|d|d<nd|kr`|d|d<nd|kr}|d|d<nd|kr�|d|d	<nd
|kr�|d
|d<nd|kr�|d|d
<nd|kr�|d|d<nd|kr|d|d<nd|kr+|d|d<nd|krNt|d�|d<n|S(Nttitletstart_groupt
startGrouptactivity_imaget
activityImagetactivity_titlet
activityTitletactivity_subtitletactivitySubtitlet
activity_texttactivityTextt
hero_imaget	heroImagettexttfactstimagesRtpotentialAction(tdictR(Rtsection_payload((sZ/usr/lib/python2.7/site-packages/ansible/modules/notification/office_365_connector_card.pyR�s0	cC`s�t�}t|d<t|d<|dk	r6||d<n|dk	rO||d<n|dk	rh||d<n|dk	r�||d<n|r�t|�|d<n|r�t|�|d<n|j|�}|S(	Ns@contexts@typetsummaryt
themeColorRR%R(R(R)tOFFICE_365_CARD_CONTEXTtOFFICE_365_CARD_TYPEtNoneRRtjsonify(tmoduleR+tcolorRR%RRtpayload((sZ/usr/lib/python2.7/site-packages/ansible/modules/notification/office_365_connector_card.pyt build_payload_for_connector_card�s"	





cC`s�idd6}td|d|d|ddd|�\}}|d	d
kr]|jdt�nm|d	dkr�|jr�|d
tkr�|jdt�q�|jdt�n|jdd||df�dS(Nsapplication/jsonsContent-TypeR1turltheaderstmethodtPOSTtdataRi�tchangedi�tbodytmsgs=failed to send %s as a connector card to Incoming Webhook: %s(R
t	exit_jsontTruet
check_modet!OFFICE_365_CARD_EMPTY_PAYLOAD_MSGt	fail_jsontOFFICE_365_INVALID_WEBHOOK_MSG(R1twebhookR3R6tresponsetinfo((sZ/usr/lib/python2.7/site-packages/ansible/modules/notification/office_365_connector_card.pyt do_notify_connector_card_webhook�s"
	c
C`s<tdtdtdtdt�dtdd�dtdd�d	tdd�d
tdd�dtdd�d
tdd��dt�}|jd}|jd}|jd}|jd	}|jd
}|jd}|jd
}t|||||||�}|jr(t|�}	t|||	�nt|||�dS(Nt
argument_specRCtrequiredtno_logR+ttypetstrR2RR%RtlistRtsupports_check_mode(R	R)R>tparamsR4R?RF(
R1RCR+R2RR%RRR3tcheck_mode_payload((sZ/usr/lib/python2.7/site-packages/ansible/modules/notification/office_365_connector_card.pytmains:	






		t__main__N(t
__future__RRRRJt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicR	tansible.module_utils.urlsR
tansible.module_utils.ec2RR-R.R@RBRRRR/R4RFRPt__name__(((sZ/usr/lib/python2.7/site-packages/ansible/modules/notification/office_365_connector_card.pyt<module>s,


*K	
			'		'

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]