GET | /rebatecodes/getbysign | Get RebateCode by RebateCodeBySign | Get RebateCode RebateCodeBySign (for example XMAS20) |
---|
import 'package:servicestack/servicestack.dart';
class DaysOfWeekResponse implements IConvertible
{
int? Id;
String? DayOfWeek;
String? DayOfWeekTranslation;
bool? DayOfWeekActive;
int? DayOfWeekSortOrder;
DaysOfWeekResponse({this.Id,this.DayOfWeek,this.DayOfWeekTranslation,this.DayOfWeekActive,this.DayOfWeekSortOrder});
DaysOfWeekResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
DayOfWeek = json['DayOfWeek'];
DayOfWeekTranslation = json['DayOfWeekTranslation'];
DayOfWeekActive = json['DayOfWeekActive'];
DayOfWeekSortOrder = json['DayOfWeekSortOrder'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'DayOfWeek': DayOfWeek,
'DayOfWeekTranslation': DayOfWeekTranslation,
'DayOfWeekActive': DayOfWeekActive,
'DayOfWeekSortOrder': DayOfWeekSortOrder
};
getTypeName() => "DaysOfWeekResponse";
TypeContext? context = _ctx;
}
class RebateCodeServiceResponse implements IConvertible
{
int? Id;
String? Name;
String? Description;
bool? Active;
RebateCodeServiceResponse({this.Id,this.Name,this.Description,this.Active});
RebateCodeServiceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Description = json['Description'];
Active = json['Active'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Description': Description,
'Active': Active
};
getTypeName() => "RebateCodeServiceResponse";
TypeContext? context = _ctx;
}
class BaseModel implements IConvertible
{
BaseModel();
BaseModel.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "BaseModel";
TypeContext? context = _ctx;
}
class ArticleServiceRelation extends BaseModel implements IConvertible
{
// @Required()
String? CompanyId;
int? Id;
// @Required()
int? ServiceId;
// @Required()
int? ArticleId;
ArticleServiceRelation({this.CompanyId,this.Id,this.ServiceId,this.ArticleId});
ArticleServiceRelation.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
CompanyId = json['CompanyId'];
Id = json['Id'];
ServiceId = json['ServiceId'];
ArticleId = json['ArticleId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'CompanyId': CompanyId,
'Id': Id,
'ServiceId': ServiceId,
'ArticleId': ArticleId
});
getTypeName() => "ArticleServiceRelation";
TypeContext? context = _ctx;
}
class ArticleResponse implements IConvertible
{
String? CompanyId;
int? Id;
String? Name;
int? ArticleTypeId;
String? Description;
String? ImageUrl;
bool? Active;
int? Amount;
double? Price;
String? CurrencyId;
DateTime? UpdatedDate;
DateTime? CreatedDate;
List<ArticleServiceRelation>? Services;
List<int>? ServiceIds;
String? PriceSign;
ArticleResponse({this.CompanyId,this.Id,this.Name,this.ArticleTypeId,this.Description,this.ImageUrl,this.Active,this.Amount,this.Price,this.CurrencyId,this.UpdatedDate,this.CreatedDate,this.Services,this.ServiceIds,this.PriceSign});
ArticleResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
Id = json['Id'];
Name = json['Name'];
ArticleTypeId = json['ArticleTypeId'];
Description = json['Description'];
ImageUrl = json['ImageUrl'];
Active = json['Active'];
Amount = json['Amount'];
Price = JsonConverters.toDouble(json['Price']);
CurrencyId = json['CurrencyId'];
UpdatedDate = JsonConverters.fromJson(json['UpdatedDate'],'DateTime',context!);
CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
Services = JsonConverters.fromJson(json['Services'],'List<ArticleServiceRelation>',context!);
ServiceIds = JsonConverters.fromJson(json['ServiceIds'],'List<int>',context!);
PriceSign = json['PriceSign'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'Id': Id,
'Name': Name,
'ArticleTypeId': ArticleTypeId,
'Description': Description,
'ImageUrl': ImageUrl,
'Active': Active,
'Amount': Amount,
'Price': Price,
'CurrencyId': CurrencyId,
'UpdatedDate': JsonConverters.toJson(UpdatedDate,'DateTime',context!),
'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
'Services': JsonConverters.toJson(Services,'List<ArticleServiceRelation>',context!),
'ServiceIds': JsonConverters.toJson(ServiceIds,'List<int>',context!),
'PriceSign': PriceSign
};
getTypeName() => "ArticleResponse";
TypeContext? context = _ctx;
}
class RebateCodeCustomerResponse implements IConvertible
{
String? Id;
String? Firstname;
String? Lastname;
String? Email;
String? Phone;
String? ImageUrl;
RebateCodeCustomerResponse({this.Id,this.Firstname,this.Lastname,this.Email,this.Phone,this.ImageUrl});
RebateCodeCustomerResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Firstname = json['Firstname'];
Lastname = json['Lastname'];
Email = json['Email'];
Phone = json['Phone'];
ImageUrl = json['ImageUrl'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Firstname': Firstname,
'Lastname': Lastname,
'Email': Email,
'Phone': Phone,
'ImageUrl': ImageUrl
};
getTypeName() => "RebateCodeCustomerResponse";
TypeContext? context = _ctx;
}
class RebateCodeTransactionQueryResponse implements IConvertible
{
int? Id;
String? CompanyId;
String? Note;
int? RebateCodeId;
String? RebateCodeSign;
int? RebateCodeTypeId;
String? RebateCodeTypeName;
double? Amount;
int? BookingId;
DateTime? UpdatedDate;
DateTime? CreatedDate;
RebateCodeServiceResponse? Service;
RebateCodeCustomerResponse? Customer;
String? PriceSign;
RebateCodeTransactionQueryResponse({this.Id,this.CompanyId,this.Note,this.RebateCodeId,this.RebateCodeSign,this.RebateCodeTypeId,this.RebateCodeTypeName,this.Amount,this.BookingId,this.UpdatedDate,this.CreatedDate,this.Service,this.Customer,this.PriceSign});
RebateCodeTransactionQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
CompanyId = json['CompanyId'];
Note = json['Note'];
RebateCodeId = json['RebateCodeId'];
RebateCodeSign = json['RebateCodeSign'];
RebateCodeTypeId = json['RebateCodeTypeId'];
RebateCodeTypeName = json['RebateCodeTypeName'];
Amount = JsonConverters.toDouble(json['Amount']);
BookingId = json['BookingId'];
UpdatedDate = JsonConverters.fromJson(json['UpdatedDate'],'DateTime',context!);
CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
Service = JsonConverters.fromJson(json['Service'],'RebateCodeServiceResponse',context!);
Customer = JsonConverters.fromJson(json['Customer'],'RebateCodeCustomerResponse',context!);
PriceSign = json['PriceSign'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'CompanyId': CompanyId,
'Note': Note,
'RebateCodeId': RebateCodeId,
'RebateCodeSign': RebateCodeSign,
'RebateCodeTypeId': RebateCodeTypeId,
'RebateCodeTypeName': RebateCodeTypeName,
'Amount': Amount,
'BookingId': BookingId,
'UpdatedDate': JsonConverters.toJson(UpdatedDate,'DateTime',context!),
'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
'Service': JsonConverters.toJson(Service,'RebateCodeServiceResponse',context!),
'Customer': JsonConverters.toJson(Customer,'RebateCodeCustomerResponse',context!),
'PriceSign': PriceSign
};
getTypeName() => "RebateCodeTransactionQueryResponse";
TypeContext? context = _ctx;
}
class RebateCodeResponse implements IConvertible
{
int? Id;
String? CompanyId;
DateTime? ValidFrom;
DateTime? ValidTo;
/**
* If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
*/
// @ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")
Duration? FromTime;
/**
* If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.
*/
// @ApiMember(Description="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.")
Duration? ToTime;
String? CreatedBy;
DateTime? Created;
String? UpdatedBy;
DateTime? Updated;
String? PersonalNote;
String? RebateCodeSign;
int? RebateCodeValue;
int? RebateCodeTypeId;
String? Name;
int? RebateCodeStatusId;
String? StatusName;
int? MaxNumberOfUses;
int? MaxNumberOfUsesPerCustomer;
int? NumberOfUsesUsed;
List<DaysOfWeekResponse>? DaysOfWeek;
List<RebateCodeServiceResponse>? Services;
ArticleResponse? Article;
List<RebateCodeTransactionQueryResponse>? Transactions;
double? RemainingAmount;
int? RemainingUsage;
List<RebateCodeCustomerResponse>? Customers;
ResponseStatus? ResponseStatus;
bool? PaymentReceived;
String? RebateCodeCurrencySign;
bool? ActiveByStatus;
String? PriceSign;
String? RebateCodeTypeName;
RebateCodeResponse({this.Id,this.CompanyId,this.ValidFrom,this.ValidTo,this.FromTime,this.ToTime,this.CreatedBy,this.Created,this.UpdatedBy,this.Updated,this.PersonalNote,this.RebateCodeSign,this.RebateCodeValue,this.RebateCodeTypeId,this.Name,this.RebateCodeStatusId,this.StatusName,this.MaxNumberOfUses,this.MaxNumberOfUsesPerCustomer,this.NumberOfUsesUsed,this.DaysOfWeek,this.Services,this.Article,this.Transactions,this.RemainingAmount,this.RemainingUsage,this.Customers,this.ResponseStatus,this.PaymentReceived,this.RebateCodeCurrencySign,this.ActiveByStatus,this.PriceSign,this.RebateCodeTypeName});
RebateCodeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
CompanyId = json['CompanyId'];
ValidFrom = JsonConverters.fromJson(json['ValidFrom'],'DateTime',context!);
ValidTo = JsonConverters.fromJson(json['ValidTo'],'DateTime',context!);
FromTime = JsonConverters.fromJson(json['FromTime'],'Duration',context!);
ToTime = JsonConverters.fromJson(json['ToTime'],'Duration',context!);
CreatedBy = json['CreatedBy'];
Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
UpdatedBy = json['UpdatedBy'];
Updated = JsonConverters.fromJson(json['Updated'],'DateTime',context!);
PersonalNote = json['PersonalNote'];
RebateCodeSign = json['RebateCodeSign'];
RebateCodeValue = json['RebateCodeValue'];
RebateCodeTypeId = json['RebateCodeTypeId'];
Name = json['Name'];
RebateCodeStatusId = json['RebateCodeStatusId'];
StatusName = json['StatusName'];
MaxNumberOfUses = json['MaxNumberOfUses'];
MaxNumberOfUsesPerCustomer = json['MaxNumberOfUsesPerCustomer'];
NumberOfUsesUsed = json['NumberOfUsesUsed'];
DaysOfWeek = JsonConverters.fromJson(json['DaysOfWeek'],'List<DaysOfWeekResponse>',context!);
Services = JsonConverters.fromJson(json['Services'],'List<RebateCodeServiceResponse>',context!);
Article = JsonConverters.fromJson(json['Article'],'ArticleResponse',context!);
Transactions = JsonConverters.fromJson(json['Transactions'],'List<RebateCodeTransactionQueryResponse>',context!);
RemainingAmount = JsonConverters.toDouble(json['RemainingAmount']);
RemainingUsage = json['RemainingUsage'];
Customers = JsonConverters.fromJson(json['Customers'],'List<RebateCodeCustomerResponse>',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
PaymentReceived = json['PaymentReceived'];
RebateCodeCurrencySign = json['RebateCodeCurrencySign'];
ActiveByStatus = json['ActiveByStatus'];
PriceSign = json['PriceSign'];
RebateCodeTypeName = json['RebateCodeTypeName'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'CompanyId': CompanyId,
'ValidFrom': JsonConverters.toJson(ValidFrom,'DateTime',context!),
'ValidTo': JsonConverters.toJson(ValidTo,'DateTime',context!),
'FromTime': JsonConverters.toJson(FromTime,'Duration',context!),
'ToTime': JsonConverters.toJson(ToTime,'Duration',context!),
'CreatedBy': CreatedBy,
'Created': JsonConverters.toJson(Created,'DateTime',context!),
'UpdatedBy': UpdatedBy,
'Updated': JsonConverters.toJson(Updated,'DateTime',context!),
'PersonalNote': PersonalNote,
'RebateCodeSign': RebateCodeSign,
'RebateCodeValue': RebateCodeValue,
'RebateCodeTypeId': RebateCodeTypeId,
'Name': Name,
'RebateCodeStatusId': RebateCodeStatusId,
'StatusName': StatusName,
'MaxNumberOfUses': MaxNumberOfUses,
'MaxNumberOfUsesPerCustomer': MaxNumberOfUsesPerCustomer,
'NumberOfUsesUsed': NumberOfUsesUsed,
'DaysOfWeek': JsonConverters.toJson(DaysOfWeek,'List<DaysOfWeekResponse>',context!),
'Services': JsonConverters.toJson(Services,'List<RebateCodeServiceResponse>',context!),
'Article': JsonConverters.toJson(Article,'ArticleResponse',context!),
'Transactions': JsonConverters.toJson(Transactions,'List<RebateCodeTransactionQueryResponse>',context!),
'RemainingAmount': RemainingAmount,
'RemainingUsage': RemainingUsage,
'Customers': JsonConverters.toJson(Customers,'List<RebateCodeCustomerResponse>',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'PaymentReceived': PaymentReceived,
'RebateCodeCurrencySign': RebateCodeCurrencySign,
'ActiveByStatus': ActiveByStatus,
'PriceSign': PriceSign,
'RebateCodeTypeName': RebateCodeTypeName
};
getTypeName() => "RebateCodeResponse";
TypeContext? context = _ctx;
}
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class GetRebateCodeBySign implements IConvertible
{
/**
*
*/
// @ApiMember(Description="", IsRequired=true)
String? CompanyId;
/**
*
*/
// @ApiMember(Description="", IsRequired=true)
String? RebateCodeSign;
/**
*
*/
// @ApiMember(Description="", IsRequired=true)
int? ServiceId;
/**
* The datetime for when to check if the code is valid
*/
// @ApiMember(Description="The datetime for when to check if the code is valid")
DateTime? Date;
/**
*
*/
// @ApiMember(Description="", IsRequired=true)
bool? IncludeConnectedServices;
/**
*
*/
// @ApiMember(Description="")
bool? IncludeConnectedDaysOfWeek;
/**
*
*/
// @ApiMember(Description="")
bool? IncludeConnectedCustomers;
/**
*
*/
// @ApiMember(Description="")
String? CustomerEmail;
GetRebateCodeBySign({this.CompanyId,this.RebateCodeSign,this.ServiceId,this.Date,this.IncludeConnectedServices,this.IncludeConnectedDaysOfWeek,this.IncludeConnectedCustomers,this.CustomerEmail});
GetRebateCodeBySign.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
RebateCodeSign = json['RebateCodeSign'];
ServiceId = json['ServiceId'];
Date = JsonConverters.fromJson(json['Date'],'DateTime',context!);
IncludeConnectedServices = json['IncludeConnectedServices'];
IncludeConnectedDaysOfWeek = json['IncludeConnectedDaysOfWeek'];
IncludeConnectedCustomers = json['IncludeConnectedCustomers'];
CustomerEmail = json['CustomerEmail'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'RebateCodeSign': RebateCodeSign,
'ServiceId': ServiceId,
'Date': JsonConverters.toJson(Date,'DateTime',context!),
'IncludeConnectedServices': IncludeConnectedServices,
'IncludeConnectedDaysOfWeek': IncludeConnectedDaysOfWeek,
'IncludeConnectedCustomers': IncludeConnectedCustomers,
'CustomerEmail': CustomerEmail
};
getTypeName() => "GetRebateCodeBySign";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'DaysOfWeekResponse': TypeInfo(TypeOf.Class, create:() => DaysOfWeekResponse()),
'RebateCodeServiceResponse': TypeInfo(TypeOf.Class, create:() => RebateCodeServiceResponse()),
'BaseModel': TypeInfo(TypeOf.Class, create:() => BaseModel()),
'ArticleServiceRelation': TypeInfo(TypeOf.Class, create:() => ArticleServiceRelation()),
'ArticleResponse': TypeInfo(TypeOf.Class, create:() => ArticleResponse()),
'List<ArticleServiceRelation>': TypeInfo(TypeOf.Class, create:() => <ArticleServiceRelation>[]),
'RebateCodeCustomerResponse': TypeInfo(TypeOf.Class, create:() => RebateCodeCustomerResponse()),
'RebateCodeTransactionQueryResponse': TypeInfo(TypeOf.Class, create:() => RebateCodeTransactionQueryResponse()),
'RebateCodeResponse': TypeInfo(TypeOf.Class, create:() => RebateCodeResponse()),
'List<DaysOfWeekResponse>': TypeInfo(TypeOf.Class, create:() => <DaysOfWeekResponse>[]),
'List<RebateCodeServiceResponse>': TypeInfo(TypeOf.Class, create:() => <RebateCodeServiceResponse>[]),
'List<RebateCodeTransactionQueryResponse>': TypeInfo(TypeOf.Class, create:() => <RebateCodeTransactionQueryResponse>[]),
'List<RebateCodeCustomerResponse>': TypeInfo(TypeOf.Class, create:() => <RebateCodeCustomerResponse>[]),
'GetRebateCodeBySign': TypeInfo(TypeOf.Class, create:() => GetRebateCodeBySign()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /rebatecodes/getbysign HTTP/1.1 Host: api.bokamera.se Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Id: 0, CompanyId: 00000000-0000-0000-0000-000000000000, FromTime: PT0S, ToTime: PT0S, CreatedBy: String, UpdatedBy: String, PersonalNote: String, RebateCodeSign: String, RebateCodeValue: 0, RebateCodeTypeId: 0, Name: String, RebateCodeStatusId: 0, StatusName: String, MaxNumberOfUses: 0, MaxNumberOfUsesPerCustomer: 0, NumberOfUsesUsed: 0, DaysOfWeek: [ { Id: 0, DayOfWeek: String, DayOfWeekTranslation: String, DayOfWeekActive: False, DayOfWeekSortOrder: 0 } ], Services: [ { Id: 0, Name: String, Description: String, Active: False } ], Article: { Id: 0, Name: String, ArticleTypeId: 0, Description: String, ImageUrl: String, Active: False, Amount: 0, Price: 0, CurrencyId: String, Services: [ { Id: 0, ServiceId: 0, ArticleId: 0 } ], ServiceIds: [ 0 ], PriceSign: String }, Transactions: [ { Id: 0, Note: String, RebateCodeId: 0, RebateCodeSign: String, RebateCodeTypeId: 0, RebateCodeTypeName: String, Amount: 0, BookingId: 0, Service: { Id: 0, Name: String, Description: String, Active: False }, Customer: { Firstname: String, Lastname: String, Email: String, Phone: String, ImageUrl: String }, PriceSign: String } ], RemainingAmount: 0, RemainingUsage: 0, Customers: [ { Firstname: String, Lastname: String, Email: String, Phone: String, ImageUrl: String } ], ResponseStatus: { ErrorCode: String, Message: String, StackTrace: String, Errors: [ { ErrorCode: String, FieldName: String, Message: String, Meta: { String: String } } ], Meta: { String: String } }, PaymentReceived: False, RebateCodeCurrencySign: String, ActiveByStatus: False, PriceSign: String, RebateCodeTypeName: String }