Interface Subscriber.Service
- All Superinterfaces:
Maskable
,ResultLimitable
,Service
- All Known Subinterfaces:
Billing.Service
,Mobile.Service
- Enclosing class:
- Subscriber
@ApiService("SoftLayer_Notification_User_Subscriber") public static interface Subscriber.Service extends Service
SoftLayer Customers can subscribe to receive notifications for various notification types. This service also allows you to "turn on" or "turn off" notification messages sent to a subscriber for certain notifications.
- See Also:
- SoftLayer_Notification_User_Subscriber
-
Method Summary
Modifier and Type Method Description Subscriber.ServiceAsync
asAsync()
Get an async version of this serviceBoolean
createObject(Subscriber templateObject)
Use the method to create a new subscription for a notification.Boolean
editObject(Subscriber templateObject)
The subscriber's subscription status can be "turned off" or "turned on" if the subscription is not required.List<Method>
getDeliveryMethods()
The delivery methods used to send the subscribed notification.Notification
getNotification()
Notification subscribed to.Subscriber
getObject()
List<Preference>
getPreferences()
Associated subscriber preferences used for the notification subscription.List<Preference>
getPreferencesDetails()
Preference details such as description, minimum and maximum limits, default value and unit of measure.Resource
getResourceRecord()
The subscriber id to resource id mapping.Customer
getUserRecord()
User record for the subscription.void
setMask(Subscriber.Mask mask)
Subscriber.Mask
withMask()
Use the existing mask on this service or create it if not presentSubscriber.Mask
withNewMask()
Overwrite the existing mask on this service with a new one and return itMethods inherited from interface com.softlayer.api.ResultLimitable
getLastResponseTotalItemCount, getResultLimit, setResultLimit
-
Method Details
-
asAsync
Subscriber.ServiceAsync asAsync()Description copied from interface:Service
Get an async version of this service -
withNewMask
Subscriber.Mask withNewMask()Description copied from interface:Maskable
Overwrite the existing mask on this service with a new one and return it- Specified by:
withNewMask
in interfaceMaskable
-
withMask
Subscriber.Mask withMask()Description copied from interface:Maskable
Use the existing mask on this service or create it if not present -
setMask
-
createObject
Use the method to create a new subscription for a notification. This method is the entry method to the notification system. Certain properties are required to create a subscription while others are optional.
The required property is the resourceRecord property which is type SoftLayer_Notification_User_Subscriber_Resource. For the resourceRecord property, the only property that needs to be populated is the resourceTableId. The resourceTableId is the unique identifier of a SoftLayer service to create the subscription for. For example, the unique identifier of the Storage Evault service to create the subscription on.
Optional properties that can be set is the preferences property. The preference property is an array SoftLayer_Notification_User_Subscriber_Preference. By default, the system will populate the preferences with the default values if no preferences are passed in. The preferences passed in must be the preferences related to the notification subscribing to. The notification preferences and preference details (such as minimum and maximum values) can be retrieved using the SoftLayer_Notification service. The properties that need to be populated for preferences are the notificationPreferenceId and value.
For example to create a subscriber for a Storage EVault service to be notified 15 times during a billing cycle and to be notified when the vault usage reaches 85% of its allowed capacity use the following structure:
*userRecordId = 1111
*notificationId = 3
*resourceRecord
**resourceTableId = 1234
*preferences[1]
**notificationPreferenceId = 2
**value = 85
*preference[2]
**notificationPreferenceId = 3
**value = 15
-
editObject
The subscriber's subscription status can be "turned off" or "turned on" if the subscription is not required.
Subscriber preferences may also be edited. To edit the preferences, you must pass in the id off the preferences to edit. Here is an example of structure to pass in. In this example, the structure will set the subscriber status to active and the threshold preference to 90 and the limit preference to 20
*id = 1111
*active = 1
*preferences[1]
**id = 11
**value = 90
*preference[2]
**id = 12
**value = 20 -
getObject
-
getDeliveryMethods
The delivery methods used to send the subscribed notification. -
getNotification
Notification subscribed to. -
getPreferences
Associated subscriber preferences used for the notification subscription. For example, preferences include number of deliveries (limit) and threshold. -
getPreferencesDetails
Preference details such as description, minimum and maximum limits, default value and unit of measure. -
getResourceRecord
The subscriber id to resource id mapping. -
getUserRecord
User record for the subscription.
-