BokaMera.API.Host

<back to all web services

UpdateVossDiscountAgreements

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/voss/discountAgreementsPUT Discount agreements
namespace BokaMera.API.ServiceModel.Dtos

open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    type PeriodKindEnum =
        | FixedTime = 0
        | AlignedToBindingPeriod = 1
        | AlignedToSubscriptionBillingPeriod = 2

    type UnitEnum =
        | Day = 0
        | Month = 1
        | Year = 2

    [<DataContract(Name="DiscountAgreementTimeLengthRequestDto")>]
    [<AllowNullLiteral>]
    type DiscountAgreementTimeLengthRequestDto() = 
        [<DataMember(Name="unit", IsRequired=true)>]
        member val Unit:UnitEnum = new UnitEnum() with get,set

        [<DataMember(Name="value", IsRequired=true)>]
        member val Value:Int32 = new Int32() with get,set

    [<DataContract(Name="UpdateDiscountPeriodRequestDto")>]
    [<AllowNullLiteral>]
    type UpdateDiscountPeriodRequestDto() = 
        [<DataMember(Name="periodKind", IsRequired=true)>]
        member val PeriodKind:PeriodKindEnum = new PeriodKindEnum() with get,set

        [<DataMember(Name="length")>]
        member val Length:DiscountAgreementTimeLengthRequestDto = null with get,set

        [<DataMember(Name="periodIterationCount")>]
        member val PeriodIterationCount:Nullable<Int32> = new Nullable<Int32>() with get,set

    type DiscountAgreementStatusEnum =
        | Draft = 0
        | Staged = 1
        | Published = 2
        | Archived = 3
        | Discarded = 4

    [<ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)>]
    [<AllowNullLiteral>]
    type UpdateVossDiscountAgreements() = 
        ///<summary>
        ///Discount agreement data
        ///</summary>
        [<ApiMember(Description="Discount agreement data", IsRequired=true)>]
        member val DiscountAgreementId:Guid = new Guid() with get,set

        ///<summary>
        ///Discount agreement period data. Iteration count must be added
        ///</summary>
        [<ApiMember(Description="Discount agreement period data. Iteration count must be added", IsRequired=true)>]
        member val DiscountPeriod:UpdateDiscountPeriodRequestDto = null with get,set

        ///<summary>
        ///Discount agreement status. Published is default.
        ///</summary>
        [<ApiMember(Description="Discount agreement status. Published is default.", IsRequired=true)>]
        member val DiscountAgreementStatus:DiscountAgreementStatusEnum = new DiscountAgreementStatusEnum() with get,set

        member val Name:String = null with get,set
        member val Description:String = null with get,set
        member val ValidFrom:DateTime = new DateTime() with get,set
        member val ValidTo:Nullable<DateTime> = new Nullable<DateTime>() with get,set

F# UpdateVossDiscountAgreements 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.

PUT /voss/discountAgreements HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<UpdateVossDiscountAgreements xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Description>String</Description>
  <DiscountAgreementId>00000000-0000-0000-0000-000000000000</DiscountAgreementId>
  <DiscountAgreementStatus>Draft</DiscountAgreementStatus>
  <DiscountPeriod xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.VossIntegration.ApiTools.Model" i:nil="true" />
  <Name>String</Name>
  <ValidFrom>0001-01-01T00:00:00</ValidFrom>
  <ValidTo>0001-01-01T00:00:00</ValidTo>
</UpdateVossDiscountAgreements>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<z:anyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />