Package app.knock.api.resources
Class ObjectsResource
- java.lang.Object
-
- app.knock.api.resources.ObjectsResource
-
public final class ObjectsResource extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classObjectsResource.ListParamsstatic classObjectsResource.ListSubscriptionParams
-
Constructor Summary
Constructors Constructor Description ObjectsResource(KnockHttp knockHttp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ObjectSubscription>addSubscriptions(java.lang.String collection, java.lang.String objectId, AddSubscriptionsRequest addSubscriptionsRequest)Adds subscriptions to an object for recipientsBulkOperationbulkDeleteInCollection(java.lang.String collection, java.util.List<java.lang.String> object_ids)Bulk deletes up to 100 objects at a time within a collection, returning an asynchronous BulkOperation that can be used to monitor the progress of the operation.BulkOperationbulkSetInCollection(java.lang.String collection, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> objects)Bulk sets up to 100 objects at a time within a collection, returning an asynchronous BulkOperation that can be used to monitor the progress of the operation.voiddelete(java.lang.String collection, java.lang.String objectId)Delete properties for a specific collection of a KnockObjectjava.util.List<ObjectSubscription>deleteSubscriptions(java.lang.String collection, java.lang.String objectId, DeleteSubscriptionsRequest deleteSubscriptionsRequest)Adds subscriptions to an object for recipientsbooleanequals(java.lang.Object o)KnockObjectget(java.lang.String collection, java.lang.String objectId)Retrieve a KnockObjectChannelDatagetChannelData(java.lang.String collection, java.lang.String objectId, java.lang.String channelId)Retrieve the ChannelData for a specific KnockObject Collection, and Channel.KnockHttpgetKnockHttp()CursorResult<KnockMessage>getMessages(java.lang.String collection, java.lang.String objectId, MessagesResource.QueryParams queryParams)Retrieve a CursorResult of KnockMessages for a specific KnockObject Collection.java.util.List<PreferenceSet>getPreferences(java.lang.String collection, java.lang.String objectId)Retrieve a list of PreferenceSets for a specific KnockObject Collection.PreferenceSetgetPreferencesById(java.lang.String collection, java.lang.String objectId, java.lang.String preferenceId)Retrieve a specific PreferenceSet for a KnockObject CollectionCursorResult<Schedule>getSchedules(java.lang.String collection, java.lang.String objectId, WorkflowsResource.SchedulesQueryParams queryParams)Retrieve a CursorResult of Schedules for a specific KnockObject Collection.CursorResult<ObjectSubscription>getSubscriptions(java.lang.String collection, java.lang.String objectId, ObjectsResource.ListSubscriptionParams queryParams)Retrieve a CursorResult of ObjectSubscriptions for a specific KnockObject as recipient.inthashCode()CursorResult<KnockObject>list(java.lang.String collection, ObjectsResource.ListParams queryParams)Retrieve paginated list of KnockObjectCursorResult<ObjectSubscription>listSubscriptions(java.lang.String collection, java.lang.String objectId, ObjectsResource.ListSubscriptionParams queryParams)Retrieve a CursorResult of ObjectSubscriptions for a Knock Object.KnockObjectset(java.lang.String collection, java.lang.String objectId, java.util.Map<java.lang.String,java.lang.Object> properties)Set a map of properties for a specific Collection of a KnockObject.ChannelDatasetChannelData(java.lang.String collection, java.lang.String objectId, java.lang.String channelId, java.util.Map<java.lang.String,java.lang.Object> data)Set a map of data for a specific KnockObject Collection, and Channel.PreferenceSetsetPreferences(java.lang.String collection, java.lang.String objectId, java.lang.String preferenceId, PreferenceSetRequest preferenceSetRequest)Set preferences for a specific PreferenceSet on a KnockObject Collection.java.lang.StringtoString()voidunsetChannelData(java.lang.String collection, java.lang.String objectId, java.lang.String channelId)Delete any data for a specific KnockObject Collection, and Channel.
-
-
-
Constructor Detail
-
ObjectsResource
public ObjectsResource(KnockHttp knockHttp)
-
-
Method Detail
-
get
public KnockObject get(java.lang.String collection, java.lang.String objectId)
Retrieve a KnockObject- Parameters:
collection-objectId-- Returns:
- KnockObject
- Throws:
KnockClientResourceException- Unable able to retrieve KnockObject from the resource
-
list
public CursorResult<KnockObject> list(java.lang.String collection, ObjectsResource.ListParams queryParams)
Retrieve paginated list of KnockObject- Parameters:
collection-queryParams-- Returns:
- KnockObject
- Throws:
KnockClientResourceException- Unable able to retrieve KnockObject from the resource
-
set
public KnockObject set(java.lang.String collection, java.lang.String objectId, java.util.Map<java.lang.String,java.lang.Object> properties)
Set a map of properties for a specific Collection of a KnockObject.- Parameters:
collection-objectId-properties-- Returns:
-
delete
public void delete(java.lang.String collection, java.lang.String objectId)Delete properties for a specific collection of a KnockObject- Parameters:
collection-objectId-
-
getChannelData
public ChannelData getChannelData(java.lang.String collection, java.lang.String objectId, java.lang.String channelId)
Retrieve the ChannelData for a specific KnockObject Collection, and Channel.- Parameters:
collection-objectId-channelId-- Returns:
-
setChannelData
public ChannelData setChannelData(java.lang.String collection, java.lang.String objectId, java.lang.String channelId, java.util.Map<java.lang.String,java.lang.Object> data)
Set a map of data for a specific KnockObject Collection, and Channel.- Parameters:
collection-objectId-channelId-data-- Returns:
-
unsetChannelData
public void unsetChannelData(java.lang.String collection, java.lang.String objectId, java.lang.String channelId)Delete any data for a specific KnockObject Collection, and Channel.- Parameters:
collection-objectId-channelId-
-
getMessages
public CursorResult<KnockMessage> getMessages(java.lang.String collection, java.lang.String objectId, MessagesResource.QueryParams queryParams)
Retrieve a CursorResult of KnockMessages for a specific KnockObject Collection.- Parameters:
collection-objectId-- Returns:
-
getSchedules
public CursorResult<Schedule> getSchedules(java.lang.String collection, java.lang.String objectId, WorkflowsResource.SchedulesQueryParams queryParams)
Retrieve a CursorResult of Schedules for a specific KnockObject Collection.- Parameters:
collection-objectId-- Returns:
-
listSubscriptions
public CursorResult<ObjectSubscription> listSubscriptions(java.lang.String collection, java.lang.String objectId, ObjectsResource.ListSubscriptionParams queryParams)
Retrieve a CursorResult of ObjectSubscriptions for a Knock Object.- Parameters:
collection-objectId-- Returns:
- cursor result of ObjectSubscription
-
getSubscriptions
public CursorResult<ObjectSubscription> getSubscriptions(java.lang.String collection, java.lang.String objectId, ObjectsResource.ListSubscriptionParams queryParams)
Retrieve a CursorResult of ObjectSubscriptions for a specific KnockObject as recipient.- Parameters:
collection-objectId-- Returns:
- cursor result of ObjectSubscription
-
addSubscriptions
public java.util.List<ObjectSubscription> addSubscriptions(java.lang.String collection, java.lang.String objectId, AddSubscriptionsRequest addSubscriptionsRequest)
Adds subscriptions to an object for recipients- Parameters:
addSubscriptionsRequest- Attributes for schedules creation- Returns:
- List of created object subscriptions
- Throws:
KnockClientResourceException
-
deleteSubscriptions
public java.util.List<ObjectSubscription> deleteSubscriptions(java.lang.String collection, java.lang.String objectId, DeleteSubscriptionsRequest deleteSubscriptionsRequest)
Adds subscriptions to an object for recipients- Parameters:
deleteSubscriptionsRequest- Attributes for schedules deletion- Returns:
- List of deleted object subscriptions
- Throws:
KnockClientResourceException
-
getPreferences
public java.util.List<PreferenceSet> getPreferences(java.lang.String collection, java.lang.String objectId)
Retrieve a list of PreferenceSets for a specific KnockObject Collection.- Parameters:
collection-objectId-- Returns:
-
getPreferencesById
public PreferenceSet getPreferencesById(java.lang.String collection, java.lang.String objectId, java.lang.String preferenceId)
Retrieve a specific PreferenceSet for a KnockObject Collection- Parameters:
collection-objectId-preferenceId-- Returns:
-
setPreferences
public PreferenceSet setPreferences(java.lang.String collection, java.lang.String objectId, java.lang.String preferenceId, PreferenceSetRequest preferenceSetRequest)
Set preferences for a specific PreferenceSet on a KnockObject Collection.- Parameters:
collection-objectId-preferenceId-preferenceSetRequest-- Returns:
-
bulkSetInCollection
public BulkOperation bulkSetInCollection(java.lang.String collection, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> objects)
Bulk sets up to 100 objects at a time within a collection, returning an asynchronous BulkOperation that can be used to monitor the progress of the operation.Each object map in the objects list must have a key of 'id' that has a non-null string value.
- Parameters:
collection-objects-- Returns:
- a bulk operation
-
bulkDeleteInCollection
public BulkOperation bulkDeleteInCollection(java.lang.String collection, java.util.List<java.lang.String> object_ids)
Bulk deletes up to 100 objects at a time within a collection, returning an asynchronous BulkOperation that can be used to monitor the progress of the operation.- Parameters:
collection-object_ids-- Returns:
- a bulk operation
-
getKnockHttp
public KnockHttp getKnockHttp()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-