示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SlackNotificationEndpoint" /> class.
 /// </summary>
 /// <param name="url">Specifies the URL of the Slack endpoint. Specify either &#x60;URL&#x60; or &#x60;Token&#x60;. (required).</param>
 /// <param name="token">Specifies the API token string. Specify either &#x60;URL&#x60; or &#x60;Token&#x60;..</param>
 public SlackNotificationEndpoint(string url = default(string), string token = default(string), string id = default(string), string orgID = default(string), string userID = default(string), string description = default(string), string name = default(string), StatusEnum?status = StatusEnum.Active, List <Label> labels = default(List <Label>), NotificationEndpointBaseLinks links = default(NotificationEndpointBaseLinks), NotificationEndpointType type = default(NotificationEndpointType)) : base(id, orgID, userID, description, name, status, labels, links, type)
 {
     // to ensure "url" is required (not null)
     if (url == null)
     {
         throw new InvalidDataException("url is a required property for SlackNotificationEndpoint and cannot be null");
     }
     else
     {
         this.Url = url;
     }
     this.Token = token;
 }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NotificationEndpointBase" /> class.
        /// </summary>
        /// <param name="id">id.</param>
        /// <param name="orgID">orgID.</param>
        /// <param name="userID">userID.</param>
        /// <param name="description">An optional description of the notification endpoint..</param>
        /// <param name="name">name (required).</param>
        /// <param name="status">The status of the endpoint. (default to StatusEnum.Active).</param>
        /// <param name="labels">labels.</param>
        /// <param name="links">links.</param>
        /// <param name="type">type (required).</param>
        public NotificationEndpointBase(string id = default(string), string orgID = default(string), string userID = default(string), string description = default(string), string name = default(string), StatusEnum?status = StatusEnum.Active, List <Label> labels = default(List <Label>), NotificationEndpointBaseLinks links = default(NotificationEndpointBaseLinks), NotificationEndpointType type = default(NotificationEndpointType)) : base()
        {
            this.Type = type;

            // to ensure "name" is required (not null)
            if (name == null)
            {
                throw new InvalidDataException("name is a required property for NotificationEndpointBase and cannot be null");
            }
            else
            {
                this.Name = name;
            }

            this.Id          = id;
            this.OrgID       = orgID;
            this.UserID      = userID;
            this.Description = description;
            // use default value if no "status" provided
            if (status == null)
            {
                this.Status = StatusEnum.Active;
            }
            else
            {
                this.Status = status;
            }
            this.Labels = labels;
            this.Links  = links;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="HTTPNotificationEndpoint" /> class.
        /// </summary>
        /// <param name="url">url (required).</param>
        /// <param name="username">username.</param>
        /// <param name="password">password.</param>
        /// <param name="token">token.</param>
        /// <param name="method">method (required).</param>
        /// <param name="authMethod">authMethod (required).</param>
        /// <param name="contentTemplate">contentTemplate.</param>
        /// <param name="headers">Customized headers..</param>
        public HTTPNotificationEndpoint(string url = default(string), string username = default(string), string password = default(string), string token = default(string), MethodEnum method = default(MethodEnum), AuthMethodEnum authMethod = default(AuthMethodEnum), string contentTemplate = default(string), Dictionary <string, string> headers = default(Dictionary <string, string>), string id = default(string), string orgID = default(string), string userID = default(string), string description = default(string), string name = default(string), StatusEnum?status = StatusEnum.Active, List <Label> labels = default(List <Label>), NotificationEndpointBaseLinks links = default(NotificationEndpointBaseLinks), NotificationEndpointType type = default(NotificationEndpointType)) : base(id, orgID, userID, description, name, status, labels, links, type)
        {
            this.Method     = method;
            this.AuthMethod = authMethod;

            // to ensure "url" is required (not null)
            if (url == null)
            {
                throw new InvalidDataException("url is a required property for HTTPNotificationEndpoint and cannot be null");
            }
            else
            {
                this.Url = url;
            }
            this.Username        = username;
            this.Password        = password;
            this.Token           = token;
            this.ContentTemplate = contentTemplate;
            this.Headers         = headers;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SlackNotificationEndpoint" /> class.
 /// </summary>
 /// <param name="url">Specifies the URL of the Slack endpoint. Specify either &#x60;URL&#x60; or &#x60;Token&#x60;..</param>
 /// <param name="token">Specifies the API token string. Specify either &#x60;URL&#x60; or &#x60;Token&#x60;..</param>
 public SlackNotificationEndpoint(string url = default(string), string token = default(string), string id = default(string), string orgID = default(string), string userID = default(string), string description = default(string), string name = default(string), StatusEnum?status = StatusEnum.Active, List <Label> labels = default(List <Label>), NotificationEndpointBaseLinks links = default(NotificationEndpointBaseLinks), NotificationEndpointType type = default(NotificationEndpointType)) : base(id, orgID, userID, description, name, status, labels, links, type)
 {
     this.Url   = url;
     this.Token = token;
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PagerDutyNotificationEndpoint" /> class.
 /// </summary>
 /// <param name="clientURL">clientURL (required).</param>
 /// <param name="routingKey">routingKey (required).</param>
 public PagerDutyNotificationEndpoint(string clientURL = default(string), string routingKey = default(string), string id = default(string), string orgID = default(string), string userID = default(string), string description = default(string), string name = default(string), StatusEnum?status = StatusEnum.Active, List <Label> labels = default(List <Label>), NotificationEndpointBaseLinks links = default(NotificationEndpointBaseLinks), NotificationEndpointType type = default(NotificationEndpointType)) : base(id, orgID, userID, description, name, status, labels, links, type)
 {
     // to ensure "clientURL" is required (not null)
     if (clientURL == null)
     {
         throw new InvalidDataException("clientURL is a required property for PagerDutyNotificationEndpoint and cannot be null");
     }
     else
     {
         this.ClientURL = clientURL;
     }
     // to ensure "routingKey" is required (not null)
     if (routingKey == null)
     {
         throw new InvalidDataException("routingKey is a required property for PagerDutyNotificationEndpoint and cannot be null");
     }
     else
     {
         this.RoutingKey = routingKey;
     }
 }