File: rule_webhook_action_py3.py

package info (click to toggle)
python-azure 20181112%2Bgit-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 407,300 kB
  • sloc: python: 717,190; makefile: 201; sh: 76
file content (45 lines) | stat: -rw-r--r-- 1,779 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .rule_action_py3 import RuleAction


class RuleWebhookAction(RuleAction):
    """Specifies the action to post to service when the rule condition is
    evaluated. The discriminator is always RuleWebhookAction in this case.

    All required parameters must be populated in order to send to Azure.

    :param odatatype: Required. Constant filled by server.
    :type odatatype: str
    :param service_uri: the service uri to Post the notification when the
     alert activates or resolves.
    :type service_uri: str
    :param properties: the dictionary of custom properties to include with the
     post operation. These data are appended to the webhook payload.
    :type properties: dict[str, str]
    """

    _validation = {
        'odatatype': {'required': True},
    }

    _attribute_map = {
        'odatatype': {'key': 'odata\\.type', 'type': 'str'},
        'service_uri': {'key': 'serviceUri', 'type': 'str'},
        'properties': {'key': 'properties', 'type': '{str}'},
    }

    def __init__(self, *, service_uri: str=None, properties=None, **kwargs) -> None:
        super(RuleWebhookAction, self).__init__(**kwargs)
        self.service_uri = service_uri
        self.properties = properties
        self.odatatype = 'Microsoft.Azure.Management.Insights.Models.RuleWebhookAction'