GET | /scheduling/{UserId}/credit-check | Check to see if a particular credit can be used to book a certain class or service. |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class CreditCheckRequest extends CreditCheckRequestDto implements IRestrictedApiRequest
{
/**
* Api Key - grants access to resources
*/
@ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")
public String ApiKey = null;
/**
* Chain ID
*/
@ApiMember(DataType="integer", Description="Chain ID", Name="ChainId", ParameterType="query")
public Integer ChainId = null;
/**
* Store ID
*/
@ApiMember(DataType="integer", Description="Store ID", Name="StoreId", ParameterType="query")
public Integer StoreId = null;
/**
* ClubReady User ID
*/
@ApiMember(DataType="integer", Description="ClubReady User ID", IsRequired=true, Name="UserId", ParameterType="path")
public Integer UserId = null;
/**
* ClubReady Customer Session ID
*/
@ApiMember(DataType="integer", Description="ClubReady Customer Session ID", IsRequired=true, Name="CustomerSessionId", ParameterType="query")
public Integer CustomerSessionId = null;
/**
* ClubReady Class ID
*/
@ApiMember(DataType="integer", Description="ClubReady Class ID", Name="ClassId", ParameterType="query")
public Integer ClassId = null;
/**
* ClubReady Session Size ID
*/
@ApiMember(DataType="integer", Description="ClubReady Session Size ID", Name="SessionSizeId", ParameterType="query")
public Integer SessionSizeId = null;
public Integer RestrictedId = null;
public RestrictedResourceType RestrictedResourceType = null;
public String getApiKey() { return ApiKey; }
public CreditCheckRequest setApiKey(String value) { this.ApiKey = value; return this; }
public Integer getChainId() { return ChainId; }
public CreditCheckRequest setChainId(Integer value) { this.ChainId = value; return this; }
public Integer getStoreId() { return StoreId; }
public CreditCheckRequest setStoreId(Integer value) { this.StoreId = value; return this; }
public Integer getUserId() { return UserId; }
public CreditCheckRequest setUserId(Integer value) { this.UserId = value; return this; }
public Integer getCustomerSessionId() { return CustomerSessionId; }
public CreditCheckRequest setCustomerSessionId(Integer value) { this.CustomerSessionId = value; return this; }
public Integer getClassId() { return ClassId; }
public CreditCheckRequest setClassId(Integer value) { this.ClassId = value; return this; }
public Integer getSessionSizeId() { return SessionSizeId; }
public CreditCheckRequest setSessionSizeId(Integer value) { this.SessionSizeId = value; return this; }
public Integer getRestrictedId() { return RestrictedId; }
public CreditCheckRequest setRestrictedId(Integer value) { this.RestrictedId = value; return this; }
public RestrictedResourceType getRestrictedResourceType() { return RestrictedResourceType; }
public CreditCheckRequest setRestrictedResourceType(RestrictedResourceType value) { this.RestrictedResourceType = value; return this; }
}
public static class CreditCheckRequestDto extends ApiDtoBase
{
public Integer UserId = null;
public Integer CustomerSessionId = null;
public Integer ClassId = null;
public Integer SessionSizeId = null;
public Integer getUserId() { return UserId; }
public CreditCheckRequestDto setUserId(Integer value) { this.UserId = value; return this; }
public Integer getCustomerSessionId() { return CustomerSessionId; }
public CreditCheckRequestDto setCustomerSessionId(Integer value) { this.CustomerSessionId = value; return this; }
public Integer getClassId() { return ClassId; }
public CreditCheckRequestDto setClassId(Integer value) { this.ClassId = value; return this; }
public Integer getSessionSizeId() { return SessionSizeId; }
public CreditCheckRequestDto setSessionSizeId(Integer value) { this.SessionSizeId = value; return this; }
}
public static class ApiDtoBase
{
public String ApiKey = null;
public Integer StoreId = null;
public Integer ChainId = null;
public String getApiKey() { return ApiKey; }
public ApiDtoBase setApiKey(String value) { this.ApiKey = value; return this; }
public Integer getStoreId() { return StoreId; }
public ApiDtoBase setStoreId(Integer value) { this.StoreId = value; return this; }
public Integer getChainId() { return ChainId; }
public ApiDtoBase setChainId(Integer value) { this.ChainId = value; return this; }
}
public static enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined;
}
public static class CreditCheckResponse extends CreditCheckResponseDto
{
public Boolean Success = null;
public String Message = null;
public Boolean CanUse = null;
public Boolean isSuccess() { return Success; }
public CreditCheckResponse setSuccess(Boolean value) { this.Success = value; return this; }
public String getMessage() { return Message; }
public CreditCheckResponse setMessage(String value) { this.Message = value; return this; }
public Boolean isCanUse() { return CanUse; }
public CreditCheckResponse setCanUse(Boolean value) { this.CanUse = value; return this; }
}
public static class CreditCheckResponseDto extends ApiResponseBase
{
public Boolean CanUse = null;
public Boolean isCanUse() { return CanUse; }
public CreditCheckResponseDto setCanUse(Boolean value) { this.CanUse = value; return this; }
}
public static class ApiResponseBase
{
public Boolean Success = null;
public String Message = null;
public Boolean isSuccess() { return Success; }
public ApiResponseBase setSuccess(Boolean value) { this.Success = value; return this; }
public String getMessage() { return Message; }
public ApiResponseBase setMessage(String value) { this.Message = value; return this; }
}
}
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 /scheduling/{UserId}/credit-check HTTP/1.1 Host: clubready.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CreditCheckResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Scheduling.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> <CanUse xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">false</CanUse> </CreditCheckResponse>