/// <summary> /// Sets the after buffer of the request. /// </summary> /// <param name="minimum"> /// The number of minutes for the minimum buffer. /// </param> /// <param name="maximum"> /// The number of minutes for the maximum buffer. /// </param> /// <returns> /// A reference to the <see cref="SequenceRequestBuilder"/>. /// </returns> /// <exception cref="ArgumentException"> /// Thrown if <paramref name="minimum"/> is not null or is negative. /// </exception> /// <exception cref="ArgumentException"> /// Thrown if <paramref name="maximum"/> is not null or is negative. /// </exception> public SequenceRequestBuilder AfterBuffer(int?minimum, int?maximum = null) { if (minimum.HasValue) { Preconditions.True(minimum.Value >= 0, "minimum buffer must be postive"); } if (maximum.HasValue) { Preconditions.True(maximum.Value >= 0, "maximum buffer must be postive"); } this.afterBuffer = new AvailabilityRequest.BufferDefintion(); if (minimum.HasValue) { this.afterBuffer.Minimum = new AvailabilityRequest.Duration { Minutes = minimum.Value }; } if (maximum.HasValue) { this.afterBuffer.Maximum = new AvailabilityRequest.Duration { Minutes = maximum.Value }; } return(this); }
/// <summary> /// Sets the transparency of the event. /// </summary> /// <param name="transparency"> /// Transparency, must not be empty. /// </param> /// <returns> /// A reference to the modified builder. /// </returns> /// <exception cref="ArgumentException"> /// Thrown if <paramref name="transparency"/> is not /// transparent or opaque. /// </exception> public UpsertEventRequestBuilder Transparency(string transparency) { Preconditions.True(new[] { "transparent", "opaque" }.Contains(transparency), "Transparency must be `transparent` or `opaque`"); this.transparency = transparency; return(this); }
/// <summary> /// Sets the group as requiring a specific number of participants. /// </summary> /// <param name="number"> /// The number of participants from the group that are required, must be greater than zero. /// </param> /// <returns> /// A reference to the <see cref="ParticipantGroupBuilder"/>. /// </returns> /// <exception cref="ArgumentException"> /// Thrown if <paramref name="number"/> is not greater than zero. /// </exception> public ParticipantGroupBuilder Required(int number) { Preconditions.True(number > 0, "number must be greater than zero"); this.required = number; return(this); }
/// <summary> /// Sets the required duration of the request. /// </summary> /// <param name="minutes"> /// The number of minutes for the required duration, must be greater than zero. /// </param> /// <returns> /// A reference to the <see cref="AvailabilityRequestBuilder"/>. /// </returns> /// <exception cref="ArgumentException"> /// Thrown if <paramref name="minutes"/> is not greater than zero. /// </exception> public AvailabilityRequestBuilder RequiredDuration(int minutes) { Preconditions.True(minutes > 0, "minutes must be greater than zero"); this.requiredDuration = minutes; return(this); }
/// <summary> /// Sets the ordinal of the request. /// </summary> /// <param name="ordinal"> /// The ordinal for the request must be greater than zero. /// </param> /// <returns> /// A reference to the <see cref="SequenceRequestBuilder"/>. /// </returns> /// <exception cref="ArgumentException"> /// Thrown if <paramref name="ordinal"/> is not greater than zero. /// </exception> public SequenceRequestBuilder Ordinal(int ordinal) { Preconditions.True(ordinal > 0, "ordinal must be greater than zero"); this.ordinal = ordinal; return(this); }
/// <summary> /// Sets the start interval of the request. /// </summary> /// <param name="minutes"> /// The number of minutes for the start interval, must be greater than zero. /// </param> /// <returns> /// A reference to the <see cref="SequenceRequestBuilder"/>. /// </returns> /// <exception cref="ArgumentException"> /// Thrown if <paramref name="minutes"/> is not greater than zero. /// </exception> public SequenceRequestBuilder StartInterval(int minutes) { Preconditions.True(minutes > 0, "minutes must be greater than zero"); this.startInterval = minutes; return(this); }
/// <summary> /// Sets the after buffer of the request. /// </summary> /// <param name="afterBuffer"> /// The number of minutes for the after buffer. /// </param> /// <returns> /// A reference to the <see cref="AvailabilityRequestBuilder"/>. /// </returns> /// <exception cref="ArgumentException"> /// Thrown if <paramref name="afterBuffer"/> is not null or is negative. /// </exception> public AvailabilityRequestBuilder AfterBuffer(int?afterBuffer) { if (afterBuffer.HasValue) { Preconditions.True(afterBuffer.Value >= 0, "buffer must be postive"); } this.afterBuffer = afterBuffer; return(this); }
/// <summary> /// Sets the before buffer of the request. /// </summary> /// <param name="beforeBuffer"> /// The number of minutes for the before buffer. /// </param> /// <returns> /// A reference to the <see cref="AvailabilityRequestBuilder"/>. /// </returns> /// <exception cref="ArgumentException"> /// Thrown if <paramref name="beforeBuffer"/> is not null or is negative. /// </exception> public AvailabilityRequestBuilder BeforeBuffer(int?beforeBuffer) { if (beforeBuffer.HasValue) { Preconditions.True(beforeBuffer.Value >= 0, "buffer must be postive"); } this.beforeBuffer = beforeBuffer; return(this); }