Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger has enum definitions to generate string enum consts #39

Merged
merged 1 commit into from
Jan 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions libraries/Microsoft.Bot.Connector/ActionTypes.cs

This file was deleted.

28 changes: 0 additions & 28 deletions libraries/Microsoft.Bot.Connector/ActivityEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,34 +185,6 @@ public Activity CreateReply(string text = null, string locale = null)
/// <returns></returns>
public ISuggestionActivity AsSuggestionActivity() { return IsActivity(ActivityTypes.Suggestion) ? this : null; }

/// <summary>
/// Maps type to activity types
/// </summary>
/// <param name="type"> The type.</param>
/// <returns> The activity type.</returns>
public static string GetActivityType(string type)
{
if (String.Equals(type, ActivityTypes.Message, StringComparison.OrdinalIgnoreCase))
return ActivityTypes.Message;

if (String.Equals(type, ActivityTypes.ContactRelationUpdate, StringComparison.OrdinalIgnoreCase))
return ActivityTypes.ContactRelationUpdate;

if (String.Equals(type, ActivityTypes.ConversationUpdate, StringComparison.OrdinalIgnoreCase))
return ActivityTypes.ConversationUpdate;

if (String.Equals(type, ActivityTypes.DeleteUserData, StringComparison.OrdinalIgnoreCase))
return ActivityTypes.DeleteUserData;

if (String.Equals(type, ActivityTypes.Typing, StringComparison.OrdinalIgnoreCase))
return ActivityTypes.Typing;

if (String.Equals(type, ActivityTypes.Ping, StringComparison.OrdinalIgnoreCase))
return ActivityTypes.Ping;

return $"{Char.ToLower(type[0])}{type.Substring(1)}";
}

/// <summary>
/// Checks if this (message) activity has content.
/// </summary>
Expand Down
83 changes: 0 additions & 83 deletions libraries/Microsoft.Bot.Connector/ActivityTypes.cs

This file was deleted.

11 changes: 0 additions & 11 deletions libraries/Microsoft.Bot.Connector/AttachmentLayoutTypes.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Bot.Connector
{

/// <summary>
/// Defines values for ActionTypes.
/// </summary>
public static class ActionTypes
{
public const string OpenUrl = "openUrl";
public const string ImBack = "imBack";
public const string PostBack = "postBack";
public const string PlayAudio = "playAudio";
public const string PlayVideo = "playVideo";
public const string ShowImage = "showImage";
public const string DownloadFile = "downloadFile";
public const string Signin = "signin";
public const string Call = "call";
public const string Payment = "payment";
public const string MessageBack = "messageBack";
}
}
50 changes: 32 additions & 18 deletions libraries/Microsoft.Bot.Connector/ConnectorAPI/Models/Activity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public Activity()
/// <summary>
/// Initializes a new instance of the Activity class.
/// </summary>
/// <param name="type">The type of the activity
/// [message|contactRelationUpdate|converationUpdate|typing|endOfConversation|event|invoke]</param>
/// <param name="type">The type of the activity. Possible values
/// include: 'message', 'contactRelationUpdate', 'conversationUpdate',
/// 'typing', 'ping', 'endOfConversation', 'event', 'invoke',
/// 'deleteUserData', 'messageUpdate', 'messageDelete',
/// 'installationUpdate', 'messageReaction', 'suggestion'</param>
/// <param name="id">ID of this activity</param>
/// <param name="timestamp">UTC Time when message was sent (set by
/// service)</param>
Expand All @@ -47,10 +50,11 @@ public Activity()
/// <param name="conversation">Conversation</param>
/// <param name="recipient">(Outbound to bot only) Bot's address that
/// received the message</param>
/// <param name="textFormat">Format of text fields [plain|markdown]
/// Default:markdown</param>
/// <param name="textFormat">Format of text fields Default:markdown.
/// Possible values include: 'markdown', 'plain', 'xml'</param>
/// <param name="attachmentLayout">Hint for how to deal with multiple
/// attachments: [list|carousel] Default:list</param>
/// attachments. Default:list. Possible values include: 'list',
/// 'carousel'</param>
/// <param name="membersAdded">Members added to the
/// conversation</param>
/// <param name="membersRemoved">Members removed from the
Expand All @@ -66,8 +70,9 @@ public Activity()
/// <param name="locale">The language code of the Text field</param>
/// <param name="text">Content for the message</param>
/// <param name="speak">SSML Speak for TTS audio response</param>
/// <param name="inputHint">Indicates whether the bot is accepting,
/// expecting, or ignoring input</param>
/// <param name="inputHint">Input hint to the channel on what the bot
/// is expecting. Possible values include: 'acceptingInput',
/// 'ignoringInput', 'expectingInput'</param>
/// <param name="summary">Text to display if the channel cannot render
/// cards</param>
/// <param name="suggestedActions">SuggestedActions are used to provide
Expand All @@ -85,8 +90,10 @@ public Activity()
/// the event</param>
/// <param name="relatesTo">Reference to another conversation or
/// activity</param>
/// <param name="code">Code indicating why the conversation has
/// ended</param>
/// <param name="code">Code indicating why the conversation has ended.
/// Possible values include: 'unknown', 'completedSuccessfully',
/// 'userCancelled', 'botTimedOut', 'botIssuedInvalidMessage',
/// 'channelFailed'</param>
/// <param name="expiration">DateTime to expire the activity as ISO
/// 8601 encoded datetime</param>
/// <param name="importance">Importance of this activity
Expand Down Expand Up @@ -145,8 +152,11 @@ public Activity()
partial void CustomInit();

/// <summary>
/// Gets or sets the type of the activity
/// [message|contactRelationUpdate|converationUpdate|typing|endOfConversation|event|invoke]
/// Gets or sets the type of the activity. Possible values include:
/// 'message', 'contactRelationUpdate', 'conversationUpdate', 'typing',
/// 'ping', 'endOfConversation', 'event', 'invoke', 'deleteUserData',
/// 'messageUpdate', 'messageDelete', 'installationUpdate',
/// 'messageReaction', 'suggestion'
/// </summary>
[JsonProperty(PropertyName = "type")]
public string Type { get; set; }
Expand Down Expand Up @@ -203,15 +213,15 @@ public Activity()
public ChannelAccount Recipient { get; set; }

/// <summary>
/// Gets or sets format of text fields [plain|markdown]
/// Default:markdown
/// Gets or sets format of text fields Default:markdown. Possible
/// values include: 'markdown', 'plain', 'xml'
/// </summary>
[JsonProperty(PropertyName = "textFormat")]
public string TextFormat { get; set; }

/// <summary>
/// Gets or sets hint for how to deal with multiple attachments:
/// [list|carousel] Default:list
/// Gets or sets hint for how to deal with multiple attachments.
/// Default:list. Possible values include: 'list', 'carousel'
/// </summary>
[JsonProperty(PropertyName = "attachmentLayout")]
public string AttachmentLayout { get; set; }
Expand Down Expand Up @@ -271,8 +281,9 @@ public Activity()
public string Speak { get; set; }

/// <summary>
/// Gets or sets indicates whether the bot is accepting, expecting, or
/// ignoring input
/// Gets or sets input hint to the channel on what the bot is
/// expecting. Possible values include: 'acceptingInput',
/// 'ignoringInput', 'expectingInput'
/// </summary>
[JsonProperty(PropertyName = "inputHint")]
public string InputHint { get; set; }
Expand Down Expand Up @@ -341,7 +352,10 @@ public Activity()
public ConversationReference RelatesTo { get; set; }

/// <summary>
/// Gets or sets code indicating why the conversation has ended
/// Gets or sets code indicating why the conversation has ended.
/// Possible values include: 'unknown', 'completedSuccessfully',
/// 'userCancelled', 'botTimedOut', 'botIssuedInvalidMessage',
/// 'channelFailed'
/// </summary>
[JsonProperty(PropertyName = "code")]
public string Code { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Bot.Connector
{

/// <summary>
/// Defines values for ActivityImportance.
/// </summary>
public static class ActivityImportance
{
public const string Low = "low";
public const string Normal = "normal";
public const string High = "high";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Bot.Connector
{

/// <summary>
/// Defines values for ActivityTypes.
/// </summary>
public static class ActivityTypes
{
public const string Message = "message";
public const string ContactRelationUpdate = "contactRelationUpdate";
public const string ConversationUpdate = "conversationUpdate";
public const string Typing = "typing";
public const string Ping = "ping";
public const string EndOfConversation = "endOfConversation";
public const string Event = "event";
public const string Invoke = "invoke";
public const string DeleteUserData = "deleteUserData";
public const string MessageUpdate = "messageUpdate";
public const string MessageDelete = "messageDelete";
public const string InstallationUpdate = "installationUpdate";
public const string MessageReaction = "messageReaction";
public const string Suggestion = "suggestion";
}
}
Loading