/// <summary>
 /// Sends a PUT to '/api/incident/{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 UpdateIncident(string id, CreateOrUpdateIncident model, string expand = null)
 {
     return new RestOperation("PUT", "api/incident/" + id + "")
         {
             Content = model,                    QueryParams =
                 {
                      {"$expand", expand},
                 }
         };
 }
partial         void CopyExtraPropertiesToClone(CreateOrUpdateIncident clone, bool includeLocalProperties);
		/// <summary>
        /// Sends a POST to '/api/incidents'  (asynchronous)
        /// </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 async Task<Incident> CreateIncidentAsync(CreateOrUpdateIncident model, string expand = null)
        {
            var operation = Operations.CreateIncident(model, expand);
			var response = await _client.SendAsync(operation.BuildRequest(_client));
			EnsureSuccess(response);
			var result = await response.Content.ReadAsAsync<Incident>();
			return result;
						
		}
 public CreateOrUpdateIncident Clone(bool includeLocalProperties)
 {
     var c = new CreateOrUpdateIncident
             {
                 AssignedToId = AssignedToId,
                 Description = Description,
                 FieldValues = FieldValues,
                 Id = Id,
                 Number = Number,
                 PriorityId = PriorityId,
                 ProjectId = ProjectId,
                 ResolutionId = ResolutionId,
                 StatusId = StatusId,
                 Summary = Summary,
                 TemporaryId = TemporaryId,
                 TypeId = TypeId,
                 WidgetValues = WidgetValues,
                 AffectedVersionIds = AffectedVersionIds.ToList(),
                 Comments = Comments.Select(x=>x.Clone(includeLocalProperties)).ToList(),
                 ComponentIds = ComponentIds.ToList(),
                 ExternalSystemLinkIds = ExternalSystemLinkIds.ToList(),
                 ExternalSystemLinks = ExternalSystemLinks.Select(x=>x.Clone(includeLocalProperties)).ToList(),
                 FixedVersionIds = FixedVersionIds.ToList(),
             };
     CopyExtraPropertiesToClone(c, includeLocalProperties);
     return c;
 }
        /// <summary>
        /// Sends a PUT to '/api/incident/{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 virtual Incident UpdateIncident(string id, CreateOrUpdateIncident model, string expand = null)
        {
            var operation = Operations.UpdateIncident(id, model, expand);
			var response = _client.SendAsync(operation.BuildRequest(_client)).Result;
			EnsureSuccess(response);
			var result = response.Content.ReadAsAsync<Incident>().Result;
			return result;
			
		}