Requires the role: | superadmin |
POST | /superadmin/support/cases | Add a new support case | Add a new support case to the company of the currently logged in user, only administrators are allowed to add support cases. |
---|
import 'package:servicestack/servicestack.dart';
class SupportCaseStatusResponse implements IConvertible
{
/**
* The status id
*/
// @ApiMember(Description="The status id")
int? Id;
/**
* The status name
*/
// @ApiMember(Description="The status name")
String? Name;
/**
* The status description
*/
// @ApiMember(Description="The status description")
String? Description;
/**
* The status icon
*/
// @ApiMember(Description="The status icon")
String? Icon;
/**
* The status color
*/
// @ApiMember(Description="The status color")
String? Color;
SupportCaseStatusResponse({this.Id,this.Name,this.Description,this.Icon,this.Color});
SupportCaseStatusResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Description = json['Description'];
Icon = json['Icon'];
Color = json['Color'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Description': Description,
'Icon': Icon,
'Color': Color
};
getTypeName() => "SupportCaseStatusResponse";
TypeContext? context = _ctx;
}
class SupportCaseTypeResponse implements IConvertible
{
/**
* The type id
*/
// @ApiMember(Description="The type id")
int? Id;
/**
* The type name
*/
// @ApiMember(Description="The type name")
String? Name;
/**
* The type description
*/
// @ApiMember(Description="The type description")
String? Description;
SupportCaseTypeResponse({this.Id,this.Name,this.Description});
SupportCaseTypeResponse.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() => "SupportCaseTypeResponse";
TypeContext? context = _ctx;
}
class SupportCaseAreaResponse implements IConvertible
{
/**
* The area id
*/
// @ApiMember(Description="The area id")
int? Id;
/**
* The area name
*/
// @ApiMember(Description="The area name")
String? Name;
/**
* The area description
*/
// @ApiMember(Description="The area description")
String? Description;
SupportCaseAreaResponse({this.Id,this.Name,this.Description});
SupportCaseAreaResponse.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() => "SupportCaseAreaResponse";
TypeContext? context = _ctx;
}
class SupportCaseCommentsResponse implements IConvertible
{
/**
* The case id
*/
// @ApiMember(Description="The case id")
int? SupportCaseId;
/**
* The comments id
*/
// @ApiMember(Description="The comments id")
int? Id;
/**
* The case comment
*/
// @ApiMember(Description="The case comment")
String? Comment;
/**
* The case comment created by
*/
// @ApiMember(Description="The case comment created by")
String? CreatedBy;
/**
* The case comment created date
*/
// @ApiMember(Description="The case comment created date")
DateTime? Created;
SupportCaseCommentsResponse({this.SupportCaseId,this.Id,this.Comment,this.CreatedBy,this.Created});
SupportCaseCommentsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
SupportCaseId = json['SupportCaseId'];
Id = json['Id'];
Comment = json['Comment'];
CreatedBy = json['CreatedBy'];
Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'SupportCaseId': SupportCaseId,
'Id': Id,
'Comment': Comment,
'CreatedBy': CreatedBy,
'Created': JsonConverters.toJson(Created,'DateTime',context!)
};
getTypeName() => "SupportCaseCommentsResponse";
TypeContext? context = _ctx;
}
class SupportCaseAttachmentResponse implements IConvertible
{
/**
* The attachment id
*/
// @ApiMember(Description="The attachment id")
int? Id;
/**
* The attachment file url
*/
// @ApiMember(Description="The attachment file url")
String? FileUrl;
SupportCaseAttachmentResponse({this.Id,this.FileUrl});
SupportCaseAttachmentResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
FileUrl = json['FileUrl'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'FileUrl': FileUrl
};
getTypeName() => "SupportCaseAttachmentResponse";
TypeContext? context = _ctx;
}
class SupportCaseQueryResponse implements IConvertible
{
/**
* The support case id
*/
// @ApiMember(Description="The support case id")
int? Id;
/**
* The company user id
*/
// @ApiMember(Description="The company user id")
String? CompanyUserId;
/**
* The case title.
*/
// @ApiMember(Description="The case title.")
String? Title;
/**
* The case description.
*/
// @ApiMember(Description="The case description.")
String? Description;
/**
* The case status id.
*/
// @ApiMember(Description="The case status id.")
int? CaseStatusId;
/**
* If the case type id.
*/
// @ApiMember(Description="If the case type id.")
int? CaseTypeId;
/**
* If the case area id.
*/
// @ApiMember(Description="If the case area id.")
int? CaseAreaId;
/**
* The case created by.
*/
// @ApiMember(Description="The case created by.")
String? CreatedBy;
/**
* The case updated by.
*/
// @ApiMember(Description="The case updated by.")
String? UpdatedBy;
/**
* The case solved by.
*/
// @ApiMember(Description="The case solved by.")
String? SolvedBy;
/**
* If case updated date.
*/
// @ApiMember(Description="If case updated date.")
DateTime? Updated;
/**
* If case created date.
*/
// @ApiMember(Description="If case created date.")
DateTime? Created;
/**
* Who owns the support case.
*/
// @ApiMember(Description="Who owns the support case.")
String? CaseOwner;
/**
* The case status information.
*/
// @ApiMember(Description="The case status information.")
SupportCaseStatusResponse? CaseStatus;
/**
* The case type information.
*/
// @ApiMember(Description="The case type information.")
SupportCaseTypeResponse? CaseType;
/**
* The case area information.
*/
// @ApiMember(Description="The case area information.")
SupportCaseAreaResponse? CaseArea;
/**
* The case comments.
*/
// @ApiMember(Description="The case comments.")
List<SupportCaseCommentsResponse>? Comments;
/**
* The case attachments.
*/
// @ApiMember(Description="The case attachments.")
List<SupportCaseAttachmentResponse>? Attachments;
/**
* The case status options to select from.
*/
// @ApiMember(Description="The case status options to select from.")
List<SupportCaseStatusResponse>? CaseStatusOptions;
/**
* The case type options to select from.
*/
// @ApiMember(Description="The case type options to select from.")
List<SupportCaseTypeResponse>? CaseTypeOptions;
/**
* The case area options to select from.
*/
// @ApiMember(Description="The case area options to select from.")
List<SupportCaseAreaResponse>? CaseAreaOptions;
SupportCaseQueryResponse({this.Id,this.CompanyUserId,this.Title,this.Description,this.CaseStatusId,this.CaseTypeId,this.CaseAreaId,this.CreatedBy,this.UpdatedBy,this.SolvedBy,this.Updated,this.Created,this.CaseOwner,this.CaseStatus,this.CaseType,this.CaseArea,this.Comments,this.Attachments,this.CaseStatusOptions,this.CaseTypeOptions,this.CaseAreaOptions});
SupportCaseQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
CompanyUserId = json['CompanyUserId'];
Title = json['Title'];
Description = json['Description'];
CaseStatusId = json['CaseStatusId'];
CaseTypeId = json['CaseTypeId'];
CaseAreaId = json['CaseAreaId'];
CreatedBy = json['CreatedBy'];
UpdatedBy = json['UpdatedBy'];
SolvedBy = json['SolvedBy'];
Updated = JsonConverters.fromJson(json['Updated'],'DateTime',context!);
Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
CaseOwner = json['CaseOwner'];
CaseStatus = JsonConverters.fromJson(json['CaseStatus'],'SupportCaseStatusResponse',context!);
CaseType = JsonConverters.fromJson(json['CaseType'],'SupportCaseTypeResponse',context!);
CaseArea = JsonConverters.fromJson(json['CaseArea'],'SupportCaseAreaResponse',context!);
Comments = JsonConverters.fromJson(json['Comments'],'List<SupportCaseCommentsResponse>',context!);
Attachments = JsonConverters.fromJson(json['Attachments'],'List<SupportCaseAttachmentResponse>',context!);
CaseStatusOptions = JsonConverters.fromJson(json['CaseStatusOptions'],'List<SupportCaseStatusResponse>',context!);
CaseTypeOptions = JsonConverters.fromJson(json['CaseTypeOptions'],'List<SupportCaseTypeResponse>',context!);
CaseAreaOptions = JsonConverters.fromJson(json['CaseAreaOptions'],'List<SupportCaseAreaResponse>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'CompanyUserId': CompanyUserId,
'Title': Title,
'Description': Description,
'CaseStatusId': CaseStatusId,
'CaseTypeId': CaseTypeId,
'CaseAreaId': CaseAreaId,
'CreatedBy': CreatedBy,
'UpdatedBy': UpdatedBy,
'SolvedBy': SolvedBy,
'Updated': JsonConverters.toJson(Updated,'DateTime',context!),
'Created': JsonConverters.toJson(Created,'DateTime',context!),
'CaseOwner': CaseOwner,
'CaseStatus': JsonConverters.toJson(CaseStatus,'SupportCaseStatusResponse',context!),
'CaseType': JsonConverters.toJson(CaseType,'SupportCaseTypeResponse',context!),
'CaseArea': JsonConverters.toJson(CaseArea,'SupportCaseAreaResponse',context!),
'Comments': JsonConverters.toJson(Comments,'List<SupportCaseCommentsResponse>',context!),
'Attachments': JsonConverters.toJson(Attachments,'List<SupportCaseAttachmentResponse>',context!),
'CaseStatusOptions': JsonConverters.toJson(CaseStatusOptions,'List<SupportCaseStatusResponse>',context!),
'CaseTypeOptions': JsonConverters.toJson(CaseTypeOptions,'List<SupportCaseTypeResponse>',context!),
'CaseAreaOptions': JsonConverters.toJson(CaseAreaOptions,'List<SupportCaseAreaResponse>',context!)
};
getTypeName() => "SupportCaseQueryResponse";
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 SuperAdminCreateSupportCase implements ICompany, IConvertible
{
/**
* Enter the company id, if blank company id and you are an admin, your company id will be used.
*/
// @ApiMember(Description="Enter the company id, if blank company id and you are an admin, your company id will be used.", IsRequired=true)
String? CompanyId;
/**
* The case title.
*/
// @ApiMember(Description="The case title.")
String? Title;
/**
* The case description.
*/
// @ApiMember(Description="The case description.")
String? Description;
/**
* If the case type id.
*/
// @ApiMember(Description="If the case type id.")
int? CaseTypeId;
/**
* If the case area id.
*/
// @ApiMember(Description="If the case area id.")
int? CaseAreaId;
SuperAdminCreateSupportCase({this.CompanyId,this.Title,this.Description,this.CaseTypeId,this.CaseAreaId});
SuperAdminCreateSupportCase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
Title = json['Title'];
Description = json['Description'];
CaseTypeId = json['CaseTypeId'];
CaseAreaId = json['CaseAreaId'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'Title': Title,
'Description': Description,
'CaseTypeId': CaseTypeId,
'CaseAreaId': CaseAreaId
};
getTypeName() => "SuperAdminCreateSupportCase";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
'SupportCaseStatusResponse': TypeInfo(TypeOf.Class, create:() => SupportCaseStatusResponse()),
'SupportCaseTypeResponse': TypeInfo(TypeOf.Class, create:() => SupportCaseTypeResponse()),
'SupportCaseAreaResponse': TypeInfo(TypeOf.Class, create:() => SupportCaseAreaResponse()),
'SupportCaseCommentsResponse': TypeInfo(TypeOf.Class, create:() => SupportCaseCommentsResponse()),
'SupportCaseAttachmentResponse': TypeInfo(TypeOf.Class, create:() => SupportCaseAttachmentResponse()),
'SupportCaseQueryResponse': TypeInfo(TypeOf.Class, create:() => SupportCaseQueryResponse()),
'List<SupportCaseCommentsResponse>': TypeInfo(TypeOf.Class, create:() => <SupportCaseCommentsResponse>[]),
'List<SupportCaseAttachmentResponse>': TypeInfo(TypeOf.Class, create:() => <SupportCaseAttachmentResponse>[]),
'List<SupportCaseStatusResponse>': TypeInfo(TypeOf.Class, create:() => <SupportCaseStatusResponse>[]),
'List<SupportCaseTypeResponse>': TypeInfo(TypeOf.Class, create:() => <SupportCaseTypeResponse>[]),
'List<SupportCaseAreaResponse>': TypeInfo(TypeOf.Class, create:() => <SupportCaseAreaResponse>[]),
'SuperAdminCreateSupportCase': TypeInfo(TypeOf.Class, create:() => SuperAdminCreateSupportCase()),
});
Dart SuperAdminCreateSupportCase 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.
POST /superadmin/support/cases HTTP/1.1
Host: testapi.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SuperAdminCreateSupportCase xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<CaseAreaId>0</CaseAreaId>
<CaseTypeId>0</CaseTypeId>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<Description>String</Description>
<Title>String</Title>
</SuperAdminCreateSupportCase>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <SupportCaseQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <Attachments> <SupportCaseAttachmentResponse> <FileUrl>String</FileUrl> <Id>0</Id> </SupportCaseAttachmentResponse> </Attachments> <CaseArea> <Description>String</Description> <Id>0</Id> <Name>String</Name> </CaseArea> <CaseAreaId>0</CaseAreaId> <CaseAreaOptions> <SupportCaseAreaResponse> <Description>String</Description> <Id>0</Id> <Name>String</Name> </SupportCaseAreaResponse> </CaseAreaOptions> <CaseOwner>String</CaseOwner> <CaseStatus> <Color>String</Color> <Description>String</Description> <Icon>String</Icon> <Id>0</Id> <Name>String</Name> </CaseStatus> <CaseStatusId>0</CaseStatusId> <CaseStatusOptions> <SupportCaseStatusResponse> <Color>String</Color> <Description>String</Description> <Icon>String</Icon> <Id>0</Id> <Name>String</Name> </SupportCaseStatusResponse> </CaseStatusOptions> <CaseType> <Description>String</Description> <Id>0</Id> <Name>String</Name> </CaseType> <CaseTypeId>0</CaseTypeId> <CaseTypeOptions> <SupportCaseTypeResponse> <Description>String</Description> <Id>0</Id> <Name>String</Name> </SupportCaseTypeResponse> </CaseTypeOptions> <Comments> <SupportCaseCommentsResponse> <Comment>String</Comment> <Created>0001-01-01T00:00:00</Created> <CreatedBy>String</CreatedBy> <Id>0</Id> <SupportCaseId>0</SupportCaseId> </SupportCaseCommentsResponse> </Comments> <CompanyUserId>00000000-0000-0000-0000-000000000000</CompanyUserId> <Created>0001-01-01T00:00:00</Created> <CreatedBy>String</CreatedBy> <Description>String</Description> <Id>0</Id> <SolvedBy>String</SolvedBy> <Title>String</Title> <Updated>0001-01-01T00:00:00</Updated> <UpdatedBy>String</UpdatedBy> </SupportCaseQueryResponse>