BokaMera.API.Host

<back to all web services

GetAxemaUserSyncJob

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin, bookingsupplier-administrator-read
The following routes are available for this service:
GET/codelock/axema/usersync/{Id}Get a single Axema user sync job by idReturns the sync job details including progress counters.
<?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 AxemaUserSyncJobResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id='',
        /** @var string */
        public string $CompanyId='',
        /** @var int */
        public int $Status=0,
        /** @var string */
        public string $StatusName='',
        /** @var int|null */
        public ?int $UsersFound=null,
        /** @var int|null */
        public ?int $UsersCreated=null,
        /** @var int|null */
        public ?int $UsersUpdated=null,
        /** @var string|null */
        public ?string $ErrorMessage=null,
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),
        /** @var DateTime */
        public DateTime $UpdatedDate=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['StatusName'])) $this->StatusName = $o['StatusName'];
        if (isset($o['UsersFound'])) $this->UsersFound = $o['UsersFound'];
        if (isset($o['UsersCreated'])) $this->UsersCreated = $o['UsersCreated'];
        if (isset($o['UsersUpdated'])) $this->UsersUpdated = $o['UsersUpdated'];
        if (isset($o['ErrorMessage'])) $this->ErrorMessage = $o['ErrorMessage'];
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['UpdatedDate'])) $this->UpdatedDate = JsonConverters::from('DateTime', $o['UpdatedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->StatusName)) $o['StatusName'] = $this->StatusName;
        if (isset($this->UsersFound)) $o['UsersFound'] = $this->UsersFound;
        if (isset($this->UsersCreated)) $o['UsersCreated'] = $this->UsersCreated;
        if (isset($this->UsersUpdated)) $o['UsersUpdated'] = $this->UsersUpdated;
        if (isset($this->ErrorMessage)) $o['ErrorMessage'] = $this->ErrorMessage;
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->UpdatedDate)) $o['UpdatedDate'] = JsonConverters::to('DateTime', $this->UpdatedDate);
        return empty($o) ? new class(){} : $o;
    }
}

// @ValidateRequest(Validator="IsAuthenticated")
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ApiResponse(Description="You have too low privileges to call this service", StatusCode=403)
class GetAxemaUserSyncJob implements ICompany, JsonSerializable
{
    public function __construct(
        /** @description The sync job id. */
        // @ApiMember(Description="The sync job id.", IsRequired=true)
        /** @var string */
        public string $Id='',

        /** @description The company id, if empty will use the company id for the user you are logged in with. */
        // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
        /** @var string|null */
        public ?string $CompanyId=null
    ) {
    }

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

PHP GetAxemaUserSyncJob DTOs

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

HTTP + CSV

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

GET /codelock/axema/usersync/{Id} HTTP/1.1 
Host: api.bokamera.se 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Status":0,"StatusName":"String","UsersFound":0,"UsersCreated":0,"UsersUpdated":0,"ErrorMessage":"String"}