Requires any of the roles: | bookingsupplier-administrator-write, superadmin, bookingsupplier-administrator-read |
GET | /bookings/{Id}/resources/available | Find available resources. |
---|
import 'package:servicestack/servicestack.dart';
class AvailableResourceResponse implements IConvertible
{
/**
* The resource id
*/
// @ApiMember(Description="The resource id")
int? Id;
/**
* The resource name
*/
// @ApiMember(Description="The resource name")
String? Name;
/**
* The resource description
*/
// @ApiMember(Description="The resource description")
String? Description;
/**
* The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue.
*/
// @ApiMember(Description="The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue.")
String? Color;
/**
* The image url of the resource
*/
// @ApiMember(Description="The image url of the resource")
Uri? ImageUrl;
AvailableResourceResponse({this.Id,this.Name,this.Description,this.Color,this.ImageUrl});
AvailableResourceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Description = json['Description'];
Color = json['Color'];
ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Description': Description,
'Color': Color,
'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!)
};
getTypeName() => "AvailableResourceResponse";
TypeContext? context = _ctx;
}
class ResourceTypeAvailableResourcesQueryResponse implements IConvertible
{
/**
* The resourcetype id
*/
// @ApiMember(Description="The resourcetype id")
int? Id;
/**
* The available resources
*/
// @ApiMember(Description="The available resources")
List<AvailableResourceResponse>? Resources;
ResourceTypeAvailableResourcesQueryResponse({this.Id,this.Resources});
ResourceTypeAvailableResourcesQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Resources = JsonConverters.fromJson(json['Resources'],'List<AvailableResourceResponse>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Resources': JsonConverters.toJson(Resources,'List<AvailableResourceResponse>',context!)
};
getTypeName() => "ResourceTypeAvailableResourcesQueryResponse";
TypeContext? context = _ctx;
}
// @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 ResourceTypeAvailableResourcesQuery implements ICompany, IConvertible
{
/**
* Enter the company and id you want to see the information for a resourcetype, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown
*/
// @ApiMember(Description="Enter the company and id you want to see the information for a resourcetype, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown ", ParameterType="query")
String? CompanyId;
/**
* Enter the id for the booking.
*/
// @ApiMember(Description="Enter the id for the booking.", IsRequired=true, ParameterType="path")
int? Id;
/**
* Enter the id for a resourcetype.
*/
// @ApiMember(Description="Enter the id for a resourcetype.", IsRequired=true)
int? ResourceTypeId;
ResourceTypeAvailableResourcesQuery({this.CompanyId,this.Id,this.ResourceTypeId});
ResourceTypeAvailableResourcesQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
Id = json['Id'];
ResourceTypeId = json['ResourceTypeId'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'Id': Id,
'ResourceTypeId': ResourceTypeId
};
getTypeName() => "ResourceTypeAvailableResourcesQuery";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'AvailableResourceResponse': TypeInfo(TypeOf.Class, create:() => AvailableResourceResponse()),
'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
'ResourceTypeAvailableResourcesQueryResponse': TypeInfo(TypeOf.Class, create:() => ResourceTypeAvailableResourcesQueryResponse()),
'List<AvailableResourceResponse>': TypeInfo(TypeOf.Class, create:() => <AvailableResourceResponse>[]),
'ResourceTypeAvailableResourcesQuery': TypeInfo(TypeOf.Class, create:() => ResourceTypeAvailableResourcesQuery()),
});
Dart ResourceTypeAvailableResourcesQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /bookings/{Id}/resources/available HTTP/1.1 Host: api.bokamera.se Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"Id":0,"Resources":[{"Id":0,"Name":"String","Description":"String","Color":"String"}]}