/// <summary> /// Determines whether this instance and another specified <see cref="WebhookStatus"/> object have the same value. /// </summary> /// <param name="value">The webhook status to compare to this instance.</param> /// <returns>true if the value of the parameter is the same as the value of this instance; otherwise, false. If value is null, the method returns false.</returns> public bool Equals(WebhookStatus value) { if (Object.ReferenceEquals(value, null)) { return(false); } if (Object.ReferenceEquals(this, value)) { return(true); } return(this.Name == value.Name); }
/// <summary> /// Parse webhook status. /// </summary> /// <param name="name">Name of the webhook status.</param> /// <returns><see cref="WebhookStatus"/> for the name.</returns> public static WebhookStatus Parse(string name) { WebhookStatus webhookStatus = null; if (name == null) { webhookStatus = WebhookStatus.Unknown; } else if (!WEBHOOK_STATUSES.TryGetValue(name, out webhookStatus)) { webhookStatus = new WebhookStatus(name); } return(webhookStatus); }