Exemplo n.º 1
0
 public JToken Update(ObjCode objcode, List<string> parameters)
 {
     VerifySignedIn();
     parameters.Add("sessionID=" + SessionID);
     JToken json = client.DoPut(string.Format("/{0}", objcode), parameters.ToArray());
     return json;
 }
Exemplo n.º 2
0
 public virtual JToken Search(ObjCode objcode, List<string> parameters)
 {
     VerifySignedIn();
     parameters.Add("sessionID=" + SessionID);
     JToken json = client.DoGet(string.Format("/{0}/search", objcode), parameters.ToArray());
     return json;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Deletes an object.
        /// </summary>
        /// <param name="objcode">
        /// The <see cref="ObjCode"/> of the object to delete
        /// </param>
        /// <param name="parameters">
        /// A <see cref="System.String[]"/>
        /// </param>
        /// <returns>
        /// A <see cref="JToken"/>
        /// </returns>
        public JToken Delete(ObjCode objcode, object parameters)
        {
            VerifySignedIn();
            string[] p    = parameterObjectToStringArray(parameters, "sessionID=" + SessionID);
            JToken   json = client.DoDelete(string.Format("/{0}", objcode), p);

            return(json);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the object of the given ObjCode and the given id
        /// </summary>
        /// <param name="objcode">
        /// A <see cref="ObjCode"/> representing the type of object you are getting
        /// </param>
        /// <param name="id">
        /// A <see cref="System.String"/> representing the ID of the object you are getting
        /// </param>
        /// <param name="fieldsToInclude">
        /// The name of the fields to include in the results
        /// </param>
        /// <returns>
        /// A <see cref="JToken"/>
        /// </returns>
        public JToken Get(ObjCode objcode, string id, params string[] fieldsToInclude)
        {
            VerifySignedIn();

            List <string> parameters = new List <string>();
            StringBuilder sb         = new StringBuilder();

            if (fieldsToInclude != null && fieldsToInclude.Length > 0)
            {
                fieldsToInclude.ToList().ForEach(s => sb.Append(s).Append(","));
                sb.Remove(sb.Length - 1, 1);
                string fields = "fields=" + sb.ToString();
                parameters.Add(fields);
            }

            parameters.Add("sessionID=" + SessionID);

            JToken json = client.DoGet(string.Format("/{0}/{1}", objcode, id), parameters.ToArray());

            return(json);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Updates an object that already exists.
 /// </summary>
 /// <param name="objcode">
 /// The <see cref="ObjCode"/> of the object to update
 /// </param>
 /// <param name="parameters">
 /// Additional parameters of the object to update.
 /// </param>
 /// <returns>
 /// A <see cref="JToken"/>
 /// </returns>
 public JToken Update(ObjCode objcode, object parameters)
 {
     VerifySignedIn();
     string[] p = parameterObjectToStringArray(parameters, "sessionID=" + SessionID);
     JToken json = client.DoPut(string.Format("/{0}", objcode), p);
     return json;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Gets the object of the given ObjCode and the given id
 /// </summary>
 /// <param name="objcode">
 /// A <see cref="ObjCode"/> representing the type of object you are getting
 /// </param>
 /// <param name="id">
 /// A <see cref="System.String"/> representing the ID of the object you are getting
 /// </param>
 /// <param name="fieldsToInclude">
 /// The name of the fields to include in the results
 /// </param>
 /// <returns>
 /// A <see cref="JToken"/>
 /// </returns>
 public JToken Get(ObjCode objcode, string id, params string[] fieldsToInclude)
 {
     VerifySignedIn();
     List<string> parameters = new List<string>();
     StringBuilder sb = new StringBuilder();
     if (fieldsToInclude != null && fieldsToInclude.Length > 0) {
         fieldsToInclude.ToList().ForEach(s => sb.Append(s).Append(","));
         sb.Remove(sb.Length - 1, 1);
         string fields = "fields=" + sb.ToString();
         parameters.Add(fields);
     }
     parameters.Add("sessionID=" + SessionID);
     JToken json = client.DoGet(string.Format("/{0}/{1}", objcode, id), parameters.ToArray());
     return json;
 }