ClubReady Api

<back to all web services

CreateUserNoteRequest

The following routes are available for this service:
POST/users/{UserId}/notes/createAdd note to a user account.
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 CreateUserNoteRequestDto extends ApiDtoBase implements IConvertible
{
    int? UserId;
    String? Subject;
    String? Text;
    int? PostedBy;

    CreateUserNoteRequestDto({this.UserId,this.Subject,this.Text,this.PostedBy});
    CreateUserNoteRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'UserId': UserId,
        'Subject': Subject,
        'Text': Text,
        'PostedBy': PostedBy
    });

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

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

class CreateUserNoteRequest extends CreateUserNoteRequestDto 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;

    /**
    * ClubReady Club ID (StoreID internally)
    */
    // @ApiMember(DataType="integer", Description="ClubReady Club ID (StoreID internally)", IsRequired=true, Name="StoreId", ParameterType="query")
    int? StoreId;

    /**
    * Create note for this ClubReady User ID
    */
    // @ApiMember(DataType="integer", Description="Create note for this ClubReady User ID", IsRequired=true, Name="UserId", ParameterType="query")
    int? UserId;

    /**
    * Subject of the note (Up to 255 characters)
    */
    // @ApiMember(DataType="string", Description="Subject of the note (Up to 255 characters)", IsRequired=true, Name="Subject", ParameterType="query")
    String? Subject;

    /**
    * Text body of the note (Up to 2000 characters)
    */
    // @ApiMember(DataType="string", Description="Text body of the note (Up to 2000 characters)", IsRequired=true, Name="Text", ParameterType="query")
    String? Text;

    /**
    * Note is being posted by this ClubReady User ID.
    */
    // @ApiMember(DataType="integer", Description="Note is being posted by this ClubReady User ID.", Name="PostedBy", ParameterType="query")
    int? PostedBy;

    int? RestrictedId;
    RestrictedResourceType? RestrictedResourceType;

    CreateUserNoteRequest({this.ApiKey,this.StoreId,this.UserId,this.Subject,this.Text,this.PostedBy,this.RestrictedId,this.RestrictedResourceType});
    CreateUserNoteRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

    getTypeName() => "CreateUserNoteRequest";
    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 CreateUserNoteResponseDto extends ApiResponseBase implements IConvertible
{
    int? NoteId;

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

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

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

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

class CreateUserNoteResponse extends CreateUserNoteResponseDto implements IConvertible
{
    bool? Success;
    String? Message;
    int? NoteId;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
    'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
    'CreateUserNoteRequestDto': TypeInfo(TypeOf.Class, create:() => CreateUserNoteRequestDto()),
    'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
    'CreateUserNoteRequest': TypeInfo(TypeOf.Class, create:() => CreateUserNoteRequest()),
    'ApiResponseBase': TypeInfo(TypeOf.Class, create:() => ApiResponseBase()),
    'CreateUserNoteResponseDto': TypeInfo(TypeOf.Class, create:() => CreateUserNoteResponseDto()),
    'CreateUserNoteResponse': TypeInfo(TypeOf.Class, create:() => CreateUserNoteResponse()),
});

Dart CreateUserNoteRequest DTOs

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

HTTP + CSV

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

POST /users/{UserId}/notes/create HTTP/1.1 
Host: clubready.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"ApiKey":"String","StoreId":0,"UserId":0,"Subject":"String","Text":"String","PostedBy":0,"RestrictedId":0,"RestrictedResourceType":"Store","ChainId":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Success":false,"Message":"String","NoteId":0}