POST | /users/{UserId}/zipwhipmessage/create | Add a ZipWhip message 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 CreateZipWhipMessageRequestDto extends ApiDtoBase implements IConvertible
{
int? UserId;
String? Subject;
String? Text;
int? PostedBy;
CreateZipWhipMessageRequestDto({this.UserId,this.Subject,this.Text,this.PostedBy});
CreateZipWhipMessageRequestDto.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() => "CreateZipWhipMessageRequestDto";
TypeContext? context = _ctx;
}
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
class CreateZipWhipMessageRequest extends CreateZipWhipMessageRequestDto 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 message (Up to 255 characters)
*/
// @ApiMember(DataType="string", Description="Subject of the message (Up to 255 characters)", IsRequired=true, Name="Subject", ParameterType="query")
String? Subject;
/**
* Text body of the message (Up to 2000 characters)
*/
// @ApiMember(DataType="string", Description="Text body of the message (Up to 2000 characters)", IsRequired=true, Name="Text", ParameterType="query")
String? Text;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
CreateZipWhipMessageRequest({this.ApiKey,this.StoreId,this.UserId,this.Subject,this.Text,this.RestrictedId,this.RestrictedResourceType});
CreateZipWhipMessageRequest.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'];
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,
'RestrictedId': RestrictedId,
'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
});
getTypeName() => "CreateZipWhipMessageRequest";
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 CreateZipWhipMessageResponseDto extends ApiResponseBase implements IConvertible
{
int? NoteId;
int? ContactLogId;
int? TaskId;
CreateZipWhipMessageResponseDto({this.NoteId,this.ContactLogId,this.TaskId});
CreateZipWhipMessageResponseDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
NoteId = json['NoteId'];
ContactLogId = json['ContactLogId'];
TaskId = json['TaskId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'NoteId': NoteId,
'ContactLogId': ContactLogId,
'TaskId': TaskId
});
getTypeName() => "CreateZipWhipMessageResponseDto";
TypeContext? context = _ctx;
}
class CreateZipWhipMessageResponse extends CreateZipWhipMessageResponseDto implements IConvertible
{
bool? Success;
String? Message;
int? NoteId;
int? ContactLogId;
int? TaskId;
CreateZipWhipMessageResponse({this.Success,this.Message,this.NoteId,this.ContactLogId,this.TaskId});
CreateZipWhipMessageResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Success = json['Success'];
Message = json['Message'];
NoteId = json['NoteId'];
ContactLogId = json['ContactLogId'];
TaskId = json['TaskId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Success': Success,
'Message': Message,
'NoteId': NoteId,
'ContactLogId': ContactLogId,
'TaskId': TaskId
});
getTypeName() => "CreateZipWhipMessageResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
'CreateZipWhipMessageRequestDto': TypeInfo(TypeOf.Class, create:() => CreateZipWhipMessageRequestDto()),
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'CreateZipWhipMessageRequest': TypeInfo(TypeOf.Class, create:() => CreateZipWhipMessageRequest()),
'ApiResponseBase': TypeInfo(TypeOf.Class, create:() => ApiResponseBase()),
'CreateZipWhipMessageResponseDto': TypeInfo(TypeOf.Class, create:() => CreateZipWhipMessageResponseDto()),
'CreateZipWhipMessageResponse': TypeInfo(TypeOf.Class, create:() => CreateZipWhipMessageResponse()),
});
Dart CreateZipWhipMessageRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /users/{UserId}/zipwhipmessage/create HTTP/1.1
Host: clubready.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateZipWhipMessageRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Members.Model">
<ApiKey xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</ApiKey>
<ChainId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ChainId>
<StoreId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</StoreId>
<PostedBy xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</PostedBy>
<Subject xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Subject>
<Text xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Text>
<UserId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</UserId>
</CreateZipWhipMessageRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CreateZipWhipMessageResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Members.Model"> <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> <ContactLogId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ContactLogId> <NoteId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</NoteId> <TaskId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</TaskId> </CreateZipWhipMessageResponse>