BokaMera.API.Host

<back to all web services

ResourceTypeAvailableResourcesQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin, bookingsupplier-administrator-read
The following routes are available for this service:
GET/bookings/{Id}/resources/availableFind available resources.
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AvailableResourceResponse:
    # @ApiMember(Description="The resource id")
    id: int = 0
    """
    The resource id
    """


    # @ApiMember(Description="The resource name")
    name: Optional[str] = None
    """
    The resource name
    """


    # @ApiMember(Description="The resource description")
    description: Optional[str] = None
    """
    The resource description
    """


    # @ApiMember(Description="The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue.")
    color: Optional[str] = None
    """
    The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue.
    """


    # @ApiMember(Description="The image url of the resource")
    image_url: Optional[str] = None
    """
    The image url of the resource
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceTypeAvailableResourcesQueryResponse:
    # @ApiMember(Description="The resourcetype id")
    id: int = 0
    """
    The resourcetype id
    """


    # @ApiMember(Description="The available resources")
    resources: Optional[List[AvailableResourceResponse]] = None
    """
    The available resources
    """


# @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
# @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403)
# @ValidateRequest(Validator="IsAuthenticated")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceTypeAvailableResourcesQuery(ICompany):
    # @ApiMember(Description="Enter the company and id you want to see the information for a resourcetype, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown ", ParameterType="query")
    company_id: Optional[str] = None
    """
    Enter the company and id you want to see the information for a resourcetype, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown 
    """


    # @ApiMember(Description="Enter the id for the booking.", IsRequired=true, ParameterType="path")
    id: int = 0
    """
    Enter the id for the booking.
    """


    # @ApiMember(Description="Enter the id for a resourcetype.", IsRequired=true)
    resource_type_id: int = 0
    """
    Enter the id for a resourcetype.
    """

Python ResourceTypeAvailableResourcesQuery DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /bookings/{Id}/resources/available HTTP/1.1 
Host: api.bokamera.se 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Id":0,"Resources":[{"Id":0,"Name":"String","Description":"String","Color":"String"}]}