GET | /settings/system | Get system settings for the currently logged in user | Get 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,
/** @description If you want to allow to send customer information in the tracking events to the external providers. Note you as a company are responsible for informing your customers and handling the data in terms of GDPR. */
// @ApiMember(Description="If you want to allow to send customer information in the tracking events to the external providers. Note you as a company are responsible for informing your customers and handling the data in terms of GDPR. ")
/** @var bool|null */
public ?bool $SendCustomerInformationToExternalProviders=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'];
if (isset($o['SendCustomerInformationToExternalProviders'])) $this->SendCustomerInformationToExternalProviders = $o['SendCustomerInformationToExternalProviders'];
}
/** @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;
if (isset($this->SendCustomerInformationToExternalProviders)) $o['SendCustomerInformationToExternalProviders'] = $this->SendCustomerInformationToExternalProviders;
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)
class SystemSettingQuery implements JsonSerializable
{
public function __construct(
/** @description If you want to include the language options to select from */
// @ApiMember(DataType="boolean", Description="If you want to include the language options to select from", ParameterType="query")
/** @var bool|null */
public ?bool $IncludeLanguageOptions=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['IncludeLanguageOptions'])) $this->IncludeLanguageOptions = $o['IncludeLanguageOptions'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->IncludeLanguageOptions)) $o['IncludeLanguageOptions'] = $this->IncludeLanguageOptions;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /settings/system HTTP/1.1 Host: api.bokamera.se Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv 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, SendCustomerInformationToExternalProviders: False }