POST | /users/{Id}/roles/assign |
---|
import java.math.*
import java.util.*
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
open class AssignUserRolesRequest : PostOperationUnTenanted<AssignUserRolesResponse>()
{
var id:String? = null
var roles:ArrayList<String> = ArrayList<String>()
}
open class PostOperationUnTenanted<TResponse> : IPost
{
}
open class AssignUserRolesResponse
{
var responseStatus:ResponseStatus? = null
var userAccount:UserAccount? = null
}
open class UserAccount : IIdentifiableResource
{
var roles:ArrayList<String> = ArrayList<String>()
var status:AccountStatus? = null
var defaultOrganisationId:String? = null
@SerializedName("type") var Type:AccountType? = null
var id:String? = null
}
enum class AccountStatus
{
Shadowed,
Registered,
}
enum class AccountType
{
Person,
Machine,
}
Kotlin AssignUserRolesRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /users/{Id}/roles/assign HTTP/1.1
Host: foundrystage-api-app.azurewebsites.net
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"id":"String","roles":["String"]}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"userAccount":{"roles":["String"],"status":"Shadowed","defaultOrganisationId":"String","type":"Person","id":"String"}}