Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /homepage/settings | Update the homepage settings | Update the homepage settings on the company of the currently logged in user, only administrators are allowed to update homepage menu. |
---|
import 'package:servicestack/servicestack.dart';
class HomepageTemplateResponse implements IConvertible
{
/**
* The template id
*/
// @ApiMember(Description="The template id")
int? Id;
/**
* The template name
*/
// @ApiMember(Description="The template name")
String? Name;
/**
* The template description
*/
// @ApiMember(Description="The template description")
String? Description;
/**
* The template image url
*/
// @ApiMember(Description="The template image url")
Uri? ImageUrl;
HomepageTemplateResponse({this.Id,this.Name,this.Description,this.ImageUrl});
HomepageTemplateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Description = json['Description'];
ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Description': Description,
'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!)
};
getTypeName() => "HomepageTemplateResponse";
TypeContext? context = _ctx;
}
class HomepageHeroSectionStyleResponse implements IConvertible
{
/**
* The hero section style id
*/
// @ApiMember(Description="The hero section style id")
int? Id;
/**
* The hero section style name
*/
// @ApiMember(Description="The hero section style name")
String? Name;
/**
* The hero section style description
*/
// @ApiMember(Description="The hero section style description")
String? Description;
HomepageHeroSectionStyleResponse({this.Id,this.Name,this.Description});
HomepageHeroSectionStyleResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Description = json['Description'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Description': Description
};
getTypeName() => "HomepageHeroSectionStyleResponse";
TypeContext? context = _ctx;
}
class HomepageSettingsQueryResponse implements IConvertible
{
/**
* The company id
*/
// @ApiMember(Description="The company id")
String? CompanyId;
/**
* The text for homepage heading
*/
// @ApiMember(Description="The text for homepage heading")
String? HomepageHeading;
/**
* The text for homepage startpage heading
*/
// @ApiMember(Description="The text for homepage startpage heading")
String? WelcomePageHeading;
/**
* The text for homepage startpage body
*/
// @ApiMember(Description="The text for homepage startpage body")
String? WelcomePageBody;
/**
* The text for homepage about us page heading
*/
// @ApiMember(Description="The text for homepage about us page heading")
String? AboutUsPageHeading;
/**
* The text for homepage about us page body
*/
// @ApiMember(Description="The text for homepage about us page body")
String? AboutUsPageBody;
/**
* The startpage image url
*/
// @ApiMember(Description="The startpage image url")
Uri? ImageUrl;
/**
* The template for the homepage
*/
// @ApiMember(Description="The template for the homepage")
int? HomePageTemplateId;
/**
* The hero section style for the homepage
*/
// @ApiMember(Description="The hero section style for the homepage")
int? HeroSectionStyleId;
/**
* Show rating on the page
*/
// @ApiMember(Description="Show rating on the page")
bool? ShowRating;
/**
* Enable the BokaMera Homepage
*/
// @ApiMember(Description="Enable the BokaMera Homepage")
bool? EnableHomepage;
/**
* Will show when the homepage settings was created, note it will only be shown if your logged in as admin for the company.
*/
// @ApiMember(DataType="datetime", Description="Will show when the homepage settings was created, note it will only be shown if your logged in as admin for the company.")
DateTime? Updated;
/**
* Will show when the homepage settings was updated, note it will only be shown if your logged in as admin for the company.
*/
// @ApiMember(DataType="datetime", Description="Will show when the homepage settings was updated, note it will only be shown if your logged in as admin for the company.")
DateTime? Created;
/**
* The homepage templates options to select from
*/
// @ApiMember(DataType="boolean", Description="The homepage templates options to select from", ParameterType="query")
List<HomepageTemplateResponse>? HomePageTemplateOptions;
/**
* The homepage hero section style options to select from
*/
// @ApiMember(DataType="boolean", Description="The homepage hero section style options to select from", ParameterType="query")
List<HomepageHeroSectionStyleResponse>? HomepageHeroSectionStyleOptions;
HomepageSettingsQueryResponse({this.CompanyId,this.HomepageHeading,this.WelcomePageHeading,this.WelcomePageBody,this.AboutUsPageHeading,this.AboutUsPageBody,this.ImageUrl,this.HomePageTemplateId,this.HeroSectionStyleId,this.ShowRating,this.EnableHomepage,this.Updated,this.Created,this.HomePageTemplateOptions,this.HomepageHeroSectionStyleOptions});
HomepageSettingsQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
HomepageHeading = json['HomepageHeading'];
WelcomePageHeading = json['WelcomePageHeading'];
WelcomePageBody = json['WelcomePageBody'];
AboutUsPageHeading = json['AboutUsPageHeading'];
AboutUsPageBody = json['AboutUsPageBody'];
ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!);
HomePageTemplateId = json['HomePageTemplateId'];
HeroSectionStyleId = json['HeroSectionStyleId'];
ShowRating = json['ShowRating'];
EnableHomepage = json['EnableHomepage'];
Updated = JsonConverters.fromJson(json['Updated'],'DateTime',context!);
Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
HomePageTemplateOptions = JsonConverters.fromJson(json['HomePageTemplateOptions'],'List<HomepageTemplateResponse>',context!);
HomepageHeroSectionStyleOptions = JsonConverters.fromJson(json['HomepageHeroSectionStyleOptions'],'List<HomepageHeroSectionStyleResponse>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'HomepageHeading': HomepageHeading,
'WelcomePageHeading': WelcomePageHeading,
'WelcomePageBody': WelcomePageBody,
'AboutUsPageHeading': AboutUsPageHeading,
'AboutUsPageBody': AboutUsPageBody,
'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!),
'HomePageTemplateId': HomePageTemplateId,
'HeroSectionStyleId': HeroSectionStyleId,
'ShowRating': ShowRating,
'EnableHomepage': EnableHomepage,
'Updated': JsonConverters.toJson(Updated,'DateTime',context!),
'Created': JsonConverters.toJson(Created,'DateTime',context!),
'HomePageTemplateOptions': JsonConverters.toJson(HomePageTemplateOptions,'List<HomepageTemplateResponse>',context!),
'HomepageHeroSectionStyleOptions': JsonConverters.toJson(HomepageHeroSectionStyleOptions,'List<HomepageHeroSectionStyleResponse>',context!)
};
getTypeName() => "HomepageSettingsQueryResponse";
TypeContext? context = _ctx;
}
// @ValidateRequest(Validator="IsAuthenticated")
class UpdateHomepageSettings implements ICompany, IConvertible
{
/**
* The company id
*/
// @ApiMember(Description="The company id")
String? CompanyId;
/**
* The text for homepage heading
*/
// @ApiMember(Description="The text for homepage heading")
String? HomepageHeading;
/**
* The text for homepage startpage heading
*/
// @ApiMember(Description="The text for homepage startpage heading")
String? WelcomePageHeading;
/**
* The text for homepage startpage body
*/
// @ApiMember(Description="The text for homepage startpage body")
String? WelcomePageBody;
/**
* The text for homepage about us page heading
*/
// @ApiMember(Description="The text for homepage about us page heading")
String? AboutUsPageHeading;
/**
* The text for homepage about us page body
*/
// @ApiMember(Description="The text for homepage about us page body")
String? AboutUsPageBody;
/**
* The start page image url
*/
// @ApiMember(Description="The start page image url")
Uri? ImageUrl;
/**
* The template for the homepage
*/
// @ApiMember(Description="The template for the homepage")
int? HomePageTemplateId;
/**
* Show rating on the page
*/
// @ApiMember(Description="Show rating on the page")
bool? ShowRating;
/**
* Enable the BokaMera Homepage
*/
// @ApiMember(Description="Enable the BokaMera Homepage")
bool? EnableHomepage;
/**
* The hero section style for the homepage
*/
// @ApiMember(Description="The hero section style for the homepage")
int? HeroSectionStyleId;
UpdateHomepageSettings({this.CompanyId,this.HomepageHeading,this.WelcomePageHeading,this.WelcomePageBody,this.AboutUsPageHeading,this.AboutUsPageBody,this.ImageUrl,this.HomePageTemplateId,this.ShowRating,this.EnableHomepage,this.HeroSectionStyleId});
UpdateHomepageSettings.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
HomepageHeading = json['HomepageHeading'];
WelcomePageHeading = json['WelcomePageHeading'];
WelcomePageBody = json['WelcomePageBody'];
AboutUsPageHeading = json['AboutUsPageHeading'];
AboutUsPageBody = json['AboutUsPageBody'];
ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!);
HomePageTemplateId = json['HomePageTemplateId'];
ShowRating = json['ShowRating'];
EnableHomepage = json['EnableHomepage'];
HeroSectionStyleId = json['HeroSectionStyleId'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'HomepageHeading': HomepageHeading,
'WelcomePageHeading': WelcomePageHeading,
'WelcomePageBody': WelcomePageBody,
'AboutUsPageHeading': AboutUsPageHeading,
'AboutUsPageBody': AboutUsPageBody,
'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!),
'HomePageTemplateId': HomePageTemplateId,
'ShowRating': ShowRating,
'EnableHomepage': EnableHomepage,
'HeroSectionStyleId': HeroSectionStyleId
};
getTypeName() => "UpdateHomepageSettings";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'HomepageTemplateResponse': TypeInfo(TypeOf.Class, create:() => HomepageTemplateResponse()),
'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
'HomepageHeroSectionStyleResponse': TypeInfo(TypeOf.Class, create:() => HomepageHeroSectionStyleResponse()),
'HomepageSettingsQueryResponse': TypeInfo(TypeOf.Class, create:() => HomepageSettingsQueryResponse()),
'List<HomepageTemplateResponse>': TypeInfo(TypeOf.Class, create:() => <HomepageTemplateResponse>[]),
'List<HomepageHeroSectionStyleResponse>': TypeInfo(TypeOf.Class, create:() => <HomepageHeroSectionStyleResponse>[]),
'UpdateHomepageSettings': TypeInfo(TypeOf.Class, create:() => UpdateHomepageSettings()),
});
Dart UpdateHomepageSettings DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /homepage/settings HTTP/1.1
Host: api.bokamera.se
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","HomepageHeading":"String","WelcomePageHeading":"String","WelcomePageBody":"String","AboutUsPageHeading":"String","AboutUsPageBody":"String","HomePageTemplateId":0,"ShowRating":false,"EnableHomepage":false,"HeroSectionStyleId":0}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"HomepageHeading":"String","WelcomePageHeading":"String","WelcomePageBody":"String","AboutUsPageHeading":"String","AboutUsPageBody":"String","HomePageTemplateId":0,"HeroSectionStyleId":0,"ShowRating":false,"EnableHomepage":false,"Updated":"0001-01-01T00:00:00","Created":"0001-01-01T00:00:00","HomePageTemplateOptions":[{"Id":0,"Name":"String","Description":"String"}],"HomepageHeroSectionStyleOptions":[{"Id":0,"Name":"String","Description":"String"}]}