POST, GET | /api/C2BGetInstrumentInfo |
---|
import 'package:servicestack/servicestack.dart';
// @DataContract
class BaseRequest implements IConvertible
{
/**
* This is your AIM API Key provided by Tri-Tech
*/
// @DataMember
// @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
String? ApiKey;
// @DataMember
// @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
String? OAuthToken;
BaseRequest({this.ApiKey,this.OAuthToken});
BaseRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ApiKey = json['ApiKey'];
OAuthToken = json['OAuthToken'];
return this;
}
Map<String, dynamic> toJson() => {
'ApiKey': ApiKey,
'OAuthToken': OAuthToken
};
getTypeName() => "BaseRequest";
TypeContext? context = _ctx;
}
// @DataContract
class BaseSecureRequest extends BaseRequest implements IConvertible
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Token", ParameterType="Header")
String? Token;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="DeviceId", ParameterType="Header")
String? DeviceId;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", IsRequired=true, Name="AppId", ParameterType="Header")
String? AppId;
BaseSecureRequest({this.Token,this.DeviceId,this.AppId});
BaseSecureRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Token = json['Token'];
DeviceId = json['DeviceId'];
AppId = json['AppId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Token': Token,
'DeviceId': DeviceId,
'AppId': AppId
});
getTypeName() => "BaseSecureRequest";
TypeContext? context = _ctx;
}
// @DataContract
class BaseResponseResult implements IConvertible
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
String? StatusCode;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
String? Login;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
String? ErrorCode;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
String? ErrorDisplayText;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
String? ErrorMessage;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
String? DomainName;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
String? IpAddress;
BaseResponseResult({this.StatusCode,this.Login,this.ErrorCode,this.ErrorDisplayText,this.ErrorMessage,this.DomainName,this.IpAddress});
BaseResponseResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
StatusCode = json['StatusCode'];
Login = json['Login'];
ErrorCode = json['ErrorCode'];
ErrorDisplayText = json['ErrorDisplayText'];
ErrorMessage = json['ErrorMessage'];
DomainName = json['DomainName'];
IpAddress = json['IpAddress'];
return this;
}
Map<String, dynamic> toJson() => {
'StatusCode': StatusCode,
'Login': Login,
'ErrorCode': ErrorCode,
'ErrorDisplayText': ErrorDisplayText,
'ErrorMessage': ErrorMessage,
'DomainName': DomainName,
'IpAddress': IpAddress
};
getTypeName() => "BaseResponseResult";
TypeContext? context = _ctx;
}
// @DataContract
class BaseResponse implements IConvertible
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
BaseResponseResult? Status;
BaseResponse({this.Status});
BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Status = JsonConverters.fromJson(json['Status'],'BaseResponseResult',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Status': JsonConverters.toJson(Status,'BaseResponseResult',context!)
};
getTypeName() => "BaseResponse";
TypeContext? context = _ctx;
}
// @DataContract
class C2BGradeGeneric implements IConvertible
{
// @DataMember
int? Level;
// @DataMember
String? Grade;
// @DataMember
double? DownPay;
// @DataMember
double? DownMaint;
// @DataMember
double? MoPay;
// @DataMember
double? MoMaint;
// @DataMember
int? Id;
// @DataMember
bool? OutOfStock;
// @DataMember
double? RentPrice;
// @DataMember
double? CashPrice;
// @DataMember
double? DownPayTax;
// @DataMember
double? DownMaintTax;
// @DataMember
double? MoPayTax;
// @DataMember
double? MoMaintTax;
// @DataMember
double? RentPricePlusTax;
// @DataMember
double? RentPricePlusTaxLessDownpay;
// @DataMember
int? Months;
C2BGradeGeneric({this.Level,this.Grade,this.DownPay,this.DownMaint,this.MoPay,this.MoMaint,this.Id,this.OutOfStock,this.RentPrice,this.CashPrice,this.DownPayTax,this.DownMaintTax,this.MoPayTax,this.MoMaintTax,this.RentPricePlusTax,this.RentPricePlusTaxLessDownpay,this.Months});
C2BGradeGeneric.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Level = json['Level'];
Grade = json['Grade'];
DownPay = JsonConverters.toDouble(json['DownPay']);
DownMaint = JsonConverters.toDouble(json['DownMaint']);
MoPay = JsonConverters.toDouble(json['MoPay']);
MoMaint = JsonConverters.toDouble(json['MoMaint']);
Id = json['Id'];
OutOfStock = json['OutOfStock'];
RentPrice = JsonConverters.toDouble(json['RentPrice']);
CashPrice = JsonConverters.toDouble(json['CashPrice']);
DownPayTax = JsonConverters.toDouble(json['DownPayTax']);
DownMaintTax = JsonConverters.toDouble(json['DownMaintTax']);
MoPayTax = JsonConverters.toDouble(json['MoPayTax']);
MoMaintTax = JsonConverters.toDouble(json['MoMaintTax']);
RentPricePlusTax = JsonConverters.toDouble(json['RentPricePlusTax']);
RentPricePlusTaxLessDownpay = JsonConverters.toDouble(json['RentPricePlusTaxLessDownpay']);
Months = json['Months'];
return this;
}
Map<String, dynamic> toJson() => {
'Level': Level,
'Grade': Grade,
'DownPay': DownPay,
'DownMaint': DownMaint,
'MoPay': MoPay,
'MoMaint': MoMaint,
'Id': Id,
'OutOfStock': OutOfStock,
'RentPrice': RentPrice,
'CashPrice': CashPrice,
'DownPayTax': DownPayTax,
'DownMaintTax': DownMaintTax,
'MoPayTax': MoPayTax,
'MoMaintTax': MoMaintTax,
'RentPricePlusTax': RentPricePlusTax,
'RentPricePlusTaxLessDownpay': RentPricePlusTaxLessDownpay,
'Months': Months
};
getTypeName() => "C2BGradeGeneric";
TypeContext? context = _ctx;
}
// @DataContract
class C2BAccessoryGeneric implements IConvertible
{
// @DataMember
String? AccessoryDesc;
// @DataMember
double? Price;
// @DataMember
bool? Required;
// @DataMember
bool? Default;
// @DataMember
bool? RequiresLocation;
// @DataMember
String? Type;
// @DataMember
String? Topic;
// @DataMember
int? Id;
// @DataMember
int? DisplayOrder;
// @DataMember
String? Sku;
// @DataMember
double? TaxAmount;
// @DataMember
int? CatNum;
C2BAccessoryGeneric({this.AccessoryDesc,this.Price,this.Required,this.Default,this.RequiresLocation,this.Type,this.Topic,this.Id,this.DisplayOrder,this.Sku,this.TaxAmount,this.CatNum});
C2BAccessoryGeneric.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
AccessoryDesc = json['AccessoryDesc'];
Price = JsonConverters.toDouble(json['Price']);
Required = json['Required'];
Default = json['Default'];
RequiresLocation = json['RequiresLocation'];
Type = json['Type'];
Topic = json['Topic'];
Id = json['Id'];
DisplayOrder = json['DisplayOrder'];
Sku = json['Sku'];
TaxAmount = JsonConverters.toDouble(json['TaxAmount']);
CatNum = json['CatNum'];
return this;
}
Map<String, dynamic> toJson() => {
'AccessoryDesc': AccessoryDesc,
'Price': Price,
'Required': Required,
'Default': Default,
'RequiresLocation': RequiresLocation,
'Type': Type,
'Topic': Topic,
'Id': Id,
'DisplayOrder': DisplayOrder,
'Sku': Sku,
'TaxAmount': TaxAmount,
'CatNum': CatNum
};
getTypeName() => "C2BAccessoryGeneric";
TypeContext? context = _ctx;
}
// @DataContract
class C2BInstrumentGeneric implements IConvertible
{
// @DataMember
String? InstrumentName;
// @DataMember
String? Sku;
// @DataMember
String? Topic;
// @DataMember
String? Image;
// @DataMember
int? Level;
// @DataMember
double? RentPrice;
// @DataMember
double? CashPrice;
// @DataMember
String? Token;
// @DataMember
int? InstrumentId;
// @DataMember
int? InstrumentTeacherId;
// @DataMember
List<C2BGradeGeneric>? GradeList;
// @DataMember
bool? HasGrades;
// @DataMember
int? DisplayOrder;
// @DataMember
List<C2BAccessoryGeneric>? AccessoryList;
// @DataMember
List<C2BAccessoryGeneric>? DeliveryList;
// @DataMember
List<C2BAccessoryGeneric>? MaintenanceList;
C2BInstrumentGeneric({this.InstrumentName,this.Sku,this.Topic,this.Image,this.Level,this.RentPrice,this.CashPrice,this.Token,this.InstrumentId,this.InstrumentTeacherId,this.GradeList,this.HasGrades,this.DisplayOrder,this.AccessoryList,this.DeliveryList,this.MaintenanceList});
C2BInstrumentGeneric.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
InstrumentName = json['InstrumentName'];
Sku = json['Sku'];
Topic = json['Topic'];
Image = json['Image'];
Level = json['Level'];
RentPrice = JsonConverters.toDouble(json['RentPrice']);
CashPrice = JsonConverters.toDouble(json['CashPrice']);
Token = json['Token'];
InstrumentId = json['InstrumentId'];
InstrumentTeacherId = json['InstrumentTeacherId'];
GradeList = JsonConverters.fromJson(json['GradeList'],'List<C2BGradeGeneric>',context!);
HasGrades = json['HasGrades'];
DisplayOrder = json['DisplayOrder'];
AccessoryList = JsonConverters.fromJson(json['AccessoryList'],'List<C2BAccessoryGeneric>',context!);
DeliveryList = JsonConverters.fromJson(json['DeliveryList'],'List<C2BAccessoryGeneric>',context!);
MaintenanceList = JsonConverters.fromJson(json['MaintenanceList'],'List<C2BAccessoryGeneric>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'InstrumentName': InstrumentName,
'Sku': Sku,
'Topic': Topic,
'Image': Image,
'Level': Level,
'RentPrice': RentPrice,
'CashPrice': CashPrice,
'Token': Token,
'InstrumentId': InstrumentId,
'InstrumentTeacherId': InstrumentTeacherId,
'GradeList': JsonConverters.toJson(GradeList,'List<C2BGradeGeneric>',context!),
'HasGrades': HasGrades,
'DisplayOrder': DisplayOrder,
'AccessoryList': JsonConverters.toJson(AccessoryList,'List<C2BAccessoryGeneric>',context!),
'DeliveryList': JsonConverters.toJson(DeliveryList,'List<C2BAccessoryGeneric>',context!),
'MaintenanceList': JsonConverters.toJson(MaintenanceList,'List<C2BAccessoryGeneric>',context!)
};
getTypeName() => "C2BInstrumentGeneric";
TypeContext? context = _ctx;
}
// @DataContract
class C2BGetInstrumentInfoResponse extends BaseResponse implements IConvertible
{
// @DataMember
List<C2BInstrumentGeneric>? Instruments;
C2BGetInstrumentInfoResponse({this.Instruments});
C2BGetInstrumentInfoResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Instruments = JsonConverters.fromJson(json['Instruments'],'List<C2BInstrumentGeneric>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Instruments': JsonConverters.toJson(Instruments,'List<C2BInstrumentGeneric>',context!)
});
getTypeName() => "C2BGetInstrumentInfoResponse";
TypeContext? context = _ctx;
}
/**
* C2BGetInstrumentInfoRequires active-e Contracts Service.
*/
// @DataContract
class C2BGetInstrumentInfoRequest extends BaseSecureRequest implements IConvertible
{
/**
* ID of the Teacher/Instrument record.
*/
// @DataMember
// @ApiMember(DataType="integer", Description="ID of the Teacher/Instrument record.", Format="int64", Name="RsiPk", ParameterType="query")
int? RsiPk;
/**
* ID of the Teacher record.
*/
// @DataMember
// @ApiMember(DataType="integer", Description="ID of the Teacher record.", Format="int64", Name="TeacherId", ParameterType="query")
int? TeacherId;
/**
* Optional Plan Code Override. If not sent, plancode from the school will be used.
*/
// @DataMember
// @ApiMember(DataType="string", Description="Optional Plan Code Override. If not sent, plancode from the school will be used.", Name="PlanCode", ParameterType="query")
String? PlanCode;
/**
* If set to false, less details will be sent. Defaults to True.
*/
// @DataMember
// @ApiMember(DataType="boolean", Description="If set to false, less details will be sent. Defaults to True.", Name="GetDetails", ParameterType="query")
bool? GetDetails;
/**
* If set to true, Out of Stock items will be included.
*/
// @DataMember
// @ApiMember(DataType="boolean", Description="If set to true, Out of Stock items will be included.", Name="IncludeOutOfStockItems", ParameterType="query")
bool? IncludeOutOfStockItems;
/**
* If set to true, each instrument will include a list of accessory options. Defaults to False.
*/
// @DataMember
// @ApiMember(DataType="boolean", Description="If set to true, each instrument will include a list of accessory options. Defaults to False.", Name="IncludeAccessoryOptions", ParameterType="query")
bool? IncludeAccessoryOptions;
/**
* If set to true, each instrument will include a list of delivery options. Defaults to False.
*/
// @DataMember
// @ApiMember(DataType="boolean", Description="If set to true, each instrument will include a list of delivery options. Defaults to False.", Name="IncludeDeliveryOptions", ParameterType="query")
bool? IncludeDeliveryOptions;
/**
* If set to true, each instrument will include a list of maintenance options. Defaults to False.
*/
// @DataMember
// @ApiMember(DataType="boolean", Description="If set to true, each instrument will include a list of maintenance options. Defaults to False.", Name="IncludeMaintenanceOptions", ParameterType="query")
bool? IncludeMaintenanceOptions;
C2BGetInstrumentInfoRequest({this.RsiPk,this.TeacherId,this.PlanCode,this.GetDetails,this.IncludeOutOfStockItems,this.IncludeAccessoryOptions,this.IncludeDeliveryOptions,this.IncludeMaintenanceOptions});
C2BGetInstrumentInfoRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
RsiPk = json['RsiPk'];
TeacherId = json['TeacherId'];
PlanCode = json['PlanCode'];
GetDetails = json['GetDetails'];
IncludeOutOfStockItems = json['IncludeOutOfStockItems'];
IncludeAccessoryOptions = json['IncludeAccessoryOptions'];
IncludeDeliveryOptions = json['IncludeDeliveryOptions'];
IncludeMaintenanceOptions = json['IncludeMaintenanceOptions'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'RsiPk': RsiPk,
'TeacherId': TeacherId,
'PlanCode': PlanCode,
'GetDetails': GetDetails,
'IncludeOutOfStockItems': IncludeOutOfStockItems,
'IncludeAccessoryOptions': IncludeAccessoryOptions,
'IncludeDeliveryOptions': IncludeDeliveryOptions,
'IncludeMaintenanceOptions': IncludeMaintenanceOptions
});
getTypeName() => "C2BGetInstrumentInfoRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'active_ewebservice.biz', types: <String, TypeInfo> {
'BaseRequest': TypeInfo(TypeOf.Class, create:() => BaseRequest()),
'BaseSecureRequest': TypeInfo(TypeOf.Class, create:() => BaseSecureRequest()),
'BaseResponseResult': TypeInfo(TypeOf.Class, create:() => BaseResponseResult()),
'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
'C2BGradeGeneric': TypeInfo(TypeOf.Class, create:() => C2BGradeGeneric()),
'C2BAccessoryGeneric': TypeInfo(TypeOf.Class, create:() => C2BAccessoryGeneric()),
'C2BInstrumentGeneric': TypeInfo(TypeOf.Class, create:() => C2BInstrumentGeneric()),
'List<C2BGradeGeneric>': TypeInfo(TypeOf.Class, create:() => <C2BGradeGeneric>[]),
'List<C2BAccessoryGeneric>': TypeInfo(TypeOf.Class, create:() => <C2BAccessoryGeneric>[]),
'C2BGetInstrumentInfoResponse': TypeInfo(TypeOf.Class, create:() => C2BGetInstrumentInfoResponse()),
'List<C2BInstrumentGeneric>': TypeInfo(TypeOf.Class, create:() => <C2BInstrumentGeneric>[]),
'C2BGetInstrumentInfoRequest': TypeInfo(TypeOf.Class, create:() => C2BGetInstrumentInfoRequest()),
});
Dart C2BGetInstrumentInfoRequest 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 /api/C2BGetInstrumentInfo HTTP/1.1
Host: active-ewebservice.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<C2BGetInstrumentInfoRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
<ApiKey>String</ApiKey>
<OAuthToken>String</OAuthToken>
<AppId>String</AppId>
<DeviceId>String</DeviceId>
<Token>String</Token>
<GetDetails>false</GetDetails>
<IncludeAccessoryOptions>false</IncludeAccessoryOptions>
<IncludeDeliveryOptions>false</IncludeDeliveryOptions>
<IncludeMaintenanceOptions>false</IncludeMaintenanceOptions>
<IncludeOutOfStockItems>false</IncludeOutOfStockItems>
<PlanCode>String</PlanCode>
<RsiPk>0</RsiPk>
<TeacherId>0</TeacherId>
</C2BGetInstrumentInfoRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <C2BGetInstrumentInfoResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService"> <Status> <DomainName>String</DomainName> <ErrorCode>String</ErrorCode> <ErrorDisplayText>String</ErrorDisplayText> <ErrorMessage>String</ErrorMessage> <IpAddress>String</IpAddress> <Login>String</Login> <StatusCode>String</StatusCode> </Status> <Instruments xmlns:d2p1="http://schemas.datacontract.org/2004/07/AIM"> <d2p1:C2BInstrumentGeneric i:nil="true" /> </Instruments> </C2BGetInstrumentInfoResponse>