BokaMera.API.Host

<back to all web services

DeleteCustomerSuperAdminUser

Requires Authentication
Required role:superadmin
The following routes are available for this service:
DELETE/superadmin/company/{Id}Deletes a customer and everything realted to customer, including administrators and bookings etc.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;
using BokaMera.API.ServiceModel.Db;

namespace BokaMera.API.ServiceModel.Db
{
    public partial class BaseModel
    {
    }

    public partial class Country
        : BaseModel
    {
        [References(typeof(BokaMera.API.ServiceModel.Db.Currency))]
        public virtual string CurrencyId { get; set; }

        public virtual Currency CurrencyInfo { get; set; }
        [Required]
        public virtual string Name { get; set; }

        public virtual string Culture { get; set; }
        public virtual string TimeZone { get; set; }
        public virtual DateTimeOffset? ModifiedDate { get; set; }
        [Required]
        public virtual string Id { get; set; }
    }

    public partial class Currency
        : BaseModel
    {
        [Required]
        public virtual string Name { get; set; }

        [Required]
        public virtual string CurrencySign { get; set; }

        [Required]
        public virtual bool Active { get; set; }

        public virtual DateTimeOffset? ModifiedDate { get; set; }
        [Required]
        public virtual string Id { get; set; }
    }

    public partial class License
        : BaseModel
    {
        public virtual LicenseType Type { get; set; }
        [Required]
        public virtual Guid CompanyId { get; set; }

        public virtual int Id { get; set; }
        [Required]
        public virtual int TypeId { get; set; }

        [Required]
        public virtual DateTime ValidFrom { get; set; }

        [Required]
        public virtual DateTime ValidTo { get; set; }

        [Required]
        public virtual bool Active { get; set; }

        [Required]
        public virtual DateTime Updated { get; set; }

        [Required]
        public virtual DateTime Created { get; set; }

        public virtual DateTimeOffset? ModifiedDate { get; set; }
        public virtual string MetaData { get; set; }
    }

    public partial class LicensePrice
        : BaseModel
    {
        [Ignore]
        public virtual Country Country { get; set; }

        [Ignore]
        public virtual bool MonthlyPayment { get; set; }

        [Required]
        public virtual int LicenseTypeId { get; set; }

        [Required]
        public virtual string CountryId { get; set; }

        [Required]
        public virtual int Price { get; set; }

        public virtual DateTimeOffset? ModifiedDate { get; set; }
    }

    public partial class LicenseType
        : BaseModel
    {
        [Ignore]
        public virtual IList<LicenseTypeItem> LicenseItems { get; set; }

        [Ignore]
        public virtual IList<LicensePrice> Prices { get; set; }

        [Ignore]
        public virtual int PeriodOfNoticeDays { get; set; }

        [Ignore]
        public virtual LicenseType NextLicenseOption { get; set; }

        [Required]
        public virtual string Name { get; set; }

        [Required]
        public virtual string Description { get; set; }

        [Required]
        public virtual bool ExtraLicenseOption { get; set; }

        public virtual DateTimeOffset? ModifiedDate { get; set; }
        public virtual int Id { get; set; }
    }

    public partial class LicenseTypeItem
        : BaseModel
    {
        [Ignore]
        public virtual string Name { get; set; }

        [Required]
        public virtual int LicenseTypesId { get; set; }

        [Required]
        public virtual int LicenseItemsId { get; set; }

        [Required]
        public virtual int NumberOfItems { get; set; }

        public virtual int Id { get; set; }
        public virtual DateTimeOffset? ModifiedDate { get; set; }
    }

}

namespace BokaMera.API.ServiceModel.Dtos
{
    [ApiResponse(Description="", StatusCode=400)]
    [ApiResponse(Description="Returned if the current user is not allowed to perform the action", StatusCode=401)]
    public partial class DeleteCustomerSuperAdminUser
        : ICompany
    {
        ///<summary>
        ///Enter the companyId for the customer
        ///</summary>
        [ApiMember(Description="Enter the companyId for the customer", ParameterType="query")]
        public virtual Guid? CompanyId { get; set; }

        ///<summary>
        ///Id (guid) of company you wish to delete.
        ///</summary>
        [ApiMember(Description="Id (guid) of company you wish to delete.", IsRequired=true)]
        public virtual Guid Id { get; set; }

        public virtual bool GotApprovedByAdmin { get; set; }
    }

    public partial class DeletedCustomerInfoResponse
    {
        public DeletedCustomerInfoResponse()
        {
            ActiveLicenses = new List<License>{};
        }

        public virtual Guid? CompanyId { get; set; }
        public virtual List<License> ActiveLicenses { get; set; }
        public virtual string Comment { get; set; }
    }

}

C# DeleteCustomerSuperAdminUser DTOs

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

HTTP + XML

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

DELETE /superadmin/company/{Id} HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DeletedCustomerInfoResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <ActiveLicenses xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
    <d2p1:License>
      <d2p1:Active>false</d2p1:Active>
      <d2p1:CompanyId>00000000-0000-0000-0000-000000000000</d2p1:CompanyId>
      <d2p1:Created>0001-01-01T00:00:00</d2p1:Created>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:MetaData>String</d2p1:MetaData>
      <d2p1:ModifiedDate xmlns:d4p1="http://schemas.datacontract.org/2004/07/System">
        <d4p1:DateTime>0001-01-01T00:00:00Z</d4p1:DateTime>
        <d4p1:OffsetMinutes>0</d4p1:OffsetMinutes>
      </d2p1:ModifiedDate>
      <d2p1:Type>
        <d2p1:Description>String</d2p1:Description>
        <d2p1:ExtraLicenseOption>false</d2p1:ExtraLicenseOption>
        <d2p1:Id>0</d2p1:Id>
        <d2p1:LicenseItems i:nil="true" />
        <d2p1:ModifiedDate xmlns:d5p1="http://schemas.datacontract.org/2004/07/System">
          <d5p1:DateTime>0001-01-01T00:00:00Z</d5p1:DateTime>
          <d5p1:OffsetMinutes>0</d5p1:OffsetMinutes>
        </d2p1:ModifiedDate>
        <d2p1:Name>String</d2p1:Name>
        <d2p1:Prices i:nil="true" />
      </d2p1:Type>
      <d2p1:TypeId>0</d2p1:TypeId>
      <d2p1:Updated>0001-01-01T00:00:00</d2p1:Updated>
      <d2p1:ValidFrom>0001-01-01T00:00:00</d2p1:ValidFrom>
      <d2p1:ValidTo>0001-01-01T00:00:00</d2p1:ValidTo>
    </d2p1:License>
  </ActiveLicenses>
  <Comment>String</Comment>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
</DeletedCustomerInfoResponse>