mirror of
https://github.com/bitwarden/server.git
synced 2025-06-17 00:03:17 -05:00

* [PM-17562] Add strict delay support for RabbitMQ * fix lint error * Added more robust FailureReason handling and some additional tests * Fix two issues noted by SonarQube * Fix typo; Add alternate handling if MessageId is null or empty * Set MessageId on all message publishers
59 lines
1.3 KiB
C#
59 lines
1.3 KiB
C#
#nullable enable
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Bit.Core.Models.Slack;
|
|
|
|
public abstract class SlackApiResponse
|
|
{
|
|
public bool Ok { get; set; }
|
|
[JsonPropertyName("response_metadata")]
|
|
public SlackResponseMetadata ResponseMetadata { get; set; } = new();
|
|
public string Error { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class SlackResponseMetadata
|
|
{
|
|
[JsonPropertyName("next_cursor")]
|
|
public string NextCursor { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class SlackChannelListResponse : SlackApiResponse
|
|
{
|
|
public List<SlackChannel> Channels { get; set; } = new();
|
|
}
|
|
|
|
public class SlackUserResponse : SlackApiResponse
|
|
{
|
|
public SlackUser User { get; set; } = new();
|
|
}
|
|
|
|
public class SlackOAuthResponse : SlackApiResponse
|
|
{
|
|
[JsonPropertyName("access_token")]
|
|
public string AccessToken { get; set; } = string.Empty;
|
|
public SlackTeam Team { get; set; } = new();
|
|
}
|
|
|
|
public class SlackTeam
|
|
{
|
|
public string Id { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class SlackChannel
|
|
{
|
|
public string Id { get; set; } = string.Empty;
|
|
public string Name { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class SlackUser
|
|
{
|
|
public string Id { get; set; } = string.Empty;
|
|
public string Name { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class SlackDmResponse : SlackApiResponse
|
|
{
|
|
public SlackChannel Channel { get; set; } = new();
|
|
}
|