Class Trigger
- java.lang.Object
-
- com.twilio.base.Resource
-
- com.twilio.rest.api.v2010.account.usage.Trigger
-
- All Implemented Interfaces:
Serializable
public class Trigger extends Resource
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Trigger.Recurring
static class
Trigger.TriggerField
static class
Trigger.UsageCategory
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TriggerCreator
creator(String pathAccountSid, URI callbackUrl, String triggerValue, Trigger.UsageCategory usageCategory)
Create a TriggerCreator to execute create.static TriggerCreator
creator(URI callbackUrl, String triggerValue, Trigger.UsageCategory usageCategory)
Create a TriggerCreator to execute create.static TriggerDeleter
deleter(String pathSid)
Create a TriggerDeleter to execute delete.static TriggerDeleter
deleter(String pathAccountSid, String pathSid)
Create a TriggerDeleter to execute delete.boolean
equals(Object o)
static TriggerFetcher
fetcher(String pathSid)
Create a TriggerFetcher to execute fetch.static TriggerFetcher
fetcher(String pathAccountSid, String pathSid)
Create a TriggerFetcher to execute fetch.static Trigger
fromJson(InputStream json, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Converts a JSON InputStream into a Trigger object using the provided ObjectMapper.static Trigger
fromJson(String json, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Converts a JSON String into a Trigger object using the provided ObjectMapper.String
getAccountSid()
Returns The The SID of the Account that this trigger monitors.String
getApiVersion()
Returns The The API version used to create the resource.HttpMethod
getCallbackMethod()
Returns The The HTTP method we use to call callback_url.URI
getCallbackUrl()
Returns The he URL we call when the trigger fires.String
getCurrentValue()
Returns The The current value of the field the trigger is watching.org.joda.time.DateTime
getDateCreated()
Returns The The RFC 2822 date and time in GMT that the resource was created.org.joda.time.DateTime
getDateFired()
Returns The The RFC 2822 date and time in GMT that the trigger was last fired.org.joda.time.DateTime
getDateUpdated()
Returns The The RFC 2822 date and time in GMT that the resource was last updated.String
getFriendlyName()
Returns The The string that you assigned to describe the trigger.Trigger.Recurring
getRecurring()
Returns The The frequency of a recurring UsageTrigger.String
getSid()
Returns The The unique string that identifies the resource.Trigger.TriggerField
getTriggerBy()
Returns The The field in the UsageRecord resource that fires the trigger.String
getTriggerValue()
Returns The The value at which the trigger will fire.String
getUri()
Returns The The URI of the resource, relative to `https://api.twilio.com`.Trigger.UsageCategory
getUsageCategory()
Returns The The usage category the trigger watches.String
getUsageRecordUri()
Returns The The URI of the UsageRecord resource this trigger watches.int
hashCode()
static TriggerReader
reader()
Create a TriggerReader to execute read.static TriggerReader
reader(String pathAccountSid)
Create a TriggerReader to execute read.String
toString()
static TriggerUpdater
updater(String pathSid)
Create a TriggerUpdater to execute update.static TriggerUpdater
updater(String pathAccountSid, String pathSid)
Create a TriggerUpdater to execute update.
-
-
-
Method Detail
-
fetcher
public static TriggerFetcher fetcher(String pathAccountSid, String pathSid)
Create a TriggerFetcher to execute fetch.- Parameters:
pathAccountSid
- The SID of the Account that created the resource to fetchpathSid
- The unique string that identifies the resource- Returns:
- TriggerFetcher capable of executing the fetch
-
fetcher
public static TriggerFetcher fetcher(String pathSid)
Create a TriggerFetcher to execute fetch.- Parameters:
pathSid
- The unique string that identifies the resource- Returns:
- TriggerFetcher capable of executing the fetch
-
updater
public static TriggerUpdater updater(String pathAccountSid, String pathSid)
Create a TriggerUpdater to execute update.- Parameters:
pathAccountSid
- The SID of the Account that created the resources to updatepathSid
- The unique string that identifies the resource- Returns:
- TriggerUpdater capable of executing the update
-
updater
public static TriggerUpdater updater(String pathSid)
Create a TriggerUpdater to execute update.- Parameters:
pathSid
- The unique string that identifies the resource- Returns:
- TriggerUpdater capable of executing the update
-
deleter
public static TriggerDeleter deleter(String pathAccountSid, String pathSid)
Create a TriggerDeleter to execute delete.- Parameters:
pathAccountSid
- The SID of the Account that created the resources to deletepathSid
- The unique string that identifies the resource- Returns:
- TriggerDeleter capable of executing the delete
-
deleter
public static TriggerDeleter deleter(String pathSid)
Create a TriggerDeleter to execute delete.- Parameters:
pathSid
- The unique string that identifies the resource- Returns:
- TriggerDeleter capable of executing the delete
-
creator
public static TriggerCreator creator(String pathAccountSid, URI callbackUrl, String triggerValue, Trigger.UsageCategory usageCategory)
Create a TriggerCreator to execute create.- Parameters:
pathAccountSid
- The SID of the Account that will create the resourcecallbackUrl
- The URL we call when the trigger firestriggerValue
- The usage value at which the trigger should fireusageCategory
- The usage category the trigger watches- Returns:
- TriggerCreator capable of executing the create
-
creator
public static TriggerCreator creator(URI callbackUrl, String triggerValue, Trigger.UsageCategory usageCategory)
Create a TriggerCreator to execute create.- Parameters:
callbackUrl
- The URL we call when the trigger firestriggerValue
- The usage value at which the trigger should fireusageCategory
- The usage category the trigger watches- Returns:
- TriggerCreator capable of executing the create
-
reader
public static TriggerReader reader(String pathAccountSid)
Create a TriggerReader to execute read.- Parameters:
pathAccountSid
- The SID of the Account that created the resources to read- Returns:
- TriggerReader capable of executing the read
-
reader
public static TriggerReader reader()
Create a TriggerReader to execute read.- Returns:
- TriggerReader capable of executing the read
-
fromJson
public static Trigger fromJson(String json, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Converts a JSON String into a Trigger object using the provided ObjectMapper.- Parameters:
json
- Raw JSON StringobjectMapper
- Jackson ObjectMapper- Returns:
- Trigger object represented by the provided JSON
-
fromJson
public static Trigger fromJson(InputStream json, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Converts a JSON InputStream into a Trigger object using the provided ObjectMapper.- Parameters:
json
- Raw JSON InputStreamobjectMapper
- Jackson ObjectMapper- Returns:
- Trigger object represented by the provided JSON
-
getAccountSid
public final String getAccountSid()
Returns The The SID of the Account that this trigger monitors.- Returns:
- The SID of the Account that this trigger monitors
-
getApiVersion
public final String getApiVersion()
Returns The The API version used to create the resource.- Returns:
- The API version used to create the resource
-
getCallbackMethod
public final HttpMethod getCallbackMethod()
Returns The The HTTP method we use to call callback_url.- Returns:
- The HTTP method we use to call callback_url
-
getCallbackUrl
public final URI getCallbackUrl()
Returns The he URL we call when the trigger fires.- Returns:
- he URL we call when the trigger fires
-
getCurrentValue
public final String getCurrentValue()
Returns The The current value of the field the trigger is watching.- Returns:
- The current value of the field the trigger is watching
-
getDateCreated
public final org.joda.time.DateTime getDateCreated()
Returns The The RFC 2822 date and time in GMT that the resource was created.- Returns:
- The RFC 2822 date and time in GMT that the resource was created
-
getDateFired
public final org.joda.time.DateTime getDateFired()
Returns The The RFC 2822 date and time in GMT that the trigger was last fired.- Returns:
- The RFC 2822 date and time in GMT that the trigger was last fired
-
getDateUpdated
public final org.joda.time.DateTime getDateUpdated()
Returns The The RFC 2822 date and time in GMT that the resource was last updated.- Returns:
- The RFC 2822 date and time in GMT that the resource was last updated
-
getFriendlyName
public final String getFriendlyName()
Returns The The string that you assigned to describe the trigger.- Returns:
- The string that you assigned to describe the trigger
-
getRecurring
public final Trigger.Recurring getRecurring()
Returns The The frequency of a recurring UsageTrigger.- Returns:
- The frequency of a recurring UsageTrigger
-
getSid
public final String getSid()
Returns The The unique string that identifies the resource.- Returns:
- The unique string that identifies the resource
-
getTriggerBy
public final Trigger.TriggerField getTriggerBy()
Returns The The field in the UsageRecord resource that fires the trigger.- Returns:
- The field in the UsageRecord resource that fires the trigger
-
getTriggerValue
public final String getTriggerValue()
Returns The The value at which the trigger will fire.- Returns:
- The value at which the trigger will fire
-
getUri
public final String getUri()
Returns The The URI of the resource, relative to `https://api.twilio.com`.- Returns:
- The URI of the resource, relative to `https://api.twilio.com`
-
getUsageCategory
public final Trigger.UsageCategory getUsageCategory()
Returns The The usage category the trigger watches.- Returns:
- The usage category the trigger watches
-
getUsageRecordUri
public final String getUsageRecordUri()
Returns The The URI of the UsageRecord resource this trigger watches.- Returns:
- The URI of the UsageRecord resource this trigger watches
-
-