Cochrane+ App API

<back to all web services

GetAllMeetings

Requires Authentication
The following routes are available for this service:
GET/user/meetings
<?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 ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo, JsonSerializable
{
    public function __construct(
        /** @description The API Key required for authentication */
        // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
        /** @var string */
        public string $apiKey='',

        /** @description Latitude of the user making this request */
        // @ApiMember(DataType="double", Description="Latitude of the user making this request")
        /** @var float */
        public float $latitude=0.0,

        /** @description Longitude of the user making this request */
        // @ApiMember(DataType="double", Description="Longitude of the user making this request")
        /** @var float */
        public float $longitude=0.0
    ) {
    }

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

class ApiServiceResponse implements IServiceResponse, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $description=null,
        /** @var string|null */
        public ?string $heading=null,
        /** @var bool|null */
        public ?bool $wasSuccessful=null,
        /** @var Object|null */
        public ?Object $modelState=null
    ) {
    }

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

class MeetingData implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $meetingId=0,
        /** @var string|null */
        public ?string $startTime=null,
        /** @var string|null */
        public ?string $arrivalTime=null,
        /** @var string|null */
        public ?string $leftTime=null,
        /** @var string|null */
        public ?string $duration=null,
        /** @var bool|null */
        public ?bool $showTimeFields=null,
        /** @var string|null */
        public ?string $arrivalStatus=null,
        /** @var string|null */
        public ?string $email=null,
        /** @var bool|null */
        public ?bool $hasEmail=null,
        /** @var string|null */
        public ?string $contactName=null,
        /** @var float */
        public float $latitude=0.0,
        /** @var float */
        public float $longitude=0.0,
        /** @var string|null */
        public ?string $location=null,
        /** @var string|null */
        public ?string $address=null,
        /** @var string|null */
        public ?string $subject=null,
        /** @var string|null */
        public ?string $description=null,
        /** @var string|null */
        public ?string $endTime=null,
        /** @var string|null */
        public ?string $company=null,
        /** @var string|null */
        public ?string $contactNumber=null,
        /** @var bool|null */
        public ?bool $hasContactNumber=null,
        /** @var bool|null */
        public ?bool $hasLocation=null,
        /** @var string|null */
        public ?string $setBy=null,
        /** @var string|null */
        public ?string $virtualOrInPerson=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['meetingId'])) $this->meetingId = $o['meetingId'];
        if (isset($o['startTime'])) $this->startTime = $o['startTime'];
        if (isset($o['arrivalTime'])) $this->arrivalTime = $o['arrivalTime'];
        if (isset($o['leftTime'])) $this->leftTime = $o['leftTime'];
        if (isset($o['duration'])) $this->duration = $o['duration'];
        if (isset($o['showTimeFields'])) $this->showTimeFields = $o['showTimeFields'];
        if (isset($o['arrivalStatus'])) $this->arrivalStatus = $o['arrivalStatus'];
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['hasEmail'])) $this->hasEmail = $o['hasEmail'];
        if (isset($o['contactName'])) $this->contactName = $o['contactName'];
        if (isset($o['latitude'])) $this->latitude = $o['latitude'];
        if (isset($o['longitude'])) $this->longitude = $o['longitude'];
        if (isset($o['location'])) $this->location = $o['location'];
        if (isset($o['address'])) $this->address = $o['address'];
        if (isset($o['subject'])) $this->subject = $o['subject'];
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['endTime'])) $this->endTime = $o['endTime'];
        if (isset($o['company'])) $this->company = $o['company'];
        if (isset($o['contactNumber'])) $this->contactNumber = $o['contactNumber'];
        if (isset($o['hasContactNumber'])) $this->hasContactNumber = $o['hasContactNumber'];
        if (isset($o['hasLocation'])) $this->hasLocation = $o['hasLocation'];
        if (isset($o['setBy'])) $this->setBy = $o['setBy'];
        if (isset($o['virtualOrInPerson'])) $this->virtualOrInPerson = $o['virtualOrInPerson'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->meetingId)) $o['meetingId'] = $this->meetingId;
        if (isset($this->startTime)) $o['startTime'] = $this->startTime;
        if (isset($this->arrivalTime)) $o['arrivalTime'] = $this->arrivalTime;
        if (isset($this->leftTime)) $o['leftTime'] = $this->leftTime;
        if (isset($this->duration)) $o['duration'] = $this->duration;
        if (isset($this->showTimeFields)) $o['showTimeFields'] = $this->showTimeFields;
        if (isset($this->arrivalStatus)) $o['arrivalStatus'] = $this->arrivalStatus;
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->hasEmail)) $o['hasEmail'] = $this->hasEmail;
        if (isset($this->contactName)) $o['contactName'] = $this->contactName;
        if (isset($this->latitude)) $o['latitude'] = $this->latitude;
        if (isset($this->longitude)) $o['longitude'] = $this->longitude;
        if (isset($this->location)) $o['location'] = $this->location;
        if (isset($this->address)) $o['address'] = $this->address;
        if (isset($this->subject)) $o['subject'] = $this->subject;
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->endTime)) $o['endTime'] = $this->endTime;
        if (isset($this->company)) $o['company'] = $this->company;
        if (isset($this->contactNumber)) $o['contactNumber'] = $this->contactNumber;
        if (isset($this->hasContactNumber)) $o['hasContactNumber'] = $this->hasContactNumber;
        if (isset($this->hasLocation)) $o['hasLocation'] = $this->hasLocation;
        if (isset($this->setBy)) $o['setBy'] = $this->setBy;
        if (isset($this->virtualOrInPerson)) $o['virtualOrInPerson'] = $this->virtualOrInPerson;
        return empty($o) ? new class(){} : $o;
    }
}

class MeetingGroupData implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $time=null,
        /** @var array<MeetingData>|null */
        public ?array $meetings=null
    ) {
    }

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

enum ArrivalStatusEnum : int
{
    case Unknown = 0;
    case OnTime = 1;
    case Late = 2;
}

class GetAllMeetingsResponse extends ApiServiceResponse implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param string|null $heading
     * @param bool|null $wasSuccessful
     * @param Object|null $modelState
     */
    public function __construct(
        ?string $description=null,
        ?string $heading=null,
        ?bool $wasSuccessful=null,
        ?Object $modelState=null,
        /** @var float */
        public float $startLatitude=0.0,
        /** @var float */
        public float $startLongitude=0.0,
        /** @var float */
        public float $endLatitude=0.0,
        /** @var float */
        public float $endLongitude=0.0,
        /** @var array<MeetingGroupData>|null */
        public ?array $meetingGroups=null,
        /** @var MeetingData|null */
        public ?MeetingData $nextMeeting=null,
        /** @var ArrivalStatusEnum|null */
        public ?ArrivalStatusEnum $arrivalStatusEnum=null
    ) {
        parent::__construct($description,$heading,$wasSuccessful,$modelState);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['startLatitude'])) $this->startLatitude = $o['startLatitude'];
        if (isset($o['startLongitude'])) $this->startLongitude = $o['startLongitude'];
        if (isset($o['endLatitude'])) $this->endLatitude = $o['endLatitude'];
        if (isset($o['endLongitude'])) $this->endLongitude = $o['endLongitude'];
        if (isset($o['meetingGroups'])) $this->meetingGroups = JsonConverters::fromArray('MeetingGroupData', $o['meetingGroups']);
        if (isset($o['nextMeeting'])) $this->nextMeeting = JsonConverters::from('MeetingData', $o['nextMeeting']);
        if (isset($o['arrivalStatusEnum'])) $this->arrivalStatusEnum = JsonConverters::from('ArrivalStatusEnum', $o['arrivalStatusEnum']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->startLatitude)) $o['startLatitude'] = $this->startLatitude;
        if (isset($this->startLongitude)) $o['startLongitude'] = $this->startLongitude;
        if (isset($this->endLatitude)) $o['endLatitude'] = $this->endLatitude;
        if (isset($this->endLongitude)) $o['endLongitude'] = $this->endLongitude;
        if (isset($this->meetingGroups)) $o['meetingGroups'] = JsonConverters::toArray('MeetingGroupData', $this->meetingGroups);
        if (isset($this->nextMeeting)) $o['nextMeeting'] = JsonConverters::to('MeetingData', $this->nextMeeting);
        if (isset($this->arrivalStatusEnum)) $o['arrivalStatusEnum'] = JsonConverters::to('ArrivalStatusEnum', $this->arrivalStatusEnum);
        return empty($o) ? new class(){} : $o;
    }
}

class GetAllMeetings extends ApiServiceRequest implements JsonSerializable
{
    /**
     * @param string $apiKey
     * @param float $latitude
     * @param float $longitude
     */
    public function __construct(
        string $apiKey='',
        float $latitude=0.0,
        float $longitude=0.0,
        // @ApiMember(IsRequired=true)
        /** @var string */
        public string $date='',

        /** @var bool|null */
        public ?bool $dashboard=null
    ) {
        parent::__construct($apiKey,$latitude,$longitude);
    }

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

PHP GetAllMeetings DTOs

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

HTTP + JSV

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

GET /user/meetings HTTP/1.1 
Host: cochraneplus-api-dev.happen.zone 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	startLatitude: 0,
	startLongitude: 0,
	endLatitude: 0,
	endLongitude: 0,
	meetingGroups: 
	[
		{
			
		}
	],
	nextMeeting: 
	{
		meetingId: 0,
		startTime: String,
		arrivalTime: String,
		leftTime: String,
		duration: String,
		showTimeFields: False,
		arrivalStatus: String,
		email: String,
		hasEmail: True,
		contactName: String,
		latitude: 0,
		longitude: 0,
		location: String,
		address: String,
		subject: String,
		description: String,
		endTime: String,
		company: String,
		contactNumber: String,
		hasContactNumber: True,
		hasLocation: False,
		setBy: String,
		virtualOrInPerson: String
	},
	arrivalStatusEnum: 0,
	description: String,
	heading: String,
	wasSuccessful: False,
	modelState: {}
}