All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softlayer.api.service.Notification Maven / Gradle / Ivy

The newest version!
package com.softlayer.api.service;

import com.softlayer.api.ApiClient;
import com.softlayer.api.ResponseHandler;
import com.softlayer.api.annotation.ApiMethod;
import com.softlayer.api.annotation.ApiProperty;
import com.softlayer.api.annotation.ApiType;
import com.softlayer.api.service.Entity;
import com.softlayer.api.service.notification.Preference;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Future;

/**
 * Details provided for the notification are basic.  Details such as the related preferences, name and keyname for the notification can be retrieved.  The keyname property for the notification can be used to refer to a notification when integrating into the SoftLayer Notification system.  The name property can used more for display purposes. 
 *
 * @see SoftLayer_Notification
 */
@ApiType("SoftLayer_Notification")
public class Notification extends Entity {

    /**
     * The preferences related to the notification. These are preferences are configurable and optional for subscribers to use.
     */
    @ApiProperty
    protected List preferences;

    public List getPreferences() {
        if (preferences == null) {
            preferences = new ArrayList();
        }
        return preferences;
    }

    /**
     * The required preferences related to the notification. While configurable, the subscriber does not have the option whether to use the preference.
     */
    @ApiProperty
    protected List requiredPreferences;

    public List getRequiredPreferences() {
        if (requiredPreferences == null) {
            requiredPreferences = new ArrayList();
        }
        return requiredPreferences;
    }

    /**
     * Unique identifier for the notification. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        idSpecified = true;
        this.id = id;
    }

    protected boolean idSpecified;

    public boolean isIdSpecified() {
        return idSpecified;
    }

    public void unsetId() {
        id = null;
        idSpecified = false;
    }

    /**
     * Name that can be used by external systems to refer to a notification. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String keyName;

    public String getKeyName() {
        return keyName;
    }

    public void setKeyName(String keyName) {
        keyNameSpecified = true;
        this.keyName = keyName;
    }

    protected boolean keyNameSpecified;

    public boolean isKeyNameSpecified() {
        return keyNameSpecified;
    }

    public void unsetKeyName() {
        keyName = null;
        keyNameSpecified = false;
    }

    /**
     * Friendly name for the notification. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        nameSpecified = true;
        this.name = name;
    }

    protected boolean nameSpecified;

    public boolean isNameSpecified() {
        return nameSpecified;
    }

    public void unsetName() {
        name = null;
        nameSpecified = false;
    }

    /**
     * A count of the preferences related to the notification. These are preferences are configurable and optional for subscribers to use.
     */
    @ApiProperty
    protected Long preferenceCount;

    public Long getPreferenceCount() {
        return preferenceCount;
    }

    public void setPreferenceCount(Long preferenceCount) {
        this.preferenceCount = preferenceCount;
    }

    /**
     * A count of the required preferences related to the notification. While configurable, the subscriber does not have the option whether to use the preference.
     */
    @ApiProperty
    protected Long requiredPreferenceCount;

    public Long getRequiredPreferenceCount() {
        return requiredPreferenceCount;
    }

    public void setRequiredPreferenceCount(Long requiredPreferenceCount) {
        this.requiredPreferenceCount = requiredPreferenceCount;
    }

    public Service asService(ApiClient client) {
        return service(client, id);
    }

    public static Service service(ApiClient client) {
        return client.createService(Service.class, null);
    }

    public static Service service(ApiClient client, Long id) {
        return client.createService(Service.class, id == null ? null : id.toString());
    }

    /**
     * SoftLayer Customers can use this service to view all of the available notifications that can be subscribed to. Some of the notifications are required while others are not. 
     *
     * @see SoftLayer_Notification
     */
    @com.softlayer.api.annotation.ApiService("SoftLayer_Notification")
    public static interface Service extends com.softlayer.api.Service {

        public ServiceAsync asAsync();
        public Mask withNewMask();
        public Mask withMask();
        public void setMask(Mask mask);

        /**
         * Use this method to retrieve all active notifications that can be subscribed to. 
         *
         * @see SoftLayer_Notification::getAllObjects
         */
        @ApiMethod
        public List getAllObjects();

        /**
         * @see SoftLayer_Notification::getObject
         */
        @ApiMethod(instanceRequired = true)
        public Notification getObject();

        /**
         * The preferences related to the notification. These are preferences are configurable and optional for subscribers to use.
         *
         * @see SoftLayer_Notification::getPreferences
         */
        @ApiMethod(instanceRequired = true)
        public List getPreferences();

        /**
         * The required preferences related to the notification. While configurable, the subscriber does not have the option whether to use the preference.
         *
         * @see SoftLayer_Notification::getRequiredPreferences
         */
        @ApiMethod(instanceRequired = true)
        public List getRequiredPreferences();

    }

    public static interface ServiceAsync extends com.softlayer.api.ServiceAsync {

        public Mask withNewMask();
        public Mask withMask();
        public void setMask(Mask mask);

        /**
         * Async version of {@link Service#getAllObjects}
         */
        public Future> getAllObjects();

        public Future getAllObjects(ResponseHandler> callback);

        /**
         * Async version of {@link Service#getObject}
         */
        public Future getObject();

        public Future getObject(ResponseHandler callback);

        /**
         * Async version of {@link Service#getPreferences}
         */
        public Future> getPreferences();

        /**
         * Async callback version of {@link Service#getPreferences}
         */
        public Future getPreferences(ResponseHandler> callback);

        /**
         * Async version of {@link Service#getRequiredPreferences}
         */
        public Future> getRequiredPreferences();

        /**
         * Async callback version of {@link Service#getRequiredPreferences}
         */
        public Future getRequiredPreferences(ResponseHandler> callback);

    }

    public static class Mask extends Entity.Mask {

        public com.softlayer.api.service.notification.Preference.Mask preferences() {
            return withSubMask("preferences", com.softlayer.api.service.notification.Preference.Mask.class);
        }

        public com.softlayer.api.service.notification.Preference.Mask requiredPreferences() {
            return withSubMask("requiredPreferences", com.softlayer.api.service.notification.Preference.Mask.class);
        }

        public Mask id() {
            withLocalProperty("id");
            return this;
        }

        public Mask keyName() {
            withLocalProperty("keyName");
            return this;
        }

        public Mask name() {
            withLocalProperty("name");
            return this;
        }

        public Mask preferenceCount() {
            withLocalProperty("preferenceCount");
            return this;
        }

        public Mask requiredPreferenceCount() {
            withLocalProperty("requiredPreferenceCount");
            return this;
        }

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy