internal SharedTicket(SharingReason reason, TicketResponse response)
        {
            Id = response.Ticket?.Id
                 ?? throw new ArgumentException("Response does not contain the Ticket ID");

            this.Reason = reason;
            Response    = response;
        }
 internal static bool IsSharedBecause(this TicketResponse response, SharingReason reason) =>
 response.Ticket.Tags.Any(t =>
                          t.EndsWith(reason.AsTag(), StringComparison.CurrentCultureIgnoreCase));
Exemplo n.º 3
0
 private Task MarkShared(Ticket ticket, SharingReason reason)
 => api.ModifyTags(
     ticket,
     removals: new[] { MakeTag(SharingState.Sending, reason) });
Exemplo n.º 4
0
 private static string MakeTag(SharingState state, SharingReason reason) =>
 $"{state}_{reason.AsTag()}".ToLower();
Exemplo n.º 5
0
 internal static string AsTag(this SharingReason reason) =>
 $"middleware_{reason}".ToLower();