Ejemplo n.º 1
0
        static public Task <ArrayList> Load()
        {
            Debug.WriteLine("Fetching from server...");
            CloudApp.Init(code, key);
            CloudQuery query = new CloudQuery(Table);

            return(query.FindAsync());
        }
Ejemplo n.º 2
0
        public void FindTest()
        {
            // TODO: add unit test for the method 'Find'
            string     appId     = null; // TODO: replace null with proper value
            string     tableName = null; // TODO: replace null with proper value
            CloudQuery body      = null; // TODO: replace null with proper value

            var response = instance.Find(appId, tableName, body);

            Assert.IsInstanceOf <List <CloudObject> > (response, "response is List<CloudObject>");
        }
Ejemplo n.º 3
0
        static public async void Remove(List <string> items)
        {
            CloudQuery query = new CloudQuery(Table);

            foreach (string s in items)
            {
                var obj = await query.GetAsync <CloudObject>(s);

                await obj.DeleteAsync();
            }
        }
Ejemplo n.º 4
0
 public void Init()
 {
     instance = new CloudQuery();
 }
Ejemplo n.º 5
0
        /// <summary>
        /// find CloudObject meeting this query criteria 
        /// </summary>
        /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="appId">CloudApp id</param>
        /// <param name="tableName">cloud table name</param>
        /// <param name="body">query object</param>
        /// <returns>Task of ApiResponse (List&lt;CloudObject&gt;)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<List<CloudObject>>> FindAsyncWithHttpInfo (string appId, string tableName, CloudQuery body)
        {
            // verify the required parameter 'appId' is set
            if (appId == null) throw new ApiException(400, "Missing required parameter 'appId' when calling Find");
            // verify the required parameter 'tableName' is set
            if (tableName == null) throw new ApiException(400, "Missing required parameter 'tableName' when calling Find");
            // verify the required parameter 'body' is set
            if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling Find");
            
    
            var localVarPath = "data/{app_id}/{table_name}/find";
    
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (appId != null) localVarPathParams.Add("app_id", Configuration.ApiClient.ParameterToString(appId)); // path parameter
            if (tableName != null) localVarPathParams.Add("table_name", Configuration.ApiClient.ParameterToString(tableName)); // path parameter
            
            
            
            
            if (body.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
            }
            else
            {
                localVarPostBody = body; // byte array
            }

            

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, 
                Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, 
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;
 
            if (localVarStatusCode >= 400)
                throw new ApiException (localVarStatusCode, "Error calling Find: " + localVarResponse.Content, localVarResponse.Content);
            else if (localVarStatusCode == 0)
                throw new ApiException (localVarStatusCode, "Error calling Find: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);

            return new ApiResponse<List<CloudObject>>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (List<CloudObject>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<CloudObject>)));
            
        }
Ejemplo n.º 6
0
        /// <summary>
        /// find CloudObject meeting this query criteria 
        /// </summary>
        /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="appId">CloudApp id</param>
        /// <param name="tableName">cloud table name</param>
        /// <param name="body">query object</param>
        /// <returns>Task of List&lt;CloudObject&gt;</returns>
        public async System.Threading.Tasks.Task<List<CloudObject>> FindAsync (string appId, string tableName, CloudQuery body)
        {
             ApiResponse<List<CloudObject>> localVarResponse = await FindAsyncWithHttpInfo(appId, tableName, body);
             return localVarResponse.Data;

        }
Ejemplo n.º 7
0
 /// <summary>
 /// find CloudObject meeting this query criteria 
 /// </summary>
 /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="appId">CloudApp id</param> 
 /// <param name="tableName">cloud table name</param> 
 /// <param name="body">query object</param> 
 /// <returns>List&lt;CloudObject&gt;</returns>
 public List<CloudObject> Find (string appId, string tableName, CloudQuery body)
 {
      ApiResponse<List<CloudObject>> localVarResponse = FindWithHttpInfo(appId, tableName, body);
      return localVarResponse.Data;
 }
Ejemplo n.º 8
0
 public void Init()
 {
     instance = new CloudQuery();
 }