| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| PUT | /voss/subscriptions | PUT voss subscription |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
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 UpdateVossSubscriptions
{
/**
* The company id. Subscription will be fetched of this company
*/
@ApiMember(Description="The company id. Subscription will be fetched of this company")
public UUID CompanyId = null;
/**
* Discount agreement data
*/
@ApiMember(Description="Discount agreement data")
public ArrayList<SubscriptionDiscountAgreementRequestDto> DiscountAgreements = new ArrayList<SubscriptionDiscountAgreementRequestDto>();
/**
* Discount agreements change type controls how already occured transactions are treated <br />Retrospective - all future and past not invoiced transactions will be recalculated with new discount agreements <br />Prospective - discounts will apply only for future transactions
*/
@ApiMember(Description=" Discount agreements change type controls how already occured transactions are treated <br />Retrospective - all future and past not invoiced transactions will be recalculated with new discount agreements <br />Prospective - discounts will apply only for future transactions\n")
public DiscountAgreementsChangeTypeEnum DiscountAgreementsChangeType = null;
/**
* The company id. Subscription will be fetched of this company
*/
@ApiMember(Description="The company id. Subscription will be fetched of this company")
public Integer CompanyOwnerId = null;
public UUID getCompanyId() { return CompanyId; }
public UpdateVossSubscriptions setCompanyId(UUID value) { this.CompanyId = value; return this; }
public ArrayList<SubscriptionDiscountAgreementRequestDto> getDiscountAgreements() { return DiscountAgreements; }
public UpdateVossSubscriptions setDiscountAgreements(ArrayList<SubscriptionDiscountAgreementRequestDto> value) { this.DiscountAgreements = value; return this; }
public DiscountAgreementsChangeTypeEnum getDiscountAgreementsChangeType() { return DiscountAgreementsChangeType; }
public UpdateVossSubscriptions setDiscountAgreementsChangeType(DiscountAgreementsChangeTypeEnum value) { this.DiscountAgreementsChangeType = value; return this; }
public Integer getCompanyOwnerId() { return CompanyOwnerId; }
public UpdateVossSubscriptions setCompanyOwnerId(Integer value) { this.CompanyOwnerId = value; return this; }
}
@DataContract(Name="SubscriptionDiscountAgreementRequestDto")
public static class SubscriptionDiscountAgreementRequestDto
{
@DataMember(Name="discountAgreementId", IsRequired=true)
@SerializedName("discountAgreementId")
public UUID DiscountAgreementId = null;
@DataMember(Name="period")
@SerializedName("period")
public SubscriptionDiscountPeriodRequestDto Period = null;
public UUID getDiscountAgreementId() { return DiscountAgreementId; }
public SubscriptionDiscountAgreementRequestDto setDiscountAgreementId(UUID value) { this.DiscountAgreementId = value; return this; }
public SubscriptionDiscountPeriodRequestDto getPeriod() { return Period; }
public SubscriptionDiscountAgreementRequestDto setPeriod(SubscriptionDiscountPeriodRequestDto value) { this.Period = value; return this; }
}
@DataContract(Name="SubscriptionDiscountPeriodRequestDto")
public static class SubscriptionDiscountPeriodRequestDto
{
@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 SubscriptionDiscountPeriodRequestDto setPeriodKind(PeriodKindEnum value) { this.PeriodKind = value; return this; }
public DiscountAgreementTimeLengthRequestDto getLength() { return Length; }
public SubscriptionDiscountPeriodRequestDto setLength(DiscountAgreementTimeLengthRequestDto value) { this.Length = value; return this; }
public Integer getPeriodIterationCount() { return PeriodIterationCount; }
public SubscriptionDiscountPeriodRequestDto 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 DiscountAgreementsChangeTypeEnum
{
Prospective,
Retrospective;
}
}
Java UpdateVossSubscriptions DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /voss/subscriptions HTTP/1.1
Host: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateVossSubscriptions xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<CompanyOwnerId>0</CompanyOwnerId>
<DiscountAgreements xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.VossIntegration.ApiTools.Model">
<d2p1:SubscriptionDiscountAgreementRequestDto i:nil="true" />
</DiscountAgreements>
<DiscountAgreementsChangeType>Prospective</DiscountAgreementsChangeType>
</UpdateVossSubscriptions>
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/" />