ClubReady Api

<back to all web services

GetMembershipTypesRequest

The following routes are available for this service:
GET/club/membership-typesList of membership types.
import 'package:servicestack/servicestack.dart';

class ApiDtoBase implements IConvertible
{
    String? ApiKey;
    int? StoreId;
    int? ChainId;

    ApiDtoBase({this.ApiKey,this.StoreId,this.ChainId});
    ApiDtoBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ApiKey = json['ApiKey'];
        StoreId = json['StoreId'];
        ChainId = json['ChainId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ApiKey': ApiKey,
        'StoreId': StoreId,
        'ChainId': ChainId
    };

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

enum RestrictedResourceType
{
    Store,
    Chain,
    User,
    Undefined,
}

class GetMembershipTypesRequest extends ApiDtoBase implements IRestrictedApiRequest, IConvertible
{
    /**
    * Api Key - grants access to resources
    */
    // @ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")
    String? ApiKey;

    /**
    * Either StoreId or ChainId is required
    */
    // @ApiMember(DataType="integer", Description="Either StoreId or ChainId is required", Name="ChainId", ParameterType="query")
    int? ChainId;

    /**
    * Either StoreId or ChainId is required
    */
    // @ApiMember(DataType="integer", Description="Either StoreId or ChainId is required", Name="StoreId", ParameterType="query")
    int? StoreId;

    int? RestrictedId;
    RestrictedResourceType? RestrictedResourceType;

    GetMembershipTypesRequest({this.ApiKey,this.ChainId,this.StoreId,this.RestrictedId,this.RestrictedResourceType});
    GetMembershipTypesRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        ApiKey = json['ApiKey'];
        ChainId = json['ChainId'];
        StoreId = json['StoreId'];
        RestrictedId = json['RestrictedId'];
        RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'ApiKey': ApiKey,
        'ChainId': ChainId,
        'StoreId': StoreId,
        'RestrictedId': RestrictedId,
        'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
    });

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

class ApiGenericType implements IConvertible
{
    int? Id;
    String? Name;
    int? StoreId;
    int? ChainId;

    ApiGenericType({this.Id,this.Name,this.StoreId,this.ChainId});
    ApiGenericType.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        StoreId = json['StoreId'];
        ChainId = json['ChainId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'StoreId': StoreId,
        'ChainId': ChainId
    };

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

class GetMembershipTypesResponseDto implements IConvertible
{
    List<ApiGenericType>? MembershipTypes;

    GetMembershipTypesResponseDto({this.MembershipTypes});
    GetMembershipTypesResponseDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'MembershipTypes': JsonConverters.toJson(MembershipTypes,'List<ApiGenericType>',context!)
    };

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

class GetMembershipTypesResponse extends GetMembershipTypesResponseDto implements IConvertible
{
    List<ApiGenericType>? MembershipTypes;

    GetMembershipTypesResponse({this.MembershipTypes});
    GetMembershipTypesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        MembershipTypes = JsonConverters.fromJson(json['MembershipTypes'],'List<ApiGenericType>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'MembershipTypes': JsonConverters.toJson(MembershipTypes,'List<ApiGenericType>',context!)
    });

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

TypeContext _ctx = TypeContext(library: 'www.clubready.com', types: <String, TypeInfo> {
    'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
    'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
    'GetMembershipTypesRequest': TypeInfo(TypeOf.Class, create:() => GetMembershipTypesRequest()),
    'ApiGenericType': TypeInfo(TypeOf.Class, create:() => ApiGenericType()),
    'GetMembershipTypesResponseDto': TypeInfo(TypeOf.Class, create:() => GetMembershipTypesResponseDto()),
    'List<ApiGenericType>': TypeInfo(TypeOf.Class, create:() => <ApiGenericType>[]),
    'GetMembershipTypesResponse': TypeInfo(TypeOf.Class, create:() => GetMembershipTypesResponse()),
});

Dart GetMembershipTypesRequest 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 /club/membership-types HTTP/1.1 
Host: www.clubready.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	MembershipTypes: 
	[
		{
			Id: 0,
			Name: String,
			StoreId: 0,
			ChainId: 0
		}
	]
}