getProperties() public method

Gets the properties of the Resource.
public getProperties ( ) : string>.Dictionary
return string>.Dictionary
Esempio n. 1
0
 /// <summary>
 /// Creates a new Resource.
 /// </summary>
 /// <param name="collectionType">Collection type to add the resource to</param>
 /// <param name="resource">Resource to add to the Collection</param>
 /// <returns>Newly created Resource</returns>
 public Resource create(string collectionType, Resource resource)
 {
     gdapi.WebRequest rRequestor = new gdapi.WebRequest(this);
     rRequestor.setType("POST");
     rRequestor.setBody(JsonConvert.SerializeObject(resource.getProperties()));
     rRequestor.setQuery(collectionType);
     return getResourceByRequest(rRequestor);
 }
Esempio n. 2
0
 /// <summary>
 /// Creates a new Resource.
 /// </summary>
 /// <param name="collectionType">Collection type to add the resource to</param>
 /// <param name="resource">Resource to add to the Collection</param>
 /// <returns>Newly created Resource</returns>
 public Resource create(string collectionType, Resource resource)
 {
     gdapi.WebRequest rRequestor = new gdapi.WebRequest(this);
     rRequestor.setType("POST");
     rRequestor.setBody(JsonConvert.SerializeObject(resource.getProperties()));
     rRequestor.setQuery(collectionType);
     return(getResourceByRequest(rRequestor));
 }
Esempio n. 3
0
 /// <summary>
 /// Performs an action from an action url and an input resource and returns the resulting Resource
 /// </summary>
 /// <param name="actionUrl">Action URL to perform.</param>
 /// <param name="inputResource">Input Resource to use send with the action URL.</param>
 /// <returns>Resource result of the action.</returns>
 public Resource doAction(string actionUrl, Resource inputResource)
 {
     gdapi.WebRequest rRequestor = new gdapi.WebRequest(this);
     rRequestor.setType("POST");
     rRequestor.setUrl(actionUrl);
     if (inputResource != null)
     {
         rRequestor.setBody(JsonConvert.SerializeObject(inputResource.getProperties()));
     }
     return(getResourceByRequest(rRequestor));
 }
Esempio n. 4
0
 /// <summary>
 /// Saves a Resource
 /// </summary>
 /// <param name="collectionType">Collection type to save the resource to</param>
 /// <param name="resource">Resource to save</param>
 /// <returns>Saved Resource</returns>
 public Resource save(string collectionType, Resource resource)
 {
     if (resource.hasProperty("id"))
     {
         gdapi.WebRequest rRequestor = new gdapi.WebRequest(this);
         rRequestor.setType("PUT");
         rRequestor.setBody(JsonConvert.SerializeObject(resource.getProperties()));
         rRequestor.setQuery(collectionType + "/" + resource.getProperty("id"));
         return(getResourceByRequest(rRequestor));
     }
     else
     {
         return(create(collectionType, resource));
     }
 }
Esempio n. 5
0
 /// <summary>
 /// Saves a Resource
 /// </summary>
 /// <param name="collectionType">Collection type to save the resource to</param>
 /// <param name="resource">Resource to save</param>
 /// <returns>Saved Resource</returns>
 public Resource save(string collectionType, Resource resource)
 {
     if (resource.hasProperty("id"))
     {
         gdapi.WebRequest rRequestor = new gdapi.WebRequest(this);
         rRequestor.setType("PUT");
         rRequestor.setBody(JsonConvert.SerializeObject(resource.getProperties()));
         rRequestor.setQuery(collectionType + "/" + resource.getProperty("id"));
         return getResourceByRequest(rRequestor);
     }
     else
     {
         return create(collectionType, resource);
     }
 }
Esempio n. 6
0
 /// <summary>
 /// Performs an action from an action url and an input resource and returns the resulting Resource
 /// </summary>
 /// <param name="actionUrl">Action URL to perform.</param>
 /// <param name="inputResource">Input Resource to use send with the action URL.</param>
 /// <returns>Resource result of the action.</returns>
 public Resource doAction(string actionUrl, Resource inputResource)
 {
     gdapi.WebRequest rRequestor = new gdapi.WebRequest(this);
     rRequestor.setType("POST");
     rRequestor.setUrl(actionUrl);
     if (inputResource != null)
     {
         rRequestor.setBody(JsonConvert.SerializeObject(inputResource.getProperties()));
     }
     return getResourceByRequest(rRequestor);
 }