ClubReady Api

<back to all web services

GetCustomCategoriesRequest

The following routes are available for this service:
GET/club/custom-categoryList of custom categories.
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;
}

class GetCustomCategoriesRequestDto extends ApiDtoBase implements IConvertible
{
    int? CustomCategoryId;

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

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CustomCategoryId = json['CustomCategoryId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CustomCategoryId': CustomCategoryId
    });

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

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

class GetCustomCategoriesRequest extends GetCustomCategoriesRequestDto 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;

    GetCustomCategoriesRequest({this.ApiKey,this.ChainId,this.StoreId,this.RestrictedId,this.RestrictedResourceType});
    GetCustomCategoriesRequest.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() => "GetCustomCategoriesRequest";
    TypeContext? context = _ctx;
}

class ApiResponseBase implements IConvertible
{
    bool? Success;
    String? Message;

    ApiResponseBase({this.Success,this.Message});
    ApiResponseBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Success = json['Success'];
        Message = json['Message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Success': Success,
        'Message': Message
    };

    getTypeName() => "ApiResponseBase";
    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 CustomCategoryInfo extends ApiGenericType implements IConvertible
{
    int? ItemCount;

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

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        ItemCount = json['ItemCount'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'ItemCount': ItemCount
    });

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

class GetCustomCategoriesResponseDto extends ApiResponseBase implements IConvertible
{
    List<CustomCategoryInfo>? CustomCategories;

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

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

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

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

class GetCustomCategoriesResponse extends GetCustomCategoriesResponseDto implements IConvertible
{
    List<CustomCategoryInfo>? CustomCategories;
    bool? Success;
    String? Message;

    GetCustomCategoriesResponse({this.CustomCategories,this.Success,this.Message});
    GetCustomCategoriesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CustomCategories': JsonConverters.toJson(CustomCategories,'List<CustomCategoryInfo>',context!),
        'Success': Success,
        'Message': Message
    });

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

TypeContext _ctx = TypeContext(library: 'www.clubready.com', types: <String, TypeInfo> {
    'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
    'GetCustomCategoriesRequestDto': TypeInfo(TypeOf.Class, create:() => GetCustomCategoriesRequestDto()),
    'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
    'GetCustomCategoriesRequest': TypeInfo(TypeOf.Class, create:() => GetCustomCategoriesRequest()),
    'ApiResponseBase': TypeInfo(TypeOf.Class, create:() => ApiResponseBase()),
    'ApiGenericType': TypeInfo(TypeOf.Class, create:() => ApiGenericType()),
    'CustomCategoryInfo': TypeInfo(TypeOf.Class, create:() => CustomCategoryInfo()),
    'GetCustomCategoriesResponseDto': TypeInfo(TypeOf.Class, create:() => GetCustomCategoriesResponseDto()),
    'List<CustomCategoryInfo>': TypeInfo(TypeOf.Class, create:() => <CustomCategoryInfo>[]),
    'GetCustomCategoriesResponse': TypeInfo(TypeOf.Class, create:() => GetCustomCategoriesResponse()),
});

Dart GetCustomCategoriesRequest DTOs

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

HTTP + XML

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

GET /club/custom-category HTTP/1.1 
Host: www.clubready.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetCustomCategoriesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Club.Models">
  <Message xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Message>
  <Success xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">false</Success>
  <CustomCategories xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">
    <CustomCategoryInfo>
      <ChainId>0</ChainId>
      <Id>0</Id>
      <Name>String</Name>
      <StoreId>0</StoreId>
      <ItemCount>0</ItemCount>
    </CustomCategoryInfo>
  </CustomCategories>
</GetCustomCategoriesResponse>