BokaMera.API.Host

<back to all web services

ApiVersionCompabilityQuery

The following routes are available for this service:
GET/version/compabilityGet information about if your current version is compability with the api verisonReturns information about which version of the API is currently running and when it was built.
import 'package:servicestack/servicestack.dart';

class ApiVersionCompabilityQueryResponse implements IConvertible
{
    /**
    * The latest version number
    */
    String? CurrentVersion;
    /**
    * Your version number
    */
    String? YourVersion;
    /**
    * Any compatible error message
    */
    String? Message;
    /**
    * If your version is compatible with the current version
    */
    bool? Compatible;
    /**
    * If the changes are blocking for use and you need to upgrade to later version
    */
    bool? BlockingChanges;
    ResponseStatus? ResponseStatus;

    ApiVersionCompabilityQueryResponse({this.CurrentVersion,this.YourVersion,this.Message,this.Compatible,this.BlockingChanges,this.ResponseStatus});
    ApiVersionCompabilityQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CurrentVersion = json['CurrentVersion'];
        YourVersion = json['YourVersion'];
        Message = json['Message'];
        Compatible = json['Compatible'];
        BlockingChanges = json['BlockingChanges'];
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CurrentVersion': CurrentVersion,
        'YourVersion': YourVersion,
        'Message': Message,
        'Compatible': Compatible,
        'BlockingChanges': BlockingChanges,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "ApiVersionCompabilityQueryResponse";
    TypeContext? context = _ctx;
}

enum VersionIdentifier
{
    BokaMeraiOS,
    BokaMeraAdminiOS,
    BokaMeraAndroid,
    BokaMeraAdminAndroid,
}

class ApiVersionCompabilityQuery implements IConvertible
{
    /**
    * The identifier for your application.
    */
    // @ApiMember(Description="The identifier for your application.", IsRequired=true, ParameterType="query")
    VersionIdentifier? Identifier;

    /**
    * The version you are running and you want to check
    */
    // @ApiMember(Description="The version you are running and you want to check", IsRequired=true, ParameterType="query")
    String? Version;

    ApiVersionCompabilityQuery({this.Identifier,this.Version});
    ApiVersionCompabilityQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Identifier = JsonConverters.fromJson(json['Identifier'],'VersionIdentifier',context!);
        Version = json['Version'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Identifier': JsonConverters.toJson(Identifier,'VersionIdentifier',context!),
        'Version': Version
    };

    getTypeName() => "ApiVersionCompabilityQuery";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'ApiVersionCompabilityQueryResponse': TypeInfo(TypeOf.Class, create:() => ApiVersionCompabilityQueryResponse()),
    'VersionIdentifier': TypeInfo(TypeOf.Enum, enumValues:VersionIdentifier.values),
    'ApiVersionCompabilityQuery': TypeInfo(TypeOf.Class, create:() => ApiVersionCompabilityQuery()),
});

Dart ApiVersionCompabilityQuery DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /version/compability HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	CurrentVersion: String,
	YourVersion: String,
	Message: String,
	Compatible: False,
	BlockingChanges: False,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}