/// <summary>
 /// Sends a PUT to '/api/projectcategory/{id}'
 /// </summary>
 /// <param name="id">a path parameter (no description)</param>
 /// <param name="model">a body parameter (no description)</param>
 /// <param name="expand">a query parameter (Allows the specifying of eager-loading of related data which is returned in-line within the results of the request.)</param>
 /// <returns></returns>
 public static RestOperation UpdateProjectCategory(string id, CreateOrUpdateProjectCategory model, string expand = null)
 {
     return new RestOperation("PUT", "api/projectcategory/" + id + "")
         {
             Content = model,                    QueryParams =
                 {
                      {"$expand", expand},
                 }
         };
 }
partial         void CopyExtraPropertiesToClone(CreateOrUpdateProjectCategory clone, bool includeLocalProperties);
		/// <summary>
        /// Sends a PUT to '/api/projectcategory/{id}'  (asynchronous)
        /// </summary>
        /// <param name="id">a path parameter (no description)</param>
        /// <param name="model">a body parameter (no description)</param>
        /// <param name="expand">a query parameter (Allows the specifying of eager-loading of related data which is returned in-line within the results of the request.)</param>
        /// <returns></returns>
        public virtual async Task<ProjectCategory> UpdateProjectCategoryAsync(string id, CreateOrUpdateProjectCategory model, string expand = null)
        {
            var operation = Operations.UpdateProjectCategory(id, model, expand);
			var response = await _client.SendAsync(operation.BuildRequest(_client));
			EnsureSuccess(response);
			var result = await response.Content.ReadAsAsync<ProjectCategory>();
			return result;
						
		}
 public CreateOrUpdateProjectCategory Clone(bool includeLocalProperties)
 {
     var c = new CreateOrUpdateProjectCategory
             {
                 Id = Id,
                 Name = Name,
                 OrderNumber = OrderNumber,
                 OrganisationId = OrganisationId,
                 ParentId = ParentId,
             };
     CopyExtraPropertiesToClone(c, includeLocalProperties);
     return c;
 }
        /// <summary>
        /// Sends a POST to '/api/projectcategories'
        /// </summary>
        /// <param name="model">a body parameter (no description)</param>
        /// <param name="expand">a query parameter (Allows the specifying of eager-loading of related data which is returned in-line within the results of the request.)</param>
        /// <returns></returns>
        public virtual ProjectCategory CreateProjectCategory(CreateOrUpdateProjectCategory model, string expand = null)
        {
            var operation = Operations.CreateProjectCategory(model, expand);
			var response = _client.SendAsync(operation.BuildRequest(_client)).Result;
			EnsureSuccess(response);
			var result = response.Content.ReadAsAsync<ProjectCategory>().Result;
			return result;
			
		}