POST | /users/{UserId}/add-waiver | Add a waiver for a user. |
---|
import 'package:servicestack/servicestack.dart';
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
class AddUserWaiverRequest 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;
/**
* Store ID
*/
// @ApiMember(DataType="integer", Description="Store ID", IsRequired=true, Name="StoreId", ParameterType="query")
int? StoreId;
/**
* ClubReady User ID
*/
// @ApiMember(DataType="integer", Description="ClubReady User ID", IsRequired=true, Name="UserId", ParameterType="path")
int? UserId;
/**
* Form ID
*/
// @ApiMember(DataType="integer", Description="Form ID", Name="FormId", ParameterType="query")
int? FormId;
/**
* Base64 encoded PDF string
*/
// @ApiMember(DataType="string", Description="Base64 encoded PDF string", IsRequired=true, Name="WaiverPdf", ParameterType="form")
String? WaiverPdf;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
AddUserWaiverRequest({this.ApiKey,this.StoreId,this.UserId,this.FormId,this.WaiverPdf,this.RestrictedId,this.RestrictedResourceType});
AddUserWaiverRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ApiKey = json['ApiKey'];
StoreId = json['StoreId'];
UserId = json['UserId'];
FormId = json['FormId'];
WaiverPdf = json['WaiverPdf'];
RestrictedId = json['RestrictedId'];
RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ApiKey': ApiKey,
'StoreId': StoreId,
'UserId': UserId,
'FormId': FormId,
'WaiverPdf': WaiverPdf,
'RestrictedId': RestrictedId,
'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
};
getTypeName() => "AddUserWaiverRequest";
TypeContext? context = _ctx;
}
class AddUserWaiverResponse implements IConvertible
{
bool? Success;
String? Message;
AddUserWaiverResponse({this.Success,this.Message});
AddUserWaiverResponse.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() => "AddUserWaiverResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'AddUserWaiverRequest': TypeInfo(TypeOf.Class, create:() => AddUserWaiverRequest()),
'AddUserWaiverResponse': TypeInfo(TypeOf.Class, create:() => AddUserWaiverResponse()),
});
Dart AddUserWaiverRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /users/{UserId}/add-waiver HTTP/1.1
Host: clubready.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ApiKey: String,
StoreId: 0,
UserId: 0,
FormId: 0,
WaiverPdf: String,
RestrictedId: 0,
RestrictedResourceType: Store
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Success: False, Message: String }