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

com.softlayer.api.service.notification.occurrence.Event Maven / Gradle / Ivy

There is a newer version: 0.3.4
Show newest version
package com.softlayer.api.service.notification.occurrence;

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.occurrence.Account;
import com.softlayer.api.service.notification.occurrence.Resource;
import com.softlayer.api.service.notification.occurrence.Update;
import com.softlayer.api.service.notification.occurrence.User;
import com.softlayer.api.service.notification.occurrence.event.Attachment;
import com.softlayer.api.service.notification.occurrence.event.Type;
import com.softlayer.api.service.notification.occurrence.status.Code;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;

/**
 * The [[SoftLayer_Notification_Occurrence_Event]] service represents all events with potential to cause a disruption in service. 
 *
 * @see SoftLayer_Notification_Occurrence_Event
 */
@ApiType("SoftLayer_Notification_Occurrence_Event")
public class Event extends Entity {

    /**
     * Indicates whether or not this event has been acknowledged by the user.
     */
    @ApiProperty
    protected Boolean acknowledgedFlag;

    public Boolean getAcknowledgedFlag() {
        return acknowledgedFlag;
    }

    public void setAcknowledgedFlag(Boolean acknowledgedFlag) {
        this.acknowledgedFlag = acknowledgedFlag;
    }

    /**
     * A collection of attachments for this event which provide supplementary information to impacted users some examples are RFO (Reason For Outage) and root cause analysis documents.
     */
    @ApiProperty
    protected List attachments;

    public List getAttachments() {
        if (attachments == null) {
            attachments = new ArrayList();
        }
        return attachments;
    }

    /**
     * The first update for this event.
     */
    @ApiProperty
    protected Update firstUpdate;

    public Update getFirstUpdate() {
        return firstUpdate;
    }

    public void setFirstUpdate(Update firstUpdate) {
        this.firstUpdate = firstUpdate;
    }

    /**
     * A collection of accounts impacted by this event. Each impacted account record relates directly to a [[SoftLayer_Account]].
     */
    @ApiProperty
    protected List impactedAccounts;

    public List getImpactedAccounts() {
        if (impactedAccounts == null) {
            impactedAccounts = new ArrayList();
        }
        return impactedAccounts;
    }

    /**
     * A collection of resources impacted by this event. Each record will relate to some physical resource that the user has access to such as [[SoftLayer_Hardware]] or [[SoftLayer_Virtual_Guest]].
     */
    @ApiProperty
    protected List impactedResources;

    public List getImpactedResources() {
        if (impactedResources == null) {
            impactedResources = new ArrayList();
        }
        return impactedResources;
    }

    /**
     * A collection of users impacted by this event. Each impacted user record relates directly to a [[SoftLayer_User_Customer]].
     */
    @ApiProperty
    protected List impactedUsers;

    public List getImpactedUsers() {
        if (impactedUsers == null) {
            impactedUsers = new ArrayList();
        }
        return impactedUsers;
    }

    /**
     * The last update for this event.
     */
    @ApiProperty
    protected Update lastUpdate;

    public Update getLastUpdate() {
        return lastUpdate;
    }

    public void setLastUpdate(Update lastUpdate) {
        this.lastUpdate = lastUpdate;
    }

    /**
     * The type of event such as planned or unplanned maintenance.
     */
    @ApiProperty
    protected Type notificationOccurrenceEventType;

    public Type getNotificationOccurrenceEventType() {
        return notificationOccurrenceEventType;
    }

    public void setNotificationOccurrenceEventType(Type notificationOccurrenceEventType) {
        this.notificationOccurrenceEventType = notificationOccurrenceEventType;
    }

    @ApiProperty
    protected Code statusCode;

    public Code getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(Code statusCode) {
        this.statusCode = statusCode;
    }

    /**
     * All updates for this event.
     */
    @ApiProperty
    protected List updates;

    public List getUpdates() {
        if (updates == null) {
            updates = new ArrayList();
        }
        return updates;
    }

    /**
     * When this event will end.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected GregorianCalendar endDate;

    public GregorianCalendar getEndDate() {
        return endDate;
    }

    public void setEndDate(GregorianCalendar endDate) {
        endDateSpecified = true;
        this.endDate = endDate;
    }

    protected boolean endDateSpecified;

    public boolean isEndDateSpecified() {
        return endDateSpecified;
    }

    public void unsetEndDate() {
        endDate = null;
        endDateSpecified = false;
    }

    /**
     * Unique identifier for this event.
     */
    @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;
    }

    /**
     * Latest count of users impacted by this event.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long lastImpactedUserCount;

    public Long getLastImpactedUserCount() {
        return lastImpactedUserCount;
    }

    public void setLastImpactedUserCount(Long lastImpactedUserCount) {
        lastImpactedUserCountSpecified = true;
        this.lastImpactedUserCount = lastImpactedUserCount;
    }

    protected boolean lastImpactedUserCountSpecified;

    public boolean isLastImpactedUserCountSpecified() {
        return lastImpactedUserCountSpecified;
    }

    public void unsetLastImpactedUserCount() {
        lastImpactedUserCount = null;
        lastImpactedUserCountSpecified = false;
    }

    /**
     * When this event was last updated.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected GregorianCalendar modifyDate;

    public GregorianCalendar getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(GregorianCalendar modifyDate) {
        modifyDateSpecified = true;
        this.modifyDate = modifyDate;
    }

    protected boolean modifyDateSpecified;

    public boolean isModifyDateSpecified() {
        return modifyDateSpecified;
    }

    public void unsetModifyDate() {
        modifyDate = null;
        modifyDateSpecified = false;
    }

    @ApiProperty(canBeNullOrNotSet = true)
    protected Long recoveryTime;

    public Long getRecoveryTime() {
        return recoveryTime;
    }

    public void setRecoveryTime(Long recoveryTime) {
        recoveryTimeSpecified = true;
        this.recoveryTime = recoveryTime;
    }

    protected boolean recoveryTimeSpecified;

    public boolean isRecoveryTimeSpecified() {
        return recoveryTimeSpecified;
    }

    public void unsetRecoveryTime() {
        recoveryTime = null;
        recoveryTimeSpecified = false;
    }

    /**
     * When this event started.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected GregorianCalendar startDate;

    public GregorianCalendar getStartDate() {
        return startDate;
    }

    public void setStartDate(GregorianCalendar startDate) {
        startDateSpecified = true;
        this.startDate = startDate;
    }

    protected boolean startDateSpecified;

    public boolean isStartDateSpecified() {
        return startDateSpecified;
    }

    public void unsetStartDate() {
        startDate = null;
        startDateSpecified = false;
    }

    /**
     * Brief description of this event.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String subject;

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        subjectSpecified = true;
        this.subject = subject;
    }

    protected boolean subjectSpecified;

    public boolean isSubjectSpecified() {
        return subjectSpecified;
    }

    public void unsetSubject() {
        subject = null;
        subjectSpecified = false;
    }

    /**
     * Details of this event.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String summary;

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        summarySpecified = true;
        this.summary = summary;
    }

    protected boolean summarySpecified;

    public boolean isSummarySpecified() {
        return summarySpecified;
    }

    public void unsetSummary() {
        summary = null;
        summarySpecified = false;
    }

    /**
     * Unique identifier for the [[SoftLayer_Ticket]] associated with this event.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long systemTicketId;

    public Long getSystemTicketId() {
        return systemTicketId;
    }

    public void setSystemTicketId(Long systemTicketId) {
        systemTicketIdSpecified = true;
        this.systemTicketId = systemTicketId;
    }

    protected boolean systemTicketIdSpecified;

    public boolean isSystemTicketIdSpecified() {
        return systemTicketIdSpecified;
    }

    public void unsetSystemTicketId() {
        systemTicketId = null;
        systemTicketIdSpecified = false;
    }

    /**
     * A count of a collection of attachments for this event which provide supplementary information to impacted users some examples are RFO (Reason For Outage) and root cause analysis documents.
     */
    @ApiProperty
    protected Long attachmentCount;

    public Long getAttachmentCount() {
        return attachmentCount;
    }

    public void setAttachmentCount(Long attachmentCount) {
        this.attachmentCount = attachmentCount;
    }

    /**
     * A count of a collection of accounts impacted by this event. Each impacted account record relates directly to a [[SoftLayer_Account]].
     */
    @ApiProperty
    protected Long impactedAccountCount;

    public Long getImpactedAccountCount() {
        return impactedAccountCount;
    }

    public void setImpactedAccountCount(Long impactedAccountCount) {
        this.impactedAccountCount = impactedAccountCount;
    }

    /**
     * A count of a collection of resources impacted by this event. Each record will relate to some physical resource that the user has access to such as [[SoftLayer_Hardware]] or [[SoftLayer_Virtual_Guest]].
     */
    @ApiProperty
    protected Long impactedResourceCount;

    public Long getImpactedResourceCount() {
        return impactedResourceCount;
    }

    public void setImpactedResourceCount(Long impactedResourceCount) {
        this.impactedResourceCount = impactedResourceCount;
    }

    /**
     * A count of a collection of users impacted by this event. Each impacted user record relates directly to a [[SoftLayer_User_Customer]].
     */
    @ApiProperty
    protected Long impactedUserCount;

    public Long getImpactedUserCount() {
        return impactedUserCount;
    }

    public void setImpactedUserCount(Long impactedUserCount) {
        this.impactedUserCount = impactedUserCount;
    }

    /**
     * A count of all updates for this event.
     */
    @ApiProperty
    protected Long updateCount;

    public Long getUpdateCount() {
        return updateCount;
    }

    public void setUpdateCount(Long updateCount) {
        this.updateCount = updateCount;
    }

    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());
    }

    /**
     * The [[SoftLayer_Notification_Occurrence_Event]] service represents all events with potential to cause a disruption in service. 
     *
     * @see SoftLayer_Notification_Occurrence_Event
     */
    @com.softlayer.api.annotation.ApiService("SoftLayer_Notification_Occurrence_Event")
    public static interface Service extends com.softlayer.api.Service {

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

        /**
         * <<<< EOT
         *
         * @see SoftLayer_Notification_Occurrence_Event::acknowledgeNotification
         */
        @ApiMethod(instanceRequired = true)
        public Boolean acknowledgeNotification();

        /**
         * @see SoftLayer_Notification_Occurrence_Event::getAllObjects
         */
        @ApiMethod
        public List getAllObjects();

        /**
         * Retrieve the contents of the file attached to a SoftLayer event by it's given identifier. 
         *
         * @see SoftLayer_Notification_Occurrence_Event::getAttachedFile
         */
        @ApiMethod(instanceRequired = true)
        public byte[] getAttachedFile(Long attachmentId);

        /**
         * This method will return the number of impacted owned accounts associated with this event for the current user. 
         *
         * @see SoftLayer_Notification_Occurrence_Event::getImpactedAccountCount
         */
        @ApiMethod(instanceRequired = true)
        public Long getImpactedAccountCount();

        /**
         * This method will return the number of impacted devices associated with this event for the current user. 
         *
         * @see SoftLayer_Notification_Occurrence_Event::getImpactedDeviceCount
         */
        @ApiMethod(instanceRequired = true)
        public Long getImpactedDeviceCount();

        /**
         * This method will return a collection of SoftLayer_Notification_Occurrence_Resource objects which is a listing of the current users' impacted devices that are associated with this event. 
         *
         * @see SoftLayer_Notification_Occurrence_Event::getImpactedDevices
         */
        @ApiMethod(instanceRequired = true)
        public List getImpactedDevices();

        /**
         * @see SoftLayer_Notification_Occurrence_Event::getObject
         */
        @ApiMethod(instanceRequired = true)
        public Event getObject();

        /**
         * Indicates whether or not this event has been acknowledged by the user.
         *
         * @see SoftLayer_Notification_Occurrence_Event::getAcknowledgedFlag
         */
        @ApiMethod(instanceRequired = true)
        public Boolean getAcknowledgedFlag();

        /**
         * A collection of attachments for this event which provide supplementary information to impacted users some examples are RFO (Reason For Outage) and root cause analysis documents.
         *
         * @see SoftLayer_Notification_Occurrence_Event::getAttachments
         */
        @ApiMethod(instanceRequired = true)
        public List getAttachments();

        /**
         * The first update for this event.
         *
         * @see SoftLayer_Notification_Occurrence_Event::getFirstUpdate
         */
        @ApiMethod(instanceRequired = true)
        public Update getFirstUpdate();

        /**
         * A collection of accounts impacted by this event. Each impacted account record relates directly to a [[SoftLayer_Account]].
         *
         * @see SoftLayer_Notification_Occurrence_Event::getImpactedAccounts
         */
        @ApiMethod(instanceRequired = true)
        public List getImpactedAccounts();

        /**
         * A collection of resources impacted by this event. Each record will relate to some physical resource that the user has access to such as [[SoftLayer_Hardware]] or [[SoftLayer_Virtual_Guest]].
         *
         * @see SoftLayer_Notification_Occurrence_Event::getImpactedResources
         */
        @ApiMethod(instanceRequired = true)
        public List getImpactedResources();

        /**
         * A collection of users impacted by this event. Each impacted user record relates directly to a [[SoftLayer_User_Customer]].
         *
         * @see SoftLayer_Notification_Occurrence_Event::getImpactedUsers
         */
        @ApiMethod(instanceRequired = true)
        public List getImpactedUsers();

        /**
         * The last update for this event.
         *
         * @see SoftLayer_Notification_Occurrence_Event::getLastUpdate
         */
        @ApiMethod(instanceRequired = true)
        public Update getLastUpdate();

        /**
         * The type of event such as planned or unplanned maintenance.
         *
         * @see SoftLayer_Notification_Occurrence_Event::getNotificationOccurrenceEventType
         */
        @ApiMethod(instanceRequired = true)
        public Type getNotificationOccurrenceEventType();

        /**
         * @see SoftLayer_Notification_Occurrence_Event::getStatusCode
         */
        @ApiMethod(instanceRequired = true)
        public Code getStatusCode();

        /**
         * All updates for this event.
         *
         * @see SoftLayer_Notification_Occurrence_Event::getUpdates
         */
        @ApiMethod(instanceRequired = true)
        public List getUpdates();

    }

    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#acknowledgeNotification}
         */
        public Future acknowledgeNotification();

        public Future acknowledgeNotification(ResponseHandler callback);

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

        public Future getAllObjects(ResponseHandler> callback);

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

        public Future getAttachedFile(Long attachmentId, ResponseHandler callback);

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

        public Future getImpactedAccountCount(ResponseHandler callback);

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

        public Future getImpactedDeviceCount(ResponseHandler callback);

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

        public Future getImpactedDevices(ResponseHandler> callback);

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

        public Future getObject(ResponseHandler callback);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    }

    public static class Mask extends com.softlayer.api.service.Entity.Mask {

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

        public com.softlayer.api.service.notification.occurrence.event.Attachment.Mask attachments() {
            return withSubMask("attachments", com.softlayer.api.service.notification.occurrence.event.Attachment.Mask.class);
        }

        public Update.Mask firstUpdate() {
            return withSubMask("firstUpdate", Update.Mask.class);
        }

        public Account.Mask impactedAccounts() {
            return withSubMask("impactedAccounts", Account.Mask.class);
        }

        public Resource.Mask impactedResources() {
            return withSubMask("impactedResources", Resource.Mask.class);
        }

        public User.Mask impactedUsers() {
            return withSubMask("impactedUsers", User.Mask.class);
        }

        public Update.Mask lastUpdate() {
            return withSubMask("lastUpdate", Update.Mask.class);
        }

        public com.softlayer.api.service.notification.occurrence.event.Type.Mask notificationOccurrenceEventType() {
            return withSubMask("notificationOccurrenceEventType", com.softlayer.api.service.notification.occurrence.event.Type.Mask.class);
        }

        public com.softlayer.api.service.notification.occurrence.status.Code.Mask statusCode() {
            return withSubMask("statusCode", com.softlayer.api.service.notification.occurrence.status.Code.Mask.class);
        }

        public Update.Mask updates() {
            return withSubMask("updates", Update.Mask.class);
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    }

}