POST | /users/{UserId}/tags/create | Add a tag 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 TagUserRequestDto extends ApiDtoBase implements IConvertible
{
int? UserId;
String? Tag;
TagUserRequestDto({this.UserId,this.Tag});
TagUserRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
UserId = json['UserId'];
Tag = json['Tag'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'UserId': UserId,
'Tag': Tag
});
getTypeName() => "TagUserRequestDto";
TypeContext? context = _ctx;
}
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
class TagUserRequest extends TagUserRequestDto 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;
/**
* ClubReady User ID
*/
// @ApiMember(DataType="integer", Description="ClubReady User ID", IsRequired=true, Name="UserId", ParameterType="query")
int? UserId;
/**
* Tag (Up to 100 characters)
*/
// @ApiMember(DataType="string", Description="Tag (Up to 100 characters)", IsRequired=true, Name="Tag", ParameterType="query")
String? Tag;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
TagUserRequest({this.ApiKey,this.StoreId,this.UserId,this.Tag,this.RestrictedId,this.RestrictedResourceType});
TagUserRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ApiKey = json['ApiKey'];
StoreId = json['StoreId'];
UserId = json['UserId'];
Tag = json['Tag'];
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,
'Tag': Tag,
'RestrictedId': RestrictedId,
'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
});
getTypeName() => "TagUserRequest";
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 TagUserResponseDto extends ApiResponseBase implements IConvertible
{
TagUserResponseDto();
TagUserResponseDto.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "TagUserResponseDto";
TypeContext? context = _ctx;
}
class TagUserResponse extends TagUserResponseDto implements IConvertible
{
bool? Success;
String? Message;
TagUserResponse({this.Success,this.Message});
TagUserResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Success = json['Success'];
Message = json['Message'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Success': Success,
'Message': Message
});
getTypeName() => "TagUserResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
'TagUserRequestDto': TypeInfo(TypeOf.Class, create:() => TagUserRequestDto()),
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'TagUserRequest': TypeInfo(TypeOf.Class, create:() => TagUserRequest()),
'ApiResponseBase': TypeInfo(TypeOf.Class, create:() => ApiResponseBase()),
'TagUserResponseDto': TypeInfo(TypeOf.Class, create:() => TagUserResponseDto()),
'TagUserResponse': TypeInfo(TypeOf.Class, create:() => TagUserResponse()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /users/{UserId}/tags/create HTTP/1.1
Host: clubready.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"ApiKey":"String","StoreId":0,"UserId":0,"Tag":"String","RestrictedId":0,"RestrictedResourceType":"Store","ChainId":0}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Success":false,"Message":"String"}