From 373950c5957a94f026fbb51a27aeea3e6c592729 Mon Sep 17 00:00:00 2001 From: Tracy Boehrer Date: Thu, 1 Aug 2019 15:47:08 -0500 Subject: [PATCH 1/4] Latest protocol changes (Fixes #72 and #65) --- .../bot/connector/Conversations.java | 173 +- .../implementation/ConversationsImpl.java | 296 + .../bot/connector/ConversationsTest.java | 24 + .../GetConversationPagedMembers.json | 53 + .../microsoft/bot/schema/ActivityImpl.java | 7 - .../bot/schema/models/ActionTypes.java | 2 +- .../microsoft/bot/schema/models/Activity.java | 161 +- .../bot/schema/models/ActivityTypes.java | 8 +- .../bot/schema/models/AnimationCard.java | 26 +- .../bot/schema/models/AttachmentView.java | 4 +- .../bot/schema/models/AudioCard.java | 26 +- .../bot/schema/models/CardAction.java | 23 + .../bot/schema/models/ChannelAccount.java | 19 + .../schema/models/ConversationAccount.java | 50 +- .../schema/models/ConversationParameters.java | 20 + .../bot/schema/models/DeliveryModes.java | 56 + .../microsoft/bot/schema/models/Entity.java | 4 +- .../microsoft/bot/schema/models/Error.java | 20 + .../bot/schema/models/InnerHttpError.java | 66 + .../bot/schema/models/MediaCard.java | 26 +- .../microsoft/bot/schema/models/Mention.java | 2 +- .../schema/models/MicrosoftPayMethodData.java | 20 +- .../bot/schema/models/PagedMembersResult.java | 66 + .../bot/schema/models/RoleTypes.java | 2 +- .../bot/schema/models/SemanticAction.java | 69 + .../schema/models/SemanticActionStates.java | 59 + .../bot/schema/models/TextHighlight.java | 6 +- .../bot/schema/models/TokenResponse.java | 24 + .../bot/schema/models/Transcript.java | 45 + .../bot/schema/models/VideoCard.java | 26 +- libraries/swagger/ConnectorAPI.json | 5095 +++++++++-------- 31 files changed, 3959 insertions(+), 2519 deletions(-) create mode 100644 libraries/bot-connector/src/test/resources/session-records/GetConversationPagedMembers.json create mode 100644 libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/DeliveryModes.java create mode 100644 libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/InnerHttpError.java create mode 100644 libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/PagedMembersResult.java create mode 100644 libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/SemanticAction.java create mode 100644 libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/SemanticActionStates.java create mode 100644 libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Transcript.java diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/Conversations.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/Conversations.java index 3660d1f4f..e278caa24 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/Conversations.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/Conversations.java @@ -16,8 +16,10 @@ import com.microsoft.bot.schema.models.ConversationParameters; import com.microsoft.bot.schema.models.ConversationResourceResponse; import com.microsoft.bot.schema.models.ConversationsResult; +import com.microsoft.bot.schema.models.PagedMembersResult; import com.microsoft.bot.connector.models.ErrorResponseException; import com.microsoft.bot.schema.models.ResourceResponse; +import com.microsoft.bot.schema.models.Transcript; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -515,7 +517,7 @@ This is slightly different from SendToConversation(). /** * GetConversationMembers. - * Enumerate the members of a converstion. + * Enumerate the members of a conversation. This REST API takes a ConversationId and returns an array of ChannelAccount objects representing the members of the conversation. * * @param conversationId Conversation ID @@ -526,7 +528,7 @@ This is slightly different from SendToConversation(). /** * DeleteConversationMember. - * Deletes a member from a converstion. + * Deletes a member from a conversation. This REST API takes a ConversationId and a memberId (of type string) and removes that member from the conversation. If that member was the last member of the conversation, the conversation will also be deleted. * @@ -540,7 +542,7 @@ This REST API takes a ConversationId and a memberId (of type string) and removes /** * DeleteConversationMember. - * Deletes a member from a converstion. + * Deletes a member from a conversation. This REST API takes a ConversationId and a memberId (of type string) and removes that member from the conversation. If that member was the last member of the conversation, the conversation will also be deleted. * @@ -554,7 +556,7 @@ This REST API takes a ConversationId and a memberId (of type string) and removes /** * DeleteConversationMember. - * Deletes a member from a converstion. + * Deletes a member from a conversation. This REST API takes a ConversationId and a memberId (of type string) and removes that member from the conversation. If that member was the last member of the conversation, the conversation will also be deleted. * @@ -567,7 +569,7 @@ This REST API takes a ConversationId and a memberId (of type string) and removes /** * DeleteConversationMember. - * Deletes a member from a converstion. + * Deletes a member from a conversation. This REST API takes a ConversationId and a memberId (of type string) and removes that member from the conversation. If that member was the last member of the conversation, the conversation will also be deleted. * @@ -684,4 +686,163 @@ This REST API takes a ConversationId and a memberId (of type string) and removes */ Observable> uploadAttachmentWithServiceResponseAsync(String conversationId, AttachmentData attachmentUpload); -} + + /** + * This method allows you to upload the historic activities to the conversation. + * + * Sender must ensure that the historic activities have unique ids and appropriate timestamps. + * The ids are used by the client to deal with duplicate activities and the timestamps are used by + * the client to render the activities in the right order. + * + * @param conversationId Conversation ID + * @param history Historic activities + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceResponse object if successful. + */ + ResourceResponse sendConversationHistory(String conversationId, Transcript history); + + /** + * This method allows you to upload the historic activities to the conversation. + * + * Sender must ensure that the historic activities have unique ids and appropriate timestamps. + * The ids are used by the client to deal with duplicate activities and the timestamps are used by + * the client to render the activities in the right order. + * + * @param conversationId Conversation ID + * @param history Historic activities + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceResponse object if successful. + */ + ServiceFuture sendConversationHistoryAsync(String conversationId, Transcript history, final ServiceCallback serviceCallback); + + /** + * This method allows you to upload the historic activities to the conversation. + * + * Sender must ensure that the historic activities have unique ids and appropriate timestamps. + * The ids are used by the client to deal with duplicate activities and the timestamps are used by + * the client to render the activities in the right order. + * + * @param conversationId Conversation ID + * @param history Historic activities + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceResponse object if successful. + */ + Observable sendConversationHistoryAsync(String conversationId, Transcript history); + + /** + * This method allows you to upload the historic activities to the conversation. + * + * Sender must ensure that the historic activities have unique ids and appropriate timestamps. + * The ids are used by the client to deal with duplicate activities and the timestamps are used by + * the client to render the activities in the right order. + * + * @param conversationId Conversation ID + * @param history Historic activities + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceResponse object if successful. + */ + Observable> sendConversationHistoryWithServiceResponseAsync(String conversationId, Transcript history); + + /** + * Enumerate the members of a conversation one page at a time. + * + * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. + * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members + * of the conversation and a continuation token that can be used to get more values. + * + * One page of ChannelAccounts records are returned with each call. The number of records in a page may + * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no + * additional results the response will not contain a continuation token. If there are no members in the + * conversation the Members will be empty or not present in the response. + * + * A response to a request that has a continuation token from a prior request may rarely return members + * from a previous request. + * + * @param conversationId Conversation ID + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedMembersResult object if successful. + */ + PagedMembersResult getConversationPagedMembers(String conversationId); + + /** + * Enumerate the members of a conversation one page at a time. + * + * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. + * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members + * of the conversation and a continuation token that can be used to get more values. + * + * One page of ChannelAccounts records are returned with each call. The number of records in a page may + * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no + * additional results the response will not contain a continuation token. If there are no members in the + * conversation the Members will be empty or not present in the response. + * + * A response to a request that has a continuation token from a prior request may rarely return members + * from a previous request. + * + * @param conversationId Conversation ID + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedMembersResult object if successful. + */ + ServiceFuture getConversationPagedMembersAsync(String conversationId, final ServiceCallback serviceCallback); + + /** + * Enumerate the members of a conversation one page at a time. + * + * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. + * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members + * of the conversation and a continuation token that can be used to get more values. + * + * One page of ChannelAccounts records are returned with each call. The number of records in a page may + * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no + * additional results the response will not contain a continuation token. If there are no members in the + * conversation the Members will be empty or not present in the response. + * + * A response to a request that has a continuation token from a prior request may rarely return members + * from a previous request. + * + * @param conversationId Conversation ID + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedMembersResult object if successful. + */ + Observable getConversationPagedMembersAsync(String conversationId); + + /** + * Enumerate the members of a conversation one page at a time. + * + * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. + * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members + * of the conversation and a continuation token that can be used to get more values. + * + * One page of ChannelAccounts records are returned with each call. The number of records in a page may + * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no + * additional results the response will not contain a continuation token. If there are no members in the + * conversation the Members will be empty or not present in the response. + * + * A response to a request that has a continuation token from a prior request may rarely return members + * from a previous request. + * + * @param conversationId Conversation ID + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the observable to the ResourceResponse object + */ + Observable> getConversationPagedMembersWithServiceResponseAsync(String conversationId); + + } diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConversationsImpl.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConversationsImpl.java index b8889cec5..489bd43b1 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConversationsImpl.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConversationsImpl.java @@ -18,8 +18,10 @@ import com.microsoft.bot.schema.models.ConversationParameters; import com.microsoft.bot.schema.models.ConversationResourceResponse; import com.microsoft.bot.schema.models.ConversationsResult; +import com.microsoft.bot.schema.models.PagedMembersResult; import com.microsoft.bot.connector.models.ErrorResponseException; import com.microsoft.bot.schema.models.ResourceResponse; +import com.microsoft.bot.schema.models.Transcript; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -109,6 +111,13 @@ interface ConversationsService { @POST("v3/conversations/{conversationId}/attachments") Observable> uploadAttachment(@Path("conversationId") String conversationId, @Body AttachmentData attachmentUpload, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.bot.schema.Conversations sendConversationHistory" }) + @POST("v3/conversations/{conversationId}/activities/history") + Observable> sendConversationHistory(@Path("conversationId") String conversationId, @Body Transcript history, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.bot.schema.Conversations getConversationPagedMembers" }) + @GET("v3/conversations/{conversationId}/pagedmembers") + Observable> getConversationPagedMembers(@Path("conversationId") String conversationId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } public static CompletableFuture> completableFutureFromObservable(Observable observable) { @@ -133,6 +142,7 @@ public static CompletableFuture> completableFutureFromObservable(Obs * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ConversationsResult object if successful. */ + @Override public ConversationsResult getConversations() { return getConversationsWithServiceResponseAsync().toBlocking().single().body(); } @@ -149,6 +159,7 @@ public ConversationsResult getConversations() { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ + @Override public ServiceFuture getConversationsAsync(final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(getConversationsWithServiceResponseAsync(), serviceCallback); } @@ -164,6 +175,7 @@ public ServiceFuture getConversationsAsync(final ServiceCal * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ConversationsResult object */ + @Override public Observable getConversationsAsync() { return getConversationsWithServiceResponseAsync().map(new Func1, ConversationsResult>() { @Override @@ -184,6 +196,7 @@ public ConversationsResult call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ConversationsResult object */ + @Override public Observable> getConversationsWithServiceResponseAsync() { final String continuationToken = null; return service.getConversations(continuationToken, this.client.acceptLanguage(), this.client.userAgent()) @@ -214,6 +227,7 @@ public Observable> call(Response getConversationsAsync(String continuationToken, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(getConversationsWithServiceResponseAsync(continuationToken), serviceCallback); } @@ -247,6 +262,7 @@ public ServiceFuture getConversationsAsync(String continuat * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ConversationsResult object */ + @Override public Observable getConversationsAsync(String continuationToken) { return getConversationsWithServiceResponseAsync(continuationToken).map(new Func1, ConversationsResult>() { @Override @@ -268,6 +284,7 @@ public ConversationsResult call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ConversationsResult object */ + @Override public Observable> getConversationsWithServiceResponseAsync(String continuationToken) { return service.getConversations(continuationToken, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @@ -311,6 +328,7 @@ private ServiceResponse getConversationsDelegate(Response createConversationAsync(ConversationParameters parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(createConversationWithServiceResponseAsync(parameters), serviceCallback); } @@ -358,6 +377,7 @@ public ServiceFuture createConversationAsync(Conve * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ConversationResourceResponse object */ + @Override public Observable createConversationAsync(ConversationParameters parameters) { return createConversationWithServiceResponseAsync(parameters).map(new Func1, ConversationResourceResponse>() { @Override @@ -392,6 +412,7 @@ public CompletableFuture> CreateConversationA * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ConversationResourceResponse object */ + @Override public Observable> createConversationWithServiceResponseAsync(ConversationParameters parameters) { if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); @@ -436,6 +457,7 @@ This is slightly different from ReplyToActivity(). * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ResourceResponse object if successful. */ + @Override public ResourceResponse sendToConversation(String conversationId, Activity activity) { return sendToConversationWithServiceResponseAsync(conversationId, activity).toBlocking().single().body(); } @@ -455,6 +477,7 @@ This is slightly different from ReplyToActivity(). * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ + @Override public ServiceFuture sendToConversationAsync(String conversationId, Activity activity, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(sendToConversationWithServiceResponseAsync(conversationId, activity), serviceCallback); } @@ -473,6 +496,7 @@ This is slightly different from ReplyToActivity(). * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResourceResponse object */ + @Override public Observable sendToConversationAsync(String conversationId, Activity activity) { return sendToConversationWithServiceResponseAsync(conversationId, activity).map(new Func1, ResourceResponse>() { @Override @@ -496,6 +520,7 @@ This is slightly different from ReplyToActivity(). * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResourceResponse object */ + @Override public Observable> sendToConversationWithServiceResponseAsync(String conversationId, Activity activity) { if (conversationId == null) { throw new IllegalArgumentException("Parameter conversationId is required and cannot be null."); @@ -541,6 +566,7 @@ private ServiceResponse sendToConversationDelegate(Response updateActivityAsync(String conversationId, String activityId, Activity activity, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(updateActivityWithServiceResponseAsync(conversationId, activityId, activity), serviceCallback); } @@ -574,6 +601,7 @@ public ServiceFuture updateActivityAsync(String conversationId * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResourceResponse object */ + @Override public Observable updateActivityAsync(String conversationId, String activityId, Activity activity) { return updateActivityWithServiceResponseAsync(conversationId, activityId, activity).map(new Func1, ResourceResponse>() { @Override @@ -595,6 +623,7 @@ public ResourceResponse call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResourceResponse object */ + @Override public Observable> updateActivityWithServiceResponseAsync(String conversationId, String activityId, Activity activity) { if (conversationId == null) { throw new IllegalArgumentException("Parameter conversationId is required and cannot be null."); @@ -646,6 +675,7 @@ This is slightly different from SendToConversation(). * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ResourceResponse object if successful. */ + @Override public ResourceResponse replyToActivity(String conversationId, String activityId, Activity activity) { return replyToActivityWithServiceResponseAsync(conversationId, activityId, activity).toBlocking().single().body(); } @@ -666,6 +696,7 @@ This is slightly different from SendToConversation(). * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ + @Override public ServiceFuture replyToActivityAsync(String conversationId, String activityId, Activity activity, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(replyToActivityWithServiceResponseAsync(conversationId, activityId, activity), serviceCallback); } @@ -685,6 +716,7 @@ This is slightly different from SendToConversation(). * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResourceResponse object */ + @Override public Observable replyToActivityAsync(String conversationId, String activityId, Activity activity) { return replyToActivityWithServiceResponseAsync(conversationId, activityId, activity).map(new Func1, ResourceResponse>() { @Override @@ -709,6 +741,7 @@ This is slightly different from SendToConversation(). * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResourceResponse object */ + @Override public Observable> replyToActivityWithServiceResponseAsync(String conversationId, String activityId, Activity activity) { if (conversationId == null) { throw new IllegalArgumentException("Parameter conversationId is required and cannot be null."); @@ -754,6 +787,7 @@ private ServiceResponse replyToActivityDelegate(Response deleteActivityAsync(String conversationId, String activityId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteActivityWithServiceResponseAsync(conversationId, activityId), serviceCallback); } @@ -783,6 +818,7 @@ public ServiceFuture deleteActivityAsync(String conversationId, String act * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ + @Override public Observable deleteActivityAsync(String conversationId, String activityId) { return deleteActivityWithServiceResponseAsync(conversationId, activityId).map(new Func1, Void>() { @Override @@ -802,6 +838,7 @@ public Void call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ + @Override public Observable> deleteActivityWithServiceResponseAsync(String conversationId, String activityId) { if (conversationId == null) { throw new IllegalArgumentException("Parameter conversationId is required and cannot be null."); @@ -842,6 +879,7 @@ private ServiceResponse deleteActivityDelegate(Response resp * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List<ChannelAccount> object if successful. */ + @Override public List getConversationMembers(String conversationId) { return getConversationMembersWithServiceResponseAsync(conversationId).toBlocking().single().body(); } @@ -856,6 +894,7 @@ public List getConversationMembers(String conversationId) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ + @Override public ServiceFuture> getConversationMembersAsync(String conversationId, final ServiceCallback> serviceCallback) { return ServiceFuture.fromResponse(getConversationMembersWithServiceResponseAsync(conversationId), serviceCallback); } @@ -869,6 +908,7 @@ public ServiceFuture> getConversationMembersAsync(String co * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<ChannelAccount> object */ + @Override public Observable> getConversationMembersAsync(String conversationId) { return getConversationMembersWithServiceResponseAsync(conversationId).map(new Func1>, List>() { @Override @@ -887,6 +927,7 @@ public List call(ServiceResponse> response) * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<ChannelAccount> object */ + @Override public Observable>> getConversationMembersWithServiceResponseAsync(String conversationId) { if (conversationId == null) { throw new IllegalArgumentException("Parameter conversationId is required and cannot be null."); @@ -924,6 +965,7 @@ This REST API takes a ConversationId and a memberId (of type string) and removes * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ + @Override public void deleteConversationMember(String conversationId, String memberId) { deleteConversationMemberWithServiceResponseAsync(conversationId, memberId).toBlocking().single().body(); } @@ -940,6 +982,7 @@ This REST API takes a ConversationId and a memberId (of type string) and removes * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ + @Override public ServiceFuture deleteConversationMemberAsync(String conversationId, String memberId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteConversationMemberWithServiceResponseAsync(conversationId, memberId), serviceCallback); } @@ -955,6 +998,7 @@ This REST API takes a ConversationId and a memberId (of type string) and removes * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ + @Override public Observable deleteConversationMemberAsync(String conversationId, String memberId) { return deleteConversationMemberWithServiceResponseAsync(conversationId, memberId).map(new Func1, Void>() { @Override @@ -978,6 +1022,7 @@ public CompletableFuture> deleteConversationMemberFuture(String conve CompletableFuture> future_result = completableFutureFromObservable(deleteConversationMemberAsync(conversationId, memberId)); return future_result; } + /** * DeleteConversationMember. * Deletes a member from a converstion. @@ -989,6 +1034,7 @@ This REST API takes a ConversationId and a memberId (of type string) and removes * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ + @Override public Observable> deleteConversationMemberWithServiceResponseAsync(String conversationId, String memberId) { if (conversationId == null) { throw new IllegalArgumentException("Parameter conversationId is required and cannot be null."); @@ -1031,6 +1077,7 @@ private ServiceResponse deleteConversationMemberDelegate(Response getActivityMembers(String conversationId, String activityId) { return getActivityMembersWithServiceResponseAsync(conversationId, activityId).toBlocking().single().body(); } @@ -1046,6 +1093,7 @@ public List getActivityMembers(String conversationId, String act * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ + @Override public ServiceFuture> getActivityMembersAsync(String conversationId, String activityId, final ServiceCallback> serviceCallback) { return ServiceFuture.fromResponse(getActivityMembersWithServiceResponseAsync(conversationId, activityId), serviceCallback); } @@ -1060,6 +1108,7 @@ public ServiceFuture> getActivityMembersAsync(String conver * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<ChannelAccount> object */ + @Override public Observable> getActivityMembersAsync(String conversationId, String activityId) { return getActivityMembersWithServiceResponseAsync(conversationId, activityId).map(new Func1>, List>() { @Override @@ -1079,6 +1128,7 @@ public List call(ServiceResponse> response) * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<ChannelAccount> object */ + @Override public Observable>> getActivityMembersWithServiceResponseAsync(String conversationId, String activityId) { if (conversationId == null) { throw new IllegalArgumentException("Parameter conversationId is required and cannot be null."); @@ -1120,6 +1170,7 @@ private ServiceResponse> getActivityMembersDelegate(Respons * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ResourceResponse object if successful. */ + @Override public ResourceResponse uploadAttachment(String conversationId, AttachmentData attachmentUpload) { return uploadAttachmentWithServiceResponseAsync(conversationId, attachmentUpload).toBlocking().single().body(); } @@ -1136,6 +1187,7 @@ public ResourceResponse uploadAttachment(String conversationId, AttachmentData a * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ + @Override public ServiceFuture uploadAttachmentAsync(String conversationId, AttachmentData attachmentUpload, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(uploadAttachmentWithServiceResponseAsync(conversationId, attachmentUpload), serviceCallback); } @@ -1151,6 +1203,7 @@ public ServiceFuture uploadAttachmentAsync(String conversation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResourceResponse object */ + @Override public Observable uploadAttachmentAsync(String conversationId, AttachmentData attachmentUpload) { return uploadAttachmentWithServiceResponseAsync(conversationId, attachmentUpload).map(new Func1, ResourceResponse>() { @Override @@ -1171,6 +1224,7 @@ public ResourceResponse call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResourceResponse object */ + @Override public Observable> uploadAttachmentWithServiceResponseAsync(String conversationId, AttachmentData attachmentUpload) { if (conversationId == null) { throw new IllegalArgumentException("Parameter conversationId is required and cannot be null."); @@ -1202,4 +1256,246 @@ private ServiceResponse uploadAttachmentDelegate(Response sendConversationHistoryAsync(String conversationId, Transcript history, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(sendConversationHistoryWithServiceResponseAsync(conversationId, history), serviceCallback); + } + + /** + * This method allows you to upload the historic activities to the conversation. + * + * Sender must ensure that the historic activities have unique ids and appropriate timestamps. + * The ids are used by the client to deal with duplicate activities and the timestamps are used by + * the client to render the activities in the right order. + * + * @param conversationId Conversation ID + * @param history Historic activities + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceResponse object if successful. + */ + @Override + public Observable sendConversationHistoryAsync(String conversationId, Transcript history) { + return sendConversationHistoryWithServiceResponseAsync(conversationId, history).map(new Func1, ResourceResponse>() { + @Override + public ResourceResponse call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method allows you to upload the historic activities to the conversation. + * + * Sender must ensure that the historic activities have unique ids and appropriate timestamps. + * The ids are used by the client to deal with duplicate activities and the timestamps are used by + * the client to render the activities in the right order. + * + * @param conversationId Conversation ID + * @param history Historic activities + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceResponse object if successful. + */ + @Override + public Observable> sendConversationHistoryWithServiceResponseAsync(String conversationId, Transcript history) { + if (conversationId == null) { + throw new IllegalArgumentException("Parameter conversationId is required and cannot be null."); + } + if (history == null) { + throw new IllegalArgumentException("Parameter history is required and cannot be null."); + } + Validator.validate(history); + return service.sendConversationHistory(conversationId, history, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = sendConversationHistoryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse sendConversationHistoryDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + + /** + * Enumerate the members of a conversation one page at a time. + * + * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. + * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members + * of the conversation and a continuation token that can be used to get more values. + * + * One page of ChannelAccounts records are returned with each call. The number of records in a page may + * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no + * additional results the response will not contain a continuation token. If there are no members in the + * conversation the Members will be empty or not present in the response. + * + * A response to a request that has a continuation token from a prior request may rarely return members + * from a previous request. + * + * @param conversationId Conversation ID + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedMembersResult object if successful. + */ + @Override + public PagedMembersResult getConversationPagedMembers(String conversationId){ + return getConversationPagedMembersWithServiceResponseAsync(conversationId).toBlocking().single().body(); + } + + /** + * Enumerate the members of a conversation one page at a time. + * + * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. + * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members + * of the conversation and a continuation token that can be used to get more values. + * + * One page of ChannelAccounts records are returned with each call. The number of records in a page may + * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no + * additional results the response will not contain a continuation token. If there are no members in the + * conversation the Members will be empty or not present in the response. + * + * A response to a request that has a continuation token from a prior request may rarely return members + * from a previous request. + * + * @param conversationId Conversation ID + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedMembersResult object if successful. + */ + @Override + public ServiceFuture getConversationPagedMembersAsync(String conversationId, final ServiceCallback serviceCallback){ + return ServiceFuture.fromResponse(getConversationPagedMembersWithServiceResponseAsync(conversationId), serviceCallback); + } + + /** + * Enumerate the members of a conversation one page at a time. + * + * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. + * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members + * of the conversation and a continuation token that can be used to get more values. + * + * One page of ChannelAccounts records are returned with each call. The number of records in a page may + * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no + * additional results the response will not contain a continuation token. If there are no members in the + * conversation the Members will be empty or not present in the response. + * + * A response to a request that has a continuation token from a prior request may rarely return members + * from a previous request. + * + * @param conversationId Conversation ID + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedMembersResult object if successful. + */ + @Override + public Observable getConversationPagedMembersAsync(String conversationId){ + return getConversationPagedMembersWithServiceResponseAsync(conversationId).map(new Func1, PagedMembersResult>() { + @Override + public PagedMembersResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enumerate the members of a conversation one page at a time. + * + * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. + * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members + * of the conversation and a continuation token that can be used to get more values. + * + * One page of ChannelAccounts records are returned with each call. The number of records in a page may + * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no + * additional results the response will not contain a continuation token. If there are no members in the + * conversation the Members will be empty or not present in the response. + * + * A response to a request that has a continuation token from a prior request may rarely return members + * from a previous request. + * + * @param conversationId Conversation ID + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the observable to the ResourceResponse object + */ + @Override + public Observable> getConversationPagedMembersWithServiceResponseAsync(String conversationId){ + if (conversationId == null) { + throw new IllegalArgumentException("Parameter conversationId is required and cannot be null."); + } + return service.getConversationPagedMembers(conversationId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getConversationPagedMembersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getConversationPagedMembersDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + } diff --git a/libraries/bot-connector/src/test/java/com/microsoft/bot/connector/ConversationsTest.java b/libraries/bot-connector/src/test/java/com/microsoft/bot/connector/ConversationsTest.java index fdc6b5eef..97f03d82c 100644 --- a/libraries/bot-connector/src/test/java/com/microsoft/bot/connector/ConversationsTest.java +++ b/libraries/bot-connector/src/test/java/com/microsoft/bot/connector/ConversationsTest.java @@ -139,6 +139,30 @@ public void GetConversationMembersWithInvalidConversationId() { } } + @Test + public void GetConversationPagedMembers(){ + ConversationParameters createMessage = new ConversationParameters() + .withMembers(Collections.singletonList(user)) + .withBot(bot); + + ConversationResourceResponse conversation = connector.conversations().createConversation(createMessage); + + try { + PagedMembersResult pagedMembers = connector.conversations().getConversationPagedMembers(conversation.id()); + + boolean hasUser = false; + for(ChannelAccount member : pagedMembers.members()){ + hasUser = member.id().equalsIgnoreCase(user.id()); + if(hasUser) + break; + } + + Assert.assertTrue(hasUser); + } catch (ErrorResponseException e) { + Assert.assertEquals("ServiceError", e.body().error().code().toString()); + } + } + @Test public void SendToConversation() { diff --git a/libraries/bot-connector/src/test/resources/session-records/GetConversationPagedMembers.json b/libraries/bot-connector/src/test/resources/session-records/GetConversationPagedMembers.json new file mode 100644 index 000000000..56cc6a79e --- /dev/null +++ b/libraries/bot-connector/src/test/resources/session-records/GetConversationPagedMembers.json @@ -0,0 +1,53 @@ +{ + "networkCallRecords": [ + { + "Uri": "https://slack.botframework.com/v3/conversations", + "Method": "POST", + "Body": "{\r\n \"bot\": {\r\n \"id\": \"B21UTEF8S:T03CWQ0QB\"\r\n },\r\n \"members\": [\r\n {\r\n \"id\": \"U19KH8EHJ:T03CWQ0QB\"\r\n }\r\n ]\r\n}", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e47c26c664df3d17fb33da29e81da7dc1985b292e3d49ee55b301a3f3f92046 Java:1.8.0_151 (BotConnector, 3.0)" + }, + "Response":{ + "date" : "Fri, 29 Dec 2017 18:30:31 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "vary" : "Accept-Encoding", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000", + "request-context" : "appId=cid-v1:6814484e-c0d5-40ea-9dba-74ff29ca4f62", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "Content-Length" : "45", + "Body" : "{\r\n \"id\": \"B21UTEF8S:T03CWQ0QB:DD6UM0YHW\"\r\n}" + } + }, + { + "Uri": "https://slack.botframework.com/v3/conversations/B21UTEF8S%3AT03CWQ0QB%3ADD6UM0YHW/pagedmembers", + "Method": "GET", + "Body": "", + "Headers" : { + "User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:9e47c26c664df3d17fb33da29e81da7dc1985b292e3d49ee55b301a3f3f92046 Java:1.8.0_151 (BotConnector, 3.0)" + }, + "Response":{ + "date" : "Fri, 29 Dec 2017 18:30:31 GMT", + "server" : "Microsoft-IIS/10.0", + "expires" : "-1", + "vary" : "Accept-Encoding", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "strict-transport-security" : "max-age=31536000", + "request-context" : "appId=cid-v1:6814484e-c0d5-40ea-9dba-74ff29ca4f62", + "x-powered-by" : "ASP.NET", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "Content-Length" : "185", + "Body" : "{\r\n \"members\": [\r\n {\r\n \"id\": \"B21UTEF8S:T03CWQ0QB\",\r\n \"name\": \"botframeworktest\"\r\n },\r\n {\r\n \"id\": \"U3Z9ZUDK5:T03CWQ0QB\",\r\n \"name\": \"juan.ar\"\r\n }\r\n ]\r\n}" + } + } + ], + "variables" : [ ] +} \ No newline at end of file diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ActivityImpl.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ActivityImpl.java index 756deb39d..07bc030e6 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ActivityImpl.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ActivityImpl.java @@ -189,13 +189,6 @@ public static ConversationUpdateActivity CreateConversationUpdateActivity() { */ //public static TypingActivity CreateTypingActivity() { return new Activity(ActivityTypes.Typing); } - /** - * Create an instance of the Activity class with Activity masking - */ - public static Activity CreatePingActivity() { - return new Activity().withType(ActivityTypes.PING); - } - /** * Create an instance of the Activity class with IEndOfConversationActivity masking */ diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ActionTypes.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ActionTypes.java index b98b531a8..d083a3e07 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ActionTypes.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ActionTypes.java @@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * Defines values for ActionTypes. + * Defines action types for clickable buttons. */ public enum ActionTypes { /** Enum value openUrl. */ diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Activity.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Activity.java index a92e134ae..c39dd41bb 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Activity.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Activity.java @@ -35,51 +35,65 @@ public class Activity { private ActivityTypes type; /** - * ID of this activity. + * Contains an ID that uniquely identifies the activity on the channel. */ @JsonProperty(value = "id") private String id; /** - * UTC Time when message was sent (set by service). + * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format. */ @JsonProperty(value = "timestamp") private DateTime timestamp; /** - * Local time when message was sent (set by client, Ex: - * 2016-09-23T13:07:49.4714686-07:00). + * Contains the local date and time of the message, expressed in ISO-8601 format. + * For example, 2016-09-23T13:07:49.4714686-07:00. */ @JsonProperty(value = "localTimestamp") private DateTime localTimestamp; /** - * Service endpoint where operations concerning the activity may be - * performed. + * Contains the name of the local timezone of the message, expressed in IANA Time Zone database format. + * For example, America/Los_Angeles. + */ + @JsonProperty(value = "localTimezone") + private String localTimezone; + + /** + * A string containing an IRI identifying the caller of a bot. This field is not intended to be transmitted + * over the wire, but is instead populated by bots and clients based on cryptographically verifiable data + * that asserts the identity of the callers (e.g. tokens). + */ + @JsonProperty(value = "callerId") + private String callerId; + + /** + * Contains the URL that specifies the channel's service endpoint. Set by the channel. */ @JsonProperty(value = "serviceUrl") private String serviceUrl; /** - * ID of the channel where the activity was sent. + * Contains an ID that uniquely identifies the channel. Set by the channel. */ @JsonProperty(value = "channelId") private String channelId; /** - * Sender address. + * Identifies the sender of the message. */ @JsonProperty(value = "from") private ChannelAccount from; /** - * Conversation. + * Identifies the conversation to which the activity belongs. */ @JsonProperty(value = "conversation") private ConversationAccount conversation; /** - * (Outbound to bot only) Bot's address that received the message. + * Identifies the recipient of the message. */ @JsonProperty(value = "recipient") private ChannelAccount recipient; @@ -92,82 +106,84 @@ public class Activity { private TextFormatTypes textFormat; /** - * Hint for how to deal with multiple attachments. Default:list. Possible - * values include: 'list', 'carousel'. + * The layout hint for multiple attachments. Default: list. */ @JsonProperty(value = "attachmentLayout") private AttachmentLayoutTypes attachmentLayout; /** - * Members added to the conversation. + * The collection of members added to the conversation. */ @JsonProperty(value = "membersAdded") private List membersAdded; /** - * Members removed from the conversation. + * The collection of members removed from the conversation. */ @JsonProperty(value = "membersRemoved") private List membersRemoved; /** - * Reactions added to the activity. + * The collection of reactions added to the conversation. */ @JsonProperty(value = "reactionsAdded") private List reactionsAdded; /** - * Reactions removed from the activity. + * The collection of reactions removed from the conversation. */ @JsonProperty(value = "reactionsRemoved") private List reactionsRemoved; /** - * The conversation's updated topic name. + * The updated topic name of the conversation. */ @JsonProperty(value = "topicName") private String topicName; /** - * True if prior history of the channel is disclosed. + * Indicates whether the prior history of the channel is disclosed. */ @JsonProperty(value = "historyDisclosed") private Boolean historyDisclosed; /** - * The language code of the Text field. + * A locale name for the contents of the text field. + * The locale name is a combination of an ISO 639 two- or three-letter culture code associated with a language + * and an ISO 3166 two-letter subculture code associated with a country or region. + * + * The locale name can also correspond to a valid BCP-47 language tag. */ @JsonProperty(value = "locale") private String locale; /** - * Content for the message. + * The text content of the message. */ @JsonProperty(value = "text") private String text; /** - * SSML Speak for TTS audio response. + * The text to speak. */ @JsonProperty(value = "speak") private String speak; /** - * Input hint to the channel on what the bot is expecting. Possible values - * include: 'acceptingInput', 'ignoringInput', 'expectingInput'. + * Indicates whether your bot is accepting, expecting, or ignoring user input after the message + * is delivered to the client. */ @JsonProperty(value = "inputHint") private InputHints inputHint; /** - * Text to display if the channel cannot render cards. + * The text to display if the channel cannot render cards. */ @JsonProperty(value = "summary") private String summary; /** - * SuggestedActions are used to provide keyboard/quickreply like behavior - * in many clients. + * The suggested actions for the activity. */ @JsonProperty(value = "suggestedActions") private SuggestedActions suggestedActions; @@ -179,92 +195,93 @@ public class Activity { private List attachments; /** - * Collection of Entity objects, each of which contains metadata about this - * activity. Each Entity object is typed. + * Represents the entities that were mentioned in the message. */ @JsonProperty(value = "entities") private List entities; /** - * Channel-specific payload. + * Contains channel-specific content. */ @JsonProperty(value = "channelData") private Object channelData; /** - * ContactAdded/Removed action. + * Indicates whether the recipient of a contactRelationUpdate was added or removed from the sender's contact list. */ @JsonProperty(value = "action") private String action; /** - * The original ID this message is a response to. + * Contains the ID of the message to which this message is a reply. */ @JsonProperty(value = "replyToId") private String replyToId; /** - * Descriptive label. + * A descriptive label for the activity. */ @JsonProperty(value = "label") private String label; /** - * Unique string which identifies the shape of the value object. + * The type of the activity's value object. */ @JsonProperty(value = "valueType") private String valueType; /** - * Open-ended value. + * A value that is associated with the activity. */ @JsonProperty(value = "value") private Object value; /** - * Name of the operation to invoke or the name of the event. + * The name of the operation associated with an invoke or event activity. */ @JsonProperty(value = "name") private String name; /** - * Reference to another conversation or activity. + * A reference to another conversation or activity. */ @JsonProperty(value = "relatesTo") private ConversationReference relatesTo; /** - * Code indicating why the conversation has ended. Possible values include: - * 'unknown', 'completedSuccessfully', 'userCancelled', 'botTimedOut', - * 'botIssuedInvalidMessage', 'channelFailed'. + * The a code for endOfConversation activities that indicates why the conversation ended. */ @JsonProperty(value = "code") private EndOfConversationCodes code; /** - * DateTime to expire the activity as ISO 8601 encoded datetime. + * The time at which the activity should be considered to be expired and should not be presented to the recipient. */ @JsonProperty(value = "expiration") private DateTime expiration; /** - * Importance of this activity - * {Low|Normal|High}, null value indicates Normal importance see - * ActivityImportance). + * The importance of the activity. */ @JsonProperty(value = "importance") private String importance; /** - * Hint to describe how this activity should be delivered. - * Currently: null or "Default" = default delivery - * "Notification" = notification semantics. + * A delivery hint to signal to the recipient alternate delivery paths for the activity. + * + * The default delivery mode is \"default\". */ @JsonProperty(value = "deliveryMode") private String deliveryMode; /** - * TextHighlight in the activity represented in the ReplyToId property. + * List of phrases and references that speech and language priming systems should listen for. + */ + @JsonProperty(value = "listenFor") + private List listenFor; + + /** + * The collection of text fragments to highlight when the activity contains a ReplyToId value. */ @JsonProperty(value = "textHighlights") private List textHighlights; @@ -349,6 +366,41 @@ public Activity withLocalTimestamp(DateTime localTimestamp) { return this; } + /** + * Gets the localTimezone. + * + * @return The name of the local timezone of the message, expressed in IANA Time Zone database format. + */ + public String localTimezone(){ + return this.localTimezone; + } + + /** + * Sets the localTimezone. + * @param localTimezone The name of the local timezone of the message, expressed in IANA Time Zone database format. + */ + public Activity withLocalTimeZone(String localTimezone){ + this.localTimezone = localTimezone; + return this; + } + + /** + * Gets the callerId + */ + public String callerId(){ + return this.callerId; + } + + /** + * Sets the callerId + * + * @param callerId A string containing an IRI identifying the caller of a bot. + */ + public Activity withCallerId(String callerId){ + this.callerId = callerId; + return this; + } + /** * Get the serviceUrl value. * @@ -1009,6 +1061,21 @@ public Activity withDeliveryMode(String deliveryMode) { return this; } + /** + * Gets listenFor value. + */ + public List listenFor(){ + return this.listenFor; + } + + /** + * Sets listenFor value on this object. + */ + public Activity withListenFor(List listenFor){ + this.listenFor = listenFor; + return this; + } + /** * Get the textHighlights value. * diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ActivityTypes.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ActivityTypes.java index 2aaa7b41c..ad01428c4 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ActivityTypes.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ActivityTypes.java @@ -29,9 +29,6 @@ public enum ActivityTypes { /** Enum value typing. */ TYPING("typing"), - /** Enum value ping. */ - PING("ping"), - /** Enum value endOfConversation. */ END_OF_CONVERSATION("endOfConversation"), @@ -60,7 +57,10 @@ public enum ActivityTypes { SUGGESTION("suggestion"), /** Enum value trace. */ - TRACE("trace"); + TRACE("trace"), + + /** Enum value handoff. */ + HANDOFF("handoff"); /** The actual serialized value for a ActivityTypes instance. */ private String value; diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AnimationCard.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AnimationCard.java index 281b8d407..c0ecd11e2 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AnimationCard.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AnimationCard.java @@ -42,7 +42,7 @@ public class AnimationCard { private ThumbnailUrl image; /** - * Media URLs for this card. + * Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content. */ @JsonProperty(value = "media") private List media; @@ -79,6 +79,12 @@ public class AnimationCard { @JsonProperty(value = "aspect") private String aspect; + /** + * Describes the length of the media content without requiring a receiver to open the content. Formatted as an ISO 8601 Duration field. + */ + @JsonProperty(value = "duration") + private String duration; + /** * Supplementary parameter for this card. */ @@ -285,6 +291,24 @@ public AnimationCard withAspect(String aspect) { return this; } + /** + * Gets the duration value. + */ + public String duration(){ + return this.duration; + } + + /** + * Sets the duration value. + * + * @param duration the duration value to set + * @return the AnimationCard object itself. + */ + public AnimationCard withDuration(String duration){ + this.duration = duration; + return this; + } + /** * Get the value value. * diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AttachmentView.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AttachmentView.java index 4102a8ae5..3717a005a 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AttachmentView.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AttachmentView.java @@ -17,13 +17,13 @@ */ public class AttachmentView { /** - * Content type of the attachment. + * Id of the attachment. */ @JsonProperty(value = "viewId") private String viewId; /** - * Name of the attachment. + * Size of the attachment. */ @JsonProperty(value = "size") private Integer size; diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AudioCard.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AudioCard.java index 9dcd5b672..d1c015bb7 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AudioCard.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/AudioCard.java @@ -42,7 +42,7 @@ public class AudioCard { private ThumbnailUrl image; /** - * Media URLs for this card. + * Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content. */ @JsonProperty(value = "media") private List media; @@ -79,6 +79,12 @@ public class AudioCard { @JsonProperty(value = "aspect") private String aspect; + /** + * Describes the length of the media content without requiring a receiver to open the content. Formatted as an ISO 8601 Duration field. + */ + @JsonProperty(value = "duration") + private String duration; + /** * Supplementary parameter for this card. */ @@ -285,6 +291,24 @@ public AudioCard withAspect(String aspect) { return this; } + /** + * Gets the duration value. + */ + public String duration(){ + return this.duration; + } + + /** + * Sets the duration value. + * + * @param duration the duration value to set + * @return the AudioCard object itself. + */ + public AudioCard withDuration(String duration){ + this.duration = duration; + return this; + } + /** * Get the value value. * diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/CardAction.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/CardAction.java index 3271237ad..af7af9ebc 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/CardAction.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/CardAction.java @@ -55,6 +55,12 @@ public class CardAction { @JsonProperty(value = "value") private Object value; + /** + * Channel-specific data associated with this action. + */ + @JsonProperty(value = "channelData") + private Object channelData; + /** * Get the type value. * @@ -175,4 +181,21 @@ public CardAction withValue(Object value) { return this; } + /** + * Gets the channelData value. + */ + public Object channelData(){ + return this.channelData; + } + + /** + * Sets the channelData value. + * + * @param channelData The channelData object to set. + * @return the CardAction object itself. + */ + public CardAction withChannelData(Object channelData){ + this.channelData = channelData; + return this; + } } diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ChannelAccount.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ChannelAccount.java index 1b7f22cf1..6e01acbad 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ChannelAccount.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ChannelAccount.java @@ -32,6 +32,12 @@ public class ChannelAccount { @JsonProperty(value = "name") private String name; + /** + * This account's object ID within Azure Active Directory (AAD) + */ + @JsonProperty(value = "aadObjectId") + private String aadObjectId; + /** * Role of the entity behind the account (Example: User, Bot, etc.). * Possible values include: 'user', 'bot'. @@ -133,5 +139,18 @@ public void setProperties(String key, JsonNode value) { this.properties.put(key, value); } + /** + * Gets aadObjectId + */ + public String aadObjectId(){ + return this.aadObjectId; + } + /** + * Sets aadObjectId + */ + public ChannelAccount withAadObjectId(String aadObjectId){ + this.aadObjectId = aadObjectId; + return this; + } } diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationAccount.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationAccount.java index 46f83368c..6007737f2 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationAccount.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationAccount.java @@ -13,7 +13,7 @@ import java.util.HashMap; /** - * Channel account information for a conversation. + * Conversation account represents the identity of the conversation within a channel. */ public class ConversationAccount { /** @@ -30,6 +30,12 @@ public class ConversationAccount { @JsonProperty(value = "conversationType") private String conversationType; + /** + * This conversation's tenant ID. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + /** * Channel id for the user or bot on this channel (Example: joe@smith.com, * or @joesmith or 123456). @@ -43,6 +49,12 @@ public class ConversationAccount { @JsonProperty(value = "name") private String name; + /** + * This account's object ID within Azure Active Directory (AAD). + */ + @JsonProperty(value = "aadObjectId") + private String aadObjectId; + /** * Role of the entity behind the account (Example: User, Bot, etc.). * Possible values include: 'user', 'bot'. @@ -90,6 +102,24 @@ public ConversationAccount withConversationType(String conversationType) { return this; } + /** + * Gets this conversation's tenant ID. + */ + public String tenantId(){ + return this.tenantId; + } + + /** + * Sets this conversation's tenant ID. + * + * @param tenantId this conversation's tenant ID + * @return the ConversationAccount object itself. + */ + public ConversationAccount withTenantId(String tenantId){ + this.tenantId = tenantId; + return this; + } + /** * Get the id value. * @@ -130,6 +160,24 @@ public ConversationAccount withName(String name) { return this; } + /** + * Gets this account's object ID within Azure Active Directory (AAD). + */ + public String aadObjectId(){ + return this.aadObjectId; + } + + /** + * Sets this account's object ID within Azure Active Directory (AAD). + + * @param name the AAD ID to set + * @return the ConversationAccount object itself. + */ + public ConversationAccount withAadObjectId(String aadObjectId){ + this.aadObjectId = aadObjectId; + return this; + } + /** * Get the role value. * diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationParameters.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationParameters.java index 1aca99625..dc7a39b70 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationParameters.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationParameters.java @@ -41,6 +41,12 @@ public class ConversationParameters { @JsonProperty(value = "topicName") private String topicName; + /** + * (Optional) The tenant ID in which the conversation should be created. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + /** * (Optional) When creating a new conversation, use this activity as the * intial message to the conversation. @@ -174,4 +180,18 @@ public ConversationParameters withChannelData(Object channelData) { return this; } + /** + * Gets tenantId + */ + public String tenantId(){ + return this.tenantId; + } + + /** + * Sets tenantId + */ + public ConversationParameters withTenantId(String tenantId){ + this.tenantId = tenantId; + return this; + } } diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/DeliveryModes.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/DeliveryModes.java new file mode 100644 index 000000000..251b63875 --- /dev/null +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/DeliveryModes.java @@ -0,0 +1,56 @@ +/** + * 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. + */ + +package com.microsoft.bot.schema.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Values for deliveryMode field. + */ +public enum DeliveryModes { + /** Enum value normal. */ + NORMAL("normal"), + + /** Enum value notification. */ + NOTIFICATION("notification"); + + + /** The actual serialized value for a DeliveryModes instance. */ + private String value; + + DeliveryModes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ActivityTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed ActivityTypes object, or null if unable to parse. + */ + @JsonCreator + public static DeliveryModes fromString(String value) { + DeliveryModes[] items = DeliveryModes.values(); + for (DeliveryModes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Entity.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Entity.java index 23aa3c71b..4d202a7ac 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Entity.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Entity.java @@ -13,11 +13,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Object of schema.org types. + * Metadata object pertaining to an activity */ public class Entity { /** - * Entity Type (typically from schema.org types). + * Type of this entity (RFC 3987 IRI). */ @JsonProperty(value = "type") private String type; diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Error.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Error.java index c2976b46e..f8c567165 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Error.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Error.java @@ -28,6 +28,12 @@ public class Error { @JsonProperty(value = "message") private String message; + /** + * Error from inner http call + */ + @JsonProperty(value = "innerHttpError") + private InnerHttpError innerHttpError; + /** * Get the code value. * @@ -68,4 +74,18 @@ public Error withMessage(String message) { return this; } + /** + * Gets error from inner http call. + */ + public InnerHttpError innerHttpError(){ + return this.innerHttpError; + } + + /** + * Sets error from inner http call. + */ + public Error withInnerHttpError(InnerHttpError innerHttpError){ + this.innerHttpError = innerHttpError; + return this; + } } diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/InnerHttpError.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/InnerHttpError.java new file mode 100644 index 000000000..82df998af --- /dev/null +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/InnerHttpError.java @@ -0,0 +1,66 @@ +/** + * 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. + */ + +package com.microsoft.bot.schema.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object representing inner http error. + */ +public class InnerHttpError { + /** + * HttpStatusCode from failed request. + */ + @JsonProperty(value = "statusCode") + private int statusCode; + + /** + * Body from failed request. + */ + @JsonProperty(value = "body") + private Object body; + + /** + * Gets HttpStatusCode from failed request. + * + * @return the statusCode value + */ + public int statusCode() { + return this.statusCode; + } + + /** + * Sets HttpStatusCode from failed request. + * + * @param activities the activities value to set + * @return the InnerHttpError object itself. + */ + public InnerHttpError withStatusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Gets Body from failed request. + */ + public Object body(){ + return this.body; + } + + /** + * Sets Body from failed request. + * @param body The body to set + */ + public InnerHttpError withBody(Object body){ + this.body = body; + return this; + } +} diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MediaCard.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MediaCard.java index e1e8e32a2..f6807422e 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MediaCard.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MediaCard.java @@ -42,7 +42,7 @@ public class MediaCard { private ThumbnailUrl image; /** - * Media URLs for this card. + * Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content. */ @JsonProperty(value = "media") private List media; @@ -79,6 +79,12 @@ public class MediaCard { @JsonProperty(value = "aspect") private String aspect; + /** + * Describes the length of the media content without requiring a receiver to open the content. Formatted as an ISO 8601 Duration field. + */ + @JsonProperty(value = "duration") + private String duration; + /** * Supplementary parameter for this card. */ @@ -285,6 +291,24 @@ public MediaCard withAspect(String aspect) { return this; } + /** + * Gets the duration value. + */ + public String duration(){ + return this.duration; + } + + /** + * Sets the duration value. + * + * @param duration the duration value to set + * @return the MediaCard object itself. + */ + public MediaCard withDuration(String duration){ + this.duration = duration; + return this; + } + /** * Get the value value. * diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Mention.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Mention.java index c5afff496..3369c5d15 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Mention.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Mention.java @@ -27,7 +27,7 @@ public class Mention extends EntityImpl { private String text; /** - * Entity Type (typically from schema.org types). + * Type of this entity (RFC 3987 IRI). */ @JsonProperty(value = "type") private String type; diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MicrosoftPayMethodData.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MicrosoftPayMethodData.java index f7af4db11..47adc58cf 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MicrosoftPayMethodData.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MicrosoftPayMethodData.java @@ -20,8 +20,8 @@ public class MicrosoftPayMethodData { /** * Microsoft Pay Merchant ID. */ - @JsonProperty(value = "mechantId") - private String mechantId; + @JsonProperty(value = "merchantId") + private String merchantId; /** * Supported payment networks (e.g., "visa" and "mastercard"). @@ -36,22 +36,22 @@ public class MicrosoftPayMethodData { private List supportedTypes; /** - * Get the mechantId value. + * Get the merchantId value. * - * @return the mechantId value + * @return the merchantId value */ - public String mechantId() { - return this.mechantId; + public String merchantId() { + return this.merchantId; } /** - * Set the mechantId value. + * Set the merchantId value. * - * @param mechantId the mechantId value to set + * @param merchantId the merchantId value to set * @return the MicrosoftPayMethodData object itself. */ - public MicrosoftPayMethodData withMechantId(String mechantId) { - this.mechantId = mechantId; + public MicrosoftPayMethodData withMerchantId(String merchantId) { + this.merchantId = merchantId; return this; } diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/PagedMembersResult.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/PagedMembersResult.java new file mode 100644 index 000000000..70ea3270e --- /dev/null +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/PagedMembersResult.java @@ -0,0 +1,66 @@ +/** + * 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. + */ + +package com.microsoft.bot.schema.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Page of members + */ +public class PagedMembersResult { + + @JsonProperty(value = "continuationToken") + private String continuationToken; + + /** + * List of members in this conversation. + */ + @JsonProperty(value = "members") + private List members; + + /** + * Gets paging token + */ + public String continuationToken(){ + return this.continuationToken; + } + + /** + * Sets paging token + * + * @return the PagedMembersResult object itself. + */ + public PagedMembersResult withContinuationToken(String continuationToken){ + this.continuationToken = continuationToken; + return this; + } + + /** + * Gets the Channel Accounts. + * + * @return the members value + */ + public List members() { + return this.members; + } + + /** + * Sets the Channel Accounts. + * + * @param members the members value to set + * @return the PagedMembersResult object itself. + */ + public PagedMembersResult withMembers(List members) { + this.members = members; + return this; + } +} diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/RoleTypes.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/RoleTypes.java index dc5b8282c..9f3df0cfc 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/RoleTypes.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/RoleTypes.java @@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * Defines values for RoleTypes. + * Role of the entity behind the account (Example: User, Bot, etc.). */ public enum RoleTypes { /** Enum value user. */ diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/SemanticAction.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/SemanticAction.java new file mode 100644 index 000000000..3ff660474 --- /dev/null +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/SemanticAction.java @@ -0,0 +1,69 @@ +/** + * 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. + */ + +package com.microsoft.bot.schema.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a reference to a programmatic action + */ +public class SemanticAction { + /** + * ID of this action. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Entities associated with this action. + */ + @JsonProperty(value = "entities") + Map entities; + + /** + * Gets ID of this action. + */ + public String id(){ + return this.id; + } + + /** + * Sets ID of this action. + * + * @param id ID of this action + * @return The SemanticAction object itself. + */ + public SemanticAction withId(String id){ + this.id = id; + return this; + } + + /** + * Gets entities associated with this action. + * + * @return the activities value + */ + public Map entities() { + return this.entities; + } + + /** + * Sets entities associated with this action. + * + * @param entities + * @return The SemanticAction object itself. + */ + public SemanticAction withEntities(Map entities){ + this.entities = entities; + return this; + } +} diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/SemanticActionStates.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/SemanticActionStates.java new file mode 100644 index 000000000..baf80ee7b --- /dev/null +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/SemanticActionStates.java @@ -0,0 +1,59 @@ +/** + * 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. + */ + +package com.microsoft.bot.schema.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Indicates whether the semantic action is starting, continuing, or done. + */ +public enum SemanticActionStates { + /** Enum value start. */ + START("start"), + + /** Enum value continue. */ + CONTINUE("continue"), + + /** Enum value done. */ + DONE("done"); + + + /** The actual serialized value for a SemanticActionStates instance. */ + private String value; + + SemanticActionStates(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ActivityTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed ActivityTypes object, or null if unable to parse. + */ + @JsonCreator + public static SemanticActionStates fromString(String value) { + SemanticActionStates[] items = SemanticActionStates.values(); + for (SemanticActionStates item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/TextHighlight.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/TextHighlight.java index c357b853b..41b1d13fa 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/TextHighlight.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/TextHighlight.java @@ -13,17 +13,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The TextHighlight model. + * Refers to a substring of content within another field. */ public class TextHighlight { /** - * plain text fragment to highlight. + * Defines the snippet of text to highlight. */ @JsonProperty(value = "text") private String text; /** - * index of occurence of the Text (Starting at 1). + * Occurrence of the text field within the referenced text, if multiple exist. */ @JsonProperty(value = "occurence") private Integer occurence; diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/TokenResponse.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/TokenResponse.java index 970407fd8..955c0f046 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/TokenResponse.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/TokenResponse.java @@ -16,6 +16,12 @@ * A response that includes a user token. */ public class TokenResponse { + /** + * The channelId of the TokenResponse. + */ + @JsonProperty(value = "channelId") + private String channelId; + /** * The connection name. */ @@ -34,6 +40,24 @@ public class TokenResponse { @JsonProperty(value = "expiration") private String expiration; + /** + * Gets the channelId value. + */ + public String channelId(){ + return this.channelId; + } + + /** + * Sets the channelId value. + * + * @param channelId The channel id to set. + * @return the TokenResponse object itself. + */ + public TokenResponse withChannelId(String channelId){ + this.channelId = channelId; + return this; + } + /** * Get the connectionName value. * diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Transcript.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Transcript.java new file mode 100644 index 000000000..9e14df073 --- /dev/null +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/Transcript.java @@ -0,0 +1,45 @@ +/** + * 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. + */ + +package com.microsoft.bot.schema.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A collection of Activities that conforms to the Transcript schema. + */ +public class Transcript { + /** + * List of members in this conversation. + */ + @JsonProperty(value = "activities") + private List activities; + + /** + * Gets collection of Activities that conforms to the Transcript schema. + * + * @return the activities value + */ + public List activities() { + return this.activities; + } + + /** + * Sets collection of Activities that conforms to the Transcript schema. + * + * @param activities the activities value to set + * @return the Transcript object itself. + */ + public Transcript withActivities(List activities) { + this.activities = activities; + return this; + } +} diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/VideoCard.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/VideoCard.java index ff98f042c..628a0b1ba 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/VideoCard.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/VideoCard.java @@ -42,7 +42,7 @@ public class VideoCard { private ThumbnailUrl image; /** - * Media URLs for this card. + * Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content. */ @JsonProperty(value = "media") private List media; @@ -79,6 +79,12 @@ public class VideoCard { @JsonProperty(value = "aspect") private String aspect; + /** + * Describes the length of the media content without requiring a receiver to open the content. Formatted as an ISO 8601 Duration field. + */ + @JsonProperty(value = "duration") + private String duration; + /** * Supplementary parameter for this card. */ @@ -285,6 +291,24 @@ public VideoCard withAspect(String aspect) { return this; } + /** + * Gets the duration value. + */ + public String duration(){ + return this.duration; + } + + /** + * Sets the duration value. + * + * @param duration the duration value to set + * @return the VideoCard object itself. + */ + public VideoCard withDuration(String duration){ + this.duration = duration; + return this; + } + /** * Get the value value. * diff --git a/libraries/swagger/ConnectorAPI.json b/libraries/swagger/ConnectorAPI.json index e64ba630a..827186e12 100644 --- a/libraries/swagger/ConnectorAPI.json +++ b/libraries/swagger/ConnectorAPI.json @@ -1,2439 +1,2674 @@ { - "swagger": "2.0", - "info": { - "version": "v3", - "title": "Microsoft Bot Connector API - v3.0", - "description": "The Bot Connector REST API allows your bot to send and receive messages to channels configured in the\r\n[Bot Framework Developer Portal](https://dev.botframework.com). The Connector service uses industry-standard REST\r\nand JSON over HTTPS.\r\n\r\nClient libraries for this REST API are available. See below for a list.\r\n\r\nMany bots will use both the Bot Connector REST API and the associated [Bot State REST API](/en-us/restapi/state). The\r\nBot State REST API allows a bot to store and retrieve state associated with users and conversations.\r\n\r\nAuthentication for both the Bot Connector and Bot State REST APIs is accomplished with JWT Bearer tokens, and is\r\ndescribed in detail in the [Connector Authentication](/en-us/restapi/authentication) document.\r\n\r\n# Client Libraries for the Bot Connector REST API\r\n\r\n* [Bot Builder for C#](/en-us/csharp/builder/sdkreference/)\r\n* [Bot Builder for Node.js](/en-us/node/builder/overview/)\r\n* Generate your own from the [Connector API Swagger file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector.Shared/Swagger/ConnectorAPI.json)\r\n\r\n© 2016 Microsoft", - "termsOfService": "https://www.microsoft.com/en-us/legal/intellectualproperty/copyright/default.aspx", - "contact": { - "name": "Bot Framework", - "url": "https://botframework.com", - "email": "botframework@microsoft.com" - }, - "license": { - "name": "The MIT License (MIT)", - "url": "https://opensource.org/licenses/MIT" - } - }, - "host": "api.botframework.com", - "schemes": [ - "https" - ], - "paths": { - "/v3/attachments/{attachmentId}": { - "get": { - "tags": [ - "Attachments" - ], - "summary": "GetAttachmentInfo", - "description": "Get AttachmentInfo structure describing the attachment views", - "operationId": "Attachments_GetAttachmentInfo", - "consumes": [ - - ], - "produces": [ - "application/json", - "text/json", - "application/xml", - "text/xml" - ], - "parameters": [ - { - "name": "attachmentId", - "in": "path", - "description": "attachment id", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "An attachmentInfo object is returned which describes the:\r\n* type of the attachment\r\n* name of the attachment\r\n\r\n\r\nand an array of views:\r\n* Size - size of the object\r\n* ViewId - View Id which can be used to fetch a variation on the content (ex: original or thumbnail)", - "schema": { - "$ref": "#/definitions/AttachmentInfo" - } - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/v3/attachments/{attachmentId}/views/{viewId}": { - "get": { - "tags": [ - "Attachments" - ], - "summary": "GetAttachment", - "description": "Get the named view as binary content", - "operationId": "Attachments_GetAttachment", - "consumes": [ - - ], - "produces": [ - "application/json", - "text/json", - "application/xml", - "text/xml" - ], - "parameters": [ - { - "name": "attachmentId", - "in": "path", - "description": "attachment id", - "required": true, - "type": "string" - }, - { - "name": "viewId", - "in": "path", - "description": "View id from attachmentInfo", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Attachment stream", - "schema": { - "format": "byte", - "type": "file" - } - }, - "301": { - "description": "The Location header describes where the content is now." - }, - "302": { - "description": "The Location header describes where the content is now." - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/v3/conversations": { - "get": { - "tags": [ - "Conversations" - ], - "summary": "GetConversations", - "description": "List the Conversations in which this bot has participated.\r\n\r\nGET from this method with a skip token\r\n\r\nThe return value is a ConversationsResult, which contains an array of ConversationMembers and a skip token. If the skip token is not empty, then \r\nthere are further values to be returned. Call this method again with the returned token to get more values.\r\n\r\nEach ConversationMembers object contains the ID of the conversation and an array of ChannelAccounts that describe the members of the conversation.", - "operationId": "Conversations_GetConversations", - "consumes": [ - - ], - "produces": [ - "application/json", - "text/json", - "application/xml", - "text/xml" - ], - "parameters": [ - { - "name": "continuationToken", - "in": "query", - "description": "skip or continuation token", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "An object will be returned containing \r\n* an array (Conversations) of ConversationMembers objects\r\n* a continuation token\r\n\r\nEach ConversationMembers object contains:\r\n* the Id of the conversation\r\n* an array (Members) of ChannelAccount objects", - "schema": { - "$ref": "#/definitions/ConversationsResult" - } - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "post": { - "tags": [ - "Conversations" - ], - "summary": "CreateConversation", - "description": "Create a new Conversation.\r\n\r\nPOST to this method with a\r\n* Bot being the bot creating the conversation\r\n* IsGroup set to true if this is not a direct message (default is false)\r\n* Members array contining the members you want to have be in the conversation.\r\n\r\nThe return value is a ResourceResponse which contains a conversation id which is suitable for use\r\nin the message payload and REST API uris.\r\n\r\nMost channels only support the semantics of bots initiating a direct message conversation. An example of how to do that would be:\r\n\r\n```\r\nvar resource = await connector.conversations.CreateConversation(new ConversationParameters(){ Bot = bot, members = new ChannelAccount[] { new ChannelAccount(\"user1\") } );\r\nawait connect.Conversations.SendToConversationAsync(resource.Id, new Activity() ... ) ;\r\n\r\n```", - "operationId": "Conversations_CreateConversation", - "consumes": [ - "application/json", - "text/json", - "application/xml", - "text/xml", - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json", - "text/json", - "application/xml", - "text/xml" - ], - "parameters": [ - { - "name": "parameters", - "in": "body", - "description": "Parameters to create the conversation from", - "required": true, - "schema": { - "$ref": "#/definitions/ConversationParameters" - } - } - ], - "responses": { - "200": { - "description": "An object will be returned containing \r\n* the ID for the conversation\r\n* ActivityId for the activity if provided. If ActivityId is null then the channel doesn't support returning resource id's for activity.", - "schema": { - "$ref": "#/definitions/ConversationResourceResponse" - } - }, - "201": { - "description": "An object will be returned containing \r\n* the ID for the conversation\r\n* ActivityId for the activity if provided. If ActivityId is null then the channel doesn't support returning resource id's for activity.", - "schema": { - "$ref": "#/definitions/ConversationResourceResponse" - } - }, - "202": { - "description": "An object will be returned containing \r\n* the ID for the conversation\r\n* ActivityId for the activity if provided. If ActivityId is null then the channel doesn't support returning resource id's for activity.", - "schema": { - "$ref": "#/definitions/ConversationResourceResponse" - } - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/v3/conversations/{conversationId}/activities": { - "post": { - "tags": [ - "Conversations" - ], - "summary": "SendToConversation", - "description": "This method allows you to send an activity to the end of a conversation.\r\n\r\nThis is slightly different from ReplyToActivity().\r\n* SendToConverstion(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel.\r\n* 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.\r\n\r\nUse ReplyToActivity when replying to a specific activity in the conversation.\r\n\r\nUse SendToConversation in all other cases.", - "operationId": "Conversations_SendToConversation", - "consumes": [ - "application/json", - "text/json", - "application/xml", - "text/xml", - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "conversationId", - "in": "path", - "description": "Conversation ID", - "required": true, - "type": "string" - }, - { - "name": "activity", - "in": "body", - "description": "Activity to send", - "required": true, - "schema": { - "$ref": "#/definitions/Activity" - } - } - ], - "responses": { - "200": { - "description": "An object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "201": { - "description": "A ResourceResponse object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "202": { - "description": "An object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/v3/conversations/{conversationId}/activities/{activityId}": { - "put": { - "tags": [ - "Conversations" - ], - "summary": "UpdateActivity", - "description": "Edit an existing activity.\r\n\r\nSome channels allow you to edit an existing activity to reflect the new state of a bot conversation.\r\n\r\nFor example, you can remove buttons after someone has clicked \"Approve\" button.", - "operationId": "Conversations_UpdateActivity", - "consumes": [ - "application/json", - "text/json", - "application/xml", - "text/xml", - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "conversationId", - "in": "path", - "description": "Conversation ID", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "in": "path", - "description": "activityId to update", - "required": true, - "type": "string" - }, - { - "name": "activity", - "in": "body", - "description": "replacement Activity", - "required": true, - "schema": { - "$ref": "#/definitions/Activity" - } - } - ], - "responses": { - "200": { - "description": "An object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "201": { - "description": "A ResourceResponse object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "202": { - "description": "An object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "post": { - "tags": [ - "Conversations" - ], - "summary": "ReplyToActivity", - "description": "This method allows you to reply to an activity.\r\n\r\nThis is slightly different from SendToConversation().\r\n* SendToConverstion(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel.\r\n* 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.\r\n\r\nUse ReplyToActivity when replying to a specific activity in the conversation.\r\n\r\nUse SendToConversation in all other cases.", - "operationId": "Conversations_ReplyToActivity", - "consumes": [ - "application/json", - "text/json", - "application/xml", - "text/xml", - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "conversationId", - "in": "path", - "description": "Conversation ID", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "in": "path", - "description": "activityId the reply is to (OPTIONAL)", - "required": true, - "type": "string" - }, - { - "name": "activity", - "in": "body", - "description": "Activity to send", - "required": true, - "schema": { - "$ref": "#/definitions/Activity" - } - } - ], - "responses": { - "200": { - "description": "An object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "201": { - "description": "A ResourceResponse object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "202": { - "description": "An object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "Conversations" - ], - "summary": "DeleteActivity", - "description": "Delete an existing activity.\r\n\r\nSome channels allow you to delete an existing activity, and if successful this method will remove the specified activity.", - "operationId": "Conversations_DeleteActivity", - "consumes": [ - - ], - "produces": [ - "application/json", - "text/json", - "application/xml", - "text/xml" - ], - "parameters": [ - { - "name": "conversationId", - "in": "path", - "description": "Conversation ID", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "in": "path", - "description": "activityId to delete", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The operation succeeded, there is no response." - }, - "202": { - "description": "The request has been accepted for processing, but the processing has not been completed" - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/v3/conversations/{conversationId}/members": { - "get": { - "tags": [ - "Conversations" - ], - "summary": "GetConversationMembers", - "description": "Enumerate the members of a converstion. \r\n\r\nThis REST API takes a ConversationId and returns an array of ChannelAccount objects representing the members of the conversation.", - "operationId": "Conversations_GetConversationMembers", - "consumes": [ - - ], - "produces": [ - "application/json", - "text/json", - "application/xml", - "text/xml" - ], - "parameters": [ - { - "name": "conversationId", - "in": "path", - "description": "Conversation ID", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "An array of ChannelAccount objects", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ChannelAccount" - } - } - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/v3/conversations/{conversationId}/members/{memberId}": { - "delete": { - "tags": [ - "Conversations" - ], - "summary": "DeleteConversationMember", - "description": "Deletes a member from a converstion. \r\n\r\nThis REST API takes a ConversationId and a memberId (of type string) and removes that member from the conversation. If that member was the last member\r\nof the conversation, the conversation will also be deleted.", - "operationId": "Conversations_DeleteConversationMember", - "consumes": [ - - ], - "produces": [ - "application/json", - "text/json", - "application/xml", - "text/xml" - ], - "parameters": [ - { - "name": "conversationId", - "in": "path", - "description": "Conversation ID", - "required": true, - "type": "string" - }, - { - "name": "memberId", - "in": "path", - "description": "ID of the member to delete from this conversation", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The operation succeeded, there is no response." - }, - "204": { - "description": "The operation succeeded but no content was returned." - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/v3/conversations/{conversationId}/activities/{activityId}/members": { - "get": { - "tags": [ - "Conversations" - ], - "summary": "GetActivityMembers", - "description": "Enumerate the members of an activity. \r\n\r\nThis REST API takes a ConversationId and a ActivityId, returning an array of ChannelAccount objects representing the members of the particular activity in the conversation.", - "operationId": "Conversations_GetActivityMembers", - "consumes": [ - - ], - "produces": [ - "application/json", - "text/json", - "application/xml", - "text/xml" - ], - "parameters": [ - { - "name": "conversationId", - "in": "path", - "description": "Conversation ID", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "in": "path", - "description": "Activity ID", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "An array of ChannelAccount objects", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ChannelAccount" - } - } - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/v3/conversations/{conversationId}/attachments": { - "post": { - "tags": [ - "Conversations" - ], - "summary": "UploadAttachment", - "description": "Upload an attachment directly into a channel's blob storage.\r\n\r\nThis is useful because it allows you to store data in a compliant store when dealing with enterprises.\r\n\r\nThe response is a ResourceResponse which contains an AttachmentId which is suitable for using with the attachments API.", - "operationId": "Conversations_UploadAttachment", - "consumes": [ - "application/json", - "text/json", - "application/xml", - "text/xml", - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "conversationId", - "in": "path", - "description": "Conversation ID", - "required": true, - "type": "string" - }, - { - "name": "attachmentUpload", - "in": "body", - "description": "Attachment data", - "required": true, - "schema": { - "$ref": "#/definitions/AttachmentData" - } - } - ], - "responses": { - "200": { - "description": "An object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "201": { - "description": "A ResourceResponse object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "202": { - "description": "An object will be returned containing the ID for the resource.", - "schema": { - "$ref": "#/definitions/ResourceResponse" - } - }, - "default": { - "description": "The operation failed and the response is an error object describing the status code and failure.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } + "swagger": "2.0", + "info": { + "version": "v3", + "title": "Microsoft Bot Connector API - v3.0", + "description": "The Bot Connector REST API allows your bot to send and receive messages to channels configured in the\r\n[Bot Framework Developer Portal](https://dev.botframework.com). The Connector service uses industry-standard REST\r\nand JSON over HTTPS.\r\n\r\nClient libraries for this REST API are available. See below for a list.\r\n\r\nMany bots will use both the Bot Connector REST API and the associated [Bot State REST API](/en-us/restapi/state). The\r\nBot State REST API allows a bot to store and retrieve state associated with users and conversations.\r\n\r\nAuthentication for both the Bot Connector and Bot State REST APIs is accomplished with JWT Bearer tokens, and is\r\ndescribed in detail in the [Connector Authentication](/en-us/restapi/authentication) document.\r\n\r\n# Client Libraries for the Bot Connector REST API\r\n\r\n* [Bot Builder for C#](/en-us/csharp/builder/sdkreference/)\r\n* [Bot Builder for Node.js](/en-us/node/builder/overview/)\r\n* Generate your own from the [Connector API Swagger file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector.Shared/Swagger/ConnectorAPI.json)\r\n\r\n© 2016 Microsoft", + "termsOfService": "https://www.microsoft.com/en-us/legal/intellectualproperty/copyright/default.aspx", + "contact": { + "name": "Bot Framework", + "url": "https://botframework.com", + "email": "botframework@microsoft.com" + }, + "license": { + "name": "The MIT License (MIT)", + "url": "https://opensource.org/licenses/MIT" + } + }, + "host": "api.botframework.com", + "schemes": [ + "https" + ], + "paths": { + "/v3/attachments/{attachmentId}": { + "get": { + "tags": [ + "Attachments" + ], + "summary": "GetAttachmentInfo", + "description": "Get AttachmentInfo structure describing the attachment views", + "operationId": "Attachments_GetAttachmentInfo", + "consumes": [], + "produces": [ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters": [ + { + "name": "attachmentId", + "in": "path", + "description": "attachment id", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "An attachmentInfo object is returned which describes the:\r\n* type of the attachment\r\n* name of the attachment\r\n\r\n\r\nand an array of views:\r\n* Size - size of the object\r\n* ViewId - View Id which can be used to fetch a variation on the content (ex: original or thumbnail)", + "schema": { + "$ref": "#/definitions/AttachmentInfo" + } + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } } + } }, - "definitions": { - "AttachmentInfo": { - "description": "Metdata for an attachment", - "type": "object", - "properties": { - "name": { - "description": "Name of the attachment", - "type": "string" - }, - "type": { - "description": "ContentType of the attachment", - "type": "string" - }, - "views": { - "description": "attachment views", - "type": "array", - "items": { - "$ref": "#/definitions/AttachmentView" - } - } - } - }, - "AttachmentView": { - "description": "Attachment View name and size", - "type": "object", - "properties": { - "viewId": { - "description": "Content type of the attachment", - "type": "string" - }, - "size": { - "format": "int32", - "description": "Name of the attachment", - "type": "integer" - } - } - }, - "ErrorResponse": { - "description": "An HTTP API response", - "type": "object", - "properties": { - "error": { - "$ref": "#/definitions/Error", - "description": "Error message" - } - } - }, - "Error": { - "description": "Object representing error information", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string" - }, - "message": { - "description": "Error message", - "type": "string" - } - } - }, - "ConversationParameters": { - "description": "Parameters for creating a new conversation", - "type": "object", - "properties": { - "isGroup": { - "description": "IsGroup", - "type": "boolean" - }, - "bot": { - "$ref": "#/definitions/ChannelAccount", - "description": "The bot address for this conversation" - }, - "members": { - "description": "Members to add to the conversation", - "type": "array", - "items": { - "$ref": "#/definitions/ChannelAccount" - } - }, - "topicName": { - "description": "(Optional) Topic of the conversation (if supported by the channel)", - "type": "string" - }, - "activity": { - "$ref": "#/definitions/Activity", - "description": "(Optional) When creating a new conversation, use this activity as the intial message to the conversation" - }, - "channelData": { - "description": "Channel specific payload for creating the conversation", - "type": "object" - } - } - }, - "ChannelAccount": { - "description": "Channel account information needed to route a message", - "type": "object", - "properties": { - "id": { - "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or 123456)", - "type": "string" - }, - "name": { - "description": "Display friendly name", - "type": "string" - }, - "role": { - "$ref": "#/definitions/RoleTypes", - "description": "Role of the entity behind the account (Example: User, Bot, etc.)" - } - } - }, - "Activity": { - "description": "An Activity is the basic communication type for the Bot Framework 3.0 protocol", - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/ActivityTypes", - "description": "The type of the activity" - }, - "id": { - "description": "ID of this activity", - "type": "string" - }, - "timestamp": { - "format": "date-time", - "description": "UTC Time when message was sent (set by service)", - "type": "string" - }, - "localTimestamp": { - "format": "date-time", - "description": "Local time when message was sent (set by client, Ex: 2016-09-23T13:07:49.4714686-07:00)", - "type": "string" - }, - "serviceUrl": { - "description": "Service endpoint where operations concerning the activity may be performed", - "type": "string" - }, - "channelId": { - "description": "ID of the channel where the activity was sent", - "type": "string" - }, - "from": { - "$ref": "#/definitions/ChannelAccount", - "description": "Sender address" - }, - "conversation": { - "$ref": "#/definitions/ConversationAccount", - "description": "Conversation" - }, - "recipient": { - "$ref": "#/definitions/ChannelAccount", - "description": "(Outbound to bot only) Bot's address that received the message" - }, - "textFormat": { - "$ref": "#/definitions/TextFormatTypes", - "description": "Format of text fields Default:markdown" - }, - "attachmentLayout": { - "$ref": "#/definitions/AttachmentLayoutTypes", - "description": "Hint for how to deal with multiple attachments. Default:list" - }, - "membersAdded": { - "description": "Members added to the conversation", - "type": "array", - "items": { - "$ref": "#/definitions/ChannelAccount" - } - }, - "membersRemoved": { - "description": "Members removed from the conversation", - "type": "array", - "items": { - "$ref": "#/definitions/ChannelAccount" - } - }, - "reactionsAdded": { - "description": "Reactions added to the activity", - "type": "array", - "items": { - "$ref": "#/definitions/MessageReaction" - } - }, - "reactionsRemoved": { - "description": "Reactions removed from the activity", - "type": "array", - "items": { - "$ref": "#/definitions/MessageReaction" - } - }, - "topicName": { - "description": "The conversation's updated topic name", - "type": "string" - }, - "historyDisclosed": { - "description": "True if prior history of the channel is disclosed", - "type": "boolean" - }, - "locale": { - "description": "The language code of the Text field", - "type": "string" - }, - "text": { - "description": "Content for the message", - "type": "string" - }, - "speak": { - "description": "SSML Speak for TTS audio response", - "type": "string" - }, - "inputHint": { - "$ref": "#/definitions/InputHints", - "description": "Input hint to the channel on what the bot is expecting." - }, - "summary": { - "description": "Text to display if the channel cannot render cards", - "type": "string" - }, - "suggestedActions": { - "$ref": "#/definitions/SuggestedActions", - "description": "SuggestedActions are used to provide keyboard/quickreply like behavior in many clients" - }, - "attachments": { - "description": "Attachments", - "type": "array", - "items": { - "$ref": "#/definitions/Attachment" - } - }, - "entities": { - "description": "Collection of Entity objects, each of which contains metadata about this activity. Each Entity object is typed.", - "type": "array", - "items": { - "$ref": "#/definitions/Entity" - } - }, - "channelData": { - "description": "Channel-specific payload", - "type": "object" - }, - "action": { - "description": "ContactAdded/Removed action", - "type": "string" - }, - "replyToId": { - "description": "The original ID this message is a response to", - "type": "string" - }, - "label": { - "description": "Descriptive label", - "type": "string" - }, - "valueType": { - "description": "Unique string which identifies the shape of the value object", - "type": "string" - }, - "value": { - "description": "Open-ended value", - "type": "object" - }, - "name": { - "description": "Name of the operation to invoke or the name of the event", - "type": "string" - }, - "relatesTo": { - "$ref": "#/definitions/ConversationReference", - "description": "Reference to another conversation or activity" - }, - "code": { - "$ref": "#/definitions/EndOfConversationCodes", - "description": "Code indicating why the conversation has ended" - }, - "expiration": { - "format": "date-time", - "description": "DateTime to expire the activity as ISO 8601 encoded datetime", - "type": "string" - }, - "importance": { - "description": "Importance of this activity \r\n {Low|Normal|High}, null value indicates Normal importance see ActivityImportance)", - "type": "string" - }, - "deliveryMode": { - "description": "Hint to describe how this activity should be delivered. \r\nCurrently: null or \"Default\" = default delivery\r\n\"Notification\" = notification semantics", - "type": "string" - }, - "textHighlights": { - "description": "TextHighlight in the activity represented in the ReplyToId property", - "type": "array", - "items": { - "$ref": "#/definitions/TextHighlight" - } - } - } - }, - "ConversationAccount": { - "description": "Channel account information for a conversation", - "type": "object", - "properties": { - "isGroup": { - "description": "Indicates whether the conversation contains more than two participants at the time the activity was generated", - "type": "boolean" - }, - "conversationType": { - "description": "Indicates the type of the conversation in channels that distinguish between conversation types", - "type": "string" - }, - "id": { - "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or 123456)", - "type": "string" - }, - "name": { - "description": "Display friendly name", - "type": "string" - }, - "role": { - "$ref": "#/definitions/RoleTypes", - "description": "Role of the entity behind the account (Example: User, Bot, etc.)" - } - } - }, - "MessageReaction": { - "description": "Message reaction object", - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/MessageReactionTypes", - "description": "Message reaction type" - } - } - }, - "SuggestedActions": { - "description": "SuggestedActions that can be performed", - "type": "object", - "properties": { - "to": { - "description": "Ids of the recipients that the actions should be shown to. These Ids are relative to the channelId and a subset of all recipients of the activity", - "type": "array", - "items": { - "type": "string" - } - }, - "actions": { - "description": "Actions that can be shown to the user", - "type": "array", - "items": { - "$ref": "#/definitions/CardAction" - } - } - } - }, - "Attachment": { - "description": "An attachment within an activity", - "type": "object", - "properties": { - "contentType": { - "description": "mimetype/Contenttype for the file", - "type": "string" - }, - "contentUrl": { - "description": "Content Url", - "type": "string" - }, - "content": { - "description": "Embedded content", - "type": "object" - }, - "name": { - "description": "(OPTIONAL) The name of the attachment", - "type": "string" - }, - "thumbnailUrl": { - "description": "(OPTIONAL) Thumbnail associated with attachment", - "type": "string" - } - } - }, - "Entity": { - "description": "Object of schema.org types", - "type": "object", - "properties": { - "type": { - "description": "Entity Type (typically from schema.org types)", - "type": "string" - } - } - }, - "ConversationReference": { - "description": "An object relating to a particular point in a conversation", - "type": "object", - "properties": { - "activityId": { - "description": "(Optional) ID of the activity to refer to", - "type": "string" - }, - "user": { - "$ref": "#/definitions/ChannelAccount", - "description": "(Optional) User participating in this conversation" - }, - "bot": { - "$ref": "#/definitions/ChannelAccount", - "description": "Bot participating in this conversation" - }, - "conversation": { - "$ref": "#/definitions/ConversationAccount", - "description": "Conversation reference" - }, - "channelId": { - "description": "Channel ID", - "type": "string" - }, - "serviceUrl": { - "description": "Service endpoint where operations concerning the referenced conversation may be performed", - "type": "string" - } - } - }, - "TextHighlight": { - "description": "", - "type": "object", - "properties": { - "text": { - "description": "plain text fragment to highlight", - "type": "string" - }, - "occurence": { - "format": "int32", - "description": "index of occurence of the Text (Starting at 1)", - "type": "integer" - } - } - }, - "CardAction": { - "description": "A clickable action", - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/ActionTypes", - "description": "The type of action implemented by this button" - }, - "title": { - "description": "Text description which appears on the button", - "type": "string" - }, - "image": { - "description": "Image URL which will appear on the button, next to text label", - "type": "string" - }, - "text": { - "description": "Text for this action", - "type": "string" - }, - "displayText": { - "description": "(Optional) text to display in the chat feed if the button is clicked", - "type": "string" - }, - "value": { - "description": "Supplementary parameter for action. Content of this property depends on the ActionType", - "type": "object" - } - } - }, - "ConversationResourceResponse": { - "description": "A response containing a resource", - "type": "object", - "properties": { - "activityId": { - "description": "ID of the Activity (if sent)", - "type": "string" - }, - "serviceUrl": { - "description": "Service endpoint where operations concerning the conversation may be performed", - "type": "string" - }, - "id": { - "description": "Id of the resource", - "type": "string" - } - } - }, - "ConversationsResult": { - "description": "Conversations result", - "type": "object", - "properties": { - "continuationToken": { - "description": "Paging token", - "type": "string" - }, - "conversations": { - "description": "List of conversations", - "type": "array", - "items": { - "$ref": "#/definitions/ConversationMembers" - } - } - } - }, - "ConversationMembers": { - "description": "Conversation and its members", - "type": "object", - "properties": { - "id": { - "description": "Conversation ID", - "type": "string" - }, - "members": { - "description": "List of members in this conversation", - "type": "array", - "items": { - "$ref": "#/definitions/ChannelAccount" - } - } - } - }, - "ResourceResponse": { - "description": "A response containing a resource ID", - "type": "object", - "properties": { - "id": { - "description": "Id of the resource", - "type": "string" - } - } - }, - "AttachmentData": { + "/v3/attachments/{attachmentId}/views/{viewId}": { + "get": { + "tags": [ + "Attachments" + ], + "summary": "GetAttachment", + "description": "Get the named view as binary content", + "operationId": "Attachments_GetAttachment", + "consumes": [], + "produces": [ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters": [ + { + "name": "attachmentId", + "in": "path", + "description": "attachment id", + "required": true, + "type": "string" + }, + { + "name": "viewId", + "in": "path", + "description": "View id from attachmentInfo", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Attachment stream", + "schema": { + "format": "byte", + "type": "file" + } + }, + "301": { + "description": "The Location header describes where the content is now." + }, + "302": { + "description": "The Location header describes where the content is now." + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/v3/conversations": { + "get": { + "tags": [ + "Conversations" + ], + "summary": "GetConversations", + "description": "List the Conversations in which this bot has participated.\r\n\r\nGET from this method with a skip token\r\n\r\nThe return value is a ConversationsResult, which contains an array of ConversationMembers and a skip token. If the skip token is not empty, then \r\nthere are further values to be returned. Call this method again with the returned token to get more values.\r\n\r\nEach ConversationMembers object contains the ID of the conversation and an array of ChannelAccounts that describe the members of the conversation.", + "operationId": "Conversations_GetConversations", + "consumes": [], + "produces": [ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters": [ + { + "name": "continuationToken", + "in": "query", + "description": "skip or continuation token", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "An object will be returned containing \r\n* an array (Conversations) of ConversationMembers objects\r\n* a continuation token\r\n\r\nEach ConversationMembers object contains:\r\n* the Id of the conversation\r\n* an array (Members) of ChannelAccount objects", + "schema": { + "$ref": "#/definitions/ConversationsResult" + } + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "post": { + "tags": [ + "Conversations" + ], + "summary": "CreateConversation", + "description": "Create a new Conversation.\r\n\r\nPOST to this method with a\r\n* Bot being the bot creating the conversation\r\n* IsGroup set to true if this is not a direct message (default is false)\r\n* Array containing the members to include in the conversation\r\n\r\nThe return value is a ResourceResponse which contains a conversation id which is suitable for use\r\nin the message payload and REST API uris.\r\n\r\nMost channels only support the semantics of bots initiating a direct message conversation. An example of how to do that would be:\r\n\r\n```\r\nvar resource = await connector.conversations.CreateConversation(new ConversationParameters(){ Bot = bot, members = new ChannelAccount[] { new ChannelAccount(\"user1\") } );\r\nawait connect.Conversations.SendToConversationAsync(resource.Id, new Activity() ... ) ;\r\n\r\n```", + "operationId": "Conversations_CreateConversation", + "consumes": [ + "application/json", + "text/json", + "application/xml", + "text/xml", + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters": [ + { + "name": "parameters", + "in": "body", + "description": "Parameters to create the conversation from", + "required": true, + "schema": { + "$ref": "#/definitions/ConversationParameters" + } + } + ], + "responses": { + "200": { + "description": "An object will be returned containing \r\n* the ID for the conversation\r\n* ActivityId for the activity if provided. If ActivityId is null then the channel doesn't support returning resource id's for activity.", + "schema": { + "$ref": "#/definitions/ConversationResourceResponse" + } + }, + "201": { + "description": "An object will be returned containing \r\n* the ID for the conversation\r\n* ActivityId for the activity if provided. If ActivityId is null then the channel doesn't support returning resource id's for activity.", + "schema": { + "$ref": "#/definitions/ConversationResourceResponse" + } + }, + "202": { + "description": "An object will be returned containing \r\n* the ID for the conversation\r\n* ActivityId for the activity if provided. If ActivityId is null then the channel doesn't support returning resource id's for activity.", + "schema": { + "$ref": "#/definitions/ConversationResourceResponse" + } + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/v3/conversations/{conversationId}/activities": { + "post": { + "tags": [ + "Conversations" + ], + "summary": "SendToConversation", + "description": "This method allows you to send an activity to the end of a conversation.\r\n\r\nThis is slightly different from ReplyToActivity().\r\n* SendToConversation(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel.\r\n* 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.\r\n\r\nUse ReplyToActivity when replying to a specific activity in the conversation.\r\n\r\nUse SendToConversation in all other cases.", + "operationId": "Conversations_SendToConversation", + "consumes": [ + "application/json", + "text/json", + "application/xml", + "text/xml", + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "conversationId", + "in": "path", + "description": "Conversation ID", + "required": true, + "type": "string" + }, + { + "name": "activity", + "in": "body", + "description": "Activity to send", + "required": true, + "schema": { + "$ref": "#/definitions/Activity" + } + } + ], + "responses": { + "200": { + "description": "An object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "201": { + "description": "A ResourceResponse object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "202": { + "description": "An object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/v3/conversations/{conversationId}/activities/history": { + "post": { + "tags": [ + "Conversations" + ], + "summary": "SendConversationHistory", + "description": "This method allows you to upload the historic activities to the conversation.\r\n\r\nSender must ensure that the historic activities have unique ids and appropriate timestamps. The ids are used by the client to deal with duplicate activities and the timestamps are used by the client to render the activities in the right order.", + "operationId": "Conversations_SendConversationHistory", + "consumes": [ + "application/json", + "text/json", + "application/xml", + "text/xml", + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "conversationId", + "in": "path", + "description": "Conversation ID", + "required": true, + "type": "string" + }, + { + "name": "history", + "in": "body", + "description": "Historic activities", + "required": true, + "schema": { + "$ref": "#/definitions/Transcript" + } + } + ], + "responses": { + "200": { + "description": "An object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "201": { + "description": "A ResourceResponse object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "202": { + "description": "An object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/v3/conversations/{conversationId}/activities/{activityId}": { + "put": { + "tags": [ + "Conversations" + ], + "summary": "UpdateActivity", + "description": "Edit an existing activity.\r\n\r\nSome channels allow you to edit an existing activity to reflect the new state of a bot conversation.\r\n\r\nFor example, you can remove buttons after someone has clicked \"Approve\" button.", + "operationId": "Conversations_UpdateActivity", + "consumes": [ + "application/json", + "text/json", + "application/xml", + "text/xml", + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "conversationId", + "in": "path", + "description": "Conversation ID", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "description": "activityId to update", + "required": true, + "type": "string" + }, + { + "name": "activity", + "in": "body", + "description": "replacement Activity", + "required": true, + "schema": { + "$ref": "#/definitions/Activity" + } + } + ], + "responses": { + "200": { + "description": "An object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "201": { + "description": "A ResourceResponse object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "202": { + "description": "An object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "post": { + "tags": [ + "Conversations" + ], + "summary": "ReplyToActivity", + "description": "This method allows you to reply to an activity.\r\n\r\nThis is slightly different from SendToConversation().\r\n* SendToConversation(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel.\r\n* 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.\r\n\r\nUse ReplyToActivity when replying to a specific activity in the conversation.\r\n\r\nUse SendToConversation in all other cases.", + "operationId": "Conversations_ReplyToActivity", + "consumes": [ + "application/json", + "text/json", + "application/xml", + "text/xml", + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "conversationId", + "in": "path", + "description": "Conversation ID", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "description": "activityId the reply is to (OPTIONAL)", + "required": true, + "type": "string" + }, + { + "name": "activity", + "in": "body", + "description": "Activity to send", + "required": true, + "schema": { + "$ref": "#/definitions/Activity" + } + } + ], + "responses": { + "200": { + "description": "An object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "201": { + "description": "A ResourceResponse object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "202": { + "description": "An object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Conversations" + ], + "summary": "DeleteActivity", + "description": "Delete an existing activity.\r\n\r\nSome channels allow you to delete an existing activity, and if successful this method will remove the specified activity.", + "operationId": "Conversations_DeleteActivity", + "consumes": [], + "produces": [ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters": [ + { + "name": "conversationId", + "in": "path", + "description": "Conversation ID", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "description": "activityId to delete", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The operation succeeded, there is no response." + }, + "202": { + "description": "The request has been accepted for processing, but the processing has not been completed" + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/v3/conversations/{conversationId}/members": { + "get": { + "tags": [ + "Conversations" + ], + "summary": "GetConversationMembers", + "description": "Enumerate the members of a conversation. \r\n\r\nThis REST API takes a ConversationId and returns an array of ChannelAccount objects representing the members of the conversation.", + "operationId": "Conversations_GetConversationMembers", + "consumes": [], + "produces": [ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters": [ + { + "name": "conversationId", + "in": "path", + "description": "Conversation ID", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "An array of ChannelAccount objects", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ChannelAccount" + } + } + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/v3/conversations/{conversationId}/pagedmembers": { + "get": { + "tags": [ + "Conversations" + ], + "summary": "GetConversationPagedMembers", + "description": "Enumerate the members of a conversation one page at a time.\r\n\r\nThis REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. It returns a PagedMembersResult, which contains an array\r\nof ChannelAccounts representing the members of the conversation and a continuation token that can be used to get more values.\r\n\r\nOne page of ChannelAccounts records are returned with each call. The number of records in a page may vary between channels and calls. The pageSize parameter can be used as \r\na suggestion. If there are no additional results the response will not contain a continuation token. If there are no members in the conversation the Members will be empty or not present in the response.\r\n\r\nA response to a request that has a continuation token from a prior request may rarely return members from a previous request.", + "operationId": "Conversations_GetConversationPagedMembers", + "consumes": [], + "produces": [ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters": [ + { + "name": "conversationId", + "in": "path", + "description": "Conversation ID", + "required": true, + "type": "string" + }, + { + "name": "pageSize", + "in": "query", + "description": "Suggested page size", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "continuationToken", + "in": "query", + "description": "Continuation Token", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/PagedMembersResult" + } + } + } + } + }, + "/v3/conversations/{conversationId}/members/{memberId}": { + "delete": { + "tags": [ + "Conversations" + ], + "summary": "DeleteConversationMember", + "description": "Deletes a member from a conversation. \r\n\r\nThis REST API takes a ConversationId and a memberId (of type string) and removes that member from the conversation. If that member was the last member\r\nof the conversation, the conversation will also be deleted.", + "operationId": "Conversations_DeleteConversationMember", + "consumes": [], + "produces": [ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters": [ + { + "name": "conversationId", + "in": "path", + "description": "Conversation ID", + "required": true, + "type": "string" + }, + { + "name": "memberId", + "in": "path", + "description": "ID of the member to delete from this conversation", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The operation succeeded, there is no response." + }, + "204": { + "description": "The operation succeeded but no content was returned." + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/v3/conversations/{conversationId}/activities/{activityId}/members": { + "get": { + "tags": [ + "Conversations" + ], + "summary": "GetActivityMembers", + "description": "Enumerate the members of an activity. \r\n\r\nThis REST API takes a ConversationId and a ActivityId, returning an array of ChannelAccount objects representing the members of the particular activity in the conversation.", + "operationId": "Conversations_GetActivityMembers", + "consumes": [], + "produces": [ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters": [ + { + "name": "conversationId", + "in": "path", + "description": "Conversation ID", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "description": "Activity ID", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "An array of ChannelAccount objects", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ChannelAccount" + } + } + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/v3/conversations/{conversationId}/attachments": { + "post": { + "tags": [ + "Conversations" + ], + "summary": "UploadAttachment", + "description": "Upload an attachment directly into a channel's blob storage.\r\n\r\nThis is useful because it allows you to store data in a compliant store when dealing with enterprises.\r\n\r\nThe response is a ResourceResponse which contains an AttachmentId which is suitable for using with the attachments API.", + "operationId": "Conversations_UploadAttachment", + "consumes": [ + "application/json", + "text/json", + "application/xml", + "text/xml", + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "conversationId", + "in": "path", + "description": "Conversation ID", + "required": true, + "type": "string" + }, + { + "name": "attachmentUpload", + "in": "body", "description": "Attachment data", - "type": "object", - "properties": { - "type": { - "description": "Content-Type of the attachment", - "type": "string" - }, - "name": { - "description": "Name of the attachment", - "type": "string" - }, - "originalBase64": { - "format": "byte", - "description": "Attachment content", - "type": "string" - }, - "thumbnailBase64": { - "format": "byte", - "description": "Attachment thumbnail", - "type": "string" - } - } - }, - "HeroCard": { - "description": "A Hero card (card with a single, large image)", - "type": "object", - "properties": { - "title": { - "description": "Title of the card", - "type": "string" - }, - "subtitle": { - "description": "Subtitle of the card", - "type": "string" - }, - "text": { - "description": "Text for the card", - "type": "string" - }, - "images": { - "description": "Array of images for the card", - "type": "array", - "items": { - "$ref": "#/definitions/CardImage" - } - }, - "buttons": { - "description": "Set of actions applicable to the current card", - "type": "array", - "items": { - "$ref": "#/definitions/CardAction" - } - }, - "tap": { - "$ref": "#/definitions/CardAction", - "description": "This action will be activated when user taps on the card itself" - } - } - }, - "CardImage": { - "description": "An image on a card", - "type": "object", - "properties": { - "url": { - "description": "URL thumbnail image for major content property", - "type": "string" - }, - "alt": { - "description": "Image description intended for screen readers", - "type": "string" - }, - "tap": { - "$ref": "#/definitions/CardAction", - "description": "Action assigned to specific Attachment" - } - } - }, - "AnimationCard": { - "description": "An animation card (Ex: gif or short video clip)", - "type": "object", - "properties": { - "title": { - "description": "Title of this card", - "type": "string" - }, - "subtitle": { - "description": "Subtitle of this card", - "type": "string" - }, - "text": { - "description": "Text of this card", - "type": "string" - }, - "image": { - "$ref": "#/definitions/ThumbnailUrl", - "description": "Thumbnail placeholder" - }, - "media": { - "description": "Media URLs for this card", - "type": "array", - "items": { - "$ref": "#/definitions/MediaUrl" - } - }, - "buttons": { - "description": "Actions on this card", - "type": "array", - "items": { - "$ref": "#/definitions/CardAction" - } - }, - "shareable": { - "description": "This content may be shared with others (default:true)", - "type": "boolean" - }, - "autoloop": { - "description": "Should the client loop playback at end of content (default:true)", - "type": "boolean" - }, - "autostart": { - "description": "Should the client automatically start playback of media in this card (default:true)", - "type": "boolean" - }, - "aspect": { - "description": "Aspect ratio of thumbnail/media placeholder, allowed values are \"16:9\" and \"4:3\"", - "type": "string" - }, - "value": { - "description": "Supplementary parameter for this card", - "type": "object" - } - } - }, - "ThumbnailUrl": { - "description": "Thumbnail URL", - "type": "object", - "properties": { - "url": { - "description": "URL pointing to the thumbnail to use for media content", - "type": "string" - }, - "alt": { - "description": "HTML alt text to include on this thumbnail image", - "type": "string" - } - } - }, - "MediaUrl": { - "description": "Media URL", - "type": "object", - "properties": { - "url": { - "description": "Url for the media", - "type": "string" - }, - "profile": { - "description": "Optional profile hint to the client to differentiate multiple MediaUrl objects from each other", - "type": "string" - } - } - }, - "AudioCard": { - "description": "Audio card", - "type": "object", - "properties": { - "title": { - "description": "Title of this card", - "type": "string" - }, - "subtitle": { - "description": "Subtitle of this card", - "type": "string" - }, - "text": { - "description": "Text of this card", - "type": "string" - }, - "image": { - "$ref": "#/definitions/ThumbnailUrl", - "description": "Thumbnail placeholder" - }, - "media": { - "description": "Media URLs for this card", - "type": "array", - "items": { - "$ref": "#/definitions/MediaUrl" - } - }, - "buttons": { - "description": "Actions on this card", - "type": "array", - "items": { - "$ref": "#/definitions/CardAction" - } - }, - "shareable": { - "description": "This content may be shared with others (default:true)", - "type": "boolean" - }, - "autoloop": { - "description": "Should the client loop playback at end of content (default:true)", - "type": "boolean" - }, - "autostart": { - "description": "Should the client automatically start playback of media in this card (default:true)", - "type": "boolean" - }, - "aspect": { - "description": "Aspect ratio of thumbnail/media placeholder, allowed values are \"16:9\" and \"4:3\"", - "type": "string" - }, - "value": { - "description": "Supplementary parameter for this card", - "type": "object" - } - } - }, - "BasicCard": { - "description": "A basic card", - "type": "object", - "properties": { - "title": { - "description": "Title of the card", - "type": "string" - }, - "subtitle": { - "description": "Subtitle of the card", - "type": "string" - }, - "text": { - "description": "Text for the card", - "type": "string" - }, - "images": { - "description": "Array of images for the card", - "type": "array", - "items": { - "$ref": "#/definitions/CardImage" - } - }, - "buttons": { - "description": "Set of actions applicable to the current card", - "type": "array", - "items": { - "$ref": "#/definitions/CardAction" - } - }, - "tap": { - "$ref": "#/definitions/CardAction", - "description": "This action will be activated when user taps on the card itself" - } - } - }, - "MediaCard": { - "description": "Media card", - "type": "object", - "properties": { - "title": { - "description": "Title of this card", - "type": "string" - }, - "subtitle": { - "description": "Subtitle of this card", - "type": "string" - }, - "text": { - "description": "Text of this card", - "type": "string" - }, - "image": { - "$ref": "#/definitions/ThumbnailUrl", - "description": "Thumbnail placeholder" - }, - "media": { - "description": "Media URLs for this card", - "type": "array", - "items": { - "$ref": "#/definitions/MediaUrl" - } - }, - "buttons": { - "description": "Actions on this card", - "type": "array", - "items": { - "$ref": "#/definitions/CardAction" - } - }, - "shareable": { - "description": "This content may be shared with others (default:true)", - "type": "boolean" - }, - "autoloop": { - "description": "Should the client loop playback at end of content (default:true)", - "type": "boolean" - }, - "autostart": { - "description": "Should the client automatically start playback of media in this card (default:true)", - "type": "boolean" - }, - "aspect": { - "description": "Aspect ratio of thumbnail/media placeholder, allowed values are \"16:9\" and \"4:3\"", - "type": "string" - }, - "value": { - "description": "Supplementary parameter for this card", - "type": "object" - } - } - }, - "ReceiptCard": { - "description": "A receipt card", - "type": "object", - "properties": { - "title": { - "description": "Title of the card", - "type": "string" - }, - "facts": { - "description": "Array of Fact objects", - "type": "array", - "items": { - "$ref": "#/definitions/Fact" - } - }, - "items": { - "description": "Array of Receipt Items", - "type": "array", - "items": { - "$ref": "#/definitions/ReceiptItem" - } - }, - "tap": { - "$ref": "#/definitions/CardAction", - "description": "This action will be activated when user taps on the card" - }, - "total": { - "description": "Total amount of money paid (or to be paid)", - "type": "string" - }, - "tax": { - "description": "Total amount of tax paid (or to be paid)", - "type": "string" - }, - "vat": { - "description": "Total amount of VAT paid (or to be paid)", - "type": "string" - }, - "buttons": { - "description": "Set of actions applicable to the current card", - "type": "array", - "items": { - "$ref": "#/definitions/CardAction" - } - } - } - }, - "Fact": { - "description": "Set of key-value pairs. Advantage of this section is that key and value properties will be \r\nrendered with default style information with some delimiter between them. So there is no need for developer to specify style information.", - "type": "object", - "properties": { - "key": { - "description": "The key for this Fact", - "type": "string" - }, - "value": { - "description": "The value for this Fact", - "type": "string" - } - } - }, - "ReceiptItem": { - "description": "An item on a receipt card", - "type": "object", - "properties": { - "title": { - "description": "Title of the Card", - "type": "string" - }, - "subtitle": { - "description": "Subtitle appears just below Title field, differs from Title in font styling only", - "type": "string" - }, - "text": { - "description": "Text field appears just below subtitle, differs from Subtitle in font styling only", - "type": "string" - }, - "image": { - "$ref": "#/definitions/CardImage", - "description": "Image" - }, - "price": { - "description": "Amount with currency", - "type": "string" - }, - "quantity": { - "description": "Number of items of given kind", - "type": "string" - }, - "tap": { - "$ref": "#/definitions/CardAction", - "description": "This action will be activated when user taps on the Item bubble." - } - } - }, - "SigninCard": { - "description": "A card representing a request to sign in", - "type": "object", - "properties": { - "text": { - "description": "Text for signin request", - "type": "string" - }, - "buttons": { - "description": "Action to use to perform signin", - "type": "array", - "items": { - "$ref": "#/definitions/CardAction" - } - } - } - }, - "OAuthCard": { - "description": "A card representing a request to peform a sign in via OAuth", - "type": "object", - "properties": { - "text": { - "description": "Text for signin request", - "type": "string" - }, - "connectionName": { - "description": "The name of the registered connection", - "type": "string" - }, - "buttons": { - "description": "Action to use to perform signin", - "type": "array", - "items": { - "$ref": "#/definitions/CardAction" - } - } - } - }, - "ThumbnailCard": { - "description": "A thumbnail card (card with a single, small thumbnail image)", - "type": "object", - "properties": { - "title": { - "description": "Title of the card", - "type": "string" - }, - "subtitle": { - "description": "Subtitle of the card", - "type": "string" - }, - "text": { - "description": "Text for the card", - "type": "string" - }, - "images": { - "description": "Array of images for the card", - "type": "array", - "items": { - "$ref": "#/definitions/CardImage" - } - }, - "buttons": { - "description": "Set of actions applicable to the current card", - "type": "array", - "items": { - "$ref": "#/definitions/CardAction" - } - }, - "tap": { - "$ref": "#/definitions/CardAction", - "description": "This action will be activated when user taps on the card itself" - } - } - }, - "VideoCard": { - "description": "Video card", - "type": "object", - "properties": { - "title": { - "description": "Title of this card", - "type": "string" - }, - "subtitle": { - "description": "Subtitle of this card", - "type": "string" - }, - "text": { - "description": "Text of this card", - "type": "string" - }, - "image": { - "$ref": "#/definitions/ThumbnailUrl", - "description": "Thumbnail placeholder" - }, - "media": { - "description": "Media URLs for this card", - "type": "array", - "items": { - "$ref": "#/definitions/MediaUrl" - } - }, - "buttons": { - "description": "Actions on this card", - "type": "array", - "items": { - "$ref": "#/definitions/CardAction" - } - }, - "shareable": { - "description": "This content may be shared with others (default:true)", - "type": "boolean" - }, - "autoloop": { - "description": "Should the client loop playback at end of content (default:true)", - "type": "boolean" - }, - "autostart": { - "description": "Should the client automatically start playback of media in this card (default:true)", - "type": "boolean" - }, - "aspect": { - "description": "Aspect ratio of thumbnail/media placeholder, allowed values are \"16:9\" and \"4:3\"", - "type": "string" - }, - "value": { - "description": "Supplementary parameter for this card", - "type": "object" - } - } - }, - "GeoCoordinates": { - "description": "GeoCoordinates (entity type: \"https://schema.org/GeoCoordinates\")", - "type": "object", - "properties": { - "elevation": { - "format": "double", - "description": "Elevation of the location [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)", - "type": "number" - }, - "latitude": { - "format": "double", - "description": "Latitude of the location [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)", - "type": "number" - }, - "longitude": { - "format": "double", - "description": "Longitude of the location [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)", - "type": "number" - }, - "type": { - "description": "The type of the thing", - "type": "string" - }, - "name": { - "description": "The name of the thing", - "type": "string" - } - } - }, - "Mention": { - "description": "Mention information (entity type: \"mention\")", - "type": "object", - "properties": { - "mentioned": { - "$ref": "#/definitions/ChannelAccount", - "description": "The mentioned user" - }, - "text": { - "description": "Sub Text which represents the mention (can be null or empty)", - "type": "string" - }, - "type": { - "description": "Entity Type (typically from schema.org types)", - "type": "string" - } - } - }, - "Place": { - "description": "Place (entity type: \"https://schema.org/Place\")", - "type": "object", - "properties": { - "address": { - "description": "Address of the place (may be `string` or complex object of type `PostalAddress`)", - "type": "object" - }, - "geo": { - "description": "Geo coordinates of the place (may be complex object of type `GeoCoordinates` or `GeoShape`)", - "type": "object" - }, - "hasMap": { - "description": "Map to the place (may be `string` (URL) or complex object of type `Map`)", - "type": "object" - }, - "type": { - "description": "The type of the thing", - "type": "string" - }, - "name": { - "description": "The name of the thing", - "type": "string" - } - } - }, - "Thing": { - "description": "Thing (entity type: \"https://schema.org/Thing\")", - "type": "object", - "properties": { - "type": { - "description": "The type of the thing", - "type": "string" - }, - "name": { - "description": "The name of the thing", - "type": "string" - } - } - }, - "MediaEventValue": { - "description": "Supplementary parameter for media events", - "type": "object", - "properties": { - "cardValue": { - "description": "Callback parameter specified in the Value field of the MediaCard that originated this event", - "type": "object" - } - } - }, - "TokenRequest": { - "description": "A request to receive a user token", - "type": "object", - "properties": { - "provider": { - "description": "The provider to request a user token from", - "type": "string" - }, - "settings": { - "description": "A collection of settings for the specific provider for this request", - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - }, - "TokenResponse": { - "description": "A response that includes a user token", - "type": "object", - "properties": { - "connectionName": { - "description": "The connection name", - "type": "string" - }, - "token": { - "description": "The user token", - "type": "string" - }, - "expiration": { - "description": "Expiration for the token, in ISO 8601 format (e.g. \"2007-04-05T14:30Z\")", - "type": "string" - } - } - }, - "ActivityTypes": { - "description": "Types of Activities", - "enum": [ - "message", - "contactRelationUpdate", - "conversationUpdate", - "typing", - "ping", - "endOfConversation", - "event", - "invoke", - "deleteUserData", - "messageUpdate", - "messageDelete", - "installationUpdate", - "messageReaction", - "suggestion", - "trace" - ], - "type": "string", - "properties": { - - }, - "x-ms-enum": { - "name": "ActivityTypes", - "modelAsString": true - } - }, - "AttachmentLayoutTypes": { - "description": "Attachment layout types", - "enum": [ - "list", - "carousel" - ], - "type": "string", - "properties": { - - }, - "x-ms-enum": { - "name": "AttachmentLayoutTypes", - "modelAsString": true - } - }, - "ActionTypes": { - "description": "Types of actions", - "enum": [ - "openUrl", - "imBack", - "postBack", - "playAudio", - "playVideo", - "showImage", - "downloadFile", - "signin", - "call", - "payment", - "messageBack" - ], - "type": "string", - "properties": { - - }, - "x-ms-enum": { - "name": "ActionTypes", - "modelAsString": true - } - }, - "ContactRelationUpdateActionTypes": { - "description": "Action types valid for ContactRelationUpdate activities", - "enum": [ - "add", - "remove" - ], - "type": "string", - "properties": { - - }, - "x-ms-enum": { - "name": "ContactRelationUpdateActionTypes", - "modelAsString": true - } - }, - "InstallationUpdateActionTypes": { - "description": "Action types valid for InstallationUpdate activities", - "enum": [ - "add", - "remove" - ], - "type": "string", - "properties": { - - }, - "x-ms-enum": { - "name": "InstallationUpdateActionTypes", - "modelAsString": true - } - }, - "MessageReactionTypes": { - "description": "Message reaction types", - "enum": [ - "like", - "plusOne" - ], - "type": "string", - "properties": { - - }, - "x-ms-enum": { - "name": "MessageReactionTypes", - "modelAsString": true - } - }, - "TextFormatTypes": { - "description": "Text format types", - "enum": [ - "markdown", - "plain", - "xml" - ], - "type": "string", - "properties": { - - }, - "x-ms-enum": { - "name": "TextFormatTypes", - "modelAsString": true - } - }, - "InputHints": { - "description": "Indicates whether the bot is accepting, expecting, or ignoring input", - "enum": [ - "acceptingInput", - "ignoringInput", - "expectingInput" - ], - "type": "string", - "properties": { - - }, - "x-ms-enum": { - "name": "InputHints", - "modelAsString": true - } - }, - "EndOfConversationCodes": { - "description": "Codes indicating why a conversation has ended", - "enum": [ - "unknown", - "completedSuccessfully", - "userCancelled", - "botTimedOut", - "botIssuedInvalidMessage", - "channelFailed" - ], - "type": "string", - "properties": { - - }, - "x-ms-enum": { - "name": "EndOfConversationCodes", - "modelAsString": true - } - }, - "ActivityImportance": { - "description": "Defines the importance of an Activity", - "enum": [ - "low", - "normal", - "high" - ], - "type": "string", - "properties": { - - }, - "x-ms-enum": { - "name": "ActivityImportance", - "modelAsString": true - } - }, - "RoleTypes": { - "enum": [ - "user", - "bot" - ], - "type": "string", - "properties": { - - }, - "x-ms-enum": { - "name": "RoleTypes", - "modelAsString": true - } - }, - "MicrosoftPayMethodData": { - "description": "W3C Payment Method Data for Microsoft Pay", - "type": "object", - "properties": { - "mechantId": { - "description": "Microsoft Pay Merchant ID", - "type": "string" - }, - "supportedNetworks": { - "description": "Supported payment networks (e.g., \"visa\" and \"mastercard\")", - "type": "array", - "items": { - "type": "string" - } - }, - "supportedTypes": { - "description": "Supported payment types (e.g., \"credit\")", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "PaymentAddress": { - "description": "Address within a Payment Request", - "type": "object", - "properties": { - "country": { - "description": "This is the CLDR (Common Locale Data Repository) region code. For example, US, GB, CN, or JP", - "type": "string" - }, - "addressLine": { - "description": "This is the most specific part of the address. It can include, for example, a street name, a house number, apartment number, a rural delivery route, descriptive instructions, or a post office box number.", - "type": "array", - "items": { - "type": "string" - } - }, - "region": { - "description": "This is the top level administrative subdivision of the country. For example, this can be a state, a province, an oblast, or a prefecture.", - "type": "string" - }, - "city": { - "description": "This is the city/town portion of the address.", - "type": "string" - }, - "dependentLocality": { - "description": "This is the dependent locality or sublocality within a city. For example, used for neighborhoods, boroughs, districts, or UK dependent localities.", - "type": "string" - }, - "postalCode": { - "description": "This is the postal code or ZIP code, also known as PIN code in India.", - "type": "string" - }, - "sortingCode": { - "description": "This is the sorting code as used in, for example, France.", - "type": "string" - }, - "languageCode": { - "description": "This is the BCP-47 language code for the address. It's used to determine the field separators and the order of fields when formatting the address for display.", - "type": "string" - }, - "organization": { - "description": "This is the organization, firm, company, or institution at this address.", - "type": "string" - }, - "recipient": { - "description": "This is the name of the recipient or contact person.", - "type": "string" - }, - "phone": { - "description": "This is the phone number of the recipient or contact person.", - "type": "string" - } - } - }, - "PaymentCurrencyAmount": { - "description": "Supplies monetary amounts", - "type": "object", - "properties": { - "currency": { - "description": "A currency identifier", - "type": "string" - }, - "value": { - "description": "Decimal monetary value", - "type": "string" - }, - "currencySystem": { - "description": "Currency system", - "type": "string" - } - } - }, - "PaymentDetails": { - "description": "Provides information about the requested transaction", - "type": "object", - "properties": { - "total": { - "$ref": "#/definitions/PaymentItem", - "description": "Contains the total amount of the payment request" - }, - "displayItems": { - "description": "Contains line items for the payment request that the user agent may display", - "type": "array", - "items": { - "$ref": "#/definitions/PaymentItem" - } - }, - "shippingOptions": { - "description": "A sequence containing the different shipping options for the user to choose from", - "type": "array", - "items": { - "$ref": "#/definitions/PaymentShippingOption" - } - }, - "modifiers": { - "description": "Contains modifiers for particular payment method identifiers", - "type": "array", - "items": { - "$ref": "#/definitions/PaymentDetailsModifier" - } - }, - "error": { - "description": "Error description", - "type": "string" - } - } - }, - "PaymentItem": { - "description": "Indicates what the payment request is for and the value asked for", - "type": "object", - "properties": { - "label": { - "description": "Human-readable description of the item", - "type": "string" - }, - "amount": { - "$ref": "#/definitions/PaymentCurrencyAmount", - "description": "Monetary amount for the item" - }, - "pending": { - "description": "When set to true this flag means that the amount field is not final.", - "type": "boolean" - } - } - }, - "PaymentShippingOption": { - "description": "Describes a shipping option", - "type": "object", - "properties": { - "id": { - "description": "String identifier used to reference this PaymentShippingOption", - "type": "string" - }, - "label": { - "description": "Human-readable description of the item", - "type": "string" - }, - "amount": { - "$ref": "#/definitions/PaymentCurrencyAmount", - "description": "Contains the monetary amount for the item" - }, - "selected": { - "description": "Indicates whether this is the default selected PaymentShippingOption", - "type": "boolean" - } - } - }, - "PaymentDetailsModifier": { - "description": "Provides details that modify the PaymentDetails based on payment method identifier", - "type": "object", - "properties": { - "supportedMethods": { - "description": "Contains a sequence of payment method identifiers", - "type": "array", - "items": { - "type": "string" - } - }, - "total": { - "$ref": "#/definitions/PaymentItem", - "description": "This value overrides the total field in the PaymentDetails dictionary for the payment method identifiers in the supportedMethods field" - }, - "additionalDisplayItems": { - "description": "Provides additional display items that are appended to the displayItems field in the PaymentDetails dictionary for the payment method identifiers in the supportedMethods field", - "type": "array", - "items": { - "$ref": "#/definitions/PaymentItem" - } - }, - "data": { - "description": "A JSON-serializable object that provides optional information that might be needed by the supported payment methods", - "type": "object" - } - } - }, - "PaymentMethodData": { - "description": "Indicates a set of supported payment methods and any associated payment method specific data for those methods", - "type": "object", - "properties": { - "supportedMethods": { - "description": "Required sequence of strings containing payment method identifiers for payment methods that the merchant web site accepts", - "type": "array", - "items": { - "type": "string" - } - }, - "data": { - "description": "A JSON-serializable object that provides optional information that might be needed by the supported payment methods", - "type": "object" - } - } - }, - "PaymentOptions": { - "description": "Provides information about the options desired for the payment request", - "type": "object", - "properties": { - "requestPayerName": { - "description": "Indicates whether the user agent should collect and return the payer's name as part of the payment request", - "type": "boolean" - }, - "requestPayerEmail": { - "description": "Indicates whether the user agent should collect and return the payer's email address as part of the payment request", - "type": "boolean" - }, - "requestPayerPhone": { - "description": "Indicates whether the user agent should collect and return the payer's phone number as part of the payment request", - "type": "boolean" - }, - "requestShipping": { - "description": "Indicates whether the user agent should collect and return a shipping address as part of the payment request", - "type": "boolean" - }, - "shippingType": { - "description": "If requestShipping is set to true, then the shippingType field may be used to influence the way the user agent presents the user interface for gathering the shipping address", - "type": "string" - } - } - }, - "PaymentRequest": { - "description": "A request to make a payment", - "type": "object", - "properties": { - "id": { - "description": "ID of this payment request", - "type": "string" - }, - "methodData": { - "description": "Allowed payment methods for this request", - "type": "array", - "items": { - "$ref": "#/definitions/PaymentMethodData" - } - }, - "details": { - "$ref": "#/definitions/PaymentDetails", - "description": "Details for this request" - }, - "options": { - "$ref": "#/definitions/PaymentOptions", - "description": "Provides information about the options desired for the payment request" - }, - "expires": { - "description": "Expiration for this request, in ISO 8601 duration format (e.g., 'P1D')", - "type": "string" - } - } - }, - "PaymentRequestComplete": { - "description": "Payload delivered when completing a payment request", - "type": "object", - "properties": { - "id": { - "description": "Payment request ID", - "type": "string" - }, - "paymentRequest": { - "$ref": "#/definitions/PaymentRequest", - "description": "Initial payment request" - }, - "paymentResponse": { - "$ref": "#/definitions/PaymentResponse", - "description": "Corresponding payment response" - } - } - }, - "PaymentResponse": { - "description": "A PaymentResponse is returned when a user has selected a payment method and approved a payment request", - "type": "object", - "properties": { - "methodName": { - "description": "The payment method identifier for the payment method that the user selected to fulfil the transaction", - "type": "string" - }, - "details": { - "description": "A JSON-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine successful fund transfer", - "type": "object" - }, - "shippingAddress": { - "$ref": "#/definitions/PaymentAddress", - "description": "If the requestShipping flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then shippingAddress will be the full and final shipping address chosen by the user" - }, - "shippingOption": { - "description": "If the requestShipping flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then shippingOption will be the id attribute of the selected shipping option", - "type": "string" - }, - "payerEmail": { - "description": "If the requestPayerEmail flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then payerEmail will be the email address chosen by the user", - "type": "string" - }, - "payerPhone": { - "description": "If the requestPayerPhone flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then payerPhone will be the phone number chosen by the user", - "type": "string" - } - } - }, - "PaymentRequestCompleteResult": { - "description": "Result from a completed payment request", - "type": "object", - "properties": { - "result": { - "description": "Result of the payment request completion", - "type": "string" - } - } - }, - "PaymentRequestUpdate": { - "description": "An update to a payment request", - "type": "object", - "properties": { - "id": { - "description": "ID for the payment request to update", - "type": "string" - }, - "details": { - "$ref": "#/definitions/PaymentDetails", - "description": "Update payment details" - }, - "shippingAddress": { - "$ref": "#/definitions/PaymentAddress", - "description": "Updated shipping address" - }, - "shippingOption": { - "description": "Updated shipping options", - "type": "string" - } - } - }, - "PaymentRequestUpdateResult": { - "description": "A result object from a Payment Request Update invoke operation", - "type": "object", - "properties": { - "details": { - "$ref": "#/definitions/PaymentDetails", - "description": "Update payment details" - } - } + "required": true, + "schema": { + "$ref": "#/definitions/AttachmentData" + } + } + ], + "responses": { + "200": { + "description": "An object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "201": { + "description": "A ResourceResponse object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "202": { + "description": "An object will be returned containing the ID for the resource.", + "schema": { + "$ref": "#/definitions/ResourceResponse" + } + }, + "default": { + "description": "The operation failed and the response is an error object describing the status code and failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "AttachmentInfo": { + "description": "Metadata for an attachment", + "type": "object", + "properties": { + "name": { + "description": "Name of the attachment", + "type": "string" + }, + "type": { + "description": "ContentType of the attachment", + "type": "string" + }, + "views": { + "description": "attachment views", + "type": "array", + "items": { + "$ref": "#/definitions/AttachmentView" + } + } + } + }, + "AttachmentView": { + "description": "Attachment View name and size", + "type": "object", + "properties": { + "viewId": { + "description": "Id of the attachment", + "type": "string" + }, + "size": { + "format": "int32", + "description": "Size of the attachment", + "type": "integer" + } + } + }, + "ErrorResponse": { + "description": "An HTTP API response", + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error", + "description": "Error message" + } + } + }, + "Error": { + "description": "Object representing error information", + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message", + "type": "string" + }, + "innerHttpError": { + "$ref": "#/definitions/InnerHttpError", + "description": "Error from inner http call" + } + } + }, + "InnerHttpError": { + "description": "Object representing inner http error", + "type": "object", + "properties": { + "statusCode": { + "format": "int32", + "description": "HttpStatusCode from failed request", + "type": "integer" + }, + "body": { + "description": "Body from failed request", + "type": "object" + } + } + }, + "ConversationParameters": { + "description": "Parameters for creating a new conversation", + "type": "object", + "properties": { + "isGroup": { + "description": "IsGroup", + "type": "boolean" + }, + "bot": { + "$ref": "#/definitions/ChannelAccount", + "description": "The bot address for this conversation" + }, + "members": { + "description": "Members to add to the conversation", + "type": "array", + "items": { + "$ref": "#/definitions/ChannelAccount" + } + }, + "topicName": { + "description": "(Optional) Topic of the conversation (if supported by the channel)", + "type": "string" + }, + "tenantId": { + "description": "(Optional) The tenant ID in which the conversation should be created", + "type": "string" + }, + "activity": { + "$ref": "#/definitions/Activity", + "description": "(Optional) When creating a new conversation, use this activity as the initial message to the conversation" + }, + "channelData": { + "description": "Channel specific payload for creating the conversation", + "type": "object" + } + } + }, + "ChannelAccount": { + "description": "Channel account information needed to route a message", + "type": "object", + "properties": { + "id": { + "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or 123456)", + "type": "string" + }, + "name": { + "description": "Display friendly name", + "type": "string" + }, + "aadObjectId": { + "description": "This account's object ID within Azure Active Directory (AAD)", + "type": "string" + }, + "role": { + "$ref": "#/definitions/RoleTypes", + "description": "Role of the entity behind the account (Example: User, Bot, etc.)" + } + } + }, + "Activity": { + "description": "An Activity is the basic communication type for the Bot Framework 3.0 protocol.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/ActivityTypes", + "description": "Contains the activity type." + }, + "id": { + "description": "Contains an ID that uniquely identifies the activity on the channel.", + "type": "string" + }, + "timestamp": { + "format": "date-time", + "description": "Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.", + "type": "string" + }, + "localTimestamp": { + "format": "date-time", + "description": "Contains the local date and time of the message, expressed in ISO-8601 format.\r\nFor example, 2016-09-23T13:07:49.4714686-07:00.", + "type": "string" + }, + "localTimezone": { + "description": "Contains the name of the local timezone of the message, expressed in IANA Time Zone database format.\r\nFor example, America/Los_Angeles.", + "type": "string" + }, + "callerId": { + "description": "A string containing an IRI identifying the caller of a bot. This field is not intended to be transmitted\r\nover the wire, but is instead populated by bots and clients based on cryptographically verifiable data\r\nthat asserts the identity of the callers (e.g. tokens).", + "type": "string" + }, + "serviceUrl": { + "description": "Contains the URL that specifies the channel's service endpoint. Set by the channel.", + "type": "string" + }, + "channelId": { + "description": "Contains an ID that uniquely identifies the channel. Set by the channel.", + "type": "string" + }, + "from": { + "$ref": "#/definitions/ChannelAccount", + "description": "Identifies the sender of the message." + }, + "conversation": { + "$ref": "#/definitions/ConversationAccount", + "description": "Identifies the conversation to which the activity belongs." + }, + "recipient": { + "$ref": "#/definitions/ChannelAccount", + "description": "Identifies the recipient of the message." + }, + "textFormat": { + "$ref": "#/definitions/TextFormatTypes", + "description": "Format of text fields Default:markdown" + }, + "attachmentLayout": { + "$ref": "#/definitions/AttachmentLayoutTypes", + "description": "The layout hint for multiple attachments. Default: list." + }, + "membersAdded": { + "description": "The collection of members added to the conversation.", + "type": "array", + "items": { + "$ref": "#/definitions/ChannelAccount" + } + }, + "membersRemoved": { + "description": "The collection of members removed from the conversation.", + "type": "array", + "items": { + "$ref": "#/definitions/ChannelAccount" + } + }, + "reactionsAdded": { + "description": "The collection of reactions added to the conversation.", + "type": "array", + "items": { + "$ref": "#/definitions/MessageReaction" + } + }, + "reactionsRemoved": { + "description": "The collection of reactions removed from the conversation.", + "type": "array", + "items": { + "$ref": "#/definitions/MessageReaction" + } + }, + "topicName": { + "description": "The updated topic name of the conversation.", + "type": "string" + }, + "historyDisclosed": { + "description": "Indicates whether the prior history of the channel is disclosed.", + "type": "boolean" + }, + "locale": { + "description": "A locale name for the contents of the text field.\r\nThe locale name is a combination of an ISO 639 two- or three-letter culture code associated with a language\r\nand an ISO 3166 two-letter subculture code associated with a country or region.\r\nThe locale name can also correspond to a valid BCP-47 language tag.", + "type": "string" + }, + "text": { + "description": "The text content of the message.", + "type": "string" + }, + "speak": { + "description": "The text to speak.", + "type": "string" + }, + "inputHint": { + "$ref": "#/definitions/InputHints", + "description": "Indicates whether your bot is accepting,\r\nexpecting, or ignoring user input after the message is delivered to the client." + }, + "summary": { + "description": "The text to display if the channel cannot render cards.", + "type": "string" + }, + "suggestedActions": { + "$ref": "#/definitions/SuggestedActions", + "description": "The suggested actions for the activity." + }, + "attachments": { + "description": "Attachments", + "type": "array", + "items": { + "$ref": "#/definitions/Attachment" + } + }, + "entities": { + "description": "Represents the entities that were mentioned in the message.", + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "channelData": { + "description": "Contains channel-specific content.", + "type": "object" + }, + "action": { + "description": "Indicates whether the recipient of a contactRelationUpdate was added or removed from the sender's contact list.", + "type": "string" + }, + "replyToId": { + "description": "Contains the ID of the message to which this message is a reply.", + "type": "string" + }, + "label": { + "description": "A descriptive label for the activity.", + "type": "string" + }, + "valueType": { + "description": "The type of the activity's value object.", + "type": "string" + }, + "value": { + "description": "A value that is associated with the activity.", + "type": "object" + }, + "name": { + "description": "The name of the operation associated with an invoke or event activity.", + "type": "string" + }, + "relatesTo": { + "$ref": "#/definitions/ConversationReference", + "description": "A reference to another conversation or activity." + }, + "code": { + "$ref": "#/definitions/EndOfConversationCodes", + "description": "The a code for endOfConversation activities that indicates why the conversation ended." + }, + "expiration": { + "format": "date-time", + "description": "The time at which the activity should be considered to be \"expired\" and should not be presented to the recipient.", + "type": "string" + }, + "importance": { + "$ref": "#/definitions/ActivityImportance", + "description": "The importance of the activity." + }, + "deliveryMode": { + "$ref": "#/definitions/DeliveryModes", + "description": "A delivery hint to signal to the recipient alternate delivery paths for the activity.\r\nThe default delivery mode is \"default\"." + }, + "listenFor": { + "description": "List of phrases and references that speech and language priming systems should listen for", + "type": "array", + "items": { + "type": "string" + } + }, + "textHighlights": { + "description": "The collection of text fragments to highlight when the activity contains a ReplyToId value.", + "type": "array", + "items": { + "$ref": "#/definitions/TextHighlight" + } + }, + "semanticAction": { + "$ref": "#/definitions/SemanticAction", + "description": "An optional programmatic action accompanying this request" + } + } + }, + "ConversationAccount": { + "description": "Conversation account represents the identity of the conversation within a channel", + "type": "object", + "properties": { + "isGroup": { + "description": "Indicates whether the conversation contains more than two participants at the time the activity was generated", + "type": "boolean" + }, + "conversationType": { + "description": "Indicates the type of the conversation in channels that distinguish between conversation types", + "type": "string" + }, + "tenantId": { + "description": "This conversation's tenant ID", + "type": "string" + }, + "id": { + "description": "Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or 123456)", + "type": "string" + }, + "name": { + "description": "Display friendly name", + "type": "string" + }, + "aadObjectId": { + "description": "This account's object ID within Azure Active Directory (AAD)", + "type": "string" + }, + "role": { + "$ref": "#/definitions/RoleTypes", + "description": "Role of the entity behind the account (Example: User, Bot, etc.)" + } + } + }, + "MessageReaction": { + "description": "Message reaction object", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/MessageReactionTypes", + "description": "Message reaction type" + } + } + }, + "SuggestedActions": { + "description": "SuggestedActions that can be performed", + "type": "object", + "properties": { + "to": { + "description": "Ids of the recipients that the actions should be shown to. These Ids are relative to the channelId and a subset of all recipients of the activity", + "type": "array", + "items": { + "type": "string" + } + }, + "actions": { + "description": "Actions that can be shown to the user", + "type": "array", + "items": { + "$ref": "#/definitions/CardAction" + } + } + } + }, + "Attachment": { + "description": "An attachment within an activity", + "type": "object", + "properties": { + "contentType": { + "description": "mimetype/Contenttype for the file", + "type": "string" + }, + "contentUrl": { + "description": "Content Url", + "type": "string" + }, + "content": { + "description": "Embedded content", + "type": "object" + }, + "name": { + "description": "(OPTIONAL) The name of the attachment", + "type": "string" + }, + "thumbnailUrl": { + "description": "(OPTIONAL) Thumbnail associated with attachment", + "type": "string" + } + } + }, + "Entity": { + "description": "Metadata object pertaining to an activity", + "type": "object", + "properties": { + "type": { + "description": "Type of this entity (RFC 3987 IRI)", + "type": "string" + } + } + }, + "ConversationReference": { + "description": "An object relating to a particular point in a conversation", + "type": "object", + "properties": { + "activityId": { + "description": "(Optional) ID of the activity to refer to", + "type": "string" + }, + "user": { + "$ref": "#/definitions/ChannelAccount", + "description": "(Optional) User participating in this conversation" + }, + "bot": { + "$ref": "#/definitions/ChannelAccount", + "description": "Bot participating in this conversation" + }, + "conversation": { + "$ref": "#/definitions/ConversationAccount", + "description": "Conversation reference" + }, + "channelId": { + "description": "Channel ID", + "type": "string" + }, + "serviceUrl": { + "description": "Service endpoint where operations concerning the referenced conversation may be performed", + "type": "string" + } + } + }, + "TextHighlight": { + "description": "Refers to a substring of content within another field", + "type": "object", + "properties": { + "text": { + "description": "Defines the snippet of text to highlight", + "type": "string" + }, + "occurrence": { + "format": "int32", + "description": "Occurrence of the text field within the referenced text, if multiple exist.", + "type": "integer" + } + } + }, + "SemanticAction": { + "description": "Represents a reference to a programmatic action", + "type": "object", + "properties": { + "state": { + "$ref": "#/definitions/SemanticActionStates", + "description": "State of this action. Allowed values: `start`, `continue`, `done`" + }, + "id": { + "description": "ID of this action", + "type": "string" + }, + "entities": { + "description": "Entities associated with this action", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Entity" + } + } + } + }, + "CardAction": { + "description": "A clickable action", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/ActionTypes", + "description": "The type of action implemented by this button" + }, + "title": { + "description": "Text description which appears on the button", + "type": "string" + }, + "image": { + "description": "Image URL which will appear on the button, next to text label", + "type": "string" + }, + "text": { + "description": "Text for this action", + "type": "string" + }, + "displayText": { + "description": "(Optional) text to display in the chat feed if the button is clicked", + "type": "string" + }, + "value": { + "description": "Supplementary parameter for action. Content of this property depends on the ActionType", + "type": "object" + }, + "channelData": { + "description": "Channel-specific data associated with this action", + "type": "object" + } + } + }, + "ConversationResourceResponse": { + "description": "A response containing a resource", + "type": "object", + "properties": { + "activityId": { + "description": "ID of the Activity (if sent)", + "type": "string" + }, + "serviceUrl": { + "description": "Service endpoint where operations concerning the conversation may be performed", + "type": "string" + }, + "id": { + "description": "Id of the resource", + "type": "string" + } + } + }, + "ConversationsResult": { + "description": "Conversations result", + "type": "object", + "properties": { + "continuationToken": { + "description": "Paging token", + "type": "string" + }, + "conversations": { + "description": "List of conversations", + "type": "array", + "items": { + "$ref": "#/definitions/ConversationMembers" + } + } + } + }, + "ConversationMembers": { + "description": "Conversation and its members", + "type": "object", + "properties": { + "id": { + "description": "Conversation ID", + "type": "string" + }, + "members": { + "description": "List of members in this conversation", + "type": "array", + "items": { + "$ref": "#/definitions/ChannelAccount" + } + } + } + }, + "ResourceResponse": { + "description": "A response containing a resource ID", + "type": "object", + "properties": { + "id": { + "description": "Id of the resource", + "type": "string" + } + } + }, + "Transcript": { + "description": "Transcript", + "type": "object", + "properties": { + "activities": { + "description": "A collection of Activities that conforms to the Transcript schema.", + "type": "array", + "items": { + "$ref": "#/definitions/Activity" + } + } + } + }, + "PagedMembersResult": { + "description": "Page of members.", + "type": "object", + "properties": { + "continuationToken": { + "description": "Paging token", + "type": "string" + }, + "members": { + "description": "The Channel Accounts.", + "type": "array", + "items": { + "$ref": "#/definitions/ChannelAccount" + } + } + } + }, + "AttachmentData": { + "description": "Attachment data", + "type": "object", + "properties": { + "type": { + "description": "Content-Type of the attachment", + "type": "string" + }, + "name": { + "description": "Name of the attachment", + "type": "string" + }, + "originalBase64": { + "format": "byte", + "description": "Attachment content", + "type": "string" + }, + "thumbnailBase64": { + "format": "byte", + "description": "Attachment thumbnail", + "type": "string" + } + } + }, + "HeroCard": { + "description": "A Hero card (card with a single, large image)", + "type": "object", + "properties": { + "title": { + "description": "Title of the card", + "type": "string" + }, + "subtitle": { + "description": "Subtitle of the card", + "type": "string" + }, + "text": { + "description": "Text for the card", + "type": "string" + }, + "images": { + "description": "Array of images for the card", + "type": "array", + "items": { + "$ref": "#/definitions/CardImage" + } + }, + "buttons": { + "description": "Set of actions applicable to the current card", + "type": "array", + "items": { + "$ref": "#/definitions/CardAction" + } + }, + "tap": { + "$ref": "#/definitions/CardAction", + "description": "This action will be activated when user taps on the card itself" + } + } + }, + "CardImage": { + "description": "An image on a card", + "type": "object", + "properties": { + "url": { + "description": "URL thumbnail image for major content property", + "type": "string" + }, + "alt": { + "description": "Image description intended for screen readers", + "type": "string" + }, + "tap": { + "$ref": "#/definitions/CardAction", + "description": "Action assigned to specific Attachment" + } + } + }, + "AnimationCard": { + "description": "An animation card (Ex: gif or short video clip)", + "type": "object", + "properties": { + "title": { + "description": "Title of this card", + "type": "string" + }, + "subtitle": { + "description": "Subtitle of this card", + "type": "string" + }, + "text": { + "description": "Text of this card", + "type": "string" + }, + "image": { + "$ref": "#/definitions/ThumbnailUrl", + "description": "Thumbnail placeholder" + }, + "media": { + "description": "Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content.", + "type": "array", + "items": { + "$ref": "#/definitions/MediaUrl" + } + }, + "buttons": { + "description": "Actions on this card", + "type": "array", + "items": { + "$ref": "#/definitions/CardAction" + } + }, + "shareable": { + "description": "This content may be shared with others (default:true)", + "type": "boolean" + }, + "autoloop": { + "description": "Should the client loop playback at end of content (default:true)", + "type": "boolean" + }, + "autostart": { + "description": "Should the client automatically start playback of media in this card (default:true)", + "type": "boolean" + }, + "aspect": { + "description": "Aspect ratio of thumbnail/media placeholder. Allowed values are \"16:9\" and \"4:3\"", + "type": "string" + }, + "duration": { + "description": "Describes the length of the media content without requiring a receiver to open the content. Formatted as an ISO 8601 Duration field.", + "type": "string" + }, + "value": { + "description": "Supplementary parameter for this card", + "type": "object" + } + } + }, + "ThumbnailUrl": { + "description": "Thumbnail URL", + "type": "object", + "properties": { + "url": { + "description": "URL pointing to the thumbnail to use for media content", + "type": "string" + }, + "alt": { + "description": "HTML alt text to include on this thumbnail image", + "type": "string" + } + } + }, + "MediaUrl": { + "description": "Media URL", + "type": "object", + "properties": { + "url": { + "description": "Url for the media", + "type": "string" + }, + "profile": { + "description": "Optional profile hint to the client to differentiate multiple MediaUrl objects from each other", + "type": "string" + } + } + }, + "AudioCard": { + "description": "Audio card", + "type": "object", + "properties": { + "title": { + "description": "Title of this card", + "type": "string" + }, + "subtitle": { + "description": "Subtitle of this card", + "type": "string" + }, + "text": { + "description": "Text of this card", + "type": "string" + }, + "image": { + "$ref": "#/definitions/ThumbnailUrl", + "description": "Thumbnail placeholder" + }, + "media": { + "description": "Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content.", + "type": "array", + "items": { + "$ref": "#/definitions/MediaUrl" + } + }, + "buttons": { + "description": "Actions on this card", + "type": "array", + "items": { + "$ref": "#/definitions/CardAction" + } + }, + "shareable": { + "description": "This content may be shared with others (default:true)", + "type": "boolean" + }, + "autoloop": { + "description": "Should the client loop playback at end of content (default:true)", + "type": "boolean" + }, + "autostart": { + "description": "Should the client automatically start playback of media in this card (default:true)", + "type": "boolean" + }, + "aspect": { + "description": "Aspect ratio of thumbnail/media placeholder. Allowed values are \"16:9\" and \"4:3\"", + "type": "string" + }, + "duration": { + "description": "Describes the length of the media content without requiring a receiver to open the content. Formatted as an ISO 8601 Duration field.", + "type": "string" + }, + "value": { + "description": "Supplementary parameter for this card", + "type": "object" + } + } + }, + "BasicCard": { + "description": "A basic card", + "type": "object", + "properties": { + "title": { + "description": "Title of the card", + "type": "string" + }, + "subtitle": { + "description": "Subtitle of the card", + "type": "string" + }, + "text": { + "description": "Text for the card", + "type": "string" + }, + "images": { + "description": "Array of images for the card", + "type": "array", + "items": { + "$ref": "#/definitions/CardImage" + } + }, + "buttons": { + "description": "Set of actions applicable to the current card", + "type": "array", + "items": { + "$ref": "#/definitions/CardAction" + } + }, + "tap": { + "$ref": "#/definitions/CardAction", + "description": "This action will be activated when user taps on the card itself" + } + } + }, + "MediaCard": { + "description": "Media card", + "type": "object", + "properties": { + "title": { + "description": "Title of this card", + "type": "string" + }, + "subtitle": { + "description": "Subtitle of this card", + "type": "string" + }, + "text": { + "description": "Text of this card", + "type": "string" + }, + "image": { + "$ref": "#/definitions/ThumbnailUrl", + "description": "Thumbnail placeholder" + }, + "media": { + "description": "Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content.", + "type": "array", + "items": { + "$ref": "#/definitions/MediaUrl" + } + }, + "buttons": { + "description": "Actions on this card", + "type": "array", + "items": { + "$ref": "#/definitions/CardAction" + } + }, + "shareable": { + "description": "This content may be shared with others (default:true)", + "type": "boolean" + }, + "autoloop": { + "description": "Should the client loop playback at end of content (default:true)", + "type": "boolean" + }, + "autostart": { + "description": "Should the client automatically start playback of media in this card (default:true)", + "type": "boolean" + }, + "aspect": { + "description": "Aspect ratio of thumbnail/media placeholder. Allowed values are \"16:9\" and \"4:3\"", + "type": "string" + }, + "duration": { + "description": "Describes the length of the media content without requiring a receiver to open the content. Formatted as an ISO 8601 Duration field.", + "type": "string" + }, + "value": { + "description": "Supplementary parameter for this card", + "type": "object" + } + } + }, + "ReceiptCard": { + "description": "A receipt card", + "type": "object", + "properties": { + "title": { + "description": "Title of the card", + "type": "string" + }, + "facts": { + "description": "Array of Fact objects", + "type": "array", + "items": { + "$ref": "#/definitions/Fact" + } + }, + "items": { + "description": "Array of Receipt Items", + "type": "array", + "items": { + "$ref": "#/definitions/ReceiptItem" + } + }, + "tap": { + "$ref": "#/definitions/CardAction", + "description": "This action will be activated when user taps on the card" + }, + "total": { + "description": "Total amount of money paid (or to be paid)", + "type": "string" + }, + "tax": { + "description": "Total amount of tax paid (or to be paid)", + "type": "string" + }, + "vat": { + "description": "Total amount of VAT paid (or to be paid)", + "type": "string" + }, + "buttons": { + "description": "Set of actions applicable to the current card", + "type": "array", + "items": { + "$ref": "#/definitions/CardAction" + } + } + } + }, + "Fact": { + "description": "Set of key-value pairs. Advantage of this section is that key and value properties will be \r\nrendered with default style information with some delimiter between them. So there is no need for developer to specify style information.", + "type": "object", + "properties": { + "key": { + "description": "The key for this Fact", + "type": "string" + }, + "value": { + "description": "The value for this Fact", + "type": "string" + } + } + }, + "ReceiptItem": { + "description": "An item on a receipt card", + "type": "object", + "properties": { + "title": { + "description": "Title of the Card", + "type": "string" + }, + "subtitle": { + "description": "Subtitle appears just below Title field, differs from Title in font styling only", + "type": "string" + }, + "text": { + "description": "Text field appears just below subtitle, differs from Subtitle in font styling only", + "type": "string" + }, + "image": { + "$ref": "#/definitions/CardImage", + "description": "Image" + }, + "price": { + "description": "Amount with currency", + "type": "string" + }, + "quantity": { + "description": "Number of items of given kind", + "type": "string" + }, + "tap": { + "$ref": "#/definitions/CardAction", + "description": "This action will be activated when user taps on the Item bubble." + } + } + }, + "SigninCard": { + "description": "A card representing a request to sign in", + "type": "object", + "properties": { + "text": { + "description": "Text for signin request", + "type": "string" + }, + "buttons": { + "description": "Action to use to perform signin", + "type": "array", + "items": { + "$ref": "#/definitions/CardAction" + } } + } }, - "securityDefinitions": { - "bearer_auth": { - "type": "apiKey", - "description": "Access token to authenticate calls to the Bot Connector Service.", - "name": "Authorization", - "in": "header" + "OAuthCard": { + "description": "A card representing a request to perform a sign in via OAuth", + "type": "object", + "properties": { + "text": { + "description": "Text for signin request", + "type": "string" + }, + "connectionName": { + "description": "The name of the registered connection", + "type": "string" + }, + "buttons": { + "description": "Action to use to perform signin", + "type": "array", + "items": { + "$ref": "#/definitions/CardAction" + } } + } + }, + "ThumbnailCard": { + "description": "A thumbnail card (card with a single, small thumbnail image)", + "type": "object", + "properties": { + "title": { + "description": "Title of the card", + "type": "string" + }, + "subtitle": { + "description": "Subtitle of the card", + "type": "string" + }, + "text": { + "description": "Text for the card", + "type": "string" + }, + "images": { + "description": "Array of images for the card", + "type": "array", + "items": { + "$ref": "#/definitions/CardImage" + } + }, + "buttons": { + "description": "Set of actions applicable to the current card", + "type": "array", + "items": { + "$ref": "#/definitions/CardAction" + } + }, + "tap": { + "$ref": "#/definitions/CardAction", + "description": "This action will be activated when user taps on the card itself" + } + } + }, + "VideoCard": { + "description": "Video card", + "type": "object", + "properties": { + "title": { + "description": "Title of this card", + "type": "string" + }, + "subtitle": { + "description": "Subtitle of this card", + "type": "string" + }, + "text": { + "description": "Text of this card", + "type": "string" + }, + "image": { + "$ref": "#/definitions/ThumbnailUrl", + "description": "Thumbnail placeholder" + }, + "media": { + "description": "Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content.", + "type": "array", + "items": { + "$ref": "#/definitions/MediaUrl" + } + }, + "buttons": { + "description": "Actions on this card", + "type": "array", + "items": { + "$ref": "#/definitions/CardAction" + } + }, + "shareable": { + "description": "This content may be shared with others (default:true)", + "type": "boolean" + }, + "autoloop": { + "description": "Should the client loop playback at end of content (default:true)", + "type": "boolean" + }, + "autostart": { + "description": "Should the client automatically start playback of media in this card (default:true)", + "type": "boolean" + }, + "aspect": { + "description": "Aspect ratio of thumbnail/media placeholder. Allowed values are \"16:9\" and \"4:3\"", + "type": "string" + }, + "duration": { + "description": "Describes the length of the media content without requiring a receiver to open the content. Formatted as an ISO 8601 Duration field.", + "type": "string" + }, + "value": { + "description": "Supplementary parameter for this card", + "type": "object" + } + } + }, + "GeoCoordinates": { + "description": "GeoCoordinates (entity type: \"https://schema.org/GeoCoordinates\")", + "type": "object", + "properties": { + "elevation": { + "format": "double", + "description": "Elevation of the location [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)", + "type": "number" + }, + "latitude": { + "format": "double", + "description": "Latitude of the location [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)", + "type": "number" + }, + "longitude": { + "format": "double", + "description": "Longitude of the location [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)", + "type": "number" + }, + "type": { + "description": "The type of the thing", + "type": "string" + }, + "name": { + "description": "The name of the thing", + "type": "string" + } + } + }, + "Mention": { + "description": "Mention information (entity type: \"mention\")", + "type": "object", + "properties": { + "mentioned": { + "$ref": "#/definitions/ChannelAccount", + "description": "The mentioned user" + }, + "text": { + "description": "Sub Text which represents the mention (can be null or empty)", + "type": "string" + }, + "type": { + "description": "Type of this entity (RFC 3987 IRI)", + "type": "string" + } + } + }, + "Place": { + "description": "Place (entity type: \"https://schema.org/Place\")", + "type": "object", + "properties": { + "address": { + "description": "Address of the place (may be `string` or complex object of type `PostalAddress`)", + "type": "object" + }, + "geo": { + "description": "Geo coordinates of the place (may be complex object of type `GeoCoordinates` or `GeoShape`)", + "type": "object" + }, + "hasMap": { + "description": "Map to the place (may be `string` (URL) or complex object of type `Map`)", + "type": "object" + }, + "type": { + "description": "The type of the thing", + "type": "string" + }, + "name": { + "description": "The name of the thing", + "type": "string" + } + } + }, + "Thing": { + "description": "Thing (entity type: \"https://schema.org/Thing\")", + "type": "object", + "properties": { + "type": { + "description": "The type of the thing", + "type": "string" + }, + "name": { + "description": "The name of the thing", + "type": "string" + } + } + }, + "MediaEventValue": { + "description": "Supplementary parameter for media events", + "type": "object", + "properties": { + "cardValue": { + "description": "Callback parameter specified in the Value field of the MediaCard that originated this event", + "type": "object" + } + } + }, + "TokenRequest": { + "description": "A request to receive a user token", + "type": "object", + "properties": { + "provider": { + "description": "The provider to request a user token from", + "type": "string" + }, + "settings": { + "description": "A collection of settings for the specific provider for this request", + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "TokenResponse": { + "description": "A response that includes a user token", + "type": "object", + "properties": { + "channelId": { + "description": "The channelId of the TokenResponse", + "type": "string" + }, + "connectionName": { + "description": "The connection name", + "type": "string" + }, + "token": { + "description": "The user token", + "type": "string" + }, + "expiration": { + "description": "Expiration for the token, in ISO 8601 format (e.g. \"2007-04-05T14:30Z\")", + "type": "string" + } + } + }, + "ActivityTypes": { + "description": "Types of Activities", + "enum": [ + "message", + "contactRelationUpdate", + "conversationUpdate", + "typing", + "endOfConversation", + "event", + "invoke", + "deleteUserData", + "messageUpdate", + "messageDelete", + "installationUpdate", + "messageReaction", + "suggestion", + "trace", + "handoff" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "ActivityTypes", + "modelAsString": true + } + }, + "AttachmentLayoutTypes": { + "description": "Attachment layout types", + "enum": [ + "list", + "carousel" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "AttachmentLayoutTypes", + "modelAsString": true + } + }, + "SemanticActionStates": { + "description": "Indicates whether the semantic action is starting, continuing, or done", + "enum": [ + "start", + "continue", + "done" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "SemanticActionStates", + "modelAsString": true + } + }, + "ActionTypes": { + "description": "Defines action types for clickable buttons.", + "enum": [ + "openUrl", + "imBack", + "postBack", + "playAudio", + "playVideo", + "showImage", + "downloadFile", + "signin", + "call", + "payment", + "messageBack" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "ActionTypes", + "modelAsString": true + } + }, + "ContactRelationUpdateActionTypes": { + "description": "Action types valid for ContactRelationUpdate activities", + "enum": [ + "add", + "remove" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "ContactRelationUpdateActionTypes", + "modelAsString": true + } + }, + "InstallationUpdateActionTypes": { + "description": "Action types valid for InstallationUpdate activities", + "enum": [ + "add", + "remove" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "InstallationUpdateActionTypes", + "modelAsString": true + } + }, + "MessageReactionTypes": { + "description": "Message reaction types", + "enum": [ + "like", + "plusOne" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "MessageReactionTypes", + "modelAsString": true + } + }, + "TextFormatTypes": { + "description": "Text format types", + "enum": [ + "markdown", + "plain", + "xml" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "TextFormatTypes", + "modelAsString": true + } + }, + "InputHints": { + "description": "Indicates whether the bot is accepting, expecting, or ignoring input", + "enum": [ + "acceptingInput", + "ignoringInput", + "expectingInput" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "InputHints", + "modelAsString": true + } + }, + "EndOfConversationCodes": { + "description": "Codes indicating why a conversation has ended", + "enum": [ + "unknown", + "completedSuccessfully", + "userCancelled", + "botTimedOut", + "botIssuedInvalidMessage", + "channelFailed" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "EndOfConversationCodes", + "modelAsString": true + } + }, + "ActivityImportance": { + "description": "Defines the importance of an Activity", + "enum": [ + "low", + "normal", + "high" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "ActivityImportance", + "modelAsString": true + } + }, + "RoleTypes": { + "description": "Role of the entity behind the account (Example: User, Bot, etc.)", + "enum": [ + "user", + "bot" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "RoleTypes", + "modelAsString": true + } + }, + "DeliveryModes": { + "description": "Values for deliveryMode field", + "enum": [ + "normal", + "notification" + ], + "type": "string", + "properties": {}, + "x-ms-enum": { + "name": "DeliveryModes", + "modelAsString": true + } + }, + "MicrosoftPayMethodData": { + "description": "W3C Payment Method Data for Microsoft Pay", + "type": "object", + "properties": { + "merchantId": { + "description": "Microsoft Pay Merchant ID", + "type": "string" + }, + "supportedNetworks": { + "description": "Supported payment networks (e.g., \"visa\" and \"mastercard\")", + "type": "array", + "items": { + "type": "string" + } + }, + "supportedTypes": { + "description": "Supported payment types (e.g., \"credit\")", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PaymentAddress": { + "description": "Address within a Payment Request", + "type": "object", + "properties": { + "country": { + "description": "This is the CLDR (Common Locale Data Repository) region code. For example, US, GB, CN, or JP", + "type": "string" + }, + "addressLine": { + "description": "This is the most specific part of the address. It can include, for example, a street name, a house number, apartment number, a rural delivery route, descriptive instructions, or a post office box number.", + "type": "array", + "items": { + "type": "string" + } + }, + "region": { + "description": "This is the top level administrative subdivision of the country. For example, this can be a state, a province, an oblast, or a prefecture.", + "type": "string" + }, + "city": { + "description": "This is the city/town portion of the address.", + "type": "string" + }, + "dependentLocality": { + "description": "This is the dependent locality or sublocality within a city. For example, used for neighborhoods, boroughs, districts, or UK dependent localities.", + "type": "string" + }, + "postalCode": { + "description": "This is the postal code or ZIP code, also known as PIN code in India.", + "type": "string" + }, + "sortingCode": { + "description": "This is the sorting code as used in, for example, France.", + "type": "string" + }, + "languageCode": { + "description": "This is the BCP-47 language code for the address. It's used to determine the field separators and the order of fields when formatting the address for display.", + "type": "string" + }, + "organization": { + "description": "This is the organization, firm, company, or institution at this address.", + "type": "string" + }, + "recipient": { + "description": "This is the name of the recipient or contact person.", + "type": "string" + }, + "phone": { + "description": "This is the phone number of the recipient or contact person.", + "type": "string" + } + } + }, + "PaymentCurrencyAmount": { + "description": "Supplies monetary amounts", + "type": "object", + "properties": { + "currency": { + "description": "A currency identifier", + "type": "string" + }, + "value": { + "description": "Decimal monetary value", + "type": "string" + }, + "currencySystem": { + "description": "Currency system", + "type": "string" + } + } + }, + "PaymentDetails": { + "description": "Provides information about the requested transaction", + "type": "object", + "properties": { + "total": { + "$ref": "#/definitions/PaymentItem", + "description": "Contains the total amount of the payment request" + }, + "displayItems": { + "description": "Contains line items for the payment request that the user agent may display", + "type": "array", + "items": { + "$ref": "#/definitions/PaymentItem" + } + }, + "shippingOptions": { + "description": "A sequence containing the different shipping options for the user to choose from", + "type": "array", + "items": { + "$ref": "#/definitions/PaymentShippingOption" + } + }, + "modifiers": { + "description": "Contains modifiers for particular payment method identifiers", + "type": "array", + "items": { + "$ref": "#/definitions/PaymentDetailsModifier" + } + }, + "error": { + "description": "Error description", + "type": "string" + } + } + }, + "PaymentItem": { + "description": "Indicates what the payment request is for and the value asked for", + "type": "object", + "properties": { + "label": { + "description": "Human-readable description of the item", + "type": "string" + }, + "amount": { + "$ref": "#/definitions/PaymentCurrencyAmount", + "description": "Monetary amount for the item" + }, + "pending": { + "description": "When set to true this flag means that the amount field is not final.", + "type": "boolean" + } + } + }, + "PaymentShippingOption": { + "description": "Describes a shipping option", + "type": "object", + "properties": { + "id": { + "description": "String identifier used to reference this PaymentShippingOption", + "type": "string" + }, + "label": { + "description": "Human-readable description of the item", + "type": "string" + }, + "amount": { + "$ref": "#/definitions/PaymentCurrencyAmount", + "description": "Contains the monetary amount for the item" + }, + "selected": { + "description": "Indicates whether this is the default selected PaymentShippingOption", + "type": "boolean" + } + } + }, + "PaymentDetailsModifier": { + "description": "Provides details that modify the PaymentDetails based on payment method identifier", + "type": "object", + "properties": { + "supportedMethods": { + "description": "Contains a sequence of payment method identifiers", + "type": "array", + "items": { + "type": "string" + } + }, + "total": { + "$ref": "#/definitions/PaymentItem", + "description": "This value overrides the total field in the PaymentDetails dictionary for the payment method identifiers in the supportedMethods field" + }, + "additionalDisplayItems": { + "description": "Provides additional display items that are appended to the displayItems field in the PaymentDetails dictionary for the payment method identifiers in the supportedMethods field", + "type": "array", + "items": { + "$ref": "#/definitions/PaymentItem" + } + }, + "data": { + "description": "A JSON-serializable object that provides optional information that might be needed by the supported payment methods", + "type": "object" + } + } + }, + "PaymentMethodData": { + "description": "Indicates a set of supported payment methods and any associated payment method specific data for those methods", + "type": "object", + "properties": { + "supportedMethods": { + "description": "Required sequence of strings containing payment method identifiers for payment methods that the merchant web site accepts", + "type": "array", + "items": { + "type": "string" + } + }, + "data": { + "description": "A JSON-serializable object that provides optional information that might be needed by the supported payment methods", + "type": "object" + } + } + }, + "PaymentOptions": { + "description": "Provides information about the options desired for the payment request", + "type": "object", + "properties": { + "requestPayerName": { + "description": "Indicates whether the user agent should collect and return the payer's name as part of the payment request", + "type": "boolean" + }, + "requestPayerEmail": { + "description": "Indicates whether the user agent should collect and return the payer's email address as part of the payment request", + "type": "boolean" + }, + "requestPayerPhone": { + "description": "Indicates whether the user agent should collect and return the payer's phone number as part of the payment request", + "type": "boolean" + }, + "requestShipping": { + "description": "Indicates whether the user agent should collect and return a shipping address as part of the payment request", + "type": "boolean" + }, + "shippingType": { + "description": "If requestShipping is set to true, then the shippingType field may be used to influence the way the user agent presents the user interface for gathering the shipping address", + "type": "string" + } + } + }, + "PaymentRequest": { + "description": "A request to make a payment", + "type": "object", + "properties": { + "id": { + "description": "ID of this payment request", + "type": "string" + }, + "methodData": { + "description": "Allowed payment methods for this request", + "type": "array", + "items": { + "$ref": "#/definitions/PaymentMethodData" + } + }, + "details": { + "$ref": "#/definitions/PaymentDetails", + "description": "Details for this request" + }, + "options": { + "$ref": "#/definitions/PaymentOptions", + "description": "Provides information about the options desired for the payment request" + }, + "expires": { + "description": "Expiration for this request, in ISO 8601 duration format (e.g., 'P1D')", + "type": "string" + } + } + }, + "PaymentRequestComplete": { + "description": "Payload delivered when completing a payment request", + "type": "object", + "properties": { + "id": { + "description": "Payment request ID", + "type": "string" + }, + "paymentRequest": { + "$ref": "#/definitions/PaymentRequest", + "description": "Initial payment request" + }, + "paymentResponse": { + "$ref": "#/definitions/PaymentResponse", + "description": "Corresponding payment response" + } + } + }, + "PaymentResponse": { + "description": "A PaymentResponse is returned when a user has selected a payment method and approved a payment request", + "type": "object", + "properties": { + "methodName": { + "description": "The payment method identifier for the payment method that the user selected to fulfil the transaction", + "type": "string" + }, + "details": { + "description": "A JSON-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine successful fund transfer", + "type": "object" + }, + "shippingAddress": { + "$ref": "#/definitions/PaymentAddress", + "description": "If the requestShipping flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then shippingAddress will be the full and final shipping address chosen by the user" + }, + "shippingOption": { + "description": "If the requestShipping flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then shippingOption will be the id attribute of the selected shipping option", + "type": "string" + }, + "payerEmail": { + "description": "If the requestPayerEmail flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then payerEmail will be the email address chosen by the user", + "type": "string" + }, + "payerPhone": { + "description": "If the requestPayerPhone flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then payerPhone will be the phone number chosen by the user", + "type": "string" + } + } + }, + "PaymentRequestCompleteResult": { + "description": "Result from a completed payment request", + "type": "object", + "properties": { + "result": { + "description": "Result of the payment request completion", + "type": "string" + } + } + }, + "PaymentRequestUpdate": { + "description": "An update to a payment request", + "type": "object", + "properties": { + "id": { + "description": "ID for the payment request to update", + "type": "string" + }, + "details": { + "$ref": "#/definitions/PaymentDetails", + "description": "Update payment details" + }, + "shippingAddress": { + "$ref": "#/definitions/PaymentAddress", + "description": "Updated shipping address" + }, + "shippingOption": { + "description": "Updated shipping options", + "type": "string" + } + } + }, + "PaymentRequestUpdateResult": { + "description": "A result object from a Payment Request Update invoke operation", + "type": "object", + "properties": { + "details": { + "$ref": "#/definitions/PaymentDetails", + "description": "Update payment details" + } + } + } + }, + "securityDefinitions": { + "bearer_auth": { + "type": "apiKey", + "description": "Access token to authenticate calls to the Bot Connector Service.", + "name": "Authorization", + "in": "header" } + } } \ No newline at end of file From f046a8f2e352f192a383f15e44b1da3efcf20ba0 Mon Sep 17 00:00:00 2001 From: Tracy Boehrer Date: Tue, 6 Aug 2019 09:52:58 -0700 Subject: [PATCH 2/4] Corrections to autorest generate command --- libraries/swagger/generateClient.cmd | 8 ++++---- libraries/swagger/package-lock.json | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libraries/swagger/generateClient.cmd b/libraries/swagger/generateClient.cmd index e8c960b7d..19b655a71 100644 --- a/libraries/swagger/generateClient.cmd +++ b/libraries/swagger/generateClient.cmd @@ -1,11 +1,11 @@ call npm install replace@0.3.0 - +del /q generated del /q ..\botbuilder-schema\src\main\java\com\microsoft\bot\schema\models\ -call autorest .\README.md --java --add-credentials true +call autorest .\README.md --java --add-credentials -robocopy .\generated\models ..\botbuilder-schema\src\main\java\com\microsoft\bot\schema\models *.* /move /xf *Exception.java +robocopy .\generated\src\main\java\com\microsoft\bot\schema\models ..\botbuilder-schema\src\main\java\com\microsoft\bot\schema\models *.* /move /xf *Exception.java call .\node_modules\.bin\replace "import com.microsoft.bot.schema.models.ErrorResponseException;" "import com.microsoft.bot.connector.models.ErrorResponseException;" . -r -q --include="*.java" call .\node_modules\.bin\replace "import com.microsoft.bot.schema.ConnectorClient;" "import com.microsoft.bot.connector.ConnectorClient;" . -r -q --include="*.java" @@ -14,4 +14,4 @@ call .\node_modules\.bin\replace "import com.microsoft.bot.schema.Conversations; call .\node_modules\.bin\replace "import com.microsoft.rest.RestException;" "import com.microsoft.rest.RestException;import com.microsoft.bot.schema.models.ErrorResponse;" . -r -q --include="ErrorResponseException.java" call .\node_modules\.bin\replace "package com.microsoft.bot.schema" "package com.microsoft.bot.connector" . -r -q --include="*.java" -robocopy .\generated ..\bot-connector\src\main\java\com\microsoft\bot\connector *.* /e /move +robocopy .\generated\src\main\java\com\microsoft\bot\schema ..\bot-connector\src\main\java\com\microsoft\bot\connector *.* /e /move diff --git a/libraries/swagger/package-lock.json b/libraries/swagger/package-lock.json index e8db7bee5..2ddf92e87 100644 --- a/libraries/swagger/package-lock.json +++ b/libraries/swagger/package-lock.json @@ -17,8 +17,8 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } }, "nomnom": { @@ -26,8 +26,8 @@ "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.6.2.tgz", "integrity": "sha1-hKZqJgF0QI/Ft3oY+IjszET7aXE=", "requires": { - "colors": "0.5.1", - "underscore": "1.4.4" + "colors": "0.5.x", + "underscore": "~1.4.4" } }, "replace": { @@ -35,9 +35,9 @@ "resolved": "https://registry.npmjs.org/replace/-/replace-0.3.0.tgz", "integrity": "sha1-YAgXIRiGWFlatqeU63/ty0yNOcc=", "requires": { - "colors": "0.5.1", - "minimatch": "0.2.14", - "nomnom": "1.6.2" + "colors": "0.5.x", + "minimatch": "~0.2.9", + "nomnom": "1.6.x" } }, "sigmund": { From 058b4d18894c3f98f2a5cdaf7660c1bd83e392fc Mon Sep 17 00:00:00 2001 From: Tracy Boehrer Date: Wed, 7 Aug 2019 09:25:44 -0700 Subject: [PATCH 3/4] Changes to comments in ConversationsImpl --- .vs/botbuilder-java/v15/.suo | Bin 24576 -> 0 bytes .../implementation/ConnectorClientImpl.java | 24 +- .../implementation/ConversationsImpl.java | 662 +++--------------- 3 files changed, 132 insertions(+), 554 deletions(-) delete mode 100644 .vs/botbuilder-java/v15/.suo diff --git a/.vs/botbuilder-java/v15/.suo b/.vs/botbuilder-java/v15/.suo deleted file mode 100644 index 6f94d5c872e14bfd7bf932f9cbc9c3c314bdcb8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24576 zcmeHPOKcm*8D9Er$4=@rbskL<*>RkQMTXSFk{sDB^y#{xwk=mY3AryhzHC<-KpBDVl7Q1nnS6ZiXOcf{q2k0r&Z zw!tB0XE-xE|I9!C{PWL0|Lh0vAN=zVfBn>7lz=;}Y*#+JyI0xeOON>C$`=%6KmIfA zv%7ciGK+CUd+t8Mz(vKx&r$l6X{ChFQr0+>q1_>6=lYm~B$~ST`}+p}_R*grM^NfJ zPrF5D0nt=$C}#n^fY`LM+O&>f<{@R(3{ zyqS9rWsbr>4}T2)1^5@?UxI%b{y2OTo^`|!KIFxl)!EByje)J4|Nj`M&i~(V(!fdj z-^%%40^HvG7wBJ~mpk#7e1LQJ8N?ZW1>tV^N4)?05c(-f@*IC!FuoV>1n0lx75=il z`R~WZ*2O8aQI6XVzXP6hz;WfcbKE$79Cz|t(gfEF@_f<+=Mecjc|O+!t`+3_a-ERl z{1nnS-MLP&jz+!}|L@29Tm#7eUxAOqC*TL*2jPd{hv84a`(d06{Ab=*eQ6WE_%z}v z-~Y3Se;xjHUz)6Y7HJpYFT$tc-+;daKL>vq{t7(HehcAM_$>Uqm$rcL8oUa>2%m$` z!^^st5Wfzu!{2~khL?FVMAe&i=amYi3BfZNPL{tz@nI$&d(m6dtt z5&7pf_um909uvJQ0uvU(uyT*A>uJb8q+#-^u<*ZuvXm|8GJtCX?m6_;1}4(LI%O~i zBSOsBZn1_>_TN7U4Ga1*W)SDxqPu_=5CaAvWdKo!6j&>b#*`@`396t$ZG&_^g#L5B zJq{nX|7Tbho^A%zdr9d-zu5-%*p++xFbi~~Xe}^stb_g+0C$ap2A2k&bDk8i0*HAb z{l+%5Cx#I+frq>@iLfH}Dt!NR2k;HNC-L77d{T;|On^F6z|V>K`Lzz<7XhCe^9 zyO2m{?oKd?c9bzoxfj*FRDTOj0RLQnxo--K{}GhsT2B{*U%&ru*?P|x(SO!OIUy|k z(<%3C7vWMO_o;}sbf-|F5&j9EyKd5*2H&bZz<=Zz>XS6k5;zKs zH-S&C>&`!NIZNQ8S)J^^gdG)e!INCIwo`A1GTGBP&WepC*Z$~ zy28RIulTn|fGH&j9LFKMO@p&1Am0t*Ujlq6if01!IjAgnt-OKO1hpb3JK(=Z0DnI` zT{!p|l$$~ORM2IuM8NsiF8&V#uAG1F{HFYsL+x?|xEr>SwuCjNxeUVj_af?(ZD5~T zxo1&;vN>JZnbGrkL%XS3T1K;-*bQ|>y?rb0xhTWHL+0JNJ&+jcPs9_qQ>tNWKSyoP zU$Ql8)-nsap*^3q&5D)NvX)jh?d+oIELL^d|=0=8E3C`yNIg|LZHoWADB36E8V* zuo7LgD%VvbT3kn?12h)&)o@kp`0nrC{q*6tzuzf*LXl%1cK-QWMm{?OO3UL%Y40Ye zkSkyYo~uv{yAM@afp_)$|G_LciJi$YiP`V_KweYrtkwuy=>S8N&(T4i(5C*wpR_q+eGqb*0a)444d7M|&FtbGkK$f*J zq_i#DkQIE6+TT1RV)ng)yxRVITNXe1#Fc!X2NDpR50gg6|Jw9hk()T2h39Rn&b@|3JROGr_R@hrEB;TLAoge+E3i1kYWV zg`MZD;Cvs}P?^f!e3pKy=20lyDrrT)i%{!**yYP{z7;lJF$`pffmo`upi zlfOAOJl|~QX#d0hlbthcR#xUw_dV*Ze^TFR3CtVoYmB|FbJHMsIASfNeHb;PevK6L zZxODiN8!W5_pg6bLb9odk!8((dYBdacFIPLZL#8jPhA%ExnbeIhO#`nrfUXY>Nq4N zxNp=xV;=qqo31vu{y%^JgXeBM-J&HNb$`_VR&|2)>*D!`3)y|vFIAg5g}*=clB&91 zch*()&%N`X`{ev5vKwRB>G@Ax{qKjE<{|liC;H1S^M5h#&?sxm2X5&xUaG-v-*Hb&`|2OgWGoJh@?SEY?rpn)5K zwrvQ~{s<)PDM;ZXIQJgLK5Pi#1Y#3dk0+pun?gR%tP>a++CR$k_r5mZ`}=<$=U_LW z1ztj*UD>lLuvu4lbSy6J?DUNo<9a#(Yytn(4W8mSH!N; z5L#Di*(&%?NjU5t81lEUd8LhP*#7(B2j%a}LgJ@w8D~Ok2l^Lq37f9<8wzNqYX5P6 zowjc5oySHtW`s<6XWPAYp3V73o%d$Xvom7%NIMdqfYYut>`DKDzu*4l@5dsM58pcY zs}J6J;b%mpOI_8cMDHh&dkufIB;E>pfGeN;>$ev^e&WfufAq*(fB5O^T!b28Nn&eb z*vbBBV=bMh1o=U_WlI^eFVk^T8r+y8g#{8wV2S-)l8bBJ`&{#%@X&<2HVkT9Bs zN02G`{{vwE-S+zPEc(wgGrDfre;h_VtTQbBd-gw7I_-k}Put_qahLW#!ho3rCpXgj zshQDcq}hFJPPZ$nk#;J1-Hh>uz-7IZH*fa$%|TPGo265U;aHr%{=P|=<5w*0R7tBi zmTL6(%~lo-J@>k{mNA#L(y7JxU}3m0Qb;87!*O*`-Oob{!u7-7!Gw<^={4KYim^%4 zFtnTlICktct)y9cE;gl$1l3x*HgNT-S1|2ZdTFV@uW08?3wH~u?HdZ+ypa)gI5&JE zF*Z1)#Ye~H`(@?+R-94o>yEl;Xx)W1Ph9NwaJpyGES7O0!`ee=Y5m(8?6dd0(+nvd za;D$JVCl}9tl(PWbH&iSSjP5BW!?@(?!{)JS>lEu!+rjPLo>&i{_VUKXK|YvzU^_3e!tpx-eCbRaYJUGOy8h3Nv5=pCZXy2`lswiN z-#$tPj@JwfAjz2hJq~(Jx`b@YytGD^uWg{oEv2Vj5kUgPuCkXcJ;(>O{0H_uG&y+Z zHfFG$OX-n_efst$4sP>WLB+DU;1tUvlgZH-&u(pRuFEyJ=IWcgxZ@q%qd~&C^eUPw z9)r=;XmTVvG?o~Sj-}#>=-`P&YAik)A03^F-}xvqbuy0Mtt91O@dCnVA~6+@CZ`ig z-1tkzC&%KcRLa*^%-#)sot{Z$HgnByU@kpN_|uc=+1A(mZr>W57>f@i2G+Z`L4FYQ zf1?3W;%Z{PBBX~YZLtDzVe>+am;{+{@M4!7@*G@xjHOFz*}iT%q8&?`l{O8*glGV8 zzAOYD4ry$`Ze7spL`GdYxR5hT1%0V1B1N|UVq3ei)N2(z-(BgZ|7u7C)u07@1AXc5 z3-@j}26KL%NZ-Y&zH22x!ErASYIpF_!(({Kem;aa`-9Div)w0BPnhLWOt*uPd#{mf z+C%Q0W10u?Z<`maxx}nr50$(>aKSpT%G6#D?^m^f5%t7kJgN;6zLb?1mu@p@vW`x} zc5Wj_yw$II6S%$G$kL9Z)7!|z|26n9r>N8w%Wpzt#VzHqx2j!C@(y(MecJq&*Vlfx zg!{}RC+w|k$`9h`6QN(02ra)-whhX(etB2MMbkE(V)F}H_3x{Xqqk-Bq=at-9T1Y6 z+q>E)zgsl}tnjY4?tNc^Uw^9LU1^)7D5oHtb5VE|_Be`i3-&hyu)>*!l@7mK!LL^E z_8e_>waUyh04~xs#LWv z8PhcESVk}7QPIn@v}33KT}W{tCPyVj9UkZQPVO1G?+Wgi#79&1VY9*F8}<*Y4VK&s zu67~V2<$EKL56NDz(Sfj)c`vCR3CIKT`}29ZY$dCKe}K227sK!;cYOkyw5#>0$Ovw zEl~SSfz~z{M?pEYUqG{!KG;H$>=U34KIs~LZGrsfkD<7S`=t?imm%xjDGhHG;*v`5 z`wwC`)*qy{&A9)!{fGO#4r-x`;CNY_2c*D_s{dES?H}ePU=271zBh#L@eBz*HjK1k z&}eHa5Ax^);Az5waSS!(P>1{ih^q#9Y|E^QdiG!P1fn_yJ^L>UGl91On|%+aJN92; Qzj70PMQZ+)o8VmiADnM}hX4Qo diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConnectorClientImpl.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConnectorClientImpl.java index 042ac1d86..e65c1a165 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConnectorClientImpl.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConnectorClientImpl.java @@ -8,13 +8,16 @@ package com.microsoft.bot.connector.implementation; import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureResponseBuilder; import com.microsoft.azure.AzureServiceClient; import com.microsoft.bot.connector.Attachments; import com.microsoft.bot.connector.ConnectorClient; -import com.microsoft.bot.connector.Conversations; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; import com.microsoft.rest.retry.RetryStrategy; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; import java.io.IOException; import java.io.InputStream; @@ -214,4 +217,23 @@ protected void initialize() { public String userAgent() { return this.user_agent_string; } + + /** + * This is a copy of what the Azure Client does to create a RestClient. This returns + * a RestClient.Builder so that the app can create a custom RestClient, and supply + * it to ConnectorClient during construction. + * + * One use case of this is for supplying a Proxy to the RestClient. + * + * @param baseUrl + * @param credentials + * @return + */ + public static RestClient.Builder getDefaultRestClientBuilder(String baseUrl, ServiceClientCredentials credentials){ + return new RestClient.Builder(new OkHttpClient.Builder(), new Retrofit.Builder()) + .withBaseUrl(baseUrl) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()); + } } diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConversationsImpl.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConversationsImpl.java index 489bd43b1..dfb2309f9 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConversationsImpl.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/implementation/ConversationsImpl.java @@ -130,17 +130,9 @@ public static CompletableFuture> completableFutureFromObservable(Obs } /** - * GetConversations. - * List the Conversations in which this bot has participated. - GET from this method with a skip token - The return value is a ConversationsResult, which contains an array of ConversationMembers and a skip token. If the skip token is not empty, then - there are further values to be returned. Call this method again with the returned token to get more values. - Each ConversationMembers object contains the ID of the conversation and an array of ChannelAccounts that describe the members of the conversation. + * Implementation of getConversations. * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ConversationsResult object if successful. + * @see Conversations#getConversations */ @Override public ConversationsResult getConversations() { @@ -148,16 +140,9 @@ public ConversationsResult getConversations() { } /** - * GetConversations. - * List the Conversations in which this bot has participated. - GET from this method with a skip token - The return value is a ConversationsResult, which contains an array of ConversationMembers and a skip token. If the skip token is not empty, then - there are further values to be returned. Call this method again with the returned token to get more values. - Each ConversationMembers object contains the ID of the conversation and an array of ChannelAccounts that describe the members of the conversation. + * Implementation of getConversationsAsync. * - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object + * @see Conversations#getConversationsAsync */ @Override public ServiceFuture getConversationsAsync(final ServiceCallback serviceCallback) { @@ -165,15 +150,9 @@ public ServiceFuture getConversationsAsync(final ServiceCal } /** - * GetConversations. - * List the Conversations in which this bot has participated. - GET from this method with a skip token - The return value is a ConversationsResult, which contains an array of ConversationMembers and a skip token. If the skip token is not empty, then - there are further values to be returned. Call this method again with the returned token to get more values. - Each ConversationMembers object contains the ID of the conversation and an array of ChannelAccounts that describe the members of the conversation. + * Implementation of getConversationsAsync. * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ConversationsResult object + * @see Conversations#getConversationsAsync */ @Override public Observable getConversationsAsync() { @@ -186,15 +165,9 @@ public ConversationsResult call(ServiceResponse response) { } /** - * GetConversations. - * List the Conversations in which this bot has participated. - GET from this method with a skip token - The return value is a ConversationsResult, which contains an array of ConversationMembers and a skip token. If the skip token is not empty, then - there are further values to be returned. Call this method again with the returned token to get more values. - Each ConversationMembers object contains the ID of the conversation and an array of ChannelAccounts that describe the members of the conversation. + * Implementation of getConversationsWithServiceResponseAsync. * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ConversationsResult object + * @see Conversations#getConversationsWithServiceResponseAsync */ @Override public Observable> getConversationsWithServiceResponseAsync() { @@ -214,18 +187,9 @@ public Observable> call(Response getConversationsAsync(String continuationToken, final ServiceCallback serviceCallback) { @@ -251,16 +207,9 @@ public ServiceFuture getConversationsAsync(String continuat } /** - * GetConversations. - * List the Conversations in which this bot has participated. - GET from this method with a skip token - The return value is a ConversationsResult, which contains an array of ConversationMembers and a skip token. If the skip token is not empty, then - there are further values to be returned. Call this method again with the returned token to get more values. - Each ConversationMembers object contains the ID of the conversation and an array of ChannelAccounts that describe the members of the conversation. + * Implementation of getConversationsAsync. * - * @param continuationToken skip or continuation token - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ConversationsResult object + * @see Conversations#getConversationsAsync */ @Override public Observable getConversationsAsync(String continuationToken) { @@ -273,16 +222,9 @@ public ConversationsResult call(ServiceResponse response) { } /** - * GetConversations. - * List the Conversations in which this bot has participated. - GET from this method with a skip token - The return value is a ConversationsResult, which contains an array of ConversationMembers and a skip token. If the skip token is not empty, then - there are further values to be returned. Call this method again with the returned token to get more values. - Each ConversationMembers object contains the ID of the conversation and an array of ChannelAccounts that describe the members of the conversation. + * Implementation of getConversationsWithServiceResponseAsync. * - * @param continuationToken skip or continuation token - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ConversationsResult object + * @see Conversations#getConversationsWithServiceResponseAsync */ @Override public Observable> getConversationsWithServiceResponseAsync(String continuationToken) { @@ -308,25 +250,9 @@ private ServiceResponse getConversationsDelegate(Response createConversationAsync(ConversationParameters parameters, final ServiceCallback serviceCallback) { @@ -359,23 +270,9 @@ public ServiceFuture createConversationAsync(Conve } /** - * CreateConversation. - * 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() ... ) ; - ```. + * Implementation of CreateConversation. * - * @param parameters Parameters to create the conversation from - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ConversationResourceResponse object + * @see Conversations#createConversationAsync */ @Override public Observable createConversationAsync(ConversationParameters parameters) { @@ -387,6 +284,9 @@ public ConversationResourceResponse call(ServiceResponse> CreateConversationAsync(ConversationParameters parameters) { CompletableFuture> future_result = completableFutureFromObservable(createConversationAsync(parameters)); return future_result; @@ -394,23 +294,9 @@ public CompletableFuture> CreateConversationA /** - * CreateConversation. - * 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() ... ) ; - ```. + * Implementation of createConversationWithServiceResponseAsync. * - * @param parameters Parameters to create the conversation from - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ConversationResourceResponse object + * @see Conversations#createConversationWithServiceResponseAsync */ @Override public Observable> createConversationWithServiceResponseAsync(ConversationParameters parameters) { @@ -442,20 +328,9 @@ private ServiceResponse createConversationDelegate } /** - * SendToConversation. - * 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. + * Implementation of sendToConversation. * - * @param conversationId Conversation ID - * @param activity Activity to send - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ResourceResponse object if successful. + * @see Conversations#sendToConversation */ @Override public ResourceResponse sendToConversation(String conversationId, Activity activity) { @@ -463,19 +338,9 @@ public ResourceResponse sendToConversation(String conversationId, Activity activ } /** - * SendToConversation. - * 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. + * Implementation of sendToConversationAsync. * - * @param conversationId Conversation ID - * @param activity Activity to send - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object + * @see Conversations#sendToConversationAsync */ @Override public ServiceFuture sendToConversationAsync(String conversationId, Activity activity, final ServiceCallback serviceCallback) { @@ -483,18 +348,9 @@ public ServiceFuture sendToConversationAsync(String conversati } /** - * SendToConversation. - * 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. + * Implementation of sendToConversationAsync. * - * @param conversationId Conversation ID - * @param activity Activity to send - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ResourceResponse object + * @see Conversations#sendToConversationAsync */ @Override public Observable sendToConversationAsync(String conversationId, Activity activity) { @@ -507,18 +363,9 @@ public ResourceResponse call(ServiceResponse response) { } /** - * SendToConversation. - * 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. + * Implementation of sendToConversationWithServiceResponseAsync. * - * @param conversationId Conversation ID - * @param activity Activity to send - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ResourceResponse object + * @see Conversations#sendToConversationWithServiceResponseAsync */ @Override public Observable> sendToConversationWithServiceResponseAsync(String conversationId, Activity activity) { @@ -553,18 +400,9 @@ private ServiceResponse sendToConversationDelegate(Response updateActivityAsync(String conversationId, String activityId, Activity activity, final ServiceCallback serviceCallback) { @@ -590,16 +420,9 @@ public ServiceFuture updateActivityAsync(String conversationId } /** - * UpdateActivity. - * 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. + * Implementation of updateActivityAsync. * - * @param conversationId Conversation ID - * @param activityId activityId to update - * @param activity replacement Activity - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ResourceResponse object + * @see Conversations#updateActivityAsync */ @Override public Observable updateActivityAsync(String conversationId, String activityId, Activity activity) { @@ -612,16 +435,9 @@ public ResourceResponse call(ServiceResponse response) { } /** - * UpdateActivity. - * 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. + * Implementation of updateActivityWithServiceResponseAsync. * - * @param conversationId Conversation ID - * @param activityId activityId to update - * @param activity replacement Activity - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ResourceResponse object + * @see Conversations#updateActivityWithServiceResponseAsync */ @Override public Observable> updateActivityWithServiceResponseAsync(String conversationId, String activityId, Activity activity) { @@ -659,21 +475,9 @@ private ServiceResponse updateActivityDelegate(Response replyToActivityAsync(String conversationId, String activityId, Activity activity, final ServiceCallback serviceCallback) { @@ -702,19 +495,9 @@ public ServiceFuture replyToActivityAsync(String conversationI } /** - * ReplyToActivity. - * 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. + * Implementation of replyToActivityAsync. * - * @param conversationId Conversation ID - * @param activityId activityId the reply is to (OPTIONAL) - * @param activity Activity to send - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ResourceResponse object + * @see Conversations#replyToActivityAsync */ @Override public Observable replyToActivityAsync(String conversationId, String activityId, Activity activity) { @@ -727,19 +510,9 @@ public ResourceResponse call(ServiceResponse response) { } /** - * ReplyToActivity. - * 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. + * Implementation of replyToActivityWithServiceResponseAsync. * - * @param conversationId Conversation ID - * @param activityId activityId the reply is to (OPTIONAL) - * @param activity Activity to send - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ResourceResponse object + * @see Conversations#replyToActivityWithServiceResponseAsync */ @Override public Observable> replyToActivityWithServiceResponseAsync(String conversationId, String activityId, Activity activity) { @@ -777,15 +550,9 @@ private ServiceResponse replyToActivityDelegate(Response deleteActivityAsync(String conversationId, String activityId, final ServiceCallback serviceCallback) { @@ -809,14 +570,9 @@ public ServiceFuture deleteActivityAsync(String conversationId, String act } /** - * DeleteActivity. - * Delete an existing activity. - Some channels allow you to delete an existing activity, and if successful this method will remove the specified activity. + * Implementation of deleteActivityAsync. * - * @param conversationId Conversation ID - * @param activityId activityId to delete - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @see Conversations#deleteActivityAsync */ @Override public Observable deleteActivityAsync(String conversationId, String activityId) { @@ -829,14 +585,9 @@ public Void call(ServiceResponse response) { } /** - * DeleteActivity. - * Delete an existing activity. - Some channels allow you to delete an existing activity, and if successful this method will remove the specified activity. + * Implementation of deleteActivityWithServiceResponseAsync. * - * @param conversationId Conversation ID - * @param activityId activityId to delete - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @see Conversations#deleteActivityWithServiceResponseAsync */ @Override public Observable> deleteActivityWithServiceResponseAsync(String conversationId, String activityId) { @@ -869,15 +620,9 @@ private ServiceResponse deleteActivityDelegate(Response resp } /** - * GetConversationMembers. - * 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. + * Implementation of getConversationMembers. * - * @param conversationId Conversation ID - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the List<ChannelAccount> object if successful. + * @see Conversations#getConversationMembers */ @Override public List getConversationMembers(String conversationId) { @@ -885,14 +630,9 @@ public List getConversationMembers(String conversationId) { } /** - * GetConversationMembers. - * 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. + * Implementation of getConversationMembersAsync. * - * @param conversationId Conversation ID - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object + * @see Conversations#getConversationMembersAsync */ @Override public ServiceFuture> getConversationMembersAsync(String conversationId, final ServiceCallback> serviceCallback) { @@ -900,13 +640,9 @@ public ServiceFuture> getConversationMembersAsync(String co } /** - * GetConversationMembers. - * 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. + * Implementation of getConversationMembersAsync. * - * @param conversationId Conversation ID - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<ChannelAccount> object + * @see Conversations#getConversationMembersAsync */ @Override public Observable> getConversationMembersAsync(String conversationId) { @@ -919,13 +655,9 @@ public List call(ServiceResponse> response) } /** - * GetConversationMembers. - * 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. + * Implementation of getConversationMembersWithServiceResponseAsync. * - * @param conversationId Conversation ID - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<ChannelAccount> object + * @see Conversations#getConversationMembersWithServiceResponseAsync */ @Override public Observable>> getConversationMembersWithServiceResponseAsync(String conversationId) { @@ -954,16 +686,9 @@ private ServiceResponse> getConversationMembersDelegate(Res } /** - * DeleteConversationMember. - * Deletes a member from a converstion. - This REST API takes a ConversationId and a memberId (of type string) and removes that member from the conversation. If that member was the last member - of the conversation, the conversation will also be deleted. + * Implementation of deleteConversationMember. * - * @param conversationId Conversation ID - * @param memberId ID of the member to delete from this conversation - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @see Conversations#deleteConversationMember */ @Override public void deleteConversationMember(String conversationId, String memberId) { @@ -971,16 +696,9 @@ public void deleteConversationMember(String conversationId, String memberId) { } /** - * DeleteConversationMember. - * Deletes a member from a converstion. - This REST API takes a ConversationId and a memberId (of type string) and removes that member from the conversation. If that member was the last member - of the conversation, the conversation will also be deleted. + * Implementation of deleteConversationMemberAsync. * - * @param conversationId Conversation ID - * @param memberId ID of the member to delete from this conversation - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object + * @see Conversations#deleteConversationMemberAsync */ @Override public ServiceFuture deleteConversationMemberAsync(String conversationId, String memberId, final ServiceCallback serviceCallback) { @@ -988,15 +706,9 @@ public ServiceFuture deleteConversationMemberAsync(String conversationId, } /** - * DeleteConversationMember. - * Deletes a member from a converstion. - This REST API takes a ConversationId and a memberId (of type string) and removes that member from the conversation. If that member was the last member - of the conversation, the conversation will also be deleted. + * Implementation of deleteConversationMemberAsync. * - * @param conversationId Conversation ID - * @param memberId ID of the member to delete from this conversation - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @see Conversations#deleteConversationMemberAsync */ @Override public Observable deleteConversationMemberAsync(String conversationId, String memberId) { @@ -1007,6 +719,7 @@ public Void call(ServiceResponse response) { } }); } + /** * DeleteConversationMemberFuture * Deletes a member from a converstion. @@ -1018,21 +731,16 @@ This REST API takes a ConversationId and a memberId (of type string) and removes * @throws IllegalArgumentException thrown if parameters fail the validation * @return CompletableFuture of List < Void > */ + // FIXME: This return result is ridiculous. public CompletableFuture> deleteConversationMemberFuture(String conversationId, String memberId) throws ExecutionException, InterruptedException { CompletableFuture> future_result = completableFutureFromObservable(deleteConversationMemberAsync(conversationId, memberId)); return future_result; } /** - * DeleteConversationMember. - * Deletes a member from a converstion. - This REST API takes a ConversationId and a memberId (of type string) and removes that member from the conversation. If that member was the last member - of the conversation, the conversation will also be deleted. + * Implementation of deleteConversationMemberWithServiceResponseAsync. * - * @param conversationId Conversation ID - * @param memberId ID of the member to delete from this conversation - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @see Conversations#deleteConversationMemberWithServiceResponseAsync */ @Override public Observable> deleteConversationMemberWithServiceResponseAsync(String conversationId, String memberId) { @@ -1066,16 +774,9 @@ private ServiceResponse deleteConversationMemberDelegate(Response getActivityMembers(String conversationId, String activityId) { @@ -1083,15 +784,9 @@ public List getActivityMembers(String conversationId, String act } /** - * GetActivityMembers. - * 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. + * Implementation of getActivityMembersAsync. * - * @param conversationId Conversation ID - * @param activityId Activity ID - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object + * @see Conversations#getActivityMembersAsync */ @Override public ServiceFuture> getActivityMembersAsync(String conversationId, String activityId, final ServiceCallback> serviceCallback) { @@ -1099,14 +794,9 @@ public ServiceFuture> getActivityMembersAsync(String conver } /** - * GetActivityMembers. - * 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. + * Implementation of getActivityMembersAsync. * - * @param conversationId Conversation ID - * @param activityId Activity ID - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<ChannelAccount> object + * @see Conversations#getActivityMembersAsync */ @Override public Observable> getActivityMembersAsync(String conversationId, String activityId) { @@ -1119,14 +809,9 @@ public List call(ServiceResponse> response) } /** - * GetActivityMembers. - * 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. + * Implementation of getActivityMembersWithServiceResponseAsync. * - * @param conversationId Conversation ID - * @param activityId Activity ID - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<ChannelAccount> object + * @see Conversations#getActivityMembersWithServiceResponseAsync */ @Override public Observable>> getActivityMembersWithServiceResponseAsync(String conversationId, String activityId) { @@ -1158,17 +843,9 @@ private ServiceResponse> getActivityMembersDelegate(Respons } /** - * UploadAttachment. - * 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. + * Implementation of uploadAttachment. * - * @param conversationId Conversation ID - * @param attachmentUpload Attachment data - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ResourceResponse object if successful. + * @see Conversations#uploadAttachment */ @Override public ResourceResponse uploadAttachment(String conversationId, AttachmentData attachmentUpload) { @@ -1176,16 +853,9 @@ public ResourceResponse uploadAttachment(String conversationId, AttachmentData a } /** - * UploadAttachment. - * 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. + * Implementation of uploadAttachmentAsync. * - * @param conversationId Conversation ID - * @param attachmentUpload Attachment data - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object + * @see Conversations#uploadAttachmentAsync */ @Override public ServiceFuture uploadAttachmentAsync(String conversationId, AttachmentData attachmentUpload, final ServiceCallback serviceCallback) { @@ -1193,15 +863,9 @@ public ServiceFuture uploadAttachmentAsync(String conversation } /** - * UploadAttachment. - * 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. + * Implementation of uploadAttachmentAsync. * - * @param conversationId Conversation ID - * @param attachmentUpload Attachment data - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ResourceResponse object + * @see Conversations#uploadAttachmentAsync */ @Override public Observable uploadAttachmentAsync(String conversationId, AttachmentData attachmentUpload) { @@ -1214,15 +878,9 @@ public ResourceResponse call(ServiceResponse response) { } /** - * UploadAttachment. - * 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. + * Implementation of uploadAttachmentWithServiceResponseAsync. * - * @param conversationId Conversation ID - * @param attachmentUpload Attachment data - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ResourceResponse object + * @see Conversations#uploadAttachmentWithServiceResponseAsync */ @Override public Observable> uploadAttachmentWithServiceResponseAsync(String conversationId, AttachmentData attachmentUpload) { @@ -1258,18 +916,9 @@ private ServiceResponse uploadAttachmentDelegate(Response sendConversationHistoryAsync(String conversationId, Transcript history, final ServiceCallback serviceCallback) { @@ -1297,18 +936,9 @@ public ServiceFuture sendConversationHistoryAsync(String conve } /** - * This method allows you to upload the historic activities to the conversation. - * - * Sender must ensure that the historic activities have unique ids and appropriate timestamps. - * The ids are used by the client to deal with duplicate activities and the timestamps are used by - * the client to render the activities in the right order. + * Implementation of sendConversationHistoryAsync. * - * @param conversationId Conversation ID - * @param history Historic activities - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ResourceResponse object if successful. + * @see Conversations#sendConversationHistoryAsync */ @Override public Observable sendConversationHistoryAsync(String conversationId, Transcript history) { @@ -1321,18 +951,9 @@ public ResourceResponse call(ServiceResponse response) { } /** - * This method allows you to upload the historic activities to the conversation. - * - * Sender must ensure that the historic activities have unique ids and appropriate timestamps. - * The ids are used by the client to deal with duplicate activities and the timestamps are used by - * the client to render the activities in the right order. + * Implementation of sendConversationHistoryWithServiceResponseAsync. * - * @param conversationId Conversation ID - * @param history Historic activities - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ResourceResponse object if successful. + * @see Conversations#sendConversationHistoryWithServiceResponseAsync */ @Override public Observable> sendConversationHistoryWithServiceResponseAsync(String conversationId, Transcript history) { @@ -1368,25 +989,9 @@ private ServiceResponse sendConversationHistoryDelegate(Respon /** - * Enumerate the members of a conversation one page at a time. - * - * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. - * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members - * of the conversation and a continuation token that can be used to get more values. - * - * One page of ChannelAccounts records are returned with each call. The number of records in a page may - * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no - * additional results the response will not contain a continuation token. If there are no members in the - * conversation the Members will be empty or not present in the response. - * - * A response to a request that has a continuation token from a prior request may rarely return members - * from a previous request. + * Implementation of getConversationPagedMembers. * - * @param conversationId Conversation ID - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedMembersResult object if successful. + * @see Conversations#getConversationPagedMembers */ @Override public PagedMembersResult getConversationPagedMembers(String conversationId){ @@ -1394,26 +999,9 @@ public PagedMembersResult getConversationPagedMembers(String conversationId){ } /** - * Enumerate the members of a conversation one page at a time. - * - * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. - * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members - * of the conversation and a continuation token that can be used to get more values. - * - * One page of ChannelAccounts records are returned with each call. The number of records in a page may - * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no - * additional results the response will not contain a continuation token. If there are no members in the - * conversation the Members will be empty or not present in the response. - * - * A response to a request that has a continuation token from a prior request may rarely return members - * from a previous request. + * Implementation of getConversationPagedMembersAsync. * - * @param conversationId Conversation ID - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedMembersResult object if successful. + * @see Conversations#getConversationPagedMembersAsync */ @Override public ServiceFuture getConversationPagedMembersAsync(String conversationId, final ServiceCallback serviceCallback){ @@ -1421,25 +1009,9 @@ public ServiceFuture getConversationPagedMembersAsync(String } /** - * Enumerate the members of a conversation one page at a time. - * - * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. - * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members - * of the conversation and a continuation token that can be used to get more values. - * - * One page of ChannelAccounts records are returned with each call. The number of records in a page may - * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no - * additional results the response will not contain a continuation token. If there are no members in the - * conversation the Members will be empty or not present in the response. - * - * A response to a request that has a continuation token from a prior request may rarely return members - * from a previous request. + * Implementation of getConversationPagedMembersAsync. * - * @param conversationId Conversation ID - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedMembersResult object if successful. + * @see Conversations#getConversationPagedMembersAsync */ @Override public Observable getConversationPagedMembersAsync(String conversationId){ @@ -1452,25 +1024,9 @@ public PagedMembersResult call(ServiceResponse response) { } /** - * Enumerate the members of a conversation one page at a time. - * - * This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. - * It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members - * of the conversation and a continuation token that can be used to get more values. - * - * One page of ChannelAccounts records are returned with each call. The number of records in a page may - * vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no - * additional results the response will not contain a continuation token. If there are no members in the - * conversation the Members will be empty or not present in the response. - * - * A response to a request that has a continuation token from a prior request may rarely return members - * from a previous request. + * Implementation of getConversationPagedMembersWithServiceResponseAsync. * - * @param conversationId Conversation ID - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the observable to the ResourceResponse object + * @see Conversations#getConversationPagedMembersWithServiceResponseAsync */ @Override public Observable> getConversationPagedMembersWithServiceResponseAsync(String conversationId){ From 6079202478bb8c4c6cb7b73da0058d8708e0e416 Mon Sep 17 00:00:00 2001 From: Tracy Boehrer Date: Thu, 8 Aug 2019 11:47:39 -0700 Subject: [PATCH 4/4] Ignore swagger\generated --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a2fa067fb..ce2912fb5 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ dependency-reduced-pom.xml *.factorypath .vscode/settings.json pom.xml.versionsBackup +libraries/swagger/generated