com.softlayer.api.service.user.permission.Role Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of softlayer-api-client Show documentation
Show all versions of softlayer-api-client Show documentation
API client for accessing the SoftLayer API
The 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;
/**
* The SoftLayer_User_Permission_Role data type contains local attributes to identify and describe the permission roles that have been created within IMS. These includes a name, description, and account id. Permission groups are defined specifically for a single [[SoftLayer_Account]].
*
* It also contains relational attributes that indicate what SoftLayer_User_Permission_Group objects are linked to a particular role, and the SoftLayer_User_Customer objects assigned to the role.
*
* @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;
}
/**
* Id of a [[SoftLayer_Account]] to which this role belongs.
*/
@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());
}
/**
* The SoftLayer_User_Permission_Role class is one of several classes that make up the customer permission system. The system is a role-based system that includes defined actions which can be "grouped" together using a SoftLayer_User_Permission_Group class. These groups of actions are then used to define roles, and the roles are assigned to users.
*
* When a [[SoftLayer_User_Customer]] is created, a SoftLayer_User_Permission_Role is created for the user with a group type of SYSTEM. This role is linked to the SYSTEM SoftLayer_User_Permission_Group that was also created specifically for this user. When the UI is used to alter the permissions of a customer user, the actions are added or removed from this group. The api can not be used to alter the permissions in this group. If an account wants to create their own unique permission groups and roles, the UI can not be used to manage them.
*
* User Customers can be assigned to multiple roles but it is recommended to either use the UI for managing account users permissions or only use the api. Mixing the two will lead to confusing results as the UI will not show any permissions assigned to a user via a customer created role/group combination.
*
* Proceed with caution.
*
* One or more [[SoftLayer_User_Permission_Action]] are assigned to one or more [[SoftLayer_User_Permission_Group]] Objects. One ore more SoftLayer_User_Permission_Group objects can be linked to a [[SoftLayer_User_Permission_Role]]. A single SoftLayer_User_Permission_Group object can be linked to multiple SoftLayer_User_Permission_Role objects. The SoftLayer_User_Permission_Role is assigned to one or more [[SoftLayer_User_Customer]]. A single SoftLayer_User_Customer can be assigned to one or more roles.
*
* The SoftLayer_User_Permission_Action class defines the permissions that are required in order for a SoftLayer_User_Customer to perform certain actions within IMS.
*
* @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);
/**
* Assigns a SoftLayer_User_Customer object to the role.
*
* @see SoftLayer_User_Permission_Role::addUser
*/
@ApiMethod(instanceRequired = true)
public Void addUser(Customer user);
/**
* Customer created permission roles must set the systemFlag attribute to false. The SYSTEM type is reserved for internal use. The account id supplied in the template permission group must match account id of the user who is creating the permission group. The user who is creating the permission group must have the permission to manage users.
*
* @see SoftLayer_User_Permission_Role::createObject
*/
@ApiMethod
public Role createObject(Role templateObject);
/**
* Customer users can only delete permission roles with systemFlag set to false. The SYSTEM type is reserved for internal use. The user who is creating the permission role must have the permission to manage users.
*
* @see SoftLayer_User_Permission_Role::deleteObject
*/
@ApiMethod(instanceRequired = true)
public Boolean deleteObject();
/**
* Allows a user to modify the name and description of an existing customer permission role. Customer permission roles must set the systemFlag attribute to false. The SYSTEM type is reserved for internal use. The account id supplied in the template permission role must match account id of the user who is creating the permission role. The user who is creating the permission role must have the permission to manage users.
*
* @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();
/**
* Links a SoftLayer_User_Permission_Group object to the role.
*
* @see SoftLayer_User_Permission_Role::linkGroup
*/
@ApiMethod(instanceRequired = true)
public Void linkGroup(Group group);
/**
* Unassigns a SoftLayer_User_Customer object from the role.
*
* @see SoftLayer_User_Permission_Role::removeUser
*/
@ApiMethod(instanceRequired = true)
public Void removeUser(Customer user);
/**
* Unlinks a SoftLayer_User_Permission_Group object to the role.
*
* @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;
}
}
}