| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| POST | /timeexceptions/{TimeExceptionId}/tags | Add tags to a time exception | Attaches one or more tags to an existing time exception. |
|---|
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Namespace Global
Namespace BokaMera.API.ServiceModel.Dtos
<ApiResponse(Description:="Returned if a tag does not belong to this company or has the wrong scope", StatusCode:=400)>
<ApiResponse(Description:="Returned if the time exception was not found", StatusCode:=404)>
<ApiResponse(Description:="Returned if the current user is not allowed to perform the action", StatusCode:=401)>
<ValidateRequest(Validator:="IsAuthenticated")>
Public Partial Class AddTagsToTimeException
Implements ICompany
'''<Summary>
'''The company id, if empty will use the company id for the user you are logged in with.
'''</Summary>
<ApiMember(Description:="The company id, if empty will use the company id for the user you are logged in with.")>
Public Overridable Property CompanyId As Guid? Implements ICompany.CompanyId
'''<Summary>
'''The time exception id.
'''</Summary>
<ApiMember(Description:="The time exception id.", IsRequired:=true, ParameterType:="path")>
Public Overridable Property TimeExceptionId As Integer
'''<Summary>
'''The ids of the tags to attach.
'''</Summary>
<ApiMember(Description:="The ids of the tags to attach.", IsRequired:=true)>
Public Overridable Property TagIds As List(Of Integer) = New List(Of Integer)
End Class
Public Partial Class DayOfWeekDto
Public Overridable Property DayOfWeekId As Integer
Public Overridable Property DotNetDayOfWeekId As Integer
Public Overridable Property DayOfWeek As String
End Class
Public Partial Class ResourceTimeExceptionQueryResponse
'''<Summary>
'''Time exception id
'''</Summary>
<ApiMember(Description:="Time exception id")>
Public Overridable Property Id As Integer
'''<Summary>
'''Time company id
'''</Summary>
<ApiMember(Description:="Time company id")>
Public Overridable Property CompanyId As Guid
'''<Summary>
'''If it's locked for editing for the logged in administrator
'''</Summary>
<ApiMember(Description:="If it's locked for editing for the logged in administrator")>
Public Overridable Property Locked As Boolean
'''<Summary>
'''Resources that owns this exception
'''</Summary>
<ApiMember(Description:="Resources that owns this exception")>
Public Overridable Property ResourceIds As Integer() = New Integer(){}
'''<Summary>
'''Resources that owns this exception
'''</Summary>
<ApiMember(Description:="Resources that owns this exception")>
Public Overridable Property Resources As List(Of TimeExceptionReosurceDetails) = New List(Of TimeExceptionReosurceDetails)
'''<Summary>
'''Indicates wheter or not the time exception is recurring
'''</Summary>
<ApiMember(Description:="Indicates wheter or not the time exception is recurring")>
Public Overridable Property IsRecurring As Boolean
'''<Summary>
'''Time exception starting timestamp
'''</Summary>
<ApiMember(Description:="Time exception starting timestamp")>
Public Overridable Property From As Date
'''<Summary>
'''Time exception ending timestamp
'''</Summary>
<ApiMember(Description:="Time exception ending timestamp")>
Public Overridable Property [To] As Date
'''<Summary>
'''If recurring then this value indicates the time of day when the time exception begins
'''</Summary>
<ApiMember(Description:="If recurring then this value indicates the time of day when the time exception begins")>
Public Overridable Property FromTime As TimeSpan
'''<Summary>
'''If recurring then this value indicates the time of day when the time exception ends
'''</Summary>
<ApiMember(Description:="If recurring then this value indicates the time of day when the time exception ends")>
Public Overridable Property ToTime As TimeSpan
'''<Summary>
'''The reason of the time exception, example: Vacation, doctors appointment, ...
'''</Summary>
<ApiMember(Description:="The reason of the time exception, example: Vacation, doctors appointment, ...")>
Public Overridable Property ReasonText As String
'''<Summary>
'''The reason of the time exception that could be public to customers, example: Vacation, Closed, Sick leave, ...
'''</Summary>
<ApiMember(Description:="The reason of the time exception that could be public to customers, example: Vacation, Closed, Sick leave, ...")>
Public Overridable Property ReasonTextPublic As String
'''<Summary>
'''What hexadecimal color code the exception should have in the scheduler
'''</Summary>
<ApiMember(Description:="What hexadecimal color code the exception should have in the scheduler")>
Public Overridable Property Color As String
'''<Summary>
'''If the time exception should block the time in the scheduler so it's not avaialable to book
'''</Summary>
<ApiMember(Description:="If the time exception should block the time in the scheduler so it's not avaialable to book")>
Public Overridable Property BlockTime As Boolean
'''<Summary>
'''If the ReasonText should only be visible to conncted resources. If false, all resources will be able to see it
'''</Summary>
<ApiMember(Description:="If the ReasonText should only be visible to conncted resources. If false, all resources will be able to see it")>
Public Overridable Property [Private] As Boolean
'''<Summary>
'''If recurring, an array indicating which days of the week the exception recurs on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs
'''</Summary>
<ApiMember(Description:="If recurring, an array indicating which days of the week the exception recurs on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs")>
Public Overridable Property DaysOfWeek As List(Of DayOfWeekDto) = New List(Of DayOfWeekDto)
'''<Summary>
'''The datetime the exception was created
'''</Summary>
<ApiMember(Description:="The datetime the exception was created")>
Public Overridable Property Created As Date
'''<Summary>
'''Tags attached to this time exception
'''</Summary>
<ApiMember(Description:="Tags attached to this time exception")>
Public Overridable Property Tags As List(Of TagResponse) = New List(Of TagResponse)
Public Overridable Property ResponseStatus As ResponseStatus
End Class
Public Partial Class TagResponse
Public Overridable Property Id As Integer
Public Overridable Property CompanyId As Guid
Public Overridable Property Name As String
Public Overridable Property Scope As Integer
Public Overridable Property Color As String
Public Overridable Property SortOrder As Integer
Public Overridable Property Active As Boolean
Public Overridable Property CreatedDate As Date
Public Overridable Property ResponseStatus As ResponseStatus
End Class
Public Partial Class TimeExceptionReosurceDetails
'''<Summary>
'''Ids of the resources that owns this exception
'''</Summary>
<ApiMember(Description:="Ids of the resources that owns this exception")>
Public Overridable Property Id As Integer
'''<Summary>
'''Name of the resource
'''</Summary>
<ApiMember(Description:="Name of the resource")>
Public Overridable Property Name As String
'''<Summary>
'''Description of the resource
'''</Summary>
<ApiMember(Description:="Description of the resource")>
Public Overridable Property Description As String
'''<Summary>
'''Color of the resource
'''</Summary>
<ApiMember(Description:="Color of the resource")>
Public Overridable Property Color As String
'''<Summary>
'''Image of the resource
'''</Summary>
<ApiMember(Description:="Image of the resource")>
Public Overridable Property ImageUrl As Uri
Public Overridable Property ResponseStatus As ResponseStatus
End Class
End Namespace
End Namespace
VB.NET AddTagsToTimeException DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /timeexceptions/{TimeExceptionId}/tags HTTP/1.1
Host: api.bookmore.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","TimeExceptionId":0,"TagIds":[0]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Id":0,"Locked":false,"ResourceIds":[0],"Resources":[{"Id":0,"Name":"String","Description":"String","Color":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}],"IsRecurring":false,"FromTime":"00:00:00","ToTime":"00:00:00","ReasonText":"String","ReasonTextPublic":"String","Color":"String","BlockTime":false,"Private":false,"DaysOfWeek":[{"DayOfWeekId":0,"DotNetDayOfWeekId":0,"DayOfWeek":"String"}],"Tags":[{"Id":0,"Name":"String","Scope":0,"Color":"String","SortOrder":0,"Active":false,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}