/// <summary> /// Get variables /// </summary> /// <remarks> /// This endpoint will list the variables of a specific conversation. /// Variables may contain one or more values. /// You have to specify a conversation ID. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='conversationId'> /// ID of the Conversation to retrieve. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Variable> GetVariablesAsync(this IBotsocietyClient operations, string conversationId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetVariablesWithHttpMessagesAsync(conversationId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List conversations /// </summary> /// <remarks> /// This endpoint will list all of your conversations, together with their name /// and other details. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <ConversationInfo> > GetConversationsAsync(this IBotsocietyClient operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetConversationsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
protected void UseClientFor(Func <IBotsocietyClient, Task> doTest, string className = null, [CallerMemberName] string methodName = "") { using (MockContext context = MockContext.Start(className ?? ClassName, methodName)) { HttpMockServer.Initialize(className ?? ClassName, methodName, mode); IBotsocietyClient client = GetClient(HttpMockServer.CreateInstance()); doTest(client).Wait(); context.Stop(); } }
/// <summary> /// Auth /// </summary> /// <remarks> /// Go to your profile page in Botsociety /// https://app.botsociety.io/#/account/api /// and generate your API key by clicking on "Generate new API key" /// Then add it to your request's header as shown on the right hand side (click /// "Auth" above so see an example). /// You should expect to receive the following response if everything goes /// well: /// ``` /// { /// "auth": true, /// "info": "You are successfully calling the API. This is just a test API to /// check your authentication params." /// } /// ``` /// In case of errors, you should expect to receive the following response: /// ``` /// { /// "auth": false, /// "info": "User not auth for the API. Please go to /// https://app.botsociety.io/#/account/api and generate your API Key. You can /// find our API documentation here: https://botsociety.docs.apiary.io" /// } /// ``` /// This is just a test API to check your authentication params. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task AuthAsync(this IBotsocietyClient operations, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.AuthWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Auth /// </summary> /// <remarks> /// Go to your profile page in Botsociety /// https://app.botsociety.io/#/account/api /// and generate your API key by clicking on "Generate new API key" /// Then add it to your request's header as shown on the right hand side (click /// "Auth" above so see an example). /// You should expect to receive the following response if everything goes /// well: /// ``` /// { /// "auth": true, /// "info": "You are successfully calling the API. This is just a test API to /// check your authentication params." /// } /// ``` /// In case of errors, you should expect to receive the following response: /// ``` /// { /// "auth": false, /// "info": "User not auth for the API. Please go to /// https://app.botsociety.io/#/account/api and generate your API Key. You can /// find our API documentation here: https://botsociety.docs.apiary.io" /// } /// ``` /// This is just a test API to check your authentication params. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static void Auth(this IBotsocietyClient operations) { operations.AuthAsync().GetAwaiter().GetResult(); }
/// <summary> /// Get variables /// </summary> /// <remarks> /// This endpoint will list the variables of a specific conversation. /// Variables may contain one or more values. /// You have to specify a conversation ID. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='conversationId'> /// ID of the Conversation to retrieve. /// </param> public static Variable GetVariables(this IBotsocietyClient operations, string conversationId) { return(operations.GetVariablesAsync(conversationId).GetAwaiter().GetResult()); }
/// <summary> /// Get message /// </summary> /// <remarks> /// You can call this endpoint to get the content of a specific message, once /// you know the unique ID or the progressive ID. /// You can get the progressive ID by visiting the building mode page (Build /// button), progressive ID is referenced as "ID". /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='conversationId'> /// ID of the Conversation to retrieve. /// </param> /// <param name='messageId'> /// ID of the Message to retrieve. This can be or the unique ID or the /// progressive ID. /// </param> public static Message GetMessage(this IBotsocietyClient operations, string conversationId, string messageId) { return(operations.GetMessageAsync(conversationId, messageId).GetAwaiter().GetResult()); }
/// <summary> /// Get conversation /// </summary> /// <remarks> /// This endpoint will list the details of a specific conversation. /// You have to specify a conversation ID, which you can get from the previous /// request. /// Also, you can get the conversation ID by visiting the building mode page, /// the conversation ID is in the right side. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='conversationId'> /// ID of the Conversation to retrieve. /// </param> public static Conversation GetConversation(this IBotsocietyClient operations, string conversationId) { return(operations.GetConversationAsync(conversationId).GetAwaiter().GetResult()); }
/// <summary> /// List conversations /// </summary> /// <remarks> /// This endpoint will list all of your conversations, together with their name /// and other details. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IList <ConversationInfo> GetConversations(this IBotsocietyClient operations) { return(operations.GetConversationsAsync().GetAwaiter().GetResult()); }