| PUT,OPTIONS | /v1/Roles/{RoleId} |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class UpdateRoleRequest
{
public Integer RoleId = null;
public String Code = null;
public String Name = null;
public String Description = null;
public ArrayList<Integer> PermissionIds = new ArrayList<Integer>();
public Integer getRoleId() { return RoleId; }
public UpdateRoleRequest setRoleId(Integer value) { this.RoleId = value; return this; }
public String getCode() { return Code; }
public UpdateRoleRequest setCode(String value) { this.Code = value; return this; }
public String getName() { return Name; }
public UpdateRoleRequest setName(String value) { this.Name = value; return this; }
public String getDescription() { return Description; }
public UpdateRoleRequest setDescription(String value) { this.Description = value; return this; }
public ArrayList<Integer> getPermissionIds() { return PermissionIds; }
public UpdateRoleRequest setPermissionIds(ArrayList<Integer> value) { this.PermissionIds = value; return this; }
}
public static class Role
{
public Integer RoleId = null;
public UUID TenantId = null;
public String Code = null;
public String Name = null;
public String Description = null;
public Boolean IsSystem = null;
public Boolean IsActive = null;
public Date CreatedUtc = null;
public ArrayList<Permission> Permissions = new ArrayList<Permission>();
public Integer getRoleId() { return RoleId; }
public Role setRoleId(Integer value) { this.RoleId = value; return this; }
public UUID getTenantId() { return TenantId; }
public Role setTenantId(UUID value) { this.TenantId = value; return this; }
public String getCode() { return Code; }
public Role setCode(String value) { this.Code = value; return this; }
public String getName() { return Name; }
public Role setName(String value) { this.Name = value; return this; }
public String getDescription() { return Description; }
public Role setDescription(String value) { this.Description = value; return this; }
public Boolean getIsSystem() { return IsSystem; }
public Role setIsSystem(Boolean value) { this.IsSystem = value; return this; }
public Boolean getIsActive() { return IsActive; }
public Role setIsActive(Boolean value) { this.IsActive = value; return this; }
public Date getCreatedUtc() { return CreatedUtc; }
public Role setCreatedUtc(Date value) { this.CreatedUtc = value; return this; }
public ArrayList<Permission> getPermissions() { return Permissions; }
public Role setPermissions(ArrayList<Permission> value) { this.Permissions = value; return this; }
}
public static class Permission
{
public Integer PermissionId = null;
public String Module = null;
public String Resource = null;
public String Action = null;
public String Name = null;
public String Description = null;
public String Tags = null;
public Integer SortOrder = null;
public Boolean IsActive = null;
public Date CreatedUtc = null;
public String Code = null;
public Integer getPermissionId() { return PermissionId; }
public Permission setPermissionId(Integer value) { this.PermissionId = value; return this; }
public String getModule() { return Module; }
public Permission setModule(String value) { this.Module = value; return this; }
public String getResource() { return Resource; }
public Permission setResource(String value) { this.Resource = value; return this; }
public String getAction() { return Action; }
public Permission setAction(String value) { this.Action = value; return this; }
public String getName() { return Name; }
public Permission setName(String value) { this.Name = value; return this; }
public String getDescription() { return Description; }
public Permission setDescription(String value) { this.Description = value; return this; }
public String getTags() { return Tags; }
public Permission setTags(String value) { this.Tags = value; return this; }
public Integer getSortOrder() { return SortOrder; }
public Permission setSortOrder(Integer value) { this.SortOrder = value; return this; }
public Boolean getIsActive() { return IsActive; }
public Permission setIsActive(Boolean value) { this.IsActive = value; return this; }
public Date getCreatedUtc() { return CreatedUtc; }
public Permission setCreatedUtc(Date value) { this.CreatedUtc = value; return this; }
public String getCode() { return Code; }
public Permission setCode(String value) { this.Code = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /v1/Roles/{RoleId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateRoleRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Code>String</Code>
<Description>String</Description>
<Name>String</Name>
<PermissionIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:int>0</d2p1:int>
</PermissionIds>
<RoleId>0</RoleId>
</UpdateRoleRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<Role xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal.Models">
<Code>String</Code>
<CreatedUtc>0001-01-01T00:00:00</CreatedUtc>
<Description>String</Description>
<IsActive>false</IsActive>
<IsSystem>false</IsSystem>
<Name>String</Name>
<Permissions>
<Permission>
<Action>String</Action>
<Code>String</Code>
<CreatedUtc>0001-01-01T00:00:00</CreatedUtc>
<Description>String</Description>
<IsActive>false</IsActive>
<Module>String</Module>
<Name>String</Name>
<PermissionId>0</PermissionId>
<Resource>String</Resource>
<SortOrder>0</SortOrder>
<Tags>String</Tags>
</Permission>
</Permissions>
<RoleId>0</RoleId>
<TenantId>00000000-0000-0000-0000-000000000000</TenantId>
</Role>