Пример #1
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.</param>
 /// <param name="status">The status of the endpoint. (default to StatusEnum.Active).</param>
 /// <param name="labels">labels.</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>), NotificationEndpointType type = default(NotificationEndpointType))
 {
     // to ensure "type" is required (not null)
     if (type == null)
     {
         throw new InvalidDataException("type is a required property for NotificationEndpointBase and cannot be null");
     }
     else
     {
         this.Type = type;
     }
     this.Id          = id;
     this.OrgID       = orgID;
     this.UserID      = userID;
     this.Description = description;
     this.Name        = name;
     // use default value if no "status" provided
     if (status == null)
     {
         this.Status = StatusEnum.Active;
     }
     else
     {
         this.Status = status;
     }
     this.Labels = labels;
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationEndpoint" /> class.
 /// </summary>
 public NotificationEndpoint(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>), NotificationEndpointType type = default(NotificationEndpointType)) : base(id, orgID, userID, description, name, status, labels, type)
 {
 }
Пример #3
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;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PagerDutyNotificationEndpoint" /> class.
 /// </summary>
 /// <param name="url">url (required).</param>
 /// <param name="routingKey">routingKey (required).</param>
 public PagerDutyNotificationEndpoint(string url = 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>), NotificationEndpointType type = default(NotificationEndpointType)) : base(id, orgID, userID, description, name, status, labels, type)
 {
     // to ensure "url" is required (not null)
     if (url == null)
     {
         throw new InvalidDataException("url is a required property for PagerDutyNotificationEndpoint and cannot be null");
     }
     else
     {
         this.Url = url;
     }
     // 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;
     }
 }
 /// <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;
 }
        /// <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;
        }