sfgboxapi

<back to all web services

UsersIntendedAdd

The following routes are available for this service:
POST/users_intended
<?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 UsersIntendedAddResponse implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=2)
        /** @var string|null */
        public ?string $firstName=null,

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

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

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

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

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

        // @DataMember(Order=8)
        /** @var int|null */
        public ?int $usersDetailsId=null,

        // @DataMember(Order=9)
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['firstName'])) $this->firstName = $o['firstName'];
        if (isset($o['lastName'])) $this->lastName = $o['lastName'];
        if (isset($o['identificationNumber'])) $this->identificationNumber = $o['identificationNumber'];
        if (isset($o['phoneNumber'])) $this->phoneNumber = $o['phoneNumber'];
        if (isset($o['latitude'])) $this->latitude = $o['latitude'];
        if (isset($o['longitude'])) $this->longitude = $o['longitude'];
        if (isset($o['usersDetailsId'])) $this->usersDetailsId = $o['usersDetailsId'];
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->firstName)) $o['firstName'] = $this->firstName;
        if (isset($this->lastName)) $o['lastName'] = $this->lastName;
        if (isset($this->identificationNumber)) $o['identificationNumber'] = $this->identificationNumber;
        if (isset($this->phoneNumber)) $o['phoneNumber'] = $this->phoneNumber;
        if (isset($this->latitude)) $o['latitude'] = $this->latitude;
        if (isset($this->longitude)) $o['longitude'] = $this->longitude;
        if (isset($this->usersDetailsId)) $o['usersDetailsId'] = $this->usersDetailsId;
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class UsersIntendedAdd implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=2)
        /** @var string|null */
        public ?string $firstName=null,

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

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

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

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

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

        // @DataMember(Order=8)
        /** @var int|null */
        public ?int $usersDetailsId=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['firstName'])) $this->firstName = $o['firstName'];
        if (isset($o['lastName'])) $this->lastName = $o['lastName'];
        if (isset($o['identificationNumber'])) $this->identificationNumber = $o['identificationNumber'];
        if (isset($o['phoneNumber'])) $this->phoneNumber = $o['phoneNumber'];
        if (isset($o['latitude'])) $this->latitude = $o['latitude'];
        if (isset($o['longitude'])) $this->longitude = $o['longitude'];
        if (isset($o['usersDetailsId'])) $this->usersDetailsId = $o['usersDetailsId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->firstName)) $o['firstName'] = $this->firstName;
        if (isset($this->lastName)) $o['lastName'] = $this->lastName;
        if (isset($this->identificationNumber)) $o['identificationNumber'] = $this->identificationNumber;
        if (isset($this->phoneNumber)) $o['phoneNumber'] = $this->phoneNumber;
        if (isset($this->latitude)) $o['latitude'] = $this->latitude;
        if (isset($this->longitude)) $o['longitude'] = $this->longitude;
        if (isset($this->usersDetailsId)) $o['usersDetailsId'] = $this->usersDetailsId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP UsersIntendedAdd DTOs

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

HTTP + OTHER

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

POST /users_intended HTTP/1.1 
Host: sfgboxapi.dev.scadsoftware.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"firstName":"String","lastName":"String","identificationNumber":"String","phoneNumber":"String","latitude":0,"longitude":0,"usersDetailsId":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"firstName":"String","lastName":"String","identificationNumber":"String","phoneNumber":"String","latitude":0,"longitude":0,"usersDetailsId":0,"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}