POST | /scheduling/class-schedule | Create a Class Schedule |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports ClubReady.Web.Api.Scheduling.Model
Imports ClubReady.Core.Api.Models
Imports ClubReady.Web.Api
Namespace Global
Namespace ClubReady.Core.Api.Models
Public Partial Class ApiDtoBase
Public Overridable Property ApiKey As String
Public Overridable Property StoreId As Nullable(Of Integer)
Public Overridable Property ChainId As Nullable(Of Integer)
End Class
Public Partial Class ApiResponseBase
Public Overridable Property Success As Boolean
Public Overridable Property Message As String
End Class
Public Partial Class CreateClassScheduleRequestDto
Inherits ApiDtoBase
Public Overridable Property ClassId As Integer
Public Overridable Property ClassDateTime As Date
Public Overridable Property TrainerId As Nullable(Of Integer)
Public Overridable Property AlternateClassName As String
End Class
Public Partial Class CreateClassScheduleResponseDto
Inherits ApiResponseBase
Public Overridable Property ClassScheduleId As Nullable(Of Integer)
End Class
End Namespace
Namespace ClubReady.Web.Api
Public Enum RestrictedResourceType
Store
Chain
User
Undefined
End Enum
End Namespace
Namespace ClubReady.Web.Api.Scheduling.Model
Public Partial Class CreateClassScheduleRequest
Inherits CreateClassScheduleRequestDto
Implements IRestrictedApiRequest
'''<Summary>
'''Api Key - grants access to resources
'''</Summary>
<ApiMember(DataType:="string", Description:="Api Key - grants access to resources", IsRequired:=true, Name:="ApiKey", ParameterType:="query")>
Public Overridable Property ApiKey As String
'''<Summary>
'''Store ID
'''</Summary>
<ApiMember(DataType:="integer", Description:="Store ID", IsRequired:=true, Name:="StoreId", ParameterType:="query")>
Public Overridable Property StoreId As Nullable(Of Integer)
'''<Summary>
'''Class ID
'''</Summary>
<ApiMember(DataType:="integer", Description:="Class ID", IsRequired:=true, Name:="ClassId", ParameterType:="query")>
Public Overridable Property ClassId As Integer
'''<Summary>
'''Date and Time for Class
'''</Summary>
<ApiMember(DataType:="date-time", Description:="Date and Time for Class", IsRequired:=true, Name:="ClassDateTime", ParameterType:="query")>
Public Overridable Property ClassDateTime As Date
'''<Summary>
'''Trainer ID
'''</Summary>
<ApiMember(DataType:="integer", Description:="Trainer ID", Name:="TrainerId", ParameterType:="query")>
Public Overridable Property TrainerId As Nullable(Of Integer)
'''<Summary>
'''Alternate Class Name
'''</Summary>
<ApiMember(DataType:="string", Description:="Alternate Class Name", Name:="AlternateClassName", ParameterType:="query")>
Public Overridable Property AlternateClassName As String
Public Overridable Property RestrictedId As Nullable(Of Integer)
Public Overridable Property RestrictedResourceType As RestrictedResourceType
End Class
Public Partial Class CreateClassScheduleResponse
Inherits CreateClassScheduleResponseDto
Public Overridable Property Success As Boolean
Public Overridable Property ClassScheduleId As Nullable(Of Integer)
Public Overridable Property Message As String
End Class
End Namespace
End Namespace
VB.NET CreateClassScheduleRequest 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 /scheduling/class-schedule HTTP/1.1
Host: clubready.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ApiKey: String,
StoreId: 0,
ClassId: 0,
ClassDateTime: 0001-01-01,
TrainerId: 0,
AlternateClassName: String,
RestrictedId: 0,
RestrictedResourceType: Store,
ChainId: 0
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Success: False, ClassScheduleId: 0, Message: String }