/* Options: Date: 2024-11-23 10:47:40 Version: 8.23 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://testapi.bokamera.se //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: CreateCustomer.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; class AddCustomField implements IConvertible { int? Id; String? Value; AddCustomField({this.Id,this.Value}); AddCustomField.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; Value = json['Value']; return this; } Map toJson() => { 'Id': Id, 'Value': Value }; getTypeName() => "AddCustomField"; TypeContext? context = _ctx; } class AddUserAccessKey implements IConvertible { String? Id; String? CompanyId; int? AccessKeyTypeId; String? Value; String? CustomerId; String? Description; AddUserAccessKey({this.Id,this.CompanyId,this.AccessKeyTypeId,this.Value,this.CustomerId,this.Description}); AddUserAccessKey.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; CompanyId = json['CompanyId']; AccessKeyTypeId = json['AccessKeyTypeId']; Value = json['Value']; CustomerId = json['CustomerId']; Description = json['Description']; return this; } Map toJson() => { 'Id': Id, 'CompanyId': CompanyId, 'AccessKeyTypeId': AccessKeyTypeId, 'Value': Value, 'CustomerId': CustomerId, 'Description': Description }; getTypeName() => "AddUserAccessKey"; TypeContext? context = _ctx; } class InvoiceAddress implements IConvertible { String? CorporateIdentityNumber; String? InvoiceAddress1; String? InvoiceAddress2; String? InvoiceCity; String? InvoicePostalCode; String? InvoiceCountryCode; InvoiceAddress({this.CorporateIdentityNumber,this.InvoiceAddress1,this.InvoiceAddress2,this.InvoiceCity,this.InvoicePostalCode,this.InvoiceCountryCode}); InvoiceAddress.fromJson(Map json) { fromMap(json); } fromMap(Map json) { CorporateIdentityNumber = json['CorporateIdentityNumber']; InvoiceAddress1 = json['InvoiceAddress1']; InvoiceAddress2 = json['InvoiceAddress2']; InvoiceCity = json['InvoiceCity']; InvoicePostalCode = json['InvoicePostalCode']; InvoiceCountryCode = json['InvoiceCountryCode']; return this; } Map toJson() => { 'CorporateIdentityNumber': CorporateIdentityNumber, 'InvoiceAddress1': InvoiceAddress1, 'InvoiceAddress2': InvoiceAddress2, 'InvoiceCity': InvoiceCity, 'InvoicePostalCode': InvoicePostalCode, 'InvoiceCountryCode': InvoiceCountryCode }; getTypeName() => "InvoiceAddress"; TypeContext? context = _ctx; } class BaseModel implements IConvertible { BaseModel(); BaseModel.fromJson(Map json) : super(); fromMap(Map json) { return this; } Map toJson() => {}; getTypeName() => "BaseModel"; TypeContext? context = _ctx; } class UserAccessKeys extends BaseModel implements IConvertible { // @Required() String? CompanyId; // @Required() int? AccessKeyTypeId; // @Required() String? Value; // @Required() String? CustomerId; String? Description; // @Required() String? Id; UserAccessKeys({this.CompanyId,this.AccessKeyTypeId,this.Value,this.CustomerId,this.Description,this.Id}); UserAccessKeys.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); CompanyId = json['CompanyId']; AccessKeyTypeId = json['AccessKeyTypeId']; Value = json['Value']; CustomerId = json['CustomerId']; Description = json['Description']; Id = json['Id']; return this; } Map toJson() => super.toJson()..addAll({ 'CompanyId': CompanyId, 'AccessKeyTypeId': AccessKeyTypeId, 'Value': Value, 'CustomerId': CustomerId, 'Description': Description, 'Id': Id }); getTypeName() => "UserAccessKeys"; TypeContext? context = _ctx; } class CustomerQueryResponse implements IConvertible { String? Id; String? Firstname; String? Lastname; String? Email; String? Phone; String? ImageUrl; List? CustomFields; List? CustomFieldValues; List? Comments; List? AccessKeys; DateTime? Updated; DateTime? Created; dynamic? ResponseStatus; bool? SubscribedToNewsletter; InvoiceAddress? InvoiceAddress; CustomerQueryResponse({this.Id,this.Firstname,this.Lastname,this.Email,this.Phone,this.ImageUrl,this.CustomFields,this.CustomFieldValues,this.Comments,this.AccessKeys,this.Updated,this.Created,this.ResponseStatus,this.SubscribedToNewsletter,this.InvoiceAddress}); CustomerQueryResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; Firstname = json['Firstname']; Lastname = json['Lastname']; Email = json['Email']; Phone = json['Phone']; ImageUrl = json['ImageUrl']; CustomFields = JsonConverters.fromJson(json['CustomFields'],'List',context!); CustomFieldValues = JsonConverters.fromJson(json['CustomFieldValues'],'List',context!); Comments = JsonConverters.fromJson(json['Comments'],'List',context!); AccessKeys = JsonConverters.fromJson(json['AccessKeys'],'List',context!); Updated = JsonConverters.fromJson(json['Updated'],'DateTime',context!); Created = JsonConverters.fromJson(json['Created'],'DateTime',context!); ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'dynamic',context!); SubscribedToNewsletter = json['SubscribedToNewsletter']; InvoiceAddress = JsonConverters.fromJson(json['InvoiceAddress'],'InvoiceAddress',context!); return this; } Map toJson() => { 'Id': Id, 'Firstname': Firstname, 'Lastname': Lastname, 'Email': Email, 'Phone': Phone, 'ImageUrl': ImageUrl, 'CustomFields': JsonConverters.toJson(CustomFields,'List',context!), 'CustomFieldValues': JsonConverters.toJson(CustomFieldValues,'List',context!), 'Comments': JsonConverters.toJson(Comments,'List',context!), 'AccessKeys': JsonConverters.toJson(AccessKeys,'List',context!), 'Updated': JsonConverters.toJson(Updated,'DateTime',context!), 'Created': JsonConverters.toJson(Created,'DateTime',context!), 'ResponseStatus': JsonConverters.toJson(ResponseStatus,'dynamic',context!), 'SubscribedToNewsletter': SubscribedToNewsletter, 'InvoiceAddress': JsonConverters.toJson(InvoiceAddress,'InvoiceAddress',context!) }; getTypeName() => "CustomerQueryResponse"; TypeContext? context = _ctx; } class UpdateCustomerResponse extends CustomerQueryResponse implements IConvertible { String? FacebookUserName; String? UserId; String? CompanyId; DateTime? CreatedDate; List? DeletedAccessKeys; List? CreatedOrUpdatedAccessKeys; UpdateCustomerResponse({this.FacebookUserName,this.UserId,this.CompanyId,this.CreatedDate,this.DeletedAccessKeys,this.CreatedOrUpdatedAccessKeys}); UpdateCustomerResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); FacebookUserName = json['FacebookUserName']; UserId = json['UserId']; CompanyId = json['CompanyId']; CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!); DeletedAccessKeys = JsonConverters.fromJson(json['DeletedAccessKeys'],'List',context!); CreatedOrUpdatedAccessKeys = JsonConverters.fromJson(json['CreatedOrUpdatedAccessKeys'],'List',context!); return this; } Map toJson() => super.toJson()..addAll({ 'FacebookUserName': FacebookUserName, 'UserId': UserId, 'CompanyId': CompanyId, 'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!), 'DeletedAccessKeys': JsonConverters.toJson(DeletedAccessKeys,'List',context!), 'CreatedOrUpdatedAccessKeys': JsonConverters.toJson(CreatedOrUpdatedAccessKeys,'List',context!) }); getTypeName() => "UpdateCustomerResponse"; TypeContext? context = _ctx; } // @Route("/customers", "POST") // @ApiResponse(Description="Returned if there is a validation error on the input parameters", StatusCode=400) // @ApiResponse(Description="Returned if the current user is not allowed to perform the action", StatusCode=401) // @ValidateRequest(Validator="IsAuthenticated") class CreateCustomer implements IReturn, IConvertible, IPost { /** * Enter the company and id for the customer, if blank company id and you are an admin, your company id will be used. */ // @ApiMember(Description="Enter the company and id for the customer, if blank company id and you are an admin, your company id will be used.", ParameterType="query") String? CompanyId; // @ApiMember(IsRequired=true) String? Firstname; // @ApiMember(IsRequired=true) String? Lastname; // @ApiMember(IsRequired=true) String? Phone; // @ApiMember() String? Email; /** * If Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated */ // @ApiMember(Description="If Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated") List? CustomFields; /** * List of Access Keys */ // @ApiMember(Description="List of Access Keys") List? AccessKeys; /** * Customer invoice adress */ // @ApiMember(Description="Customer invoice adress") InvoiceAddress? InvoiceAddress; CreateCustomer({this.CompanyId,this.Firstname,this.Lastname,this.Phone,this.Email,this.CustomFields,this.AccessKeys,this.InvoiceAddress}); CreateCustomer.fromJson(Map json) { fromMap(json); } fromMap(Map json) { CompanyId = json['CompanyId']; Firstname = json['Firstname']; Lastname = json['Lastname']; Phone = json['Phone']; Email = json['Email']; CustomFields = JsonConverters.fromJson(json['CustomFields'],'List',context!); AccessKeys = JsonConverters.fromJson(json['AccessKeys'],'List',context!); InvoiceAddress = JsonConverters.fromJson(json['InvoiceAddress'],'InvoiceAddress',context!); return this; } Map toJson() => { 'CompanyId': CompanyId, 'Firstname': Firstname, 'Lastname': Lastname, 'Phone': Phone, 'Email': Email, 'CustomFields': JsonConverters.toJson(CustomFields,'List',context!), 'AccessKeys': JsonConverters.toJson(AccessKeys,'List',context!), 'InvoiceAddress': JsonConverters.toJson(InvoiceAddress,'InvoiceAddress',context!) }; createResponse() => UpdateCustomerResponse(); getResponseTypeName() => "UpdateCustomerResponse"; getTypeName() => "CreateCustomer"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: { 'AddCustomField': TypeInfo(TypeOf.Class, create:() => AddCustomField()), 'AddUserAccessKey': TypeInfo(TypeOf.Class, create:() => AddUserAccessKey()), 'InvoiceAddress': TypeInfo(TypeOf.Class, create:() => InvoiceAddress()), 'BaseModel': TypeInfo(TypeOf.Class, create:() => BaseModel()), 'UserAccessKeys': TypeInfo(TypeOf.Class, create:() => UserAccessKeys()), 'CustomerQueryResponse': TypeInfo(TypeOf.Class, create:() => CustomerQueryResponse()), 'List': TypeInfo(TypeOf.Class, create:() => []), 'CustomFieldConfigData': TypeInfo(TypeOf.Class, create:() => CustomFieldConfigData()), 'List': TypeInfo(TypeOf.Class, create:() => []), 'CustomFieldDataResponse': TypeInfo(TypeOf.Class, create:() => CustomFieldDataResponse()), 'List': TypeInfo(TypeOf.Class, create:() => []), 'CustomerCommentsResponse': TypeInfo(TypeOf.Class, create:() => CustomerCommentsResponse()), 'List': TypeInfo(TypeOf.Class, create:() => []), 'UpdateCustomerResponse': TypeInfo(TypeOf.Class, create:() => UpdateCustomerResponse()), 'CreateCustomer': TypeInfo(TypeOf.Class, create:() => CreateCustomer()), 'List': TypeInfo(TypeOf.Class, create:() => []), 'List': TypeInfo(TypeOf.Class, create:() => []), });