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

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

/**
 * The SoftLayer_User_Permission_Group data type contains local attributes to identify and describe the permission groups 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_Action objects belong to a particular group, and what SoftLayer_User_Permission_Role objects the group is linked. * * @see SoftLayer_User_Permission_Group */ @ApiType("SoftLayer_User_Permission_Group") public class Group 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 roles; public List getRoles() { if (roles == null) { roles = new ArrayList(); } return roles; } /** * The type of the permission group. */ @ApiProperty protected Type type; public Type getType() { return type; } public void setType(Type type) { this.type = type; } /** * A permission groups 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 group 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 group. */ @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; } /** * The date the group will be destroyed. */ @ApiProperty(canBeNullOrNotSet = true) protected GregorianCalendar expirationDate; public GregorianCalendar getExpirationDate() { return expirationDate; } public void setExpirationDate(GregorianCalendar expirationDate) { expirationDateSpecified = true; this.expirationDate = expirationDate; } protected boolean expirationDateSpecified; public boolean isExpirationDateSpecified() { return expirationDateSpecified; } public void unsetExpirationDate() { expirationDate = null; expirationDateSpecified = false; } /** * A permission groups 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 group 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 group. */ @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; } /** * The type of permission group. */ @ApiProperty(canBeNullOrNotSet = true) protected Long typeId; public Long getTypeId() { return typeId; } public void setTypeId(Long typeId) { typeIdSpecified = true; this.typeId = typeId; } protected boolean typeIdSpecified; public boolean isTypeIdSpecified() { return typeIdSpecified; } public void unsetTypeId() { typeId = null; typeIdSpecified = 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 roleCount; public Long getRoleCount() { return roleCount; } public void setRoleCount(Long roleCount) { this.roleCount = roleCount; } 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_Group class is one of several classes that make up the customer permission system. It 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. The SoftLayer_User_Permission_Group is also used to track the resources or account devices to which a user has been granted access. The types of resources that users can be granted access is defined in [[SoftLayer_User_Permission_Resource_Type]].
*
* When a [[SoftLayer_User_Customer]] is created, a SoftLayer_User_Permission_Group and SoftLayer_User_Permission_Role is created specifically for the user with a group type of SYSTEM. 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.
*
* This is also true for device access. Either, the UI can be used to track the devices to which users are granted access which will use the SYSTEM group, or the api can be used, making the UI information inaccurate.
*
* 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]].
*
* 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.
*
* Resources belonging to the user's account can also be linked to permission groups. See [[SoftLayer_User_Permission_Resource_Type]]. * * @see SoftLayer_User_Permission_Group */ @com.softlayer.api.annotation.ApiService("SoftLayer_User_Permission_Group") 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_Permission_Action object to the group. * * @see SoftLayer_User_Permission_Group::addAction */ @ApiMethod(instanceRequired = true) public Void addAction(Action action); /** * Assigns multiple SoftLayer_User_Permission_Action objects to the group. * * @see SoftLayer_User_Permission_Group::addBulkActions */ @ApiMethod(instanceRequired = true) public Void addBulkActions(List actions); /** * Links multiple SoftLayer_Hardware_Server, SoftLayer_Virtual_Guest, or SoftLayer_Virtual_DedicatedHost objects to the group. All objects must be of the same type. * * @see SoftLayer_User_Permission_Group::addBulkResourceObjects */ @ApiMethod(instanceRequired = true) public Boolean addBulkResourceObjects(List resourceObjects, String resourceTypeKeyName); /** * Links a SoftLayer_Hardware_Server, SoftLayer_Virtual_Guest, or SoftLayer_Virtual_DedicatedHost object to the group. * * @see SoftLayer_User_Permission_Group::addResourceObject */ @ApiMethod(instanceRequired = true) public Boolean addResourceObject(Entity resourceObject, String resourceTypeKeyName); /** * Customer created permission groups must be of type NORMAL. 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_Group::createObject */ @ApiMethod public Group createObject(Group templateObject); /** * Customer users can only delete permission groups of type NORMAL. The SYSTEM type is reserved for internal use. The user who is creating the permission group must have the permission to manage users. * * @see SoftLayer_User_Permission_Group::deleteObject */ @ApiMethod(instanceRequired = true) public Boolean deleteObject(); /** * Allows a user to modify the name and description of an existing customer permission group. Customer permission groups must be of type NORMAL. 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_Group::editObject */ @ApiMethod(instanceRequired = true) public Group editObject(Group templateObject); /** * @see SoftLayer_User_Permission_Group::getObject */ @ApiMethod(instanceRequired = true) public Group getObject(); /** * Links a SoftLayer_User_Permission_Role object to the group. * * @see SoftLayer_User_Permission_Group::linkRole */ @ApiMethod(instanceRequired = true) public Void linkRole(Role role); /** * Unassigns a SoftLayer_User_Permission_Action object from the group. * * @see SoftLayer_User_Permission_Group::removeAction */ @ApiMethod(instanceRequired = true) public Void removeAction(Action action); /** * Unassigns multiple SoftLayer_User_Permission_Action objects from the group. * * @see SoftLayer_User_Permission_Group::removeBulkActions */ @ApiMethod(instanceRequired = true) public Void removeBulkActions(List actions); /** * Unlinks multiple SoftLayer_Hardware_Server, SoftLayer_Virtual_Guest, or SoftLayer_Virtual_DedicatedHost objects from the group. All objects must be of the same type. * * @see SoftLayer_User_Permission_Group::removeBulkResourceObjects */ @ApiMethod(instanceRequired = true) public Boolean removeBulkResourceObjects(List resourceObjects, String resourceTypeKeyName); /** * Unlinks a SoftLayer_Hardware_Server, SoftLayer_Virtual_Guest, or SoftLayer_Virtual_DedicatedHost object from the group. * * @see SoftLayer_User_Permission_Group::removeResourceObject */ @ApiMethod(instanceRequired = true) public Boolean removeResourceObject(Entity resourceObject, String resourceTypeKeyName); /** * Removes a link from SoftLayer_User_Permission_Role object to the group. * * @see SoftLayer_User_Permission_Group::unlinkRole */ @ApiMethod(instanceRequired = true) public Void unlinkRole(Role role); /** * @see SoftLayer_User_Permission_Group::getAccount */ @ApiMethod(instanceRequired = true) public Account getAccount(); /** * @see SoftLayer_User_Permission_Group::getActions */ @ApiMethod(instanceRequired = true) public List getActions(); /** * @see SoftLayer_User_Permission_Group::getRoles */ @ApiMethod(instanceRequired = true) public List getRoles(); /** * The type of the permission group. * * @see SoftLayer_User_Permission_Group::getType */ @ApiMethod(instanceRequired = true) public Type getType(); } 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#addAction} */ public Future addAction(Action action); public Future addAction(Action action, ResponseHandler callback); /** * Async version of {@link Service#addBulkActions} */ public Future addBulkActions(List actions); public Future addBulkActions(List actions, ResponseHandler callback); /** * Async version of {@link Service#addBulkResourceObjects} */ public Future addBulkResourceObjects(List resourceObjects, String resourceTypeKeyName); public Future addBulkResourceObjects(List resourceObjects, String resourceTypeKeyName, ResponseHandler callback); /** * Async version of {@link Service#addResourceObject} */ public Future addResourceObject(Entity resourceObject, String resourceTypeKeyName); public Future addResourceObject(Entity resourceObject, String resourceTypeKeyName, ResponseHandler callback); /** * Async version of {@link Service#createObject} */ public Future createObject(Group templateObject); public Future createObject(Group 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(Group templateObject); public Future editObject(Group templateObject, ResponseHandler callback); /** * Async version of {@link Service#getObject} */ public Future getObject(); public Future getObject(ResponseHandler callback); /** * Async version of {@link Service#linkRole} */ public Future linkRole(Role role); public Future linkRole(Role role, ResponseHandler callback); /** * Async version of {@link Service#removeAction} */ public Future removeAction(Action action); public Future removeAction(Action action, ResponseHandler callback); /** * Async version of {@link Service#removeBulkActions} */ public Future removeBulkActions(List actions); public Future removeBulkActions(List actions, ResponseHandler callback); /** * Async version of {@link Service#removeBulkResourceObjects} */ public Future removeBulkResourceObjects(List resourceObjects, String resourceTypeKeyName); public Future removeBulkResourceObjects(List resourceObjects, String resourceTypeKeyName, ResponseHandler callback); /** * Async version of {@link Service#removeResourceObject} */ public Future removeResourceObject(Entity resourceObject, String resourceTypeKeyName); public Future removeResourceObject(Entity resourceObject, String resourceTypeKeyName, ResponseHandler callback); /** * Async version of {@link Service#unlinkRole} */ public Future unlinkRole(Role role); public Future unlinkRole(Role role, 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#getRoles} */ public Future> getRoles(); /** * Async callback version of {@link Service#getRoles} */ public Future getRoles(ResponseHandler> callback); /** * Async version of {@link Service#getType} */ public Future getType(); /** * Async callback version of {@link Service#getType} */ public Future getType(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 Role.Mask roles() { return withSubMask("roles", Role.Mask.class); } public com.softlayer.api.service.user.permission.group.Type.Mask type() { return withSubMask("type", com.softlayer.api.service.user.permission.group.Type.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 expirationDate() { withLocalProperty("expirationDate"); 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 typeId() { withLocalProperty("typeId"); return this; } public Mask actionCount() { withLocalProperty("actionCount"); return this; } public Mask roleCount() { withLocalProperty("roleCount"); return this; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy