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
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;

public class dtos
{

    @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
    public static class UpdateVossDiscountAgreements
    {
        /**
        * Discount agreement data
        */
        @ApiMember(Description="Discount agreement data", IsRequired=true)
        public UUID DiscountAgreementId = null;

        /**
        * Discount agreement period data. Iteration count must be added
        */
        @ApiMember(Description="Discount agreement period data. Iteration count must be added", IsRequired=true)
        public UpdateDiscountPeriodRequestDto DiscountPeriod = null;

        /**
        * Discount agreement status. Published is default.
        */
        @ApiMember(Description="Discount agreement status. Published is default.", IsRequired=true)
        public DiscountAgreementStatusEnum DiscountAgreementStatus = null;

        public String Name = null;
        public String Description = null;
        public Date ValidFrom = null;
        public Date ValidTo = null;
        
        public UUID getDiscountAgreementId() { return DiscountAgreementId; }
        public UpdateVossDiscountAgreements setDiscountAgreementId(UUID value) { this.DiscountAgreementId = value; return this; }
        public UpdateDiscountPeriodRequestDto getDiscountPeriod() { return DiscountPeriod; }
        public UpdateVossDiscountAgreements setDiscountPeriod(UpdateDiscountPeriodRequestDto value) { this.DiscountPeriod = value; return this; }
        public DiscountAgreementStatusEnum getDiscountAgreementStatus() { return DiscountAgreementStatus; }
        public UpdateVossDiscountAgreements setDiscountAgreementStatus(DiscountAgreementStatusEnum value) { this.DiscountAgreementStatus = value; return this; }
        public String getName() { return Name; }
        public UpdateVossDiscountAgreements setName(String value) { this.Name = value; return this; }
        public String getDescription() { return Description; }
        public UpdateVossDiscountAgreements setDescription(String value) { this.Description = value; return this; }
        public Date getValidFrom() { return ValidFrom; }
        public UpdateVossDiscountAgreements setValidFrom(Date value) { this.ValidFrom = value; return this; }
        public Date getValidTo() { return ValidTo; }
        public UpdateVossDiscountAgreements setValidTo(Date value) { this.ValidTo = value; return this; }
    }

    @DataContract(Name="UpdateDiscountPeriodRequestDto")
    public static class UpdateDiscountPeriodRequestDto
    {
        @DataMember(Name="periodKind", IsRequired=true)
        @SerializedName("periodKind")
        public PeriodKindEnum PeriodKind = null;

        @DataMember(Name="length")
        @SerializedName("length")
        public DiscountAgreementTimeLengthRequestDto Length = null;

        @DataMember(Name="periodIterationCount")
        @SerializedName("periodIterationCount")
        public Integer PeriodIterationCount = null;
        
        public PeriodKindEnum getPeriodKind() { return PeriodKind; }
        public UpdateDiscountPeriodRequestDto setPeriodKind(PeriodKindEnum value) { this.PeriodKind = value; return this; }
        public DiscountAgreementTimeLengthRequestDto getLength() { return Length; }
        public UpdateDiscountPeriodRequestDto setLength(DiscountAgreementTimeLengthRequestDto value) { this.Length = value; return this; }
        public Integer getPeriodIterationCount() { return PeriodIterationCount; }
        public UpdateDiscountPeriodRequestDto setPeriodIterationCount(Integer value) { this.PeriodIterationCount = value; return this; }
    }

    public static enum PeriodKindEnum
    {
        FixedTime,
        AlignedToBindingPeriod,
        AlignedToSubscriptionBillingPeriod;
    }

    @DataContract(Name="DiscountAgreementTimeLengthRequestDto")
    public static class DiscountAgreementTimeLengthRequestDto
    {
        @DataMember(Name="unit", IsRequired=true)
        @SerializedName("unit")
        public UnitEnum Unit = null;

        @DataMember(Name="value", IsRequired=true)
        @SerializedName("value")
        public Integer Value = null;
        
        public UnitEnum getUnit() { return Unit; }
        public DiscountAgreementTimeLengthRequestDto setUnit(UnitEnum value) { this.Unit = value; return this; }
        public Integer getValue() { return Value; }
        public DiscountAgreementTimeLengthRequestDto setValue(Integer value) { this.Value = value; return this; }
    }

    public static enum UnitEnum
    {
        Day,
        Month,
        Year;
    }

    public static enum DiscountAgreementStatusEnum
    {
        Draft,
        Staged,
        Published,
        Archived,
        Discarded;
    }

}

Java UpdateVossDiscountAgreements 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.

PUT /voss/discountAgreements HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"DiscountAgreementStatus":"Draft","Name":"String","Description":"String","ValidTo":"0001-01-01T00:00:00"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{}