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

com.softlayer.api.service.user.permission.Role Maven / Gradle / Ivy

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

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.Account;
import com.softlayer.api.service.Entity;
import com.softlayer.api.service.user.Customer;
import com.softlayer.api.service.user.permission.Action;
import com.softlayer.api.service.user.permission.Group;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;

/**
 * @see SoftLayer_User_Permission_Role
 */
@ApiType("SoftLayer_User_Permission_Role")
public class Role extends Entity {

    @ApiProperty
    protected Account account;

    public Account getAccount() {
        return account;
    }

    public void setAccount(Account account) {
        this.account = account;
    }

    @ApiProperty
    protected List actions;

    public List getActions() {
        if (actions == null) {
            actions = new ArrayList();
        }
        return actions;
    }

    @ApiProperty
    protected List groups;

    public List getGroups() {
        if (groups == null) {
            groups = new ArrayList();
        }
        return groups;
    }

    @ApiProperty
    protected List users;

    public List getUsers() {
        if (users == null) {
            users = new ArrayList();
        }
        return users;
    }

    /**
     * A permission roles associated [[SoftLayer_Account|customer account]] id.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long accountId;

    public Long getAccountId() {
        return accountId;
    }

    public void setAccountId(Long accountId) {
        accountIdSpecified = true;
        this.accountId = accountId;
    }

    protected boolean accountIdSpecified;

    public boolean isAccountIdSpecified() {
        return accountIdSpecified;
    }

    public void unsetAccountId() {
        accountId = null;
        accountIdSpecified = false;
    }

    /**
     * The date the permission role record was created.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected GregorianCalendar createDate;

    public GregorianCalendar getCreateDate() {
        return createDate;
    }

    public void setCreateDate(GregorianCalendar createDate) {
        createDateSpecified = true;
        this.createDate = createDate;
    }

    protected boolean createDateSpecified;

    public boolean isCreateDateSpecified() {
        return createDateSpecified;
    }

    public void unsetCreateDate() {
        createDate = null;
        createDateSpecified = false;
    }

    /**
     * The description of the permission role.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String description;

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        descriptionSpecified = true;
        this.description = description;
    }

    protected boolean descriptionSpecified;

    public boolean isDescriptionSpecified() {
        return descriptionSpecified;
    }

    public void unsetDescription() {
        description = null;
        descriptionSpecified = false;
    }

    /**
     * A permission roles internal identifying number.
     */
    @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;
    }

    /**
     * The date the permission role record was last modified.
     */
    @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;
    }

    /**
     * The name of the permission role.
     */
    @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 flag showing if new users should be automatically added to this role.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long newUserDefaultFlag;

    public Long getNewUserDefaultFlag() {
        return newUserDefaultFlag;
    }

    public void setNewUserDefaultFlag(Long newUserDefaultFlag) {
        newUserDefaultFlagSpecified = true;
        this.newUserDefaultFlag = newUserDefaultFlag;
    }

    protected boolean newUserDefaultFlagSpecified;

    public boolean isNewUserDefaultFlagSpecified() {
        return newUserDefaultFlagSpecified;
    }

    public void unsetNewUserDefaultFlag() {
        newUserDefaultFlag = null;
        newUserDefaultFlagSpecified = false;
    }

    /**
     * A flag showing if the permission role was created by our internal system for a single user. If this flag is set, only a single user can be assigned to this permission role and it can not be deleted. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long systemFlag;

    public Long getSystemFlag() {
        return systemFlag;
    }

    public void setSystemFlag(Long systemFlag) {
        systemFlagSpecified = true;
        this.systemFlag = systemFlag;
    }

    protected boolean systemFlagSpecified;

    public boolean isSystemFlagSpecified() {
        return systemFlagSpecified;
    }

    public void unsetSystemFlag() {
        systemFlag = null;
        systemFlagSpecified = false;
    }

    /**
     * A count of 
     */
    @ApiProperty
    protected Long actionCount;

    public Long getActionCount() {
        return actionCount;
    }

    public void setActionCount(Long actionCount) {
        this.actionCount = actionCount;
    }

    /**
     * A count of 
     */
    @ApiProperty
    protected Long groupCount;

    public Long getGroupCount() {
        return groupCount;
    }

    public void setGroupCount(Long groupCount) {
        this.groupCount = groupCount;
    }

    /**
     * A count of 
     */
    @ApiProperty
    protected Long userCount;

    public Long getUserCount() {
        return userCount;
    }

    public void setUserCount(Long userCount) {
        this.userCount = userCount;
    }

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

    /**
     * @see SoftLayer_User_Permission_Role
     */
    @com.softlayer.api.annotation.ApiService("SoftLayer_User_Permission_Role")
    public static interface Service extends com.softlayer.api.Service {

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

        /**
         * @see SoftLayer_User_Permission_Role::addUser
         */
        @ApiMethod(instanceRequired = true)
        public Void addUser(Customer user);

        /**
         * @see SoftLayer_User_Permission_Role::createObject
         */
        @ApiMethod
        public Role createObject(Role templateObject);

        /**
         * @see SoftLayer_User_Permission_Role::deleteObject
         */
        @ApiMethod(instanceRequired = true)
        public Boolean deleteObject();

        /**
         * @see SoftLayer_User_Permission_Role::editObject
         */
        @ApiMethod(instanceRequired = true)
        public Role editObject(Role templateObject);

        /**
         * @see SoftLayer_User_Permission_Role::getObject
         */
        @ApiMethod(instanceRequired = true)
        public Role getObject();

        /**
         * @see SoftLayer_User_Permission_Role::linkGroup
         */
        @ApiMethod(instanceRequired = true)
        public Void linkGroup(Group group);

        /**
         * @see SoftLayer_User_Permission_Role::removeUser
         */
        @ApiMethod(instanceRequired = true)
        public Void removeUser(Customer user);

        /**
         * @see SoftLayer_User_Permission_Role::unlinkGroup
         */
        @ApiMethod(instanceRequired = true)
        public Void unlinkGroup(Group group);

        /**
         * @see SoftLayer_User_Permission_Role::getAccount
         */
        @ApiMethod(instanceRequired = true)
        public Account getAccount();

        /**
         * @see SoftLayer_User_Permission_Role::getActions
         */
        @ApiMethod(instanceRequired = true)
        public List getActions();

        /**
         * @see SoftLayer_User_Permission_Role::getGroups
         */
        @ApiMethod(instanceRequired = true)
        public List getGroups();

        /**
         * @see SoftLayer_User_Permission_Role::getUsers
         */
        @ApiMethod(instanceRequired = true)
        public List getUsers();

    }

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

        public Future addUser(Customer user, ResponseHandler callback);

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

        public Future createObject(Role templateObject, ResponseHandler callback);

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

        public Future deleteObject(ResponseHandler callback);

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

        public Future editObject(Role templateObject, ResponseHandler callback);

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

        public Future getObject(ResponseHandler callback);

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

        public Future linkGroup(Group group, ResponseHandler callback);

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

        public Future removeUser(Customer user, ResponseHandler callback);

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

        public Future unlinkGroup(Group group, ResponseHandler callback);

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

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

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

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

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

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

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

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

    }

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

        public com.softlayer.api.service.Account.Mask account() {
            return withSubMask("account", com.softlayer.api.service.Account.Mask.class);
        }

        public Action.Mask actions() {
            return withSubMask("actions", Action.Mask.class);
        }

        public Group.Mask groups() {
            return withSubMask("groups", Group.Mask.class);
        }

        public com.softlayer.api.service.user.Customer.Mask users() {
            return withSubMask("users", com.softlayer.api.service.user.Customer.Mask.class);
        }

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

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

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

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

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

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

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

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

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

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

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

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy