BokaMera.API.Host

<back to all web services

EndAllLicenses

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/licenses/company/deleteEnd all licensesEnd all licenses on the company for the logged in user.
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Imports BokaMera.API.ServiceModel.Db

Namespace Global

    Namespace BokaMera.API.ServiceModel.Db

        Public Partial Class BaseModel
        End Class

        Public Partial Class Country
            Inherits BaseModel
            <References(GetType(Currency))>
            Public Overridable Property CurrencyId As String

            Public Overridable Property CurrencyInfo As Currency
            <Required>
            Public Overridable Property Name As String

            Public Overridable Property Culture As String
            Public Overridable Property TimeZone As String
            Public Overridable Property ModifiedDate As Nullable(Of DateTimeOffset)
            <Required>
            Public Overridable Property Id As String
        End Class

        Public Partial Class Currency
            Inherits BaseModel
            <Required>
            Public Overridable Property Name As String

            <Required>
            Public Overridable Property CurrencySign As String

            <Required>
            Public Overridable Property Active As Boolean

            Public Overridable Property ModifiedDate As Nullable(Of DateTimeOffset)
            <Required>
            Public Overridable Property Id As String
        End Class

        Public Partial Class LicensePrice
            Inherits BaseModel
            <Ignore>
            Public Overridable Property Country As Country

            <Ignore>
            Public Overridable Property MonthlyPayment As Boolean

            <Required>
            Public Overridable Property LicenseTypeId As Integer

            <Required>
            Public Overridable Property CountryId As String

            <Required>
            Public Overridable Property Price As Integer

            Public Overridable Property ModifiedDate As Nullable(Of DateTimeOffset)
        End Class
    End Namespace

    Namespace BokaMera.API.ServiceModel.Dtos

        Public Partial Class CompanyLicenseQueryResponse
            Public Overridable Property Id As Integer
            Public Overridable Property TypeId As Integer
            Public Overridable Property Type As LicenseTypeQueryResponse
            Public Overridable Property ValidFrom As Date
            Public Overridable Property ValidTo As Date
            Public Overridable Property MetaData As String
            Public Overridable Property Active As Boolean
            Public Overridable Property Canceled As Boolean
            Public Overridable Property Updated As Date
            Public Overridable Property Created As Date
        End Class

        <ApiResponse(Description:="You were unauthorized to call this service", StatusCode:=401)>
        <ValidateRequest(Validator:="IsAuthenticated")>
        Public Partial Class EndAllLicenses
            Implements ICompany
            Public Sub New()
                Questionnaire = New Questionnaire(){}
            End Sub

            '''<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 Nullable(Of Guid)

            '''<Summary>
            '''If you want to deactivate the account the booking system also (will not be working during your period of notice).
            '''</Summary>
            <ApiMember(Description:="If you want to deactivate the account the booking system also (will not be working during your period of notice).")>
            Public Overridable Property Deactivate As Boolean

            '''<Summary>
            '''Questionaire with answers from customer why ending license.
            '''</Summary>
            <ApiMember(Description:="Questionaire with answers from customer why ending license.")>
            Public Overridable Property Questionnaire As Questionnaire()
        End Class

        Public Partial Class LicenseItemsResponse
            Public Overridable Property Id As Integer
            Public Overridable Property Name As String
            Public Overridable Property AllowedItems As Integer
        End Class

        Public Partial Class LicenseTypeQueryResponse
            Public Sub New()
                Items = New List(Of LicenseItemsResponse)
                Prices = New List(Of LicensePrice)
            End Sub

            '''<Summary>
            '''The license type id
            '''</Summary>
            <ApiMember(Description:="The license type id")>
            Public Overridable Property Id As Integer

            '''<Summary>
            '''The license type name
            '''</Summary>
            <ApiMember(Description:="The license type name")>
            Public Overridable Property Name As String

            '''<Summary>
            '''The license type description
            '''</Summary>
            <ApiMember(Description:="The license type description")>
            Public Overridable Property Description As String

            '''<Summary>
            '''If the license type is not a standard license but instead an extra license option. An example would be sending new letter license.
            '''</Summary>
            <ApiMember(Description:="If the license type is not a standard license but instead an extra license option. An example would be sending new letter license.")>
            Public Overridable Property IsExtraLicenseOption As Boolean

            '''<Summary>
            '''The period of notice for the license in days.
            '''</Summary>
            <ApiMember(Description:="The period of notice for the license in days.")>
            Public Overridable Property PeriodOfNoticeDays As Integer

            '''<Summary>
            '''The license items for the license type
            '''</Summary>
            <ApiMember(Description:="The license items for the license type")>
            Public Overridable Property Items As List(Of LicenseItemsResponse)

            '''<Summary>
            '''The license prices in each country for the license type
            '''</Summary>
            <ApiMember(Description:="The license prices in each country for the license type")>
            Public Overridable Property Prices As List(Of LicensePrice)
        End Class

        Public Partial Class Questionnaire
            Public Overridable Property Question As String
            Public Overridable Property Value As String
        End Class
    End Namespace
End Namespace

VB.NET EndAllLicenses DTOs

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

HTTP + OTHER

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

POST /licenses/company/delete HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Deactivate":false,"Questionnaire":[{"Question":"String","Value":"String"}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Id":0,"TypeId":0,"Type":{"Id":0,"Name":"String","Description":"String","IsExtraLicenseOption":false,"PeriodOfNoticeDays":0,"Items":[{"Id":0,"Name":"String","AllowedItems":0}],"Prices":[{"Country":{"CurrencyId":"String","CurrencyInfo":{"Name":"String","CurrencySign":"String","Active":false,"ModifiedDate":"0001-01-01T00:00:00.0000000+00:00","Id":"String"},"Name":"String","Culture":"String","TimeZone":"String","ModifiedDate":"0001-01-01T00:00:00.0000000+00:00","Id":"String"},"MonthlyPayment":true,"LicenseTypeId":0,"CountryId":"String","Price":0,"ModifiedDate":"0001-01-01T00:00:00.0000000+00:00"}]},"MetaData":"String","Active":false,"Canceled":false}