Beispiel #1
0
        public HttpResponseMessage GetMetadata(string actionType, string recipientType, string metadataType)
        {
            // the following will parse the enums case-insensitively
            TeamsFlowbotActionType    teamsFlowbotActionType    = actionType.ParseWithDefault(defaultValue: TeamsFlowbotActionType.NotSpecified);
            TeamsFlowbotRecipientType teamsFlowbotRecipientType = recipientType.ParseWithDefault(defaultValue: TeamsFlowbotRecipientType.NotSpecified);

            var connectorMetadataType = metadataType.ParseWithDefault(defaultValue: ConnectorMetadataType.NotSpecified);

            var metadata = this
                           .GetTeamsFlowbotManager()
                           .GetMetadata(teamsFlowbotActionType, teamsFlowbotRecipientType, connectorMetadataType);

            return(this.Request.CreateResponse(statusCode: HttpStatusCode.OK, value: metadata));
        }
Beispiel #2
0
        public async Task <HttpResponseMessage> PostAndWaitForMessageWithOptions(string recipientType)
        {
            this.PopulateSenderFromAuthHeader();
            string operationName = "TeamsFlowbotActionsConnectorController.PostAndWaitForMessageWithOptions";
            TeamsFlowbotRecipientType teamsFlowbotRecipientType = recipientType.ParseWithDefault(defaultValue: TeamsFlowbotRecipientType.NotSpecified);

            Validation.RecipientType(teamsFlowbotRecipientType);

            return(teamsFlowbotRecipientType == TeamsFlowbotRecipientType.User
                ? await this
                   .GetTeamsFlowbotManager()
                   .PostMessageAsync <BotMessageWithOptionsRequest <UserBotRecipient>, UserBotRecipient>(operationName, this.Request, true, TeamsFlowbotActionType.MessageWithOptions)
                   .ConfigureAwait(continueOnCapturedContext: false)
                : await this
                   .GetTeamsFlowbotManager()
                   .PostMessageAsync <BotMessageWithOptionsRequest <ChannelBotRecipient>, ChannelBotRecipient>(operationName, this.Request, true, TeamsFlowbotActionType.MessageWithOptions)
                   .ConfigureAwait(continueOnCapturedContext: false));
        }