| Requires the role: | TenantReader |
| GET | /api/patching/windows/{Id} | Returns a single patching window by its id | |
|---|---|---|---|
| GET | /patching/windows/{Id} | Returns a single patching window by its id |
import 'package:servicestack/servicestack.dart';
enum MonthlyDayOccurence
{
First,
Second,
Third,
Fourth,
}
class PatchingWindowDto implements IConvertible
{
String id = "";
String name = "";
DayOfWeek dayOfWeek;
MonthlyDayOccurence monthlyOccurence;
Duration timeOfDay;
Duration duration;
bool isDefault;
PatchingWindowDto({this.id,this.name,this.dayOfWeek,this.monthlyOccurence,this.timeOfDay,this.duration,this.isDefault});
PatchingWindowDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
dayOfWeek = JsonConverters.fromJson(json['dayOfWeek'],'DayOfWeek',context!);
monthlyOccurence = JsonConverters.fromJson(json['monthlyOccurence'],'MonthlyDayOccurence',context!);
timeOfDay = JsonConverters.fromJson(json['timeOfDay'],'Duration',context!);
duration = JsonConverters.fromJson(json['duration'],'Duration',context!);
isDefault = json['isDefault'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'dayOfWeek': JsonConverters.toJson(dayOfWeek,'DayOfWeek',context!),
'monthlyOccurence': JsonConverters.toJson(monthlyOccurence,'MonthlyDayOccurence',context!),
'timeOfDay': JsonConverters.toJson(timeOfDay,'Duration',context!),
'duration': JsonConverters.toJson(duration,'Duration',context!),
'isDefault': isDefault
};
getTypeName() => "PatchingWindowDto";
TypeContext? context = _ctx;
}
/**
* Returns a single patching window by its id
*/
// @Api(Description="Returns a single patching window by its id")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(PatchingWindowDto), StatusCode=200)
class GetPatchingWindow implements IBaseRequest, IHasId, IHasTenantName, IGet, IConvertible
{
/**
* The primary key of every config item
*/
// @ApiMember(DataType="string", Description="The primary key of every config item", Format="guid", IsRequired=true, ParameterType="path")
String id = "";
// @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
// @Validate(Validator="NotEmpty")
String tenantName = "";
GetPatchingWindow({this.id,this.tenantName});
GetPatchingWindow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
tenantName = json['tenantName'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'tenantName': tenantName
};
getTypeName() => "GetPatchingWindow";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
'MonthlyDayOccurence': TypeInfo(TypeOf.Enum, enumValues:MonthlyDayOccurence.values),
'PatchingWindowDto': TypeInfo(TypeOf.Class, create:() => PatchingWindowDto()),
'DayOfWeek': TypeInfo(TypeOf.Class, create:() => DayOfWeek()),
'GetPatchingWindow': TypeInfo(TypeOf.Class, create:() => GetPatchingWindow()),
});
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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/patching/windows/{Id} HTTP/1.1
Host: core.starburst.svc
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"id":"00000000-0000-0000-0000-000000000000","name":"String","dayOfWeek":"Sunday","monthlyOccurence":"First","timeOfDay":"00:00:00","duration":"00:00:00","isDefault":false}