public void CloseIfStillOpen()
        {
            var config = GetPagerDutyConfig();
            var subject = "[IPHost] 'Parkmobile NL Web02 on web02-nl.parkmobile.com' - 'ok'";
            var api = new IntegrationApi(config);

            var incidents = api.GetOpenIncidents();

            var incident = incidents.FirstOrDefault(i => i.trigger_summary_data != null
                           && i.trigger_summary_data.IndexOf("IPHOST", StringComparison.OrdinalIgnoreCase) >= 0);

            if (incident != null)
            {
                var resolveEvent = new ResolveEvent(new IncidentEvent
                {
                    incident_key = incident.incident_key
                }, subject);

                var resResponse = api.Resolve(resolveEvent);

                Assert.IsTrue(resResponse.IsOk(), "Incident should be resolved");

            }
            else
            {
                //none open
            }
        }
        public void CreateAcknowledgeResolve()
        {
            var config = GetPagerDutyConfig();

            /*var config = new PagerDutyConfig
                {
                    EventAuthToken = "YOUR_EVENT_API_KEY_HERE",
                    EventApiUrl = "https://events.pagerduty.com/generic/2010-04-15/create_event.json"
                };
            */

            var incident = new IncidentEvent
                {
                    client = "UnitTest",
                    description = "Event triggered by unittest",
                    incident_key = Guid.NewGuid().ToString(),
                    service_key = config.EventAuthToken,
                };

            var apiClient = new IntegrationApi(config);

            var response = apiClient.Trigger(incident);

            Assert.IsTrue(response.IsOk(), "Incident should be created");

            var acknowledge = new AcknowledgeEvent(incident, "Working on it!");

            var ackResponse = apiClient.Acknowledge(acknowledge);

            Assert.IsTrue(ackResponse.IsOk(), "Incident should be acknowledged");

            var resolveEvent = new ResolveEvent(incident, "Fixed!");

            var resResponse = apiClient.Resolve(resolveEvent);

            Assert.IsTrue(resResponse.IsOk(), "Incident should be resolved");
        }