-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
WaitTimeExceptionTrigger.cs
49 lines (42 loc) · 1.57 KB
/
WaitTimeExceptionTrigger.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
using System;
using System.Text.Json;
using Azure.Core;
#nullable disable
namespace Azure.Communication.JobRouter
{
/// <summary> Trigger for an exception action on exceeding wait time. </summary>
public partial class WaitTimeExceptionTrigger : IUtf8JsonSerializable
{
/// <summary> Initializes a new instance of WaitTimeExceptionTrigger. </summary>
/// <param name="threshold"> Threshold for wait time for this trigger. </param>
public WaitTimeExceptionTrigger(TimeSpan threshold) : this(ExceptionTriggerKind.WaitTime, threshold.TotalSeconds)
{
}
/// <summary> Threshold for wait time for this trigger. </summary>
public TimeSpan Threshold { get; internal set; }
/// <summary> Threshold for wait time for this trigger. </summary>
[CodeGenMember("ThresholdSeconds")]
internal double _thresholdSeconds {
get
{
return Threshold.TotalSeconds;
}
set
{
Threshold = TimeSpan.FromSeconds(value);
}
}
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
writer.WritePropertyName("thresholdSeconds"u8);
writer.WriteNumberValue(_thresholdSeconds);
writer.WritePropertyName("kind"u8);
writer.WriteStringValue(Kind.ToString());
writer.WriteEndObject();
}
}
}