diff --git a/core/src/Microsoft.Bot.Core/Activities/Activity.cs b/core/src/Microsoft.Bot.Core/Activities/Activity.cs new file mode 100644 index 00000000..4c5931ed --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/Activity.cs @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Base class for bot activities. +/// +#pragma warning disable CA1056 // URI properties should not be strings +public class Activity +#pragma warning restore CA1056 // URI properties should not be strings +{ + /// + /// Gets or sets the unique identifier for the activity. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Gets or sets the type of the activity. + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Gets or sets the ID of the activity to which this activity is a reply. + /// + [JsonPropertyName("replyToId")] + public string? ReplyToId { get; set; } + + /// + /// Gets or sets the channel identifier. + /// + [JsonPropertyName("channelId")] + public string? ChannelId { get; set; } + + /// + /// Gets or sets the account that sent this activity. + /// + [JsonPropertyName("from")] + public Account? From { get; set; } + + /// + /// Gets or sets the account that should receive this activity. + /// + [JsonPropertyName("recipient")] + public Account? Recipient { get; set; } + + /// + /// Gets or sets the conversation in which this activity is taking place. + /// + [JsonPropertyName("conversation")] + public Conversation? Conversation { get; set; } + + /// + /// Gets or sets a reference to another conversation or activity. + /// + [JsonPropertyName("relatesTo")] + public ConversationReference? RelatesTo { get; set; } + + /// + /// Gets or sets the URL of the service endpoint. + /// + [JsonPropertyName("serviceUrl")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:URI properties should not be strings", Justification = "Activity schema uses string for ServiceUrl")] + public string? ServiceUrl { get; set; } + + /// + /// Gets or sets the locale of the activity. + /// + [JsonPropertyName("locale")] + public string? Locale { get; set; } + + /// + /// Gets or sets the timestamp of when the activity was sent. + /// + [JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// Gets or sets the local timestamp of when the activity was sent. + /// + [JsonPropertyName("localTimestamp")] + public DateTime? LocalTimestamp { get; set; } + + /// + /// Gets the collection of entities included in the activity. + /// + [JsonPropertyName("entities")] + public IList? Entities { get; init; } + + /// + /// Gets or sets channel-specific data associated with this activity. + /// + [JsonPropertyName("channelData")] + public ChannelData? ChannelData { get; set; } + + /// + /// Gets or sets extension data for additional properties. + /// + [JsonExtensionData] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "JsonExtensionData requires a setter")] + public IDictionary? Properties { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public Activity() + { + } + + /// + /// Initializes a new instance of the class with the specified type. + /// + /// The activity type. + public Activity(string type) + { + Type = type; + } +} + +/// +/// Represents an account. +/// +#pragma warning disable CA1724 // Type names should not match namespaces +public class Account +#pragma warning restore CA1724 // Type names should not match namespaces +{ + /// + /// Gets or sets the unique identifier for the account. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Gets or sets the Azure Active Directory object ID. + /// + [JsonPropertyName("aadObjectId")] + public string? AadObjectId { get; set; } + + /// + /// Gets or sets the role of the account. See for common values. + /// + [JsonPropertyName("role")] + public string? Role { get; set; } + + /// + /// Gets or sets the name of the account. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Gets or sets additional properties. + /// + [JsonPropertyName("properties")] +#pragma warning disable CA2227 // Collection properties should be read only + public Dictionary? Properties { get; set; } +#pragma warning restore CA2227 // Collection properties should be read only +} + +/// +/// String constants for account roles. +/// +public static class Roles +{ + /// + /// Indicates the account is a bot. + /// + public const string Bot = "bot"; + + /// + /// Indicates the account is a user. + /// + public const string User = "user"; +} + +/// +/// Represents a conversation. +/// +public class Conversation +{ + /// + /// Gets or sets the unique identifier for the conversation. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Gets or sets the name of the conversation. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Gets or sets additional properties. + /// + [JsonPropertyName("properties")] +#pragma warning disable CA2227 // Collection properties should be read only + public Dictionary? Properties { get; set; } +#pragma warning restore CA2227 // Collection properties should be read only +} + +/// +/// Represents a reference to another conversation or activity. +/// +#pragma warning disable CA1056 // URI properties should not be strings +public class ConversationReference +#pragma warning restore CA1056 // URI properties should not be strings +{ + /// + /// Gets or sets the activity ID. + /// + [JsonPropertyName("activityId")] + public string? ActivityId { get; set; } + + /// + /// Gets or sets the user account. + /// + [JsonPropertyName("user")] + public Account? User { get; set; } + + /// + /// Gets or sets the bot account. + /// + [JsonPropertyName("bot")] + public Account? Bot { get; set; } + + /// + /// Gets or sets the conversation. + /// + [JsonPropertyName("conversation")] + public Conversation? Conversation { get; set; } + + /// + /// Gets or sets the channel ID. + /// + [JsonPropertyName("channelId")] + public string? ChannelId { get; set; } + + /// + /// Gets or sets the service URL. + /// + [JsonPropertyName("serviceUrl")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:URI properties should not be strings", Justification = "Activity schema uses string for ServiceUrl")] + public string? ServiceUrl { get; set; } +} + +/// +/// Represents channel-specific data. +/// +public class ChannelData +{ + /// + /// Gets or sets extension data for additional properties. + /// + [JsonExtensionData] +#pragma warning disable CA2227 // Collection properties should be read only + public IDictionary? Properties { get; set; } +#pragma warning restore CA2227 // Collection properties should be read only +} + +/// +/// Represents an entity. +/// +public class Entity +{ + /// + /// Gets or sets the type of the entity. + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Gets or sets extension data for additional properties. + /// + [JsonExtensionData] +#pragma warning disable CA2227 // Collection properties should be read only + public IDictionary? Properties { get; set; } +#pragma warning restore CA2227 // Collection properties should be read only +} + +/// +/// Represents an error. +/// +#pragma warning disable CA1716 // Identifiers should not match keywords +public class Error +#pragma warning restore CA1716 // Identifiers should not match keywords +{ + /// + /// Gets or sets the error code. + /// + [JsonPropertyName("code")] + public string? Code { get; set; } + + /// + /// Gets or sets the error message. + /// + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// Gets or sets inner HTTP error details. + /// + [JsonPropertyName("innerHttpError")] + public InnerHttpError? InnerHttpError { get; set; } +} + +/// +/// Represents inner HTTP error details. +/// +public class InnerHttpError +{ + /// + /// Gets or sets the HTTP status code. + /// + [JsonPropertyName("statusCode")] + public int? StatusCode { get; set; } + + /// + /// Gets or sets the response body. + /// + [JsonPropertyName("body")] + public object? Body { get; set; } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/ActivityTypes.cs b/core/src/Microsoft.Bot.Core/Activities/ActivityTypes.cs new file mode 100644 index 00000000..5a941a60 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/ActivityTypes.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// String constants for activity types. +/// +public static class ActivityTypes +{ + /// + /// Message activity type. + /// + public const string Message = "message"; + + /// + /// Typing activity type. + /// + public const string Typing = "typing"; + + /// + /// Event activity type. + /// + public const string Event = "event"; + + /// + /// Command activity type. + /// + public const string Command = "command"; + + /// + /// Command result activity type. + /// + public const string CommandResult = "commandResult"; + + /// + /// Installation update activity type. + /// + public const string InstallationUpdate = "installationUpdate"; + + /// + /// Conversation update activity type. + /// + public const string ConversationUpdate = "conversationUpdate"; + + /// + /// End of conversation activity type. + /// + public const string EndOfConversation = "endOfConversation"; + + /// + /// Invoke activity type. + /// + public const string Invoke = "invoke"; + + /// + /// Message delete activity type. + /// + public const string MessageDelete = "messageDelete"; + + /// + /// Message update activity type. + /// + public const string MessageUpdate = "messageUpdate"; + + /// + /// Message reaction activity type. + /// + public const string MessageReaction = "messageReaction"; +} diff --git a/core/src/Microsoft.Bot.Core/Activities/AdaptiveCardActivity.cs b/core/src/Microsoft.Bot.Core/Activities/AdaptiveCardActivity.cs new file mode 100644 index 00000000..d8954d40 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/AdaptiveCardActivity.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents an adaptive card invoke activity. +/// +public class AdaptiveCardActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public AdaptiveCardActivity() + { + } + + /// + /// Initializes a new instance of the class with the specified name. + /// + /// The invoke operation name. + public AdaptiveCardActivity(string name) + { + Name = name; + } +} + +/// +/// Represents an adaptive card action invoke activity. +/// +public class AdaptiveCardActionActivity : AdaptiveCardActivity +{ + /// + /// Initializes a new instance of the class. + /// + public AdaptiveCardActionActivity() : base("adaptiveCard/action") + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/CommandActivity.cs b/core/src/Microsoft.Bot.Core/Activities/CommandActivity.cs new file mode 100644 index 00000000..fd290ca2 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/CommandActivity.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a command activity. +/// +public class CommandActivity : Activity +{ + /// + /// Gets or sets the name of the command. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Gets or sets the value for this command. + /// + [JsonPropertyName("value")] + public CommandValue? Value { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public CommandActivity() : base(ActivityTypes.Command) + { + } +} + +/// +/// The value field of a command activity contains metadata related to a command. +/// An optional extensible data payload may be included if defined by the command activity name. +/// +public class CommandValue +{ + /// + /// Gets or sets the channel ID for the command. + /// + [JsonPropertyName("channelId")] + public string? ChannelId { get; set; } + + /// + /// Gets or sets the data field containing optional parameters specific to this command activity, + /// as defined by the name. The value of the data field is a complex type. + /// + [JsonPropertyName("data")] + public object? Data { get; set; } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/CommandResultActivity.cs b/core/src/Microsoft.Bot.Core/Activities/CommandResultActivity.cs new file mode 100644 index 00000000..29a1e16c --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/CommandResultActivity.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Asynchronous external command result activity. +/// +public class CommandResultActivity : Activity +{ + /// + /// Gets or sets the name of the command. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Gets or sets the value for this command result. + /// + [JsonPropertyName("value")] + public CommandResultValue? Value { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public CommandResultActivity() : base(ActivityTypes.CommandResult) + { + } +} + +/// +/// The value field of a contains metadata related to a command result. +/// An optional extensible data payload may be included if defined by the command result activity name. +/// The presence of an error field indicates that the original command failed to complete. +/// +public class CommandResultValue +{ + /// + /// Gets or sets the ID of the command. + /// + [JsonPropertyName("commandId")] + public string? CommandId { get; set; } + + /// + /// Gets or sets the data field containing optional parameters specific to this command result activity, + /// as defined by the name. The value of the data field is a complex type. + /// + [JsonPropertyName("data")] + public object? Data { get; set; } + + /// + /// Gets or sets the optional error, if the command result indicates a failure. + /// + [JsonPropertyName("error")] + public Error? Error { get; set; } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/ConfigActivity.cs b/core/src/Microsoft.Bot.Core/Activities/ConfigActivity.cs new file mode 100644 index 00000000..c5d3ee52 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/ConfigActivity.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a config fetch invoke activity. +/// +public class ConfigFetchActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public ConfigFetchActivity() : base("config/fetch") + { + } +} + +/// +/// Represents a config submit invoke activity. +/// +public class ConfigSubmitActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public ConfigSubmitActivity() : base("config/submit") + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/ConversationUpdateActivity.cs b/core/src/Microsoft.Bot.Core/Activities/ConversationUpdateActivity.cs new file mode 100644 index 00000000..eee2e3e7 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/ConversationUpdateActivity.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a conversation update activity. +/// +public class ConversationUpdateActivity : Activity +{ + /// + /// Gets or sets the updated topic name of the conversation. + /// + [JsonPropertyName("topicName")] + public string? TopicName { get; set; } + + /// + /// Gets or sets a value indicating whether the prior history of the channel is disclosed. + /// + [JsonPropertyName("historyDisclosed")] + public bool? HistoryDisclosed { get; set; } + + /// + /// Gets or sets the collection of members added to the conversation. + /// + [JsonPropertyName("membersAdded")] +#pragma warning disable CA2227 // Collection properties should be read only + public IList? MembersAdded { get; set; } +#pragma warning restore CA2227 // Collection properties should be read only + + /// + /// Gets or sets the collection of members removed from the conversation. + /// + [JsonPropertyName("membersRemoved")] +#pragma warning disable CA2227 // Collection properties should be read only + public IList? MembersRemoved { get; set; } +#pragma warning restore CA2227 // Collection properties should be read only + + /// + /// Initializes a new instance of the class. + /// + public ConversationUpdateActivity() : base(ActivityTypes.ConversationUpdate) + { + } +} + +/// +/// String constants for conversation update event types. +/// +public static class ConversationEventTypes +{ + /// + /// Channel created event type. + /// + public const string ChannelCreated = "channelCreated"; + + /// + /// Channel deleted event type. + /// + public const string ChannelDeleted = "channelDeleted"; + + /// + /// Channel renamed event type. + /// + public const string ChannelRenamed = "channelRenamed"; + + /// + /// Channel restored event type. + /// + public const string ChannelRestored = "channelRestored"; + + /// + /// Channel shared event type. + /// + public const string ChannelShared = "channelShared"; + + /// + /// Channel unshared event type. + /// + public const string ChannelUnShared = "channelUnshared"; + + /// + /// Channel member added event type. + /// + public const string ChannelMemberAdded = "channelMemberAdded"; + + /// + /// Channel member removed event type. + /// + public const string ChannelMemberRemoved = "channelMemberRemoved"; + + /// + /// Team archived event type. + /// + public const string TeamArchived = "teamArchived"; + + /// + /// Team deleted event type. + /// + public const string TeamDeleted = "teamDeleted"; + + /// + /// Team hard deleted event type. + /// + public const string TeamHardDeleted = "teamHardDeleted"; + + /// + /// Team renamed event type. + /// + public const string TeamRenamed = "teamRenamed"; + + /// + /// Team restored event type. + /// + public const string TeamRestored = "teamRestored"; + + /// + /// Team unarchived event type. + /// + public const string TeamUnarchived = "teamUnarchived"; +} diff --git a/core/src/Microsoft.Bot.Core/Activities/EndOfConversationActivity.cs b/core/src/Microsoft.Bot.Core/Activities/EndOfConversationActivity.cs new file mode 100644 index 00000000..d3f3d4e2 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/EndOfConversationActivity.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents an end of conversation activity. +/// +public class EndOfConversationActivity : Activity +{ + /// + /// Gets or sets the code for endOfConversation activities that indicates why the conversation ended. + /// See for common values. + /// + [JsonPropertyName("code")] + public string? Code { get; set; } + + /// + /// Gets or sets the text content of the message. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public EndOfConversationActivity() : base(ActivityTypes.EndOfConversation) + { + } +} + +/// +/// String constants for end of conversation codes. +/// +public static class EndOfConversationCodes +{ + /// + /// Unknown reason for ending the conversation. + /// + public const string Unknown = "unknown"; + + /// + /// Conversation completed successfully. + /// + public const string CompletedSuccessfully = "completedSuccessfully"; + + /// + /// User cancelled the conversation. + /// + public const string UserCancelled = "userCancelled"; + + /// + /// Bot timed out. + /// + public const string BotTimedOut = "botTimedOut"; + + /// + /// Bot issued an invalid message. + /// + public const string BotIssuedInvalidMessage = "botIssuedInvalidMessage"; + + /// + /// Channel failed. + /// + public const string ChannelFailed = "channelFailed"; +} diff --git a/core/src/Microsoft.Bot.Core/Activities/EventActivity.cs b/core/src/Microsoft.Bot.Core/Activities/EventActivity.cs new file mode 100644 index 00000000..c2d9154a --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/EventActivity.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents an event activity. +/// +public class EventActivity : Activity +{ + /// + /// Gets or sets the name of the event. See for common values. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public EventActivity() : base(ActivityTypes.Event) + { + } + + /// + /// Initializes a new instance of the class with the specified event name. + /// + /// The event name. + public EventActivity(string name) : base(ActivityTypes.Event) + { + Name = name; + } +} + +/// +/// String constants for event activity names. +/// +public static class EventNames +{ + /// + /// Read receipt event name. + /// + public const string ReadReceipt = "application/vnd.microsoft.readReceipt"; + + /// + /// Meeting start event name. + /// + public const string MeetingStart = "application/vnd.microsoft.meetingStart"; + + /// + /// Meeting end event name. + /// + public const string MeetingEnd = "application/vnd.microsoft.meetingEnd"; + + /// + /// Meeting participant join event name. + /// + public const string MeetingParticipantJoin = "application/vnd.microsoft.meetingParticipantJoin"; + + /// + /// Meeting participant leave event name. + /// + public const string MeetingParticipantLeave = "application/vnd.microsoft.meetingParticipantLeave"; +} diff --git a/core/src/Microsoft.Bot.Core/Activities/ExecuteActionActivity.cs b/core/src/Microsoft.Bot.Core/Activities/ExecuteActionActivity.cs new file mode 100644 index 00000000..514f6c3b --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/ExecuteActionActivity.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents an execute action invoke activity. +/// +public class ExecuteActionActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public ExecuteActionActivity() : base("actionableMessage/executeAction") + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/FileConsentActivity.cs b/core/src/Microsoft.Bot.Core/Activities/FileConsentActivity.cs new file mode 100644 index 00000000..004339e4 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/FileConsentActivity.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a file consent invoke activity. +/// +public class FileConsentActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public FileConsentActivity() : base("fileConsent/invoke") + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/HandoffActivity.cs b/core/src/Microsoft.Bot.Core/Activities/HandoffActivity.cs new file mode 100644 index 00000000..4850892c --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/HandoffActivity.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a handoff invoke activity. +/// +public class HandoffActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public HandoffActivity() : base("handoff/action") + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/InstallUpdateActivity.cs b/core/src/Microsoft.Bot.Core/Activities/InstallUpdateActivity.cs new file mode 100644 index 00000000..72b0de68 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/InstallUpdateActivity.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents an installation update activity. +/// +public class InstallUpdateActivity : Activity +{ + /// + /// Gets or sets the action for the installation update. See for common values. + /// + [JsonPropertyName("action")] + public string? Action { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public InstallUpdateActivity() : base(ActivityTypes.InstallationUpdate) + { + } +} + +/// +/// String constants for installation update actions. +/// +public static class InstallUpdateActions +{ + /// + /// Add action. + /// + public const string Add = "add"; + + /// + /// Remove action. + /// + public const string Remove = "remove"; +} diff --git a/core/src/Microsoft.Bot.Core/Activities/InvokeActivity.cs b/core/src/Microsoft.Bot.Core/Activities/InvokeActivity.cs new file mode 100644 index 00000000..dadfee15 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/InvokeActivity.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents an invoke activity. +/// +public class InvokeActivity : Activity +{ + /// + /// Gets or sets the name of the operation. See for common values. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Gets or sets a value that is associated with the activity. + /// + [JsonPropertyName("value")] + public object? Value { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public InvokeActivity() + { + Type = ActivityTypes.Invoke; + } + + /// + /// Initializes a new instance of the class with the specified name. + /// + /// The invoke operation name. + public InvokeActivity(string name) + { + Type = ActivityTypes.Invoke; + Name = name; + } +} + +/// +/// String constants for invoke activity names. +/// +public static class InvokeNames +{ + /// + /// Execute action invoke name. + /// + public const string ExecuteAction = "actionableMessage/executeAction"; + + /// + /// File consent invoke name. + /// + public const string FileConsent = "fileConsent/invoke"; + + /// + /// Handoff invoke name. + /// + public const string Handoff = "handoff/action"; + + /// + /// Search invoke name. + /// + public const string Search = "search"; + + /// + /// Adaptive card action invoke name. + /// + public const string AdaptiveCardAction = "adaptiveCard/action"; + + /// + /// Config fetch invoke name. + /// + public const string ConfigFetch = "config/fetch"; + + /// + /// Config submit invoke name. + /// + public const string ConfigSubmit = "config/submit"; + + /// + /// Tab fetch invoke name. + /// + public const string TabFetch = "tab/fetch"; + + /// + /// Tab submit invoke name. + /// + public const string TabSubmit = "tab/submit"; + + /// + /// Task fetch invoke name. + /// + public const string TaskFetch = "task/fetch"; + + /// + /// Task submit invoke name. + /// + public const string TaskSubmit = "task/submit"; + + /// + /// Sign-in token exchange invoke name. + /// + public const string SignInTokenExchange = "signin/tokenExchange"; + + /// + /// Sign-in verify state invoke name. + /// + public const string SignInVerifyState = "signin/verifyState"; + + /// + /// Message submit action invoke name. + /// + public const string MessageSubmitAction = "message/submitAction"; + + /// + /// Message extension anonymous query link invoke name. + /// + public const string MessageExtensionAnonQueryLink = "composeExtension/anonymousQueryLink"; + + /// + /// Message extension card button clicked invoke name. + /// + public const string MessageExtensionCardButtonClicked = "composeExtension/onCardButtonClicked"; + + /// + /// Message extension fetch task invoke name. + /// + public const string MessageExtensionFetchTask = "composeExtension/fetchTask"; + + /// + /// Message extension query invoke name. + /// + public const string MessageExtensionQuery = "composeExtension/query"; + + /// + /// Message extension query link invoke name. + /// + public const string MessageExtensionQueryLink = "composeExtension/queryLink"; + + /// + /// Message extension query setting URL invoke name. + /// + public const string MessageExtensionQuerySettingUrl = "composeExtension/querySettingUrl"; + + /// + /// Message extension select item invoke name. + /// + public const string MessageExtensionSelectItem = "composeExtension/selectItem"; + + /// + /// Message extension setting invoke name. + /// + public const string MessageExtensionSetting = "composeExtension/setting"; + + /// + /// Message extension submit action invoke name. + /// + public const string MessageExtensionSubmitAction = "composeExtension/submitAction"; +} diff --git a/core/src/Microsoft.Bot.Core/Activities/MeetingEndActivity.cs b/core/src/Microsoft.Bot.Core/Activities/MeetingEndActivity.cs new file mode 100644 index 00000000..1d9b735d --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/MeetingEndActivity.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a meeting end event activity. +/// +public class MeetingEndActivity : EventActivity +{ + /// + /// Gets or sets a value that is associated with the activity. + /// + [JsonPropertyName("value")] + public MeetingEndActivityValue? Value { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public MeetingEndActivity() : base(EventNames.MeetingEnd) + { + } +} + +/// +/// A value that is associated with a meeting end activity. +/// +#pragma warning disable CA1056 // URI properties should not be strings +public class MeetingEndActivityValue +#pragma warning restore CA1056 // URI properties should not be strings +{ + /// + /// Gets or sets the meeting's ID, encoded as a BASE64 string. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Gets or sets the meeting's type. + /// + [JsonPropertyName("meetingType")] + public string? MeetingType { get; set; } + + /// + /// Gets or sets the URL used to join the meeting. + /// + [JsonPropertyName("joinUrl")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:URI properties should not be strings", Justification = "Meeting activity schema uses string for JoinUrl")] + public string? JoinUrl { get; set; } + + /// + /// Gets or sets the title of the meeting. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Gets or sets the timestamp for meeting end, in UTC. + /// + [JsonPropertyName("endTime")] + public DateTime? EndTime { get; set; } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/MeetingParticipantJoinActivity.cs b/core/src/Microsoft.Bot.Core/Activities/MeetingParticipantJoinActivity.cs new file mode 100644 index 00000000..a6f858eb --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/MeetingParticipantJoinActivity.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a meeting participant join event activity. +/// +public class MeetingParticipantJoinActivity : EventActivity +{ + /// + /// Gets or sets a value that is associated with the activity. + /// + [JsonPropertyName("value")] + public MeetingParticipantJoinActivityValue? Value { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public MeetingParticipantJoinActivity() : base(EventNames.MeetingParticipantJoin) + { + } +} + +/// +/// A value that is associated with a meeting participant join activity. +/// +public class MeetingParticipantJoinActivityValue +{ + /// + /// Gets or sets the participants info. + /// + [JsonPropertyName("members")] +#pragma warning disable CA2227 // Collection properties should be read only + public IList? Members { get; set; } +#pragma warning restore CA2227 // Collection properties should be read only +} + +/// +/// Represents a meeting participant member. +/// +public class MeetingParticipantMember +{ + /// + /// Gets or sets the participant account. + /// + [JsonPropertyName("user")] + public Account? User { get; set; } + + /// + /// Gets or sets the participant's meeting info. + /// + [JsonPropertyName("meeting")] + public MeetingParticipantMeetingInfo? Meeting { get; set; } +} + +/// +/// Represents meeting participant meeting information. +/// +public class MeetingParticipantMeetingInfo +{ + /// + /// Gets or sets a value indicating whether the user is in the meeting. + /// + [JsonPropertyName("inMeeting")] + public bool InMeeting { get; set; } + + /// + /// Gets or sets the participant's role in the meeting. See for common values. + /// + [JsonPropertyName("role")] + public string? Role { get; set; } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/MeetingParticipantLeaveActivity.cs b/core/src/Microsoft.Bot.Core/Activities/MeetingParticipantLeaveActivity.cs new file mode 100644 index 00000000..7403857e --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/MeetingParticipantLeaveActivity.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a meeting participant leave event activity. +/// +public class MeetingParticipantLeaveActivity : EventActivity +{ + /// + /// Gets or sets a value that is associated with the activity. + /// + [JsonPropertyName("value")] + public MeetingParticipantLeaveActivityValue? Value { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public MeetingParticipantLeaveActivity() : base(EventNames.MeetingParticipantLeave) + { + } +} + +/// +/// A value that is associated with a meeting participant leave activity. +/// +public class MeetingParticipantLeaveActivityValue +{ + /// + /// Gets or sets the participants info. + /// + [JsonPropertyName("members")] +#pragma warning disable CA2227 // Collection properties should be read only + public IList? Members { get; set; } +#pragma warning restore CA2227 // Collection properties should be read only +} diff --git a/core/src/Microsoft.Bot.Core/Activities/MeetingStartActivity.cs b/core/src/Microsoft.Bot.Core/Activities/MeetingStartActivity.cs new file mode 100644 index 00000000..10724509 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/MeetingStartActivity.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a meeting start event activity. +/// +public class MeetingStartActivity : EventActivity +{ + /// + /// Gets or sets a value that is associated with the activity. + /// + [JsonPropertyName("value")] + public MeetingStartActivityValue? Value { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public MeetingStartActivity() : base(EventNames.MeetingStart) + { + } +} + +/// +/// A value that is associated with a meeting start activity. +/// +#pragma warning disable CA1056 // URI properties should not be strings +public class MeetingStartActivityValue +#pragma warning restore CA1056 // URI properties should not be strings +{ + /// + /// Gets or sets the meeting's ID, encoded as a BASE64 string. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Gets or sets the meeting's type. + /// + [JsonPropertyName("meetingType")] + public string? MeetingType { get; set; } + + /// + /// Gets or sets the URL used to join the meeting. + /// + [JsonPropertyName("joinUrl")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:URI properties should not be strings", Justification = "Meeting activity schema uses string for JoinUrl")] + public string? JoinUrl { get; set; } + + /// + /// Gets or sets the title of the meeting. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Gets or sets the timestamp for meeting start, in UTC. + /// + [JsonPropertyName("startTime")] + public DateTime? StartTime { get; set; } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/MessageActivity.cs b/core/src/Microsoft.Bot.Core/Activities/MessageActivity.cs new file mode 100644 index 00000000..12d4fcc5 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/MessageActivity.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a message activity. +/// +public class MessageActivity : Activity +{ + /// + /// Gets or sets the text content of the message. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// Gets or sets the SSML speak content of the message. + /// + [JsonPropertyName("speak")] + public string? Speak { get; set; } + + /// + /// Gets or sets the input hint. See for common values. + /// + [JsonPropertyName("inputHint")] + public string? InputHint { get; set; } + + /// + /// Gets or sets the summary of the message. + /// + [JsonPropertyName("summary")] + public string? Summary { get; set; } + + /// + /// Gets or sets the text format. See for common values. + /// + [JsonPropertyName("textFormat")] + public string? TextFormat { get; set; } + + /// + /// Gets or sets the attachment layout. + /// + [JsonPropertyName("attachmentLayout")] + public string? AttachmentLayout { get; set; } + + /// + /// Gets or sets the importance. See for common values. + /// + [JsonPropertyName("importance")] + public string? Importance { get; set; } + + /// + /// Gets or sets the delivery mode. See for common values. + /// + [JsonPropertyName("deliveryMode")] + public string? DeliveryMode { get; set; } + + /// + /// Gets or sets the expiration time of the message. + /// + [JsonPropertyName("expiration")] + public DateTime? Expiration { get; set; } + + /// + /// Gets or sets the value associated with the message. + /// + [JsonPropertyName("value")] + public object? Value { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public MessageActivity() : base(ActivityTypes.Message) + { + } + + /// + /// Initializes a new instance of the class with the specified text. + /// + /// The text content of the message. + public MessageActivity(string text) : base(ActivityTypes.Message) + { + Text = text; + } +} + +/// +/// String constants for input hints. +/// +public static class InputHints +{ + /// + /// Accepting input hint. + /// + public const string AcceptingInput = "acceptingInput"; + + /// + /// Ignoring input hint. + /// + public const string IgnoringInput = "ignoringInput"; + + /// + /// Expecting input hint. + /// + public const string ExpectingInput = "expectingInput"; +} + +/// +/// String constants for text formats. +/// +public static class TextFormats +{ + /// + /// Plain text format. + /// + public const string Plain = "plain"; + + /// + /// Markdown text format. + /// + public const string Markdown = "markdown"; + + /// + /// XML text format. + /// + public const string Xml = "xml"; +} + +/// +/// String constants for importance levels. +/// +public static class ImportanceLevels +{ + /// + /// Low importance. + /// + public const string Low = "low"; + + /// + /// Normal importance. + /// + public const string Normal = "normal"; + + /// + /// High importance. + /// + public const string High = "high"; + + /// + /// Urgent importance. + /// + public const string Urgent = "urgent"; +} + +/// +/// String constants for delivery modes. +/// +public static class DeliveryModes +{ + /// + /// Normal delivery mode. + /// + public const string Normal = "normal"; + + /// + /// Notification delivery mode. + /// + public const string Notification = "notification"; + + /// + /// Ephemeral delivery mode. + /// + public const string Ephemeral = "ephemeral"; + + /// + /// Expected replies delivery mode. + /// + public const string ExpectedReplies = "expectReplies"; +} diff --git a/core/src/Microsoft.Bot.Core/Activities/MessageDeleteActivity.cs b/core/src/Microsoft.Bot.Core/Activities/MessageDeleteActivity.cs new file mode 100644 index 00000000..6aa4a88e --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/MessageDeleteActivity.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a message delete activity. +/// +public class MessageDeleteActivity : Activity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageDeleteActivity() : base(ActivityTypes.MessageDelete) + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/MessageExtensionActivity.cs b/core/src/Microsoft.Bot.Core/Activities/MessageExtensionActivity.cs new file mode 100644 index 00000000..115340ef --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/MessageExtensionActivity.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a message extension anonymous query link invoke activity. +/// +public class MessageExtensionAnonQueryLinkActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageExtensionAnonQueryLinkActivity() : base("composeExtension/anonymousQueryLink") + { + } +} + +/// +/// Represents a message extension card button clicked invoke activity. +/// +public class MessageExtensionCardButtonClickedActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageExtensionCardButtonClickedActivity() : base("composeExtension/onCardButtonClicked") + { + } +} + +/// +/// Represents a message extension fetch task invoke activity. +/// +public class MessageExtensionFetchTaskActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageExtensionFetchTaskActivity() : base("composeExtension/fetchTask") + { + } +} + +/// +/// Represents a message extension query invoke activity. +/// +public class MessageExtensionQueryActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageExtensionQueryActivity() : base("composeExtension/query") + { + } +} + +/// +/// Represents a message extension query link invoke activity. +/// +public class MessageExtensionQueryLinkActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageExtensionQueryLinkActivity() : base("composeExtension/queryLink") + { + } +} + +/// +/// Represents a message extension query setting URL invoke activity. +/// +public class MessageExtensionQuerySettingUrlActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageExtensionQuerySettingUrlActivity() : base("composeExtension/querySettingUrl") + { + } +} + +/// +/// Represents a message extension select item invoke activity. +/// +public class MessageExtensionSelectItemActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageExtensionSelectItemActivity() : base("composeExtension/selectItem") + { + } +} + +/// +/// Represents a message extension setting invoke activity. +/// +public class MessageExtensionSettingActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageExtensionSettingActivity() : base("composeExtension/setting") + { + } +} + +/// +/// Represents a message extension submit action invoke activity. +/// +public class MessageExtensionSubmitActionActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageExtensionSubmitActionActivity() : base("composeExtension/submitAction") + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/MessageInvokeActivity.cs b/core/src/Microsoft.Bot.Core/Activities/MessageInvokeActivity.cs new file mode 100644 index 00000000..7339b9a7 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/MessageInvokeActivity.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a message submit action invoke activity. +/// +public class MessageSubmitActionActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageSubmitActionActivity() : base("message/submitAction") + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/MessageReactionActivity.cs b/core/src/Microsoft.Bot.Core/Activities/MessageReactionActivity.cs new file mode 100644 index 00000000..937b38eb --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/MessageReactionActivity.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a message reaction activity. +/// +public class MessageReactionActivity : Activity +{ + /// + /// Gets or sets the collection of reactions added. + /// + [JsonPropertyName("reactionsAdded")] +#pragma warning disable CA2227 // Collection properties should be read only + public IList? ReactionsAdded { get; set; } +#pragma warning restore CA2227 // Collection properties should be read only + + /// + /// Gets or sets the collection of reactions removed. + /// + [JsonPropertyName("reactionsRemoved")] +#pragma warning disable CA2227 // Collection properties should be read only + public IList? ReactionsRemoved { get; set; } +#pragma warning restore CA2227 // Collection properties should be read only + + /// + /// Initializes a new instance of the class. + /// + public MessageReactionActivity() : base(ActivityTypes.MessageReaction) + { + } +} + +/// +/// Represents a message reaction. +/// +public class MessageReaction +{ + /// + /// Gets or sets the type of reaction. See for common values. + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Gets or sets the timestamp of when the user reacted to the message. + /// + [JsonPropertyName("createdDateTime")] + public string? CreatedDateTime { get; set; } + + /// + /// Gets or sets the user with which the reaction is associated. + /// + [JsonPropertyName("user")] + public ReactionUser? User { get; set; } +} + +/// +/// Represents a user associated with a reaction. +/// +public class ReactionUser +{ + /// + /// Gets or sets the ID of the user. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Gets or sets the identity type of the user. See for common values. + /// + [JsonPropertyName("userIdentityType")] + public string? UserIdentityType { get; set; } + + /// + /// Gets or sets the plaintext display name of the user. + /// + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } +} + +/// +/// String constants for reaction types. +/// +public static class ReactionTypes +{ + /// + /// Like reaction. + /// + public const string Like = "like"; + + /// + /// Heart reaction. + /// + public const string Heart = "heart"; + + /// + /// Laugh reaction. + /// + public const string Laugh = "laugh"; + + /// + /// Surprise reaction. + /// + public const string Surprise = "surprise"; + + /// + /// Sad reaction. + /// + public const string Sad = "sad"; + + /// + /// Angry reaction. + /// + public const string Angry = "angry"; + + /// + /// Plus one reaction. + /// + public const string PlusOne = "plusOne"; +} + +/// +/// String constants for user identity types. +/// +public static class UserIdentityTypes +{ + /// + /// Azure AD user. + /// + public const string AadUser = "aadUser"; + + /// + /// On-premise Azure AD user. + /// + public const string OnPremiseAadUser = "onPremiseAadUser"; + + /// + /// Anonymous guest user. + /// + public const string AnonymousGuest = "anonymousGuest"; + + /// + /// Federated user. + /// + public const string FederatedUser = "federatedUser"; +} diff --git a/core/src/Microsoft.Bot.Core/Activities/MessageUpdateActivity.cs b/core/src/Microsoft.Bot.Core/Activities/MessageUpdateActivity.cs new file mode 100644 index 00000000..077bcec7 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/MessageUpdateActivity.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a message update activity. +/// +public class MessageUpdateActivity : MessageActivity +{ + /// + /// Initializes a new instance of the class. + /// + public MessageUpdateActivity() : base() + { + Type = ActivityTypes.MessageUpdate; + } + + /// + /// Initializes a new instance of the class with the specified text. + /// + /// The text content of the message. + public MessageUpdateActivity(string text) : base(text) + { + Type = ActivityTypes.MessageUpdate; + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/ReadReceiptActivity.cs b/core/src/Microsoft.Bot.Core/Activities/ReadReceiptActivity.cs new file mode 100644 index 00000000..c25d6076 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/ReadReceiptActivity.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a read receipt event activity. +/// +public class ReadReceiptActivity : EventActivity +{ + /// + /// Initializes a new instance of the class. + /// + public ReadReceiptActivity() : base(EventNames.ReadReceipt) + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/SearchActivity.cs b/core/src/Microsoft.Bot.Core/Activities/SearchActivity.cs new file mode 100644 index 00000000..823502bd --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/SearchActivity.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a search invoke activity. +/// +public class SearchActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public SearchActivity() : base("search") + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/SignInActivity.cs b/core/src/Microsoft.Bot.Core/Activities/SignInActivity.cs new file mode 100644 index 00000000..2a08e830 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/SignInActivity.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a sign-in token exchange invoke activity. +/// +public class SignInTokenExchangeActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public SignInTokenExchangeActivity() : base("signin/tokenExchange") + { + } +} + +/// +/// Represents a sign-in verify state invoke activity. +/// +public class SignInVerifyStateActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public SignInVerifyStateActivity() : base("signin/verifyState") + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/TabActivity.cs b/core/src/Microsoft.Bot.Core/Activities/TabActivity.cs new file mode 100644 index 00000000..9f526f92 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/TabActivity.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a tab fetch invoke activity. +/// +public class TabFetchActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public TabFetchActivity() : base("tab/fetch") + { + } +} + +/// +/// Represents a tab submit invoke activity. +/// +public class TabSubmitActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public TabSubmitActivity() : base("tab/submit") + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/TaskActivity.cs b/core/src/Microsoft.Bot.Core/Activities/TaskActivity.cs new file mode 100644 index 00000000..4273e488 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/TaskActivity.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a task fetch invoke activity. +/// +public class TaskFetchActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public TaskFetchActivity() : base("task/fetch") + { + } +} + +/// +/// Represents a task submit invoke activity. +/// +public class TaskSubmitActivity : InvokeActivity +{ + /// + /// Initializes a new instance of the class. + /// + public TaskSubmitActivity() : base("task/submit") + { + } +} diff --git a/core/src/Microsoft.Bot.Core/Activities/TypingActivity.cs b/core/src/Microsoft.Bot.Core/Activities/TypingActivity.cs new file mode 100644 index 00000000..c243a166 --- /dev/null +++ b/core/src/Microsoft.Bot.Core/Activities/TypingActivity.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Core.Activities; + +/// +/// Represents a typing activity. +/// +public class TypingActivity : Activity +{ + /// + /// Gets or sets the text content of the typing activity. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public TypingActivity() : base(ActivityTypes.Typing) + { + } + + /// + /// Initializes a new instance of the class with the specified text. + /// + /// The text content. + public TypingActivity(string text) : base(ActivityTypes.Typing) + { + Text = text; + } +}