| GET,OPTIONS | /v1/staff/outreach/responses |
|---|
<?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 StaffResponseDto implements JsonSerializable
{
public function __construct(
/** @var int */
public int $StaffOutreachRecipientID=0,
/** @var int */
public int $ContactID=0,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Kind=null,
/** @var float */
public float $Rate=0.0,
/** @var float */
public float $Rating=0.0,
/** @var int */
public int $RatingCount=0,
/** @var string|null */
public ?string $Status=null,
/** @var string|null */
public ?string $Note=null,
/** @var float */
public float $CounterRate=0.0,
/** @var string|null */
public ?string $CounterStartDate=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['StaffOutreachRecipientID'])) $this->StaffOutreachRecipientID = $o['StaffOutreachRecipientID'];
if (isset($o['ContactID'])) $this->ContactID = $o['ContactID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Kind'])) $this->Kind = $o['Kind'];
if (isset($o['Rate'])) $this->Rate = $o['Rate'];
if (isset($o['Rating'])) $this->Rating = $o['Rating'];
if (isset($o['RatingCount'])) $this->RatingCount = $o['RatingCount'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['Note'])) $this->Note = $o['Note'];
if (isset($o['CounterRate'])) $this->CounterRate = $o['CounterRate'];
if (isset($o['CounterStartDate'])) $this->CounterStartDate = $o['CounterStartDate'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->StaffOutreachRecipientID)) $o['StaffOutreachRecipientID'] = $this->StaffOutreachRecipientID;
if (isset($this->ContactID)) $o['ContactID'] = $this->ContactID;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Kind)) $o['Kind'] = $this->Kind;
if (isset($this->Rate)) $o['Rate'] = $this->Rate;
if (isset($this->Rating)) $o['Rating'] = $this->Rating;
if (isset($this->RatingCount)) $o['RatingCount'] = $this->RatingCount;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->Note)) $o['Note'] = $this->Note;
if (isset($this->CounterRate)) $o['CounterRate'] = $this->CounterRate;
if (isset($this->CounterStartDate)) $o['CounterStartDate'] = $this->CounterStartDate;
return empty($o) ? new class(){} : $o;
}
}
class StaffResponsesResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<StaffResponseDto>|null */
public ?array $Responses=null,
/** @var int */
public int $SentCount=0,
/** @var int */
public int $OpenedCount=0,
/** @var int */
public int $ClickedCount=0,
/** @var int */
public int $Accepted=0,
/** @var int */
public int $Question=0,
/** @var int */
public int $Declined=0,
/** @var int */
public int $NoReply=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Responses'])) $this->Responses = JsonConverters::fromArray('StaffResponseDto', $o['Responses']);
if (isset($o['SentCount'])) $this->SentCount = $o['SentCount'];
if (isset($o['OpenedCount'])) $this->OpenedCount = $o['OpenedCount'];
if (isset($o['ClickedCount'])) $this->ClickedCount = $o['ClickedCount'];
if (isset($o['Accepted'])) $this->Accepted = $o['Accepted'];
if (isset($o['Question'])) $this->Question = $o['Question'];
if (isset($o['Declined'])) $this->Declined = $o['Declined'];
if (isset($o['NoReply'])) $this->NoReply = $o['NoReply'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Responses)) $o['Responses'] = JsonConverters::toArray('StaffResponseDto', $this->Responses);
if (isset($this->SentCount)) $o['SentCount'] = $this->SentCount;
if (isset($this->OpenedCount)) $o['OpenedCount'] = $this->OpenedCount;
if (isset($this->ClickedCount)) $o['ClickedCount'] = $this->ClickedCount;
if (isset($this->Accepted)) $o['Accepted'] = $this->Accepted;
if (isset($this->Question)) $o['Question'] = $this->Question;
if (isset($this->Declined)) $o['Declined'] = $this->Declined;
if (isset($this->NoReply)) $o['NoReply'] = $this->NoReply;
return empty($o) ? new class(){} : $o;
}
}
class StaffResponsesRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $PlaceholderContactID=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['PlaceholderContactID'])) $this->PlaceholderContactID = $o['PlaceholderContactID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->PlaceholderContactID)) $o['PlaceholderContactID'] = $this->PlaceholderContactID;
return empty($o) ? new class(){} : $o;
}
}
PHP StaffResponsesRequest 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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/staff/outreach/responses HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/json
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"}},"Responses":[{"StaffOutreachRecipientID":0,"ContactID":0,"Name":"String","Kind":"String","Rate":0,"Rating":0,"RatingCount":0,"Status":"String","Note":"String","CounterRate":0,"CounterStartDate":"String"}],"SentCount":0,"OpenedCount":0,"ClickedCount":0,"Accepted":0,"Question":0,"Declined":0,"NoReply":0}