Class ObjectsResource


  • public final class ObjectsResource
    extends java.lang.Object
    • 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
      • 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
      • bulkAddSubscriptions

        public BulkOperation bulkAddSubscriptions​(java.lang.String collection,
                                                  java.util.List<BulkAddObjectSubscriptionRequest> subscriptions)
        Creates and returns a BulkOperation to create subscriptions for a set of recipients to a set of objects within the given collection.
        Parameters:
        collection -
        subscriptions -
        Returns:
        a bulk operation
      • 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:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object