All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.twilio.sdk.TwilioMonitorClient Maven / Gradle / Ivy

There is a newer version: 7.0.0-rc-10
Show newest version
package com.twilio.sdk;

import com.twilio.sdk.resource.instance.monitor.Alert;
import com.twilio.sdk.resource.instance.monitor.Event;
import com.twilio.sdk.resource.list.monitor.AlertList;
import com.twilio.sdk.resource.list.monitor.EventList;

import java.util.HashMap;
import java.util.Map;

public class TwilioMonitorClient extends TwilioClient {

	public static final String DEFAULT_VERSION = "v1";

	public TwilioMonitorClient(final String accountSid, final String authToken) {
		super(accountSid, authToken, "https://monitor.twilio.com");
	}

	public TwilioMonitorClient(final String accountSid, final String authToken, final String endpoint) {
		super(accountSid, authToken, endpoint);
	}

	/**
	 * Get an event instance by sid.
	 *
	 * @param eventSid The 34 character sid starting with AE
	 */
	public Event getEvent(final String eventSid) {
		return new Event(this, eventSid);
	}

	/**
	 * Get the events.
	 *
	 * @return the events
	 */
	public EventList getEvents() {
		return getEvents(new HashMap(0));
	}

	/**
	 * Get the events.
	 *
	 * @param filters the filters
	 * @return events matching the filters
	 */
	public EventList getEvents(final Map filters) {
		return new EventList(this, filters);
	}

	/**
	 * Get an Alert instance by sid.
	 * @param alertSid Alert identifier
	 * @return Alert instance
	 */
	public Alert getAlert(final String alertSid) {
		return new Alert(this, alertSid);
	}

	public AlertList getAlerts(final Map filters) {
		return new AlertList(this, filters);
	}

	/**
	 * Get a list of Alerts for the current account.
	 * @return Alert list.
	 */
	public AlertList getAlerts() {
		return getAlerts(new HashMap(0));
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy