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

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

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

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

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

            var localVarAccept = Vevro.Rasa.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 " + Vevro.Rasa.ApiClient.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }
            // authentication (TokenAuth) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("token")))
            {
                foreach (var kvp in Vevro.Rasa.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);
        }
コード例 #2
0
        /// <summary>
        /// Retrieve the loaded domain Returns the domain specification the currently loaded model is using.
        /// </summary>
        /// <exception cref="Vevro.Rasa.ApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>Task of ApiResponse (Domain)</returns>
        public async System.Threading.Tasks.Task <Vevro.Rasa.ApiClient.Client.ApiResponse <Domain> > DomainGetAsyncWithHttpInfo()
        {
            Vevro.Rasa.ApiClient.Client.RequestOptions requestOptions = new Vevro.Rasa.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 " + Vevro.Rasa.ApiClient.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }
            // authentication (TokenAuth) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("token")))
            {
                foreach (var kvp in Vevro.Rasa.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);
        }
コード例 #3
0
        /// <summary>
        /// Version of Rasa Returns the version of Rasa.
        /// </summary>
        /// <exception cref="Vevro.Rasa.ApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>ApiResponse of InlineResponse200</returns>
        public Vevro.Rasa.ApiClient.Client.ApiResponse <InlineResponse200> VersionGetWithHttpInfo()
        {
            Vevro.Rasa.ApiClient.Client.RequestOptions requestOptions = new Vevro.Rasa.ApiClient.Client.RequestOptions();

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

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

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

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

            var localVarAccept = Vevro.Rasa.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);
        }
コード例 #4
0
        /// <summary>
        /// Version of Rasa Returns the version of Rasa.
        /// </summary>
        /// <exception cref="Vevro.Rasa.ApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>Task of ApiResponse (InlineResponse200)</returns>
        public async System.Threading.Tasks.Task <Vevro.Rasa.ApiClient.Client.ApiResponse <InlineResponse200> > VersionGetAsyncWithHttpInfo()
        {
            Vevro.Rasa.ApiClient.Client.RequestOptions requestOptions = new Vevro.Rasa.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);
        }
コード例 #5
0
        public Vevro.Rasa.ApiClient.Client.ApiResponse <List <WebhookMessage> > SendMessageWithHttpInfo(string conversationId, string message)
        {
            // verify the required parameter 'conversationId' is set
            if (conversationId == null)
            {
                throw new Vevro.Rasa.ApiClient.Client.ApiException(400, "Missing required parameter 'conversationId' when calling TrackerApi->ConversationsConversationIdMessagesPost");
            }

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

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

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

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

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

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

            var localVarAccept = Vevro.Rasa.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 " + Vevro.Rasa.ApiClient.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }
            // authentication (TokenAuth) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("token")))
            {
                foreach (var kvp in Vevro.Rasa.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);
        }