BokaMera.API.Host

<back to all web services

UpdateSystemSetting

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/settings/systemUpdate system settings for the currently logged in userUpdate system settings for the currently logged in user.
<?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 LanguageResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Name=null
    ) {
    }

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

class SystemSettingsResponse implements JsonSerializable
{
    public function __construct(
        /** @description The country options to choose from */
        // @ApiMember(Description="The country options to choose from")
        /** @var array<LanguageResponse>|null */
        public ?array $LanguageOptions=null,

        /** @description If the booking is active or not */
        // @ApiMember(DataType="bool", Description="If the booking is active or not")
        /** @var bool|null */
        public ?bool $Active=null,

        /** @description If the booking is not active, what message to show to the customers */
        // @ApiMember(DataType="string", Description="If the booking is not active, what message to show to the customers")
        /** @var string|null */
        public ?string $InactiveMessage=null,

        /** @description If the company should be visible in search results on hompage */
        // @ApiMember(DataType="bool", Description="If the company should be visible in search results on hompage")
        /** @var bool|null */
        public ?bool $Searchable=null,

        /** @description If you have a google analytics account and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a google analytics account and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $GATrackingId=null,

        /** @description If you have a google Ads Conversion Id account and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a google Ads Conversion Id account and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $GoogleAdsConversionId=null,

        /** @description If you have a LinkedIn account and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a LinkedIn account and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $LinkedinTagId=null,

        /** @description If you have a Google Ads Conversion Label and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a Google Ads Conversion Label and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $GoogleAdsConversionLabel=null,

        /** @description If you have a google tag manager account and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a google tag manager account and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $GTMTrackingId=null,

        /** @description If you have a facebook account and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a facebook account and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $FacebookPixelId=null,

        /** @description If the company should be visible on the marketplace */
        // @ApiMember(DataType="bool", Description="If the company should be visible on the marketplace")
        /** @var bool|null */
        public ?bool $ShowOnMarketplace=null,

        /** @description If you want your customers to be albe to change language on your homepage */
        // @ApiMember(DataType="bool", Description="If you want your customers to be albe to change language on your homepage")
        /** @var bool|null */
        public ?bool $MultiLanguage=null,

        /** @description If you want your own written text on your homepage to be translated using google analytics when a user changes language */
        // @ApiMember(DataType="bool", Description="If you want your own written text on your homepage to be translated using google analytics when a user changes language")
        /** @var bool|null */
        public ?bool $EnableAPITranslation=null,

        /** @description What is the standard language your homepage information is written in. Select from the different countries, ie. SE,NO,EN */
        // @ApiMember(DataType="string", Description="What is the standard language your homepage information is written in. Select from the different countries, ie. SE,NO,EN")
        /** @var string|null */
        public ?string $DefaultLanguage=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LanguageOptions'])) $this->LanguageOptions = JsonConverters::fromArray('LanguageResponse', $o['LanguageOptions']);
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['InactiveMessage'])) $this->InactiveMessage = $o['InactiveMessage'];
        if (isset($o['Searchable'])) $this->Searchable = $o['Searchable'];
        if (isset($o['GATrackingId'])) $this->GATrackingId = $o['GATrackingId'];
        if (isset($o['GoogleAdsConversionId'])) $this->GoogleAdsConversionId = $o['GoogleAdsConversionId'];
        if (isset($o['LinkedinTagId'])) $this->LinkedinTagId = $o['LinkedinTagId'];
        if (isset($o['GoogleAdsConversionLabel'])) $this->GoogleAdsConversionLabel = $o['GoogleAdsConversionLabel'];
        if (isset($o['GTMTrackingId'])) $this->GTMTrackingId = $o['GTMTrackingId'];
        if (isset($o['FacebookPixelId'])) $this->FacebookPixelId = $o['FacebookPixelId'];
        if (isset($o['ShowOnMarketplace'])) $this->ShowOnMarketplace = $o['ShowOnMarketplace'];
        if (isset($o['MultiLanguage'])) $this->MultiLanguage = $o['MultiLanguage'];
        if (isset($o['EnableAPITranslation'])) $this->EnableAPITranslation = $o['EnableAPITranslation'];
        if (isset($o['DefaultLanguage'])) $this->DefaultLanguage = $o['DefaultLanguage'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LanguageOptions)) $o['LanguageOptions'] = JsonConverters::toArray('LanguageResponse', $this->LanguageOptions);
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->InactiveMessage)) $o['InactiveMessage'] = $this->InactiveMessage;
        if (isset($this->Searchable)) $o['Searchable'] = $this->Searchable;
        if (isset($this->GATrackingId)) $o['GATrackingId'] = $this->GATrackingId;
        if (isset($this->GoogleAdsConversionId)) $o['GoogleAdsConversionId'] = $this->GoogleAdsConversionId;
        if (isset($this->LinkedinTagId)) $o['LinkedinTagId'] = $this->LinkedinTagId;
        if (isset($this->GoogleAdsConversionLabel)) $o['GoogleAdsConversionLabel'] = $this->GoogleAdsConversionLabel;
        if (isset($this->GTMTrackingId)) $o['GTMTrackingId'] = $this->GTMTrackingId;
        if (isset($this->FacebookPixelId)) $o['FacebookPixelId'] = $this->FacebookPixelId;
        if (isset($this->ShowOnMarketplace)) $o['ShowOnMarketplace'] = $this->ShowOnMarketplace;
        if (isset($this->MultiLanguage)) $o['MultiLanguage'] = $this->MultiLanguage;
        if (isset($this->EnableAPITranslation)) $o['EnableAPITranslation'] = $this->EnableAPITranslation;
        if (isset($this->DefaultLanguage)) $o['DefaultLanguage'] = $this->DefaultLanguage;
        return empty($o) ? new class(){} : $o;
    }
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403)
// @ValidateRequest(Validator="IsAuthenticated")
class UpdateSystemSetting implements ICompany, JsonSerializable
{
    public function __construct(
        /** @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,

        /** @description If the booking is active or not */
        // @ApiMember(DataType="bool", Description="If the booking is active or not")
        /** @var bool|null */
        public ?bool $Active=null,

        /** @description If the booking is not active, what message to show to the customers */
        // @ApiMember(DataType="string", Description="If the booking is not active, what message to show to the customers")
        /** @var string|null */
        public ?string $InactiveMessage=null,

        /** @description If the company should be visible in search results on hompage */
        // @ApiMember(DataType="bool", Description="If the company should be visible in search results on hompage")
        /** @var bool|null */
        public ?bool $Searchable=null,

        /** @description If you have a google analytics account and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a google analytics account and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $GATrackingId=null,

        /** @description If you have a google Ads Conversion Id account and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a google Ads Conversion Id account and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $GoogleAdsConversionId=null,

        /** @description If you have a LinkedIn account and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a LinkedIn account and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $LinkedinTagId=null,

        /** @description If you have a Google Ads Conversion Label and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a Google Ads Conversion Label and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $GoogleAdsConversionLabel=null,

        /** @description If you have a google tag manager account and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a google tag manager account and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $GTMTrackingId=null,

        /** @description If you have a facebook account and want to track your customers behaviors. */
        // @ApiMember(DataType="string", Description="If you have a facebook account and want to track your customers behaviors.")
        /** @var string|null */
        public ?string $FacebookPixelId=null,

        /** @description If the company should be visible on the marketplace */
        // @ApiMember(DataType="bool", Description="If the company should be visible on the marketplace")
        /** @var bool|null */
        public ?bool $ShowOnMarketplace=null,

        /** @description If you want your customers to be albe to change language on your homepage */
        // @ApiMember(DataType="bool", Description="If you want your customers to be albe to change language on your homepage")
        /** @var bool|null */
        public ?bool $MultiLanguage=null,

        /** @description If you want your own written text on your homepage to be translated using google analytics when a user changes language */
        // @ApiMember(DataType="bool", Description="If you want your own written text on your homepage to be translated using google analytics when a user changes language")
        /** @var bool|null */
        public ?bool $EnableAPITranslation=null,

        /** @description What is the standard language your homepage information is written in. Select from the different countries, ie. SE,NO,EN */
        // @ApiMember(DataType="string", Description="What is the standard language your homepage information is written in. Select from the different countries, ie. SE,NO,EN")
        /** @var string|null */
        public ?string $DefaultLanguage=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['InactiveMessage'])) $this->InactiveMessage = $o['InactiveMessage'];
        if (isset($o['Searchable'])) $this->Searchable = $o['Searchable'];
        if (isset($o['GATrackingId'])) $this->GATrackingId = $o['GATrackingId'];
        if (isset($o['GoogleAdsConversionId'])) $this->GoogleAdsConversionId = $o['GoogleAdsConversionId'];
        if (isset($o['LinkedinTagId'])) $this->LinkedinTagId = $o['LinkedinTagId'];
        if (isset($o['GoogleAdsConversionLabel'])) $this->GoogleAdsConversionLabel = $o['GoogleAdsConversionLabel'];
        if (isset($o['GTMTrackingId'])) $this->GTMTrackingId = $o['GTMTrackingId'];
        if (isset($o['FacebookPixelId'])) $this->FacebookPixelId = $o['FacebookPixelId'];
        if (isset($o['ShowOnMarketplace'])) $this->ShowOnMarketplace = $o['ShowOnMarketplace'];
        if (isset($o['MultiLanguage'])) $this->MultiLanguage = $o['MultiLanguage'];
        if (isset($o['EnableAPITranslation'])) $this->EnableAPITranslation = $o['EnableAPITranslation'];
        if (isset($o['DefaultLanguage'])) $this->DefaultLanguage = $o['DefaultLanguage'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->InactiveMessage)) $o['InactiveMessage'] = $this->InactiveMessage;
        if (isset($this->Searchable)) $o['Searchable'] = $this->Searchable;
        if (isset($this->GATrackingId)) $o['GATrackingId'] = $this->GATrackingId;
        if (isset($this->GoogleAdsConversionId)) $o['GoogleAdsConversionId'] = $this->GoogleAdsConversionId;
        if (isset($this->LinkedinTagId)) $o['LinkedinTagId'] = $this->LinkedinTagId;
        if (isset($this->GoogleAdsConversionLabel)) $o['GoogleAdsConversionLabel'] = $this->GoogleAdsConversionLabel;
        if (isset($this->GTMTrackingId)) $o['GTMTrackingId'] = $this->GTMTrackingId;
        if (isset($this->FacebookPixelId)) $o['FacebookPixelId'] = $this->FacebookPixelId;
        if (isset($this->ShowOnMarketplace)) $o['ShowOnMarketplace'] = $this->ShowOnMarketplace;
        if (isset($this->MultiLanguage)) $o['MultiLanguage'] = $this->MultiLanguage;
        if (isset($this->EnableAPITranslation)) $o['EnableAPITranslation'] = $this->EnableAPITranslation;
        if (isset($this->DefaultLanguage)) $o['DefaultLanguage'] = $this->DefaultLanguage;
        return empty($o) ? new class(){} : $o;
    }
}

PHP UpdateSystemSetting 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

HTTP + JSON

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

PUT /settings/system HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Active":false,"InactiveMessage":"String","Searchable":false,"GATrackingId":"String","GoogleAdsConversionId":"String","LinkedinTagId":"String","GoogleAdsConversionLabel":"String","GTMTrackingId":"String","FacebookPixelId":"String","ShowOnMarketplace":false,"MultiLanguage":false,"EnableAPITranslation":false,"DefaultLanguage":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"LanguageOptions":[{"Id":"String","Name":"String"}],"Active":false,"InactiveMessage":"String","Searchable":false,"GATrackingId":"String","GoogleAdsConversionId":"String","LinkedinTagId":"String","GoogleAdsConversionLabel":"String","GTMTrackingId":"String","FacebookPixelId":"String","ShowOnMarketplace":false,"MultiLanguage":false,"EnableAPITranslation":false,"DefaultLanguage":"String"}