Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /services/prices/{Id} | Update a price | Update a price on a service |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@ValidateRequest(Validator="IsAuthenticated")
public static class UpdateServicePrice implements ICompany
{
/**
* The company id, if empty will use the company id for the user you are logged in with.
*/
@ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
public UUID CompanyId = null;
/**
* Id of the price
*/
@ApiMember(Description="Id of the price", IsRequired=true, ParameterType="path")
public Integer Id = null;
/**
* The price
*/
@ApiMember(Description="The price")
public Double Price = null;
/**
* The price currency
*/
@ApiMember(Description="The price currency")
public String CurrencyId = null;
/**
* The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day
*/
@ApiMember(Description="The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day")
public Integer CalculationTypeId = null;
/**
* The price VAT in percent
*/
@ApiMember(Description="The price VAT in percent")
public BigDecimal VAT = null;
/**
* The price category if price has a category
*/
@ApiMember(Description="The price category if price has a category")
public String Category = null;
/**
* The valid from date for the price.
*/
@ApiMember(Description="The valid from date for the price.")
public Date From = null;
/**
* The valid to date for the price.
*/
@ApiMember(Description="The valid to date for the price.")
public Date To = null;
/**
* If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
*/
@ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")
public ArrayList<Integer> DaysOfWeek = null;
/**
* If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
*/
@ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")
public TimeSpan FromTime = null;
/**
* If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.
*/
@ApiMember(Description="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.")
public TimeSpan ToTime = null;
public UUID getCompanyId() { return CompanyId; }
public UpdateServicePrice setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Integer getId() { return Id; }
public UpdateServicePrice setId(Integer value) { this.Id = value; return this; }
public Double getPrice() { return Price; }
public UpdateServicePrice setPrice(Double value) { this.Price = value; return this; }
public String getCurrencyId() { return CurrencyId; }
public UpdateServicePrice setCurrencyId(String value) { this.CurrencyId = value; return this; }
public Integer getCalculationTypeId() { return CalculationTypeId; }
public UpdateServicePrice setCalculationTypeId(Integer value) { this.CalculationTypeId = value; return this; }
public BigDecimal getVat() { return VAT; }
public UpdateServicePrice setVat(BigDecimal value) { this.VAT = value; return this; }
public String getCategory() { return Category; }
public UpdateServicePrice setCategory(String value) { this.Category = value; return this; }
public Date getFrom() { return From; }
public UpdateServicePrice setFrom(Date value) { this.From = value; return this; }
public Date getTo() { return To; }
public UpdateServicePrice setTo(Date value) { this.To = value; return this; }
public ArrayList<Integer> getDaysOfWeek() { return DaysOfWeek; }
public UpdateServicePrice setDaysOfWeek(ArrayList<Integer> value) { this.DaysOfWeek = value; return this; }
public TimeSpan getFromTime() { return FromTime; }
public UpdateServicePrice setFromTime(TimeSpan value) { this.FromTime = value; return this; }
public TimeSpan getToTime() { return ToTime; }
public UpdateServicePrice setToTime(TimeSpan value) { this.ToTime = value; return this; }
}
public static class ServicePriceResponse
{
/**
* The company id
*/
@ApiMember(Description="The company id")
public UUID CompanyId = null;
/**
* The price id
*/
@ApiMember(Description="The price id")
public Integer Id = null;
/**
* The service id
*/
@ApiMember(Description="The service id")
public Integer ServiceId = null;
/**
* The price
*/
@ApiMember(Description="The price")
public Double Price = null;
/**
* The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day
*/
@ApiMember(Description="The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day")
public Integer CalculationTypeId = null;
/**
* The price currency
*/
@ApiMember(Description="The price currency")
public String CurrencyId = null;
/**
* The price sign
*/
@ApiMember(Description="The price sign")
public String PriceSign = null;
/**
* The price VAT in percent
*/
@ApiMember(Description="The price VAT in percent")
public BigDecimal VAT = null;
/**
* The price category if price has a category
*/
@ApiMember(Description="The price category if price has a category")
public String Category = null;
/**
* The price text to display
*/
@ApiMember(Description="The price text to display")
public String PriceText = null;
/**
* The valid from date for the price.
*/
@ApiMember(Description="The valid from date for the price.")
public Date From = null;
/**
* The valid to date for the price.
*/
@ApiMember(Description="The valid to date for the price.")
public Date To = null;
/**
* If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
*/
@ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")
public ArrayList<DayOfWeekDto> DaysOfWeek = null;
/**
* If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
*/
@ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")
public TimeSpan FromTime = null;
/**
* If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.
*/
@ApiMember(Description="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.")
public TimeSpan ToTime = null;
public ServiceInfoResponse Service = null;
/**
* If the price is only valid for a specific time span
*/
@ApiMember(Description="If the price is only valid for a specific time span")
public Boolean IsTimeSpecific = null;
/**
* If the price is only valid for specific days of week
*/
@ApiMember(Description="If the price is only valid for specific days of week")
public Boolean IsDaysOfWeekSpecific = null;
public UUID getCompanyId() { return CompanyId; }
public ServicePriceResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Integer getId() { return Id; }
public ServicePriceResponse setId(Integer value) { this.Id = value; return this; }
public Integer getServiceId() { return ServiceId; }
public ServicePriceResponse setServiceId(Integer value) { this.ServiceId = value; return this; }
public Double getPrice() { return Price; }
public ServicePriceResponse setPrice(Double value) { this.Price = value; return this; }
public Integer getCalculationTypeId() { return CalculationTypeId; }
public ServicePriceResponse setCalculationTypeId(Integer value) { this.CalculationTypeId = value; return this; }
public String getCurrencyId() { return CurrencyId; }
public ServicePriceResponse setCurrencyId(String value) { this.CurrencyId = value; return this; }
public String getPriceSign() { return PriceSign; }
public ServicePriceResponse setPriceSign(String value) { this.PriceSign = value; return this; }
public BigDecimal getVat() { return VAT; }
public ServicePriceResponse setVat(BigDecimal value) { this.VAT = value; return this; }
public String getCategory() { return Category; }
public ServicePriceResponse setCategory(String value) { this.Category = value; return this; }
public String getPriceText() { return PriceText; }
public ServicePriceResponse setPriceText(String value) { this.PriceText = value; return this; }
public Date getFrom() { return From; }
public ServicePriceResponse setFrom(Date value) { this.From = value; return this; }
public Date getTo() { return To; }
public ServicePriceResponse setTo(Date value) { this.To = value; return this; }
public ArrayList<DayOfWeekDto> getDaysOfWeek() { return DaysOfWeek; }
public ServicePriceResponse setDaysOfWeek(ArrayList<DayOfWeekDto> value) { this.DaysOfWeek = value; return this; }
public TimeSpan getFromTime() { return FromTime; }
public ServicePriceResponse setFromTime(TimeSpan value) { this.FromTime = value; return this; }
public TimeSpan getToTime() { return ToTime; }
public ServicePriceResponse setToTime(TimeSpan value) { this.ToTime = value; return this; }
public ServiceInfoResponse getService() { return Service; }
public ServicePriceResponse setService(ServiceInfoResponse value) { this.Service = value; return this; }
public Boolean getIsTimeSpecific() { return IsTimeSpecific; }
public ServicePriceResponse setIsTimeSpecific(Boolean value) { this.IsTimeSpecific = value; return this; }
public Boolean getIsDaysOfWeekSpecific() { return IsDaysOfWeekSpecific; }
public ServicePriceResponse setIsDaysOfWeekSpecific(Boolean value) { this.IsDaysOfWeekSpecific = value; return this; }
}
public static class DayOfWeekDto
{
public Integer DayOfWeekId = null;
public Integer DotNetDayOfWeekId = null;
public String DayOfWeek = null;
public Integer getDayOfWeekId() { return DayOfWeekId; }
public DayOfWeekDto setDayOfWeekId(Integer value) { this.DayOfWeekId = value; return this; }
public Integer getDotNetDayOfWeekId() { return DotNetDayOfWeekId; }
public DayOfWeekDto setDotNetDayOfWeekId(Integer value) { this.DotNetDayOfWeekId = value; return this; }
public String getDayOfWeek() { return DayOfWeek; }
public DayOfWeekDto setDayOfWeek(String value) { this.DayOfWeek = value; return this; }
}
public static class ServiceInfoResponse
{
public Integer Id = null;
public String Name = null;
public String Description = null;
public Uri ImageUrl = null;
public Integer LengthInMinutes = null;
public Integer MaxNumberOfSpotsPerBooking = null;
public Integer MinNumberOfSpotsPerBooking = null;
public GroupBookingSettings GroupBooking = null;
public MultipleResourceSettings MultipleResource = null;
public Boolean IsGroupBooking = null;
public Boolean IsPaymentEnabled = null;
public Integer getId() { return Id; }
public ServiceInfoResponse setId(Integer value) { this.Id = value; return this; }
public String getName() { return Name; }
public ServiceInfoResponse setName(String value) { this.Name = value; return this; }
public String getDescription() { return Description; }
public ServiceInfoResponse setDescription(String value) { this.Description = value; return this; }
public Uri getImageUrl() { return ImageUrl; }
public ServiceInfoResponse setImageUrl(Uri value) { this.ImageUrl = value; return this; }
public Integer getLengthInMinutes() { return LengthInMinutes; }
public ServiceInfoResponse setLengthInMinutes(Integer value) { this.LengthInMinutes = value; return this; }
public Integer getMaxNumberOfSpotsPerBooking() { return MaxNumberOfSpotsPerBooking; }
public ServiceInfoResponse setMaxNumberOfSpotsPerBooking(Integer value) { this.MaxNumberOfSpotsPerBooking = value; return this; }
public Integer getMinNumberOfSpotsPerBooking() { return MinNumberOfSpotsPerBooking; }
public ServiceInfoResponse setMinNumberOfSpotsPerBooking(Integer value) { this.MinNumberOfSpotsPerBooking = value; return this; }
public GroupBookingSettings getGroupBooking() { return GroupBooking; }
public ServiceInfoResponse setGroupBooking(GroupBookingSettings value) { this.GroupBooking = value; return this; }
public MultipleResourceSettings getMultipleResource() { return MultipleResource; }
public ServiceInfoResponse setMultipleResource(MultipleResourceSettings value) { this.MultipleResource = value; return this; }
public Boolean getIsGroupBooking() { return IsGroupBooking; }
public ServiceInfoResponse setIsGroupBooking(Boolean value) { this.IsGroupBooking = value; return this; }
public Boolean getIsPaymentEnabled() { return IsPaymentEnabled; }
public ServiceInfoResponse setIsPaymentEnabled(Boolean value) { this.IsPaymentEnabled = value; return this; }
}
public static class GroupBookingSettings
{
public Boolean Active = null;
public Integer Min = null;
public Integer Max = null;
public Boolean isActive() { return Active; }
public GroupBookingSettings setActive(Boolean value) { this.Active = value; return this; }
public Integer getMin() { return Min; }
public GroupBookingSettings setMin(Integer value) { this.Min = value; return this; }
public Integer getMax() { return Max; }
public GroupBookingSettings setMax(Integer value) { this.Max = value; return this; }
}
public static class MultipleResourceSettings
{
public Boolean Active = null;
public Integer Min = null;
public Integer Max = null;
public Boolean isActive() { return Active; }
public MultipleResourceSettings setActive(Boolean value) { this.Active = value; return this; }
public Integer getMin() { return Min; }
public MultipleResourceSettings setMin(Integer value) { this.Min = value; return this; }
public Integer getMax() { return Max; }
public MultipleResourceSettings setMax(Integer value) { this.Max = value; return this; }
}
}
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 /services/prices/{Id} HTTP/1.1
Host: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateServicePrice xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<CalculationTypeId>0</CalculationTypeId>
<Category>String</Category>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<CurrencyId>String</CurrencyId>
<DaysOfWeek xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:int>0</d2p1:int>
</DaysOfWeek>
<From>0001-01-01T00:00:00</From>
<FromTime>PT0S</FromTime>
<Id>0</Id>
<Price>0</Price>
<To>0001-01-01T00:00:00</To>
<ToTime>PT0S</ToTime>
<VAT>0</VAT>
</UpdateServicePrice>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ServicePriceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <CalculationTypeId>0</CalculationTypeId> <Category>String</Category> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <CurrencyId>String</CurrencyId> <DaysOfWeek> <DayOfWeekDto> <DayOfWeek>String</DayOfWeek> <DayOfWeekId>0</DayOfWeekId> <DotNetDayOfWeekId>0</DotNetDayOfWeekId> </DayOfWeekDto> </DaysOfWeek> <From>0001-01-01T00:00:00</From> <FromTime>PT0S</FromTime> <Id>0</Id> <IsDaysOfWeekSpecific>false</IsDaysOfWeekSpecific> <IsTimeSpecific>false</IsTimeSpecific> <Price>0</Price> <PriceSign>String</PriceSign> <PriceText>String</PriceText> <Service> <Description>String</Description> <GroupBooking> <Active>false</Active> <Max>0</Max> <Min>0</Min> </GroupBooking> <Id>0</Id> <ImageUrl i:nil="true" /> <IsGroupBooking>false</IsGroupBooking> <IsPaymentEnabled>false</IsPaymentEnabled> <LengthInMinutes>0</LengthInMinutes> <MaxNumberOfSpotsPerBooking>0</MaxNumberOfSpotsPerBooking> <MinNumberOfSpotsPerBooking>0</MinNumberOfSpotsPerBooking> <MultipleResource> <Active>false</Active> <Max>0</Max> <Min>0</Min> </MultipleResource> <Name>String</Name> </Service> <ServiceId>0</ServiceId> <To>0001-01-01T00:00:00</To> <ToTime>PT0S</ToTime> <VAT>0</VAT> </ServicePriceResponse>