Skip to content

Commit

Permalink
Merge pull request #21 from Microsoft/southworks/connector-updates-sw…
Browse files Browse the repository at this point in the history
…agger

[Microsoft.Bot.Connector] AutoRest Generation updates
  • Loading branch information
Tom Laird-McConnell authored Jan 24, 2018
2 parents 762e721 + 2b5dd04 commit 81eaf87
Show file tree
Hide file tree
Showing 63 changed files with 279 additions and 281 deletions.
4 changes: 4 additions & 0 deletions libraries/Microsoft.Bot.Connector/ConnectorAPI/Attachments.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// <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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// <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.
Expand All @@ -16,23 +20,6 @@ namespace Microsoft.Bot.Connector
/// </summary>
public static partial class AttachmentsExtensions
{
/// <summary>
/// GetAttachmentInfo
/// </summary>
/// <remarks>
/// Get AttachmentInfo structure describing the attachment views
/// </remarks>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='attachmentId'>
/// attachment id
/// </param>
public static AttachmentInfo GetAttachmentInfo(this IAttachments operations, string attachmentId)
{
return operations.GetAttachmentInfoAsync(attachmentId).GetAwaiter().GetResult();
}

/// <summary>
/// GetAttachmentInfo
/// </summary>
Expand All @@ -56,26 +43,6 @@ public static AttachmentInfo GetAttachmentInfo(this IAttachments operations, str
}
}

/// <summary>
/// GetAttachment
/// </summary>
/// <remarks>
/// Get the named view as binary content
/// </remarks>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='attachmentId'>
/// attachment id
/// </param>
/// <param name='viewId'>
/// View id from attachmentInfo
/// </param>
public static Stream GetAttachment(this IAttachments operations, string attachmentId, string viewId)
{
return operations.GetAttachmentAsync(attachmentId, viewId).GetAwaiter().GetResult();
}

/// <summary>
/// GetAttachment
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// <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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// <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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// <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.
Expand All @@ -17,45 +21,6 @@ namespace Microsoft.Bot.Connector
/// </summary>
public static partial class ConversationsExtensions
{
/// <summary>
/// CreateConversation
/// </summary>
/// <remarks>
/// Create a new Conversation.
///
/// POST to this method with a
/// * Bot being the bot creating the conversation
/// * IsGroup set to true if this is not a direct message (default is false)
/// * Members array contining the members you want to have be in the
/// conversation.
///
/// The return value is a ResourceResponse which contains a conversation id
/// which is suitable for use
/// in the message payload and REST API uris.
///
/// Most channels only support the semantics of bots initiating a direct
/// message conversation. An example of how to do that would be:
///
/// ```
/// var resource = await connector.conversations.CreateConversation(new
/// ConversationParameters(){ Bot = bot, members = new ChannelAccount[] { new
/// ChannelAccount("user1") } );
/// await connect.Conversations.SendToConversationAsync(resource.Id, new
/// Activity() ... ) ;
///
/// ```
/// </remarks>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='parameters'>
/// Parameters to create the conversation from
/// </param>
public static ConversationResourceResponse CreateConversation(this IConversations operations, ConversationParameters parameters)
{
return operations.CreateConversationAsync(parameters).GetAwaiter().GetResult();
}

/// <summary>
/// CreateConversation
/// </summary>
Expand Down Expand Up @@ -101,38 +66,6 @@ public static ConversationResourceResponse CreateConversation(this IConversation
}
}

/// <summary>
/// SendToConversation
/// </summary>
/// <remarks>
/// This method allows you to send an activity to the end of a conversation.
///
/// This is slightly different from ReplyToActivity().
/// * SendToConverstion(conversationId) - will append the activity to the end
/// of the conversation according to the timestamp or semantics of the channel.
/// * ReplyToActivity(conversationId,ActivityId) - adds the activity as a reply
/// to another activity, if the channel supports it. If the channel does not
/// support nested replies, ReplyToActivity falls back to SendToConversation.
///
/// Use ReplyToActivity when replying to a specific activity in the
/// conversation.
///
/// Use SendToConversation in all other cases.
/// </remarks>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='conversationId'>
/// Conversation ID
/// </param>
/// <param name='activity'>
/// Activity to send
/// </param>
public static ResourceResponse SendToConversation(this IConversations operations, string conversationId, Activity activity)
{
return operations.SendToConversationAsync(conversationId, activity).GetAwaiter().GetResult();
}

/// <summary>
/// SendToConversation
/// </summary>
Expand Down Expand Up @@ -171,35 +104,6 @@ public static ResourceResponse SendToConversation(this IConversations operations
}
}

/// <summary>
/// UpdateActivity
/// </summary>
/// <remarks>
/// Edit an existing activity.
///
/// Some channels allow you to edit an existing activity to reflect the new
/// state of a bot conversation.
///
/// For example, you can remove buttons after someone has clicked "Approve"
/// button.
/// </remarks>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='conversationId'>
/// Conversation ID
/// </param>
/// <param name='activityId'>
/// activityId to update
/// </param>
/// <param name='activity'>
/// replacement Activity
/// </param>
public static ResourceResponse UpdateActivity(this IConversations operations, string conversationId, string activityId, Activity activity)
{
return operations.UpdateActivityAsync(conversationId, activityId, activity).GetAwaiter().GetResult();
}

/// <summary>
/// UpdateActivity
/// </summary>
Expand Down Expand Up @@ -235,41 +139,6 @@ public static ResourceResponse UpdateActivity(this IConversations operations, st
}
}

/// <summary>
/// ReplyToActivity
/// </summary>
/// <remarks>
/// This method allows you to reply to an activity.
///
/// This is slightly different from SendToConversation().
/// * SendToConverstion(conversationId) - will append the activity to the end
/// of the conversation according to the timestamp or semantics of the channel.
/// * ReplyToActivity(conversationId,ActivityId) - adds the activity as a reply
/// to another activity, if the channel supports it. If the channel does not
/// support nested replies, ReplyToActivity falls back to SendToConversation.
///
/// Use ReplyToActivity when replying to a specific activity in the
/// conversation.
///
/// Use SendToConversation in all other cases.
/// </remarks>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='conversationId'>
/// Conversation ID
/// </param>
/// <param name='activityId'>
/// activityId the reply is to (OPTIONAL)
/// </param>
/// <param name='activity'>
/// Activity to send
/// </param>
public static ResourceResponse ReplyToActivity(this IConversations operations, string conversationId, string activityId, Activity activity)
{
return operations.ReplyToActivityAsync(conversationId, activityId, activity).GetAwaiter().GetResult();
}

/// <summary>
/// ReplyToActivity
/// </summary>
Expand Down Expand Up @@ -311,29 +180,6 @@ public static ResourceResponse ReplyToActivity(this IConversations operations, s
}
}

/// <summary>
/// DeleteActivity
/// </summary>
/// <remarks>
/// Delete an existing activity.
///
/// Some channels allow you to delete an existing activity, and if successful
/// this method will remove the specified activity.
/// </remarks>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='conversationId'>
/// Conversation ID
/// </param>
/// <param name='activityId'>
/// activityId to delete
/// </param>
public static void DeleteActivity(this IConversations operations, string conversationId, string activityId)
{
operations.DeleteActivityAsync(conversationId, activityId).GetAwaiter().GetResult();
}

/// <summary>
/// DeleteActivity
/// </summary>
Expand All @@ -360,26 +206,6 @@ public static void DeleteActivity(this IConversations operations, string convers
(await operations.DeleteActivityWithHttpMessagesAsync(conversationId, activityId, null, cancellationToken).ConfigureAwait(false)).Dispose();
}

/// <summary>
/// GetConversationMembers
/// </summary>
/// <remarks>
/// Enumerate the members of a converstion.
///
/// This REST API takes a ConversationId and returns an array of ChannelAccount
/// objects representing the members of the conversation.
/// </remarks>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='conversationId'>
/// Conversation ID
/// </param>
public static IList<ChannelAccount> GetConversationMembers(this IConversations operations, string conversationId)
{
return operations.GetConversationMembersAsync(conversationId).GetAwaiter().GetResult();
}

/// <summary>
/// GetConversationMembers
/// </summary>
Expand All @@ -406,30 +232,6 @@ public static IList<ChannelAccount> GetConversationMembers(this IConversations o
}
}

/// <summary>
/// GetActivityMembers
/// </summary>
/// <remarks>
/// Enumerate the members of an activity.
///
/// This REST API takes a ConversationId and a ActivityId, returning an array
/// of ChannelAccount objects representing the members of the particular
/// activity in the conversation.
/// </remarks>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='conversationId'>
/// Conversation ID
/// </param>
/// <param name='activityId'>
/// Activity ID
/// </param>
public static IList<ChannelAccount> GetActivityMembers(this IConversations operations, string conversationId, string activityId)
{
return operations.GetActivityMembersAsync(conversationId, activityId).GetAwaiter().GetResult();
}

/// <summary>
/// GetActivityMembers
/// </summary>
Expand Down Expand Up @@ -460,32 +262,6 @@ public static IList<ChannelAccount> GetActivityMembers(this IConversations opera
}
}

/// <summary>
/// UploadAttachment
/// </summary>
/// <remarks>
/// Upload an attachment directly into a channel's blob storage.
///
/// This is useful because it allows you to store data in a compliant store
/// when dealing with enterprises.
///
/// The response is a ResourceResponse which contains an AttachmentId which is
/// suitable for using with the attachments API.
/// </remarks>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='conversationId'>
/// Conversation ID
/// </param>
/// <param name='attachmentUpload'>
/// Attachment data
/// </param>
public static ResourceResponse UploadAttachment(this IConversations operations, string conversationId, AttachmentData attachmentUpload)
{
return operations.UploadAttachmentAsync(conversationId, attachmentUpload).GetAwaiter().GetResult();
}

/// <summary>
/// UploadAttachment
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// <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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// <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.
Expand Down
Loading

0 comments on commit 81eaf87

Please sign in to comment.