ClubReady Api

<back to all web services

ContractTextEndpoint

The following routes are available for this service:
GET/sales/agreement/contractGet a contracts HTML verbiageGet 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 .jsv suffix or ?format=jsv

HTTP + JSV

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: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	contractHtml: String,
	incompleteAgreementToken: String,
	success: False,
	message: String
}