Test

<back to all web services

GetUserDetails

Requires Authentication
The following routes are available for this service:
All Verbs/account
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class GetUserDetails implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

class GetUserDetailsResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $provider=null,
        /** @var string|null */
        public ?string $userId=null,
        /** @var string|null */
        public ?string $userName=null,
        /** @var string|null */
        public ?string $fullName=null,
        /** @var string|null */
        public ?string $displayName=null,
        /** @var string|null */
        public ?string $firstName=null,
        /** @var string|null */
        public ?string $lastName=null,
        /** @var string|null */
        public ?string $company=null,
        /** @var string|null */
        public ?string $email=null,
        /** @var string|null */
        public ?string $phoneNumber=null,
        /** @var DateTime|null */
        public ?DateTime $birthDate=null,
        /** @var string|null */
        public ?string $birthDateRaw=null,
        /** @var string|null */
        public ?string $address=null,
        /** @var string|null */
        public ?string $address2=null,
        /** @var string|null */
        public ?string $city=null,
        /** @var string|null */
        public ?string $state=null,
        /** @var string|null */
        public ?string $country=null,
        /** @var string|null */
        public ?string $culture=null,
        /** @var string|null */
        public ?string $gender=null,
        /** @var string|null */
        public ?string $language=null,
        /** @var string|null */
        public ?string $mailAddress=null,
        /** @var string|null */
        public ?string $nickname=null,
        /** @var string|null */
        public ?string $postalCode=null,
        /** @var string|null */
        public ?string $timeZone=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['provider'])) $this->provider = $o['provider'];
        if (isset($o['userId'])) $this->userId = $o['userId'];
        if (isset($o['userName'])) $this->userName = $o['userName'];
        if (isset($o['fullName'])) $this->fullName = $o['fullName'];
        if (isset($o['displayName'])) $this->displayName = $o['displayName'];
        if (isset($o['firstName'])) $this->firstName = $o['firstName'];
        if (isset($o['lastName'])) $this->lastName = $o['lastName'];
        if (isset($o['company'])) $this->company = $o['company'];
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['phoneNumber'])) $this->phoneNumber = $o['phoneNumber'];
        if (isset($o['birthDate'])) $this->birthDate = JsonConverters::from('DateTime', $o['birthDate']);
        if (isset($o['birthDateRaw'])) $this->birthDateRaw = $o['birthDateRaw'];
        if (isset($o['address'])) $this->address = $o['address'];
        if (isset($o['address2'])) $this->address2 = $o['address2'];
        if (isset($o['city'])) $this->city = $o['city'];
        if (isset($o['state'])) $this->state = $o['state'];
        if (isset($o['country'])) $this->country = $o['country'];
        if (isset($o['culture'])) $this->culture = $o['culture'];
        if (isset($o['gender'])) $this->gender = $o['gender'];
        if (isset($o['language'])) $this->language = $o['language'];
        if (isset($o['mailAddress'])) $this->mailAddress = $o['mailAddress'];
        if (isset($o['nickname'])) $this->nickname = $o['nickname'];
        if (isset($o['postalCode'])) $this->postalCode = $o['postalCode'];
        if (isset($o['timeZone'])) $this->timeZone = $o['timeZone'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->provider)) $o['provider'] = $this->provider;
        if (isset($this->userId)) $o['userId'] = $this->userId;
        if (isset($this->userName)) $o['userName'] = $this->userName;
        if (isset($this->fullName)) $o['fullName'] = $this->fullName;
        if (isset($this->displayName)) $o['displayName'] = $this->displayName;
        if (isset($this->firstName)) $o['firstName'] = $this->firstName;
        if (isset($this->lastName)) $o['lastName'] = $this->lastName;
        if (isset($this->company)) $o['company'] = $this->company;
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->phoneNumber)) $o['phoneNumber'] = $this->phoneNumber;
        if (isset($this->birthDate)) $o['birthDate'] = JsonConverters::to('DateTime', $this->birthDate);
        if (isset($this->birthDateRaw)) $o['birthDateRaw'] = $this->birthDateRaw;
        if (isset($this->address)) $o['address'] = $this->address;
        if (isset($this->address2)) $o['address2'] = $this->address2;
        if (isset($this->city)) $o['city'] = $this->city;
        if (isset($this->state)) $o['state'] = $this->state;
        if (isset($this->country)) $o['country'] = $this->country;
        if (isset($this->culture)) $o['culture'] = $this->culture;
        if (isset($this->gender)) $o['gender'] = $this->gender;
        if (isset($this->language)) $o['language'] = $this->language;
        if (isset($this->mailAddress)) $o['mailAddress'] = $this->mailAddress;
        if (isset($this->nickname)) $o['nickname'] = $this->nickname;
        if (isset($this->postalCode)) $o['postalCode'] = $this->postalCode;
        if (isset($this->timeZone)) $o['timeZone'] = $this->timeZone;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetUserDetails DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /account HTTP/1.1 
Host: test.servicestack.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<GetUserDetails xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Test.ServiceInterface" />
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetUserDetailsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Test.ServiceInterface">
  <Address>String</Address>
  <Address2>String</Address2>
  <BirthDate>0001-01-01T00:00:00</BirthDate>
  <BirthDateRaw>String</BirthDateRaw>
  <City>String</City>
  <Company>String</Company>
  <Country>String</Country>
  <Culture>String</Culture>
  <DisplayName>String</DisplayName>
  <Email>String</Email>
  <FirstName>String</FirstName>
  <FullName>String</FullName>
  <Gender>String</Gender>
  <Language>String</Language>
  <LastName>String</LastName>
  <MailAddress>String</MailAddress>
  <Nickname>String</Nickname>
  <PhoneNumber>String</PhoneNumber>
  <PostalCode>String</PostalCode>
  <Provider>String</Provider>
  <State>String</State>
  <TimeZone>String</TimeZone>
  <UserId>String</UserId>
  <UserName>String</UserName>
</GetUserDetailsResponse>