Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /voss/subscriptions | PUT voss subscription |
---|
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 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 = null;
/**
* 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 .other suffix or ?format=other
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: testapi.bokamera.se
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"DiscountAgreements":[{}],"DiscountAgreementsChangeType":"Prospective","CompanyOwnerId":0}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {}