sfgboxapi

<back to all web services

UsersDetailsLookup

Requires Authentication
The following routes are available for this service:
GET/users_details
<?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};


// @DataContract
class UsersDetailsLookup implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=2)
        /** @var int */
        public int $appUserId=0,

        // @DataMember(Order=3)
        /** @var bool|null */
        public ?bool $approved=null,

        // @DataMember(Order=4)
        /** @var string|null */
        public ?string $identificationNumber=null,

        // @DataMember(Order=5)
        /** @var string|null */
        public ?string $passportNumber=null,

        // @DataMember(Order=6)
        /** @var string|null */
        public ?string $address=null,

        // @DataMember(Order=7)
        /** @var float */
        public float $latitude=0.0,

        // @DataMember(Order=8)
        /** @var float */
        public float $longitude=0.0,

        // @DataMember(Order=9)
        /** @var int */
        public int $age=0,

        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $ethnicGroup=null,

        // @DataMember(Order=11)
        /** @var string|null */
        public ?string $gender=null,

        // @DataMember(Order=12)
        /** @var bool|null */
        public ?bool $isDisabled=null,

        // @DataMember(Order=13)
        /** @var string|null */
        public ?string $documentUrl=null,

        // @DataMember(Order=14)
        /** @var DateTime */
        public DateTime $applicationDate=new DateTime(),

        // @DataMember(Order=15)
        /** @var DateTime */
        public DateTime $approvalDate=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['appUserId'])) $this->appUserId = $o['appUserId'];
        if (isset($o['approved'])) $this->approved = $o['approved'];
        if (isset($o['identificationNumber'])) $this->identificationNumber = $o['identificationNumber'];
        if (isset($o['passportNumber'])) $this->passportNumber = $o['passportNumber'];
        if (isset($o['address'])) $this->address = $o['address'];
        if (isset($o['latitude'])) $this->latitude = $o['latitude'];
        if (isset($o['longitude'])) $this->longitude = $o['longitude'];
        if (isset($o['age'])) $this->age = $o['age'];
        if (isset($o['ethnicGroup'])) $this->ethnicGroup = $o['ethnicGroup'];
        if (isset($o['gender'])) $this->gender = $o['gender'];
        if (isset($o['isDisabled'])) $this->isDisabled = $o['isDisabled'];
        if (isset($o['documentUrl'])) $this->documentUrl = $o['documentUrl'];
        if (isset($o['applicationDate'])) $this->applicationDate = JsonConverters::from('DateTime', $o['applicationDate']);
        if (isset($o['approvalDate'])) $this->approvalDate = JsonConverters::from('DateTime', $o['approvalDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->appUserId)) $o['appUserId'] = $this->appUserId;
        if (isset($this->approved)) $o['approved'] = $this->approved;
        if (isset($this->identificationNumber)) $o['identificationNumber'] = $this->identificationNumber;
        if (isset($this->passportNumber)) $o['passportNumber'] = $this->passportNumber;
        if (isset($this->address)) $o['address'] = $this->address;
        if (isset($this->latitude)) $o['latitude'] = $this->latitude;
        if (isset($this->longitude)) $o['longitude'] = $this->longitude;
        if (isset($this->age)) $o['age'] = $this->age;
        if (isset($this->ethnicGroup)) $o['ethnicGroup'] = $this->ethnicGroup;
        if (isset($this->gender)) $o['gender'] = $this->gender;
        if (isset($this->isDisabled)) $o['isDisabled'] = $this->isDisabled;
        if (isset($this->documentUrl)) $o['documentUrl'] = $this->documentUrl;
        if (isset($this->applicationDate)) $o['applicationDate'] = JsonConverters::to('DateTime', $this->applicationDate);
        if (isset($this->approvalDate)) $o['approvalDate'] = JsonConverters::to('DateTime', $this->approvalDate);
        return empty($o) ? new class(){} : $o;
    }
}

PHP UsersDetailsLookup DTOs

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

HTTP + CSV

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

GET /users_details HTTP/1.1 
Host: sfgboxapi.dev.scadsoftware.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{Unable to show example output for type 'IEnumerable`1' using the custom 'csv' filter}Cannot dynamically create an instance of type 'System.Collections.Generic.IEnumerable`1[sfgboxapi.ServiceModel.UsersDetailsLookupResponse]'. Reason: Cannot create an instance of an interface.