BokaMera.API.Host

<back to all web services

UnSyncedUsers

The following routes are available for this service:
GET/unsyncedusers/Get user that are no sync benween DB and Keycloack
<?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 UnSyncedUserResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Email='',
        /** @var bool|null */
        public ?bool $InDb=null,
        /** @var bool|null */
        public ?bool $InKeyCloak=null,
        /** @var bool|null */
        public ?bool $ErrorGettingValuesFromKeyCloak=null
    ) {
    }

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

class UnSyncedUsersResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $CompanyId='',
        /** @var array<UnSyncedUserResponse>|null */
        public ?array $UnSyncedUsers=null
    ) {
    }

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

class UnSyncedUsers implements JsonSerializable
{
    public function __construct(
        /** @description Id of the company */
        // @ApiMember(Description="Id of the company", IsRequired=true, ParameterType="path")
        /** @var string */
        public string $CompanyId=''
    ) {
    }

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

PHP UnSyncedUsers 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 /unsyncedusers/ HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<UnSyncedUsersResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <UnSyncedUsers>
    <UnSyncedUserResponse>
      <Email>String</Email>
      <ErrorGettingValuesFromKeyCloak>false</ErrorGettingValuesFromKeyCloak>
      <InDb>false</InDb>
      <InKeyCloak>false</InKeyCloak>
    </UnSyncedUserResponse>
  </UnSyncedUsers>
</UnSyncedUsersResponse>