GET | /sales/agreement/contract | Get a contracts HTML verbiage | Get the agreements contract in HTML. Uses the Incomplete Agreements Token to identify the contract verbiage, and converts it into HTML, and returns it to the requestor. The header `X-Forwarded-For` is NOT required. It can be set to the IP address of the end user, or left blank. |
---|
import 'package:servicestack/servicestack.dart';
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
// @ApiResponse(Description="", ResponseType=typeof(ContractTextResponse), StatusCode=200)
class ContractTextEndpoint implements IContractTextEndpoint, IRestrictedApiRequest, IConvertible
{
/**
* IP address of the end user
*/
// @ApiMember(Description="IP address of the end user", Name="X-Forwarded-For", ParameterType="header")
String? XForwardedFor;
/**
* Api Authentication Key
*/
// @ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query")
String? ApiKey;
/**
* ID# of the store to get contract for.
*/
// @ApiMember(DataType="int", Description="ID# of the store to get contract for.", IsRequired=true, Name="StoreId", ParameterType="query")
int? StoreId;
int? ChainId;
/**
* Token for Incomplete Agreement to get details for
*/
// @ApiMember(DataType="string", Description="Token for Incomplete Agreement to get details for", IsRequired=true, Name="IncompleteAgreementToken", ParameterType="query")
String? IncompleteAgreementToken;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
ContractTextEndpoint({this.XForwardedFor,this.ApiKey,this.StoreId,this.ChainId,this.IncompleteAgreementToken,this.RestrictedId,this.RestrictedResourceType});
ContractTextEndpoint.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
XForwardedFor = json['XForwardedFor'];
ApiKey = json['ApiKey'];
StoreId = json['StoreId'];
ChainId = json['ChainId'];
IncompleteAgreementToken = json['IncompleteAgreementToken'];
RestrictedId = json['RestrictedId'];
RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
return this;
}
Map<String, dynamic> toJson() => {
'XForwardedFor': XForwardedFor,
'ApiKey': ApiKey,
'StoreId': StoreId,
'ChainId': ChainId,
'IncompleteAgreementToken': IncompleteAgreementToken,
'RestrictedId': RestrictedId,
'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
};
getTypeName() => "ContractTextEndpoint";
TypeContext? context = _ctx;
}
class ApiResponse2Base implements IConvertible
{
bool? success;
String? message;
ApiResponse2Base({this.success,this.message});
ApiResponse2Base.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() => "ApiResponse2Base";
TypeContext? context = _ctx;
}
class ContractTextResponse extends ApiResponse2Base implements IConvertible
{
String? contractHtml;
String? incompleteAgreementToken;
ContractTextResponse({this.contractHtml,this.incompleteAgreementToken});
ContractTextResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
contractHtml = json['contractHtml'];
incompleteAgreementToken = json['incompleteAgreementToken'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'contractHtml': contractHtml,
'incompleteAgreementToken': incompleteAgreementToken
});
getTypeName() => "ContractTextResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'www.clubready.com', types: <String, TypeInfo> {
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'ContractTextEndpoint': TypeInfo(TypeOf.Class, create:() => ContractTextEndpoint()),
'ApiResponse2Base': TypeInfo(TypeOf.Class, create:() => ApiResponse2Base()),
'ContractTextResponse': TypeInfo(TypeOf.Class, create:() => ContractTextResponse()),
});
Dart ContractTextEndpoint 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.
GET /sales/agreement/contract HTTP/1.1 Host: www.clubready.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ContractTextResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Sales.Agreement"> <message xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api">String</message> <success xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api">false</success> <contractHtml>String</contractHtml> <incompleteAgreementToken>String</incompleteAgreementToken> </ContractTextResponse>