Trendsic Platform Service

<back to all web services

GetInspectionReport

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/InspectionReport/{AgentUID}/{ContactUID}/
<?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 Employee implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $FirstName=null,
        /** @var string|null */
        public ?string $MiddleName=null,
        /** @var string|null */
        public ?string $LastName=null
    ) {
    }

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

class InspectionReport implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $AgentUID='',
        /** @var string */
        public string $ContactUID='',
        /** @var string */
        public string $InspectionReportUID='',
        /** @var string|null */
        public ?string $TradeName=null,
        /** @var string|null */
        public ?string $BusinessPhone=null,
        /** @var string|null */
        public ?string $StreetAddress=null,
        /** @var string|null */
        public ?string $ZipCode=null,
        /** @var string|null */
        public ?string $OwnersName=null,
        /** @var int */
        public int $ComplianceStatus=0,
        /** @var bool|null */
        public ?bool $IsBusinessClassABeer=null,
        /** @var bool|null */
        public ?bool $IsBusinessClassBBeer=null,
        /** @var bool|null */
        public ?bool $IsBusinessClassALiquor=null,
        /** @var bool|null */
        public ?bool $IsBusinessClassBLiquor=null,
        /** @var bool|null */
        public ?bool $IsBusinessClassD=null,
        /** @var bool|null */
        public ?bool $IsBusinessClassM=null,
        /** @var bool|null */
        public ?bool $IsBusinessClassP=null,
        /** @var bool|null */
        public ?bool $IsBusinessClassR=null,
        /** @var bool|null */
        public ?bool $IsBusinessClassRAH=null,
        /** @var string|null */
        public ?string $ClassBeerAccountNum=null,
        /** @var string|null */
        public ?string $ClassBeerStateNum=null,
        /** @var string|null */
        public ?string $ClassLiquorAccountNum=null,
        /** @var string|null */
        public ?string $ClassLiquorStateNum=null,
        /** @var array<Employee>|null */
        public ?array $LicensedEmployees=null,
        /** @var string|null */
        public ?string $AgentName=null,
        /** @var Object|null */
        public ?Object $ManagerSignature=null,
        /** @var string|null */
        public ?string $ManagerName=null,
        /** @var string|null */
        public ?string $ManagerPhone=null,
        /** @var DateTime */
        public DateTime $InspectionDate=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AgentUID'])) $this->AgentUID = $o['AgentUID'];
        if (isset($o['ContactUID'])) $this->ContactUID = $o['ContactUID'];
        if (isset($o['InspectionReportUID'])) $this->InspectionReportUID = $o['InspectionReportUID'];
        if (isset($o['TradeName'])) $this->TradeName = $o['TradeName'];
        if (isset($o['BusinessPhone'])) $this->BusinessPhone = $o['BusinessPhone'];
        if (isset($o['StreetAddress'])) $this->StreetAddress = $o['StreetAddress'];
        if (isset($o['ZipCode'])) $this->ZipCode = $o['ZipCode'];
        if (isset($o['OwnersName'])) $this->OwnersName = $o['OwnersName'];
        if (isset($o['ComplianceStatus'])) $this->ComplianceStatus = $o['ComplianceStatus'];
        if (isset($o['IsBusinessClassABeer'])) $this->IsBusinessClassABeer = $o['IsBusinessClassABeer'];
        if (isset($o['IsBusinessClassBBeer'])) $this->IsBusinessClassBBeer = $o['IsBusinessClassBBeer'];
        if (isset($o['IsBusinessClassALiquor'])) $this->IsBusinessClassALiquor = $o['IsBusinessClassALiquor'];
        if (isset($o['IsBusinessClassBLiquor'])) $this->IsBusinessClassBLiquor = $o['IsBusinessClassBLiquor'];
        if (isset($o['IsBusinessClassD'])) $this->IsBusinessClassD = $o['IsBusinessClassD'];
        if (isset($o['IsBusinessClassM'])) $this->IsBusinessClassM = $o['IsBusinessClassM'];
        if (isset($o['IsBusinessClassP'])) $this->IsBusinessClassP = $o['IsBusinessClassP'];
        if (isset($o['IsBusinessClassR'])) $this->IsBusinessClassR = $o['IsBusinessClassR'];
        if (isset($o['IsBusinessClassRAH'])) $this->IsBusinessClassRAH = $o['IsBusinessClassRAH'];
        if (isset($o['ClassBeerAccountNum'])) $this->ClassBeerAccountNum = $o['ClassBeerAccountNum'];
        if (isset($o['ClassBeerStateNum'])) $this->ClassBeerStateNum = $o['ClassBeerStateNum'];
        if (isset($o['ClassLiquorAccountNum'])) $this->ClassLiquorAccountNum = $o['ClassLiquorAccountNum'];
        if (isset($o['ClassLiquorStateNum'])) $this->ClassLiquorStateNum = $o['ClassLiquorStateNum'];
        if (isset($o['LicensedEmployees'])) $this->LicensedEmployees = JsonConverters::fromArray('Employee', $o['LicensedEmployees']);
        if (isset($o['AgentName'])) $this->AgentName = $o['AgentName'];
        if (isset($o['ManagerSignature'])) $this->ManagerSignature = JsonConverters::from('Object', $o['ManagerSignature']);
        if (isset($o['ManagerName'])) $this->ManagerName = $o['ManagerName'];
        if (isset($o['ManagerPhone'])) $this->ManagerPhone = $o['ManagerPhone'];
        if (isset($o['InspectionDate'])) $this->InspectionDate = JsonConverters::from('DateTime', $o['InspectionDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AgentUID)) $o['AgentUID'] = $this->AgentUID;
        if (isset($this->ContactUID)) $o['ContactUID'] = $this->ContactUID;
        if (isset($this->InspectionReportUID)) $o['InspectionReportUID'] = $this->InspectionReportUID;
        if (isset($this->TradeName)) $o['TradeName'] = $this->TradeName;
        if (isset($this->BusinessPhone)) $o['BusinessPhone'] = $this->BusinessPhone;
        if (isset($this->StreetAddress)) $o['StreetAddress'] = $this->StreetAddress;
        if (isset($this->ZipCode)) $o['ZipCode'] = $this->ZipCode;
        if (isset($this->OwnersName)) $o['OwnersName'] = $this->OwnersName;
        if (isset($this->ComplianceStatus)) $o['ComplianceStatus'] = $this->ComplianceStatus;
        if (isset($this->IsBusinessClassABeer)) $o['IsBusinessClassABeer'] = $this->IsBusinessClassABeer;
        if (isset($this->IsBusinessClassBBeer)) $o['IsBusinessClassBBeer'] = $this->IsBusinessClassBBeer;
        if (isset($this->IsBusinessClassALiquor)) $o['IsBusinessClassALiquor'] = $this->IsBusinessClassALiquor;
        if (isset($this->IsBusinessClassBLiquor)) $o['IsBusinessClassBLiquor'] = $this->IsBusinessClassBLiquor;
        if (isset($this->IsBusinessClassD)) $o['IsBusinessClassD'] = $this->IsBusinessClassD;
        if (isset($this->IsBusinessClassM)) $o['IsBusinessClassM'] = $this->IsBusinessClassM;
        if (isset($this->IsBusinessClassP)) $o['IsBusinessClassP'] = $this->IsBusinessClassP;
        if (isset($this->IsBusinessClassR)) $o['IsBusinessClassR'] = $this->IsBusinessClassR;
        if (isset($this->IsBusinessClassRAH)) $o['IsBusinessClassRAH'] = $this->IsBusinessClassRAH;
        if (isset($this->ClassBeerAccountNum)) $o['ClassBeerAccountNum'] = $this->ClassBeerAccountNum;
        if (isset($this->ClassBeerStateNum)) $o['ClassBeerStateNum'] = $this->ClassBeerStateNum;
        if (isset($this->ClassLiquorAccountNum)) $o['ClassLiquorAccountNum'] = $this->ClassLiquorAccountNum;
        if (isset($this->ClassLiquorStateNum)) $o['ClassLiquorStateNum'] = $this->ClassLiquorStateNum;
        if (isset($this->LicensedEmployees)) $o['LicensedEmployees'] = JsonConverters::toArray('Employee', $this->LicensedEmployees);
        if (isset($this->AgentName)) $o['AgentName'] = $this->AgentName;
        if (isset($this->ManagerSignature)) $o['ManagerSignature'] = JsonConverters::to('Object', $this->ManagerSignature);
        if (isset($this->ManagerName)) $o['ManagerName'] = $this->ManagerName;
        if (isset($this->ManagerPhone)) $o['ManagerPhone'] = $this->ManagerPhone;
        if (isset($this->InspectionDate)) $o['InspectionDate'] = JsonConverters::to('DateTime', $this->InspectionDate);
        return empty($o) ? new class(){} : $o;
    }
}

class GetInspectionReportResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<InspectionReport>|null */
        public ?array $Result=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class GetInspectionReport implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $AgentUID='',
        /** @var string */
        public string $ContactUID='',
        /** @var string */
        public string $InspectionReportUID=''
    ) {
    }

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

PHP GetInspectionReport 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.

GET /v1/InspectionReport/{AgentUID}/{ContactUID}/ HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetInspectionReportResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Result>
    <InspectionReport>
      <AgentName>String</AgentName>
      <AgentUID>00000000-0000-0000-0000-000000000000</AgentUID>
      <BusinessPhone>String</BusinessPhone>
      <ClassBeerAccountNum>String</ClassBeerAccountNum>
      <ClassBeerStateNum>String</ClassBeerStateNum>
      <ClassLiquorAccountNum>String</ClassLiquorAccountNum>
      <ClassLiquorStateNum>String</ClassLiquorStateNum>
      <ComplianceStatus>0</ComplianceStatus>
      <ContactUID>00000000-0000-0000-0000-000000000000</ContactUID>
      <InspectionDate>0001-01-01T00:00:00</InspectionDate>
      <InspectionReportUID>00000000-0000-0000-0000-000000000000</InspectionReportUID>
      <IsBusinessClassABeer>false</IsBusinessClassABeer>
      <IsBusinessClassALiquor>false</IsBusinessClassALiquor>
      <IsBusinessClassBBeer>false</IsBusinessClassBBeer>
      <IsBusinessClassBLiquor>false</IsBusinessClassBLiquor>
      <IsBusinessClassD>false</IsBusinessClassD>
      <IsBusinessClassM>false</IsBusinessClassM>
      <IsBusinessClassP>false</IsBusinessClassP>
      <IsBusinessClassR>false</IsBusinessClassR>
      <IsBusinessClassRAH>false</IsBusinessClassRAH>
      <LicensedEmployees>
        <Employee>
          <FirstName>String</FirstName>
          <IsOnDuty>false</IsOnDuty>
          <LastName>String</LastName>
          <LicenseExpirationDate>0001-01-01T00:00:00</LicenseExpirationDate>
          <LicenseNumber>String</LicenseNumber>
          <LicenseTypeCode>0</LicenseTypeCode>
          <MiddleName>String</MiddleName>
        </Employee>
      </LicensedEmployees>
      <ManagerName>String</ManagerName>
      <ManagerPhone>String</ManagerPhone>
      <ManagerSignature />
      <OwnersName>String</OwnersName>
      <StreetAddress>String</StreetAddress>
      <TradeName>String</TradeName>
      <ZipCode>String</ZipCode>
    </InspectionReport>
  </Result>
</GetInspectionReportResponse>