Requires any of the roles: | VeoliaAdmin, SupplierAdmin, UserRegistration, User |
GET | /user/{userid} |
---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResponseBase:
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ModifyRequestBase(IConcurrencyStamp):
concurrency_stamp: Optional[str] = None
class ApplicationUserStatus(IntEnum):
REGISTERED = 0
CONFIRMED_BY_USER = 1
SUPPLIER_USER_REGISTERED = 2
AWAITING_SUPPLIER_CONFIRMATION = 3
AWAITING_VEOLIA_CONFIRMATION = 4
ACTIVE = 5
REJECTED = 6
DELETED = 7
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UserDetails(ModifyRequestBase):
id: int = 0
email: Optional[str] = None
user_name: Optional[str] = None
phone_number: Optional[str] = None
display_name: Optional[str] = None
phone_number_extension: Optional[str] = None
phone_number_country_code_id: Optional[int] = None
phone_number_country_code: Optional[str] = None
mobile_phone_number: Optional[str] = None
mobile_phone_number_country_code_id: Optional[int] = None
mobile_phone_number_country_code: Optional[str] = None
organization_unit: Optional[str] = None
position: Optional[str] = None
status: Optional[ApplicationUserStatus] = None
supplier_id: Optional[int] = None
supplier_owner_id: Optional[int] = None
meta: Optional[Dict[str, str]] = None
roles: Optional[List[str]] = None
is_supplier_admin: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BrowseUserResponse(ResponseBase):
user: Optional[UserDetails] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BrowseUser(IGet):
user_id: int = 0
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /user/{userid} HTTP/1.1 Host: szallitoiportal-be.veolia.hu Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { "User": { "Id": 0, "Email": "String", "UserName": "String", "PhoneNumber": "String", "DisplayName": "String", "PhoneNumberExtension": "String", "PhoneNumberCountryCodeId": 0, "PhoneNumberCountryCode": "String", "MobilePhoneNumber": "String", "MobilePhoneNumberCountryCodeId": 0, "MobilePhoneNumberCountryCode": "String", "OrganizationUnit": "String", "Position": "String", "Status": 0, "SupplierId": 0, "SupplierOwnerId": 0, "Meta": { "String": "String" }, "Roles": [ "String" ], "IsSupplierAdmin": true, "ConcurrencyStamp": "String" }, "ResponseStatus": { "ErrorCode": "String", "Message": "String", "StackTrace": "String", "Errors": [ { "ErrorCode": "String", "FieldName": "String", "Message": "String", "Meta": { "String": "String" } } ], "Meta": { "String": "String" } } }