コード例 #1
0
        /// <summary>
        /// Advanced Query You can pass up cookies to use for a query in the input object optionally. This is shown in the example.\n\n\nThis feature is required if you are using authenticated APIs and maintaining a session between calls.
        /// </summary>
        /// <param name="id">ID of the Connector you are querying.</param>
        /// <param name="query">The query to execute.</param>
        /// <returns>Page</returns>
        public async System.Threading.Tasks.Task<Page> QueryPostAsync (string id, Query query)
        {
            // verify the required parameter 'id' is set
            if (id == null) throw new ApiException(400, "Missing required parameter 'id' when calling QueryPost");
            // verify the required parameter 'query' is set
            if (query == null) throw new ApiException(400, "Missing required parameter 'query' when calling QueryPost");
            
    
            var path = "/store/connector/{id}/_query";
    
            var pathParams = new Dictionary<String, String>();
            var queryParams = new Dictionary<String, String>();
            var headerParams = new Dictionary<String, String>();
            var formParams = new Dictionary<String, String>();
            var fileParams = new Dictionary<String, FileParameter>();
            String postBody = null;
    
            pathParams.Add("format", "json");
            if (id != null) pathParams.Add("id", ApiClient.ParameterToString(id)); // path parameter
            
            
            
            
            postBody = ApiClient.Serialize(query); // http body (model) parameter
            
    
            // authentication setting, if any
            String[] authSettings = new String[] {  };
    
            // make the HTTP request
            IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
            if (((int)response.StatusCode) >= 400)
                throw new ApiException ((int)response.StatusCode, "Error calling QueryPost: " + response.Content, response.Content);

            return (Page) ApiClient.Deserialize(response.Content, typeof(Page), response.Headers);
        }
コード例 #2
0
ファイル: QueryTests.cs プロジェクト: CloudBoost/swagger
 public void Init()
 {
     instance = new Query();
 }