/// <summary>
        /// Status of the currently loaded Rasa model Information about the currently loaded Rasa model.
        /// </summary>
        /// <exception cref="ApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>ApiResponse of InlineResponse2001</returns>
        public ApiClient.Client.ApiResponse <InlineResponse2001> StatusGetWithHttpInfo()
        {
            ApiClient.Client.RequestOptions requestOptions = new ApiClient.Client.RequestOptions();

            String[] @contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] @accepts = new String[] {
                "application/json"
            };

            var localVarContentType = ApiClient.Client.ClientUtils.SelectHeaderContentType(@contentTypes);

            if (localVarContentType != null)
            {
                requestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = ApiClient.Client.ClientUtils.SelectHeaderAccept(@accepts);

            if (localVarAccept != null)
            {
                requestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }


            // authentication (JWT) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                requestOptions.HeaderParameters.Add("Authorization", "Basic " + ApiClient.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }
            // authentication (TokenAuth) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("token")))
            {
                foreach (var kvp in ApiClient.Client.ClientUtils.ParameterToMultiMap("", "token", this.Configuration.GetApiKeyWithPrefix("token")))
                {
                    foreach (var value in kvp.Value)
                    {
                        requestOptions.QueryParameters.Add(kvp.Key, value);
                    }
                }
            }

            // make the HTTP request

            var response = this.Client.Get <InlineResponse2001>("/status", requestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception exception = this.ExceptionFactory("StatusGet", response);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(response);
        }
Esempio n. 2
0
        /// <summary>
        /// Retrieve the loaded domain Returns the domain specification the currently loaded model is using.
        /// </summary>
        /// <exception cref="ApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>Task of ApiResponse (Domain)</returns>
        public async System.Threading.Tasks.Task <ApiClient.Client.ApiResponse <Domain> > DomainGetAsyncWithHttpInfo()
        {
            ApiClient.Client.RequestOptions requestOptions = new ApiClient.Client.RequestOptions();

            String[] @contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] @accepts = new String[] {
                "application/json",
                "application/yaml"
            };

            foreach (var contentType in @contentTypes)
            {
                requestOptions.HeaderParameters.Add("Content-Type", contentType);
            }

            foreach (var accept in @accepts)
            {
                requestOptions.HeaderParameters.Add("Accept", accept);
            }


            // authentication (JWT) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                requestOptions.HeaderParameters.Add("Authorization", "Basic " + ApiClient.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }
            // authentication (TokenAuth) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("token")))
            {
                foreach (var kvp in ApiClient.Client.ClientUtils.ParameterToMultiMap("", "token", this.Configuration.GetApiKeyWithPrefix("token")))
                {
                    foreach (var value in kvp.Value)
                    {
                        requestOptions.QueryParameters.Add(kvp.Key, value);
                    }
                }
            }

            // make the HTTP request

            var response = await this.AsynchronousClient.GetAsync <Domain>("/domain", requestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception exception = this.ExceptionFactory("DomainGet", response);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(response);
        }
        /// <summary>
        /// Version of Rasa Returns the version of Rasa.
        /// </summary>
        /// <exception cref="ApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>ApiResponse of InlineResponse200</returns>
        public ApiClient.Client.ApiResponse <InlineResponse200> VersionGetWithHttpInfo()
        {
            ApiClient.Client.RequestOptions requestOptions = new ApiClient.Client.RequestOptions();

            String[] @contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] @accepts = new String[] {
                "application/json"
            };

            var localVarContentType = ApiClient.Client.ClientUtils.SelectHeaderContentType(@contentTypes);

            if (localVarContentType != null)
            {
                requestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = ApiClient.Client.ClientUtils.SelectHeaderAccept(@accepts);

            if (localVarAccept != null)
            {
                requestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }



            // make the HTTP request

            var response = this.Client.Get <InlineResponse200>("/version", requestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception exception = this.ExceptionFactory("VersionGet", response);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(response);
        }
        /// <summary>
        /// Version of Rasa Returns the version of Rasa.
        /// </summary>
        /// <exception cref="ApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>Task of ApiResponse (InlineResponse200)</returns>
        public async System.Threading.Tasks.Task <ApiClient.Client.ApiResponse <InlineResponse200> > VersionGetAsyncWithHttpInfo()
        {
            ApiClient.Client.RequestOptions requestOptions = new ApiClient.Client.RequestOptions();

            String[] @contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] @accepts = new String[] {
                "application/json"
            };

            foreach (var contentType in @contentTypes)
            {
                requestOptions.HeaderParameters.Add("Content-Type", contentType);
            }

            foreach (var accept in @accepts)
            {
                requestOptions.HeaderParameters.Add("Accept", accept);
            }



            // make the HTTP request

            var response = await this.AsynchronousClient.GetAsync <InlineResponse200>("/version", requestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception exception = this.ExceptionFactory("VersionGet", response);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(response);
        }
        public ApiClient.Client.ApiResponse <List <WebhookMessage> > SendMessageWithHttpInfo(string conversationId, string message)
        {
            // verify the required parameter 'conversationId' is set
            if (conversationId == null)
            {
                throw new ApiClient.Client.ApiException(400, "Missing required parameter 'conversationId' when calling TrackerApi->ConversationsConversationIdMessagesPost");
            }

            // verify the required parameter 'message' is set
            if (message == null)
            {
                throw new ApiClient.Client.ApiException(400, "Missing required parameter 'message' when calling TrackerApi->ConversationsConversationIdMessagesPost");
            }

            ApiClient.Client.RequestOptions requestOptions = new ApiClient.Client.RequestOptions();

            String[] @contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] @accepts = new String[] {
                "application/json"
            };

            var localVarContentType = ApiClient.Client.ClientUtils.SelectHeaderContentType(@contentTypes);

            if (localVarContentType != null)
            {
                requestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = ApiClient.Client.ClientUtils.SelectHeaderAccept(@accepts);

            if (localVarAccept != null)
            {
                requestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            requestOptions.Data = new WebhookMessage {
                Sender = conversationId, Message = message
            };

            // authentication (JWT) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                requestOptions.HeaderParameters.Add("Authorization", "Basic " + ApiClient.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }
            // authentication (TokenAuth) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("token")))
            {
                foreach (var kvp in ApiClient.Client.ClientUtils.ParameterToMultiMap("", "token", this.Configuration.GetApiKeyWithPrefix("token")))
                {
                    foreach (var value in kvp.Value)
                    {
                        requestOptions.QueryParameters.Add(kvp.Key, value);
                    }
                }
            }

            // make the HTTP request

            var response = this.Client.Post <List <WebhookMessage> >(RestPath, requestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception exception = this.ExceptionFactory("ConversationsConversationIdMessagesPost", response);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(response);
        }