| GET | /widget/configuration | List or get widget configurations | Returns widget configurations. If slug is provided, returns a single configuration matching that slug. Otherwise returns all configurations for the company. |
|---|
import 'package:servicestack/servicestack.dart';
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
class WidgetConfigurationQuery implements ICompany, IConvertible
{
/**
* 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.")
String? CompanyId;
/**
* Optional slug to fetch a single configuration (e.g., 'hairsalon-001'). If provided, ignores other filter parameters.
*/
// @ApiMember(Description="Optional slug to fetch a single configuration (e.g., 'hairsalon-001'). If provided, ignores other filter parameters.")
String? Slug;
/**
* Filter by schema version.
*/
// @ApiMember(Description="Filter by schema version.")
int? SchemaVersion;
/**
* Number of records to skip
*/
// @ApiMember(Description="Number of records to skip")
int? Skip;
/**
* Number of records to take
*/
// @ApiMember(Description="Number of records to take")
int? Take;
/**
* Sort field
*/
// @ApiMember(Description="Sort field")
String OrderBy = "";
WidgetConfigurationQuery({this.CompanyId,this.Slug,this.SchemaVersion,this.Skip,this.Take,this.OrderBy});
WidgetConfigurationQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
Slug = json['Slug'];
SchemaVersion = json['SchemaVersion'];
Skip = json['Skip'];
Take = json['Take'];
OrderBy = json['OrderBy'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'Slug': Slug,
'SchemaVersion': SchemaVersion,
'Skip': Skip,
'Take': Take,
'OrderBy': OrderBy
};
getTypeName() => "WidgetConfigurationQuery";
TypeContext? context = _ctx;
}
class AccessKeyTypeResponse implements IConvertible
{
int Id = 0;
String KeyType = "";
String Description = "";
AccessKeyTypeResponse({this.Id,this.KeyType,this.Description});
AccessKeyTypeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
KeyType = json['KeyType'];
Description = json['Description'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'KeyType': KeyType,
'Description': Description
};
getTypeName() => "AccessKeyTypeResponse";
TypeContext? context = _ctx;
}
// @DataContract
class QueryResponse<T> implements IConvertible
{
// @DataMember(Order=1)
int Offset = 0;
// @DataMember(Order=2)
int Total = 0;
// @DataMember(Order=3)
List<AccessKeyTypeResponse> Results = [];
// @DataMember(Order=4)
Map<String,String?>? Meta;
// @DataMember(Order=5)
ResponseStatus? ResponseStatus;
QueryResponse({this.Offset,this.Total,this.Results,this.Meta,this.ResponseStatus});
QueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Offset = json['Offset'];
Total = json['Total'];
Results = JsonConverters.fromJson(json['Results'],'List<AccessKeyTypeResponse>',context!);
Meta = JsonConverters.toStringMap(json['Meta']);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Offset': Offset,
'Total': Total,
'Results': JsonConverters.toJson(Results,'List<AccessKeyTypeResponse>',context!),
'Meta': Meta,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "QueryResponse<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
'WidgetConfigurationQuery': TypeInfo(TypeOf.Class, create:() => WidgetConfigurationQuery()),
'AccessKeyTypeResponse': TypeInfo(TypeOf.Class, create:() => AccessKeyTypeResponse()),
'List<AccessKeyTypeResponse>': TypeInfo(TypeOf.Class, create:() => <AccessKeyTypeResponse>[]),
});
Dart WidgetConfigurationQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /widget/configuration HTTP/1.1 Host: testapi.bokamera.se Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<QueryResponseOfWidgetConfigurationResponseWg5EthtI xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<Offset>0</Offset>
<Total>0</Total>
<Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<d2p1:WidgetConfigurationResponse>
<d2p1:CompanyId>00000000-0000-0000-0000-000000000000</d2p1:CompanyId>
<d2p1:Configuration>String</d2p1:Configuration>
<d2p1:CreatedDate>0001-01-01T00:00:00</d2p1:CreatedDate>
<d2p1:Description>String</d2p1:Description>
<d2p1:Id>String</d2p1:Id>
<d2p1:Name>String</d2p1:Name>
<d2p1:ResponseStatus>
<ErrorCode>String</ErrorCode>
<Message>String</Message>
<StackTrace>String</StackTrace>
<Errors>
<ResponseError>
<ErrorCode>String</ErrorCode>
<FieldName>String</FieldName>
<Message>String</Message>
<Meta xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d7p1:KeyValueOfstringstring>
<d7p1:Key>String</d7p1:Key>
<d7p1:Value>String</d7p1:Value>
</d7p1:KeyValueOfstringstring>
</Meta>
</ResponseError>
</Errors>
<Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</Meta>
</d2p1:ResponseStatus>
<d2p1:SchemaVersion>0</d2p1:SchemaVersion>
<d2p1:Slug>String</d2p1:Slug>
<d2p1:UpdatedDate xmlns:d4p1="http://schemas.datacontract.org/2004/07/System">
<d4p1:DateTime>0001-01-01T00:00:00Z</d4p1:DateTime>
<d4p1:OffsetMinutes>0</d4p1:OffsetMinutes>
</d2p1:UpdatedDate>
</d2p1:WidgetConfigurationResponse>
</Results>
<Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</Meta>
<ResponseStatus>
<ErrorCode>String</ErrorCode>
<Message>String</Message>
<StackTrace>String</StackTrace>
<Errors>
<ResponseError>
<ErrorCode>String</ErrorCode>
<FieldName>String</FieldName>
<Message>String</Message>
<Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</Meta>
</ResponseError>
</Errors>
<Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</Meta>
</ResponseStatus>
</QueryResponseOfWidgetConfigurationResponseWg5EthtI>