@BoxResourceType(value="webhook") public class BoxWebHook extends BoxResource
Modifier and Type | Class and Description |
---|---|
class |
BoxWebHook.Info
Contains information for a
BoxWebHook instance. |
static class |
BoxWebHook.Target
WebHook target - file or folder.
|
static class |
BoxWebHook.Trigger
A Box related triggers.
|
Modifier and Type | Field and Description |
---|---|
static URLTemplate |
WEBHOOK_URL_TEMPLATE
URLTemplate for single BoxWebHook resource. |
static URLTemplate |
WEBHOOKS_URL_TEMPLATE
URLTemplate for BoxWebHook s resource. |
Constructor and Description |
---|
BoxWebHook(BoxAPIConnection api,
String id)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static Iterable<BoxWebHook.Info> |
all(BoxAPIConnection api)
Returns iterator over all
BoxWebHook -s. |
static Iterable<BoxWebHook.Info> |
all(BoxAPIConnection api,
String... fields)
Returns iterator over all
BoxWebHook -s. |
static BoxWebHook.Info |
create(BoxResource target,
URL address,
BoxWebHook.Trigger... triggers)
Adds a
BoxWebHook to a provided BoxResource . |
static BoxWebHook.Info |
create(BoxResource target,
URL address,
Set<BoxWebHook.Trigger> triggers)
Adds a
BoxWebHook to a provided BoxResource . |
void |
delete()
Deletes this webhook.
|
BoxWebHook.Info |
getInfo(String... fields) |
void |
updateInfo(BoxWebHook.Info info)
Updates
BoxWebHook information. |
static void |
validateTriggers(String targetType,
Collection<BoxWebHook.Trigger> triggers)
Validates that provided
BoxWebHook.Trigger -s can be applied on the provided BoxResourceType . |
equals, getAPI, getID, getResourceType, hashCode
public static final URLTemplate WEBHOOKS_URL_TEMPLATE
URLTemplate
for BoxWebHook
s resource.public static final URLTemplate WEBHOOK_URL_TEMPLATE
URLTemplate
for single BoxWebHook
resource.public BoxWebHook(BoxAPIConnection api, String id)
api
- BoxResource.getAPI()
id
- BoxResource.getID()
public static BoxWebHook.Info create(BoxResource target, URL address, BoxWebHook.Trigger... triggers)
BoxWebHook
to a provided BoxResource
.target
- BoxResource
web resourceaddress
- URL
where the notification should send totriggers
- events this BoxWebHook
is interested inBoxWebHook
create(BoxResource, URL, Set)
public static BoxWebHook.Info create(BoxResource target, URL address, Set<BoxWebHook.Trigger> triggers)
BoxWebHook
to a provided BoxResource
.target
- BoxResource
web resourceaddress
- URL
where the notification should send totriggers
- events this BoxWebHook
is interested inBoxWebHook
create(BoxResource, URL, Trigger...)
public static Iterable<BoxWebHook.Info> all(BoxAPIConnection api)
BoxWebHook
-s.api
- the API connection to be used by the resourceBoxWebHook.Info
-spublic static Iterable<BoxWebHook.Info> all(BoxAPIConnection api, String... fields)
BoxWebHook
-s.api
- the API connection to be used by the resourcefields
- the fields to retrieve.BoxWebHook.Info
-spublic static void validateTriggers(String targetType, Collection<BoxWebHook.Trigger> triggers)
BoxWebHook.Trigger
-s can be applied on the provided BoxResourceType
.targetType
- on which target the triggers should be applied totriggers
- for checkvalidateTrigger(String, Trigger)
public BoxWebHook.Info getInfo(String... fields)
fields
- the fields to retrieve.BoxWebHook
.public void updateInfo(BoxWebHook.Info info)
BoxWebHook
information.info
- new statepublic void delete()