Trendsic Platform Service

<back to all web services

UserSendVerifyCellPhoneRequest

The following routes are available for this service:
GET,PUT,POST,OPTIONS/v1/usersendverifycellphone
<?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};


enum CoreChecksumAlgorithm : string
{
    case NONE = 'NONE';
    case CRC32C = 'CRC32C';
    case CRC32 = 'CRC32';
    case SHA256 = 'SHA256';
    case SHA1 = 'SHA1';
}

enum ChecksumValidationStatus : string
{
    case NOT_VALIDATED = 'NOT_VALIDATED';
    case PENDING_RESPONSE_READ = 'PENDING_RESPONSE_READ';
    case SUCCESSFUL = 'SUCCESSFUL';
    case INVALID = 'INVALID';
}

class ResponseMetadata implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $RequestId=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var CoreChecksumAlgorithm|null */
        public ?CoreChecksumAlgorithm $ChecksumAlgorithm=null,
        /** @var ChecksumValidationStatus|null */
        public ?ChecksumValidationStatus $ChecksumValidationStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RequestId'])) $this->RequestId = $o['RequestId'];
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['ChecksumAlgorithm'])) $this->ChecksumAlgorithm = JsonConverters::from('CoreChecksumAlgorithm', $o['ChecksumAlgorithm']);
        if (isset($o['ChecksumValidationStatus'])) $this->ChecksumValidationStatus = JsonConverters::from('ChecksumValidationStatus', $o['ChecksumValidationStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RequestId)) $o['RequestId'] = $this->RequestId;
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->ChecksumAlgorithm)) $o['ChecksumAlgorithm'] = JsonConverters::to('CoreChecksumAlgorithm', $this->ChecksumAlgorithm);
        if (isset($this->ChecksumValidationStatus)) $o['ChecksumValidationStatus'] = JsonConverters::to('ChecksumValidationStatus', $this->ChecksumValidationStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class AmazonWebServiceResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseMetadata|null */
        public ?ResponseMetadata $ResponseMetadata=null,
        /** @var int */
        public int $ContentLength=0,
        /** @var HttpStatusCode|null */
        public ?HttpStatusCode $HttpStatusCode=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseMetadata'])) $this->ResponseMetadata = JsonConverters::from('ResponseMetadata', $o['ResponseMetadata']);
        if (isset($o['ContentLength'])) $this->ContentLength = $o['ContentLength'];
        if (isset($o['HttpStatusCode'])) $this->HttpStatusCode = JsonConverters::from('HttpStatusCode', $o['HttpStatusCode']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseMetadata)) $o['ResponseMetadata'] = JsonConverters::to('ResponseMetadata', $this->ResponseMetadata);
        if (isset($this->ContentLength)) $o['ContentLength'] = $this->ContentLength;
        if (isset($this->HttpStatusCode)) $o['HttpStatusCode'] = JsonConverters::to('HttpStatusCode', $this->HttpStatusCode);
        return empty($o) ? new class(){} : $o;
    }
}

class NewDeviceMetadataType implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $DeviceGroupKey=null,
        /** @var string|null */
        public ?string $DeviceKey=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DeviceGroupKey'])) $this->DeviceGroupKey = $o['DeviceGroupKey'];
        if (isset($o['DeviceKey'])) $this->DeviceKey = $o['DeviceKey'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DeviceGroupKey)) $o['DeviceGroupKey'] = $this->DeviceGroupKey;
        if (isset($this->DeviceKey)) $o['DeviceKey'] = $this->DeviceKey;
        return empty($o) ? new class(){} : $o;
    }
}

class AuthenticationResultType implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $AccessToken=null,
        /** @var int */
        public int $ExpiresIn=0,
        /** @var string|null */
        public ?string $IdToken=null,
        /** @var NewDeviceMetadataType|null */
        public ?NewDeviceMetadataType $NewDeviceMetadata=null,
        /** @var string|null */
        public ?string $RefreshToken=null,
        /** @var string|null */
        public ?string $TokenType=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AccessToken'])) $this->AccessToken = $o['AccessToken'];
        if (isset($o['ExpiresIn'])) $this->ExpiresIn = $o['ExpiresIn'];
        if (isset($o['IdToken'])) $this->IdToken = $o['IdToken'];
        if (isset($o['NewDeviceMetadata'])) $this->NewDeviceMetadata = JsonConverters::from('NewDeviceMetadataType', $o['NewDeviceMetadata']);
        if (isset($o['RefreshToken'])) $this->RefreshToken = $o['RefreshToken'];
        if (isset($o['TokenType'])) $this->TokenType = $o['TokenType'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AccessToken)) $o['AccessToken'] = $this->AccessToken;
        if (isset($this->ExpiresIn)) $o['ExpiresIn'] = $this->ExpiresIn;
        if (isset($this->IdToken)) $o['IdToken'] = $this->IdToken;
        if (isset($this->NewDeviceMetadata)) $o['NewDeviceMetadata'] = JsonConverters::to('NewDeviceMetadataType', $this->NewDeviceMetadata);
        if (isset($this->RefreshToken)) $o['RefreshToken'] = $this->RefreshToken;
        if (isset($this->TokenType)) $o['TokenType'] = $this->TokenType;
        return empty($o) ? new class(){} : $o;
    }
}

class ConstantClass implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Value=null
    ) {
    }

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

class ChallengeNameType extends ConstantClass implements JsonSerializable
{
    /**
     * @param string|null $Value
     */
    public function __construct(
        ?string $Value=null
    ) {
        parent::__construct($Value);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

class InitiateAuthResponse extends AmazonWebServiceResponse implements JsonSerializable
{
    /**
     * @param ResponseMetadata|null $ResponseMetadata
     * @param int $ContentLength
     * @param HttpStatusCode|null $HttpStatusCode
     */
    public function __construct(
        ?ResponseMetadata $ResponseMetadata=null,
        int $ContentLength=0,
        ?HttpStatusCode $HttpStatusCode=null,
        /** @var AuthenticationResultType|null */
        public ?AuthenticationResultType $AuthenticationResult=null,
        /** @var ChallengeNameType|null */
        public ?ChallengeNameType $ChallengeName=null,
        /** @var array<string,string>|null */
        public ?array $ChallengeParameters=null,
        /** @var string|null */
        public ?string $Session=null
    ) {
        parent::__construct($ResponseMetadata,$ContentLength,$HttpStatusCode);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['AuthenticationResult'])) $this->AuthenticationResult = JsonConverters::from('AuthenticationResultType', $o['AuthenticationResult']);
        if (isset($o['ChallengeName'])) $this->ChallengeName = JsonConverters::from('ChallengeNameType', $o['ChallengeName']);
        if (isset($o['ChallengeParameters'])) $this->ChallengeParameters = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['ChallengeParameters']);
        if (isset($o['Session'])) $this->Session = $o['Session'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->AuthenticationResult)) $o['AuthenticationResult'] = JsonConverters::to('AuthenticationResultType', $this->AuthenticationResult);
        if (isset($this->ChallengeName)) $o['ChallengeName'] = JsonConverters::to('ChallengeNameType', $this->ChallengeName);
        if (isset($this->ChallengeParameters)) $o['ChallengeParameters'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->ChallengeParameters);
        if (isset($this->Session)) $o['Session'] = $this->Session;
        return empty($o) ? new class(){} : $o;
    }
}

class AwsAuthResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var InitiateAuthResponse|null */
        public ?InitiateAuthResponse $InitiateAuthResponse=null,
        /** @var bool|null */
        public ?bool $Success=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['InitiateAuthResponse'])) $this->InitiateAuthResponse = JsonConverters::from('InitiateAuthResponse', $o['InitiateAuthResponse']);
        if (isset($o['Success'])) $this->Success = $o['Success'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->InitiateAuthResponse)) $o['InitiateAuthResponse'] = JsonConverters::to('InitiateAuthResponse', $this->InitiateAuthResponse);
        if (isset($this->Success)) $o['Success'] = $this->Success;
        return empty($o) ? new class(){} : $o;
    }
}

class UserSendVerifyCellPhoneRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Username=null,
        /** @var string|null */
        public ?string $UserId=null,
        /** @var string|null */
        public ?string $Password=null,
        /** @var string|null */
        public ?string $PhoneNumber=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Username'])) $this->Username = $o['Username'];
        if (isset($o['UserId'])) $this->UserId = $o['UserId'];
        if (isset($o['Password'])) $this->Password = $o['Password'];
        if (isset($o['PhoneNumber'])) $this->PhoneNumber = $o['PhoneNumber'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Username)) $o['Username'] = $this->Username;
        if (isset($this->UserId)) $o['UserId'] = $this->UserId;
        if (isset($this->Password)) $o['Password'] = $this->Password;
        if (isset($this->PhoneNumber)) $o['PhoneNumber'] = $this->PhoneNumber;
        return empty($o) ? new class(){} : $o;
    }
}

PHP UserSendVerifyCellPhoneRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /v1/usersendverifycellphone HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Username":"String","UserId":"String","Password":"String","PhoneNumber":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"InitiateAuthResponse":{"AuthenticationResult":{"AccessToken":"String","ExpiresIn":0,"IdToken":"String","NewDeviceMetadata":{"DeviceGroupKey":"String","DeviceKey":"String"},"RefreshToken":"String","TokenType":"String"},"ChallengeName":null,"ChallengeParameters":{"String":"String"},"Session":"String","ResponseMetadata":{"RequestId":"String","Metadata":{},"ChecksumAlgorithm":"NONE","ChecksumValidationStatus":"NOT_VALIDATED"},"ContentLength":0,"HttpStatusCode":"Continue"},"Success":false}