/// <summary>
 /// Sends a POST to '/api/scriptpackages'
 /// </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 static RestOperation CreateScriptPackage(CreateOrUpdateScriptPackage model, string expand = null)
 {
     return new RestOperation("POST", "api/scriptpackages")
         {
             Content = model,                    QueryParams =
                 {
                      {"$expand", expand},
                 }
         };
 }
partial         void CopyExtraPropertiesToClone(CreateOrUpdateScriptPackage clone, bool includeLocalProperties);
		/// <summary>
        /// Sends a POST to '/api/scriptpackages'  (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<ScriptPackage> CreateScriptPackageAsync(CreateOrUpdateScriptPackage model, string expand = null)
        {
            var operation = Operations.CreateScriptPackage(model, expand);
			var response = await _client.SendAsync(operation.BuildRequest(_client));
			EnsureSuccess(response);
			var result = await response.Content.ReadAsAsync<ScriptPackage>();
			return result;
						
		}
 public CreateOrUpdateScriptPackage Clone(bool includeLocalProperties)
 {
     var c = new CreateOrUpdateScriptPackage
             {
                 Id = Id,
                 Name = Name,
                 OrderNumber = OrderNumber,
                 ParentId = ParentId,
                 ProjectId = ProjectId,
             };
     CopyExtraPropertiesToClone(c, includeLocalProperties);
     return c;
 }
        /// <summary>
        /// Sends a PUT to '/api/scriptpackage/{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 ScriptPackage UpdateScriptPackage(string id, CreateOrUpdateScriptPackage model, string expand = null)
        {
            var operation = Operations.UpdateScriptPackage(id, model, expand);
			var response = _client.SendAsync(operation.BuildRequest(_client)).Result;
			EnsureSuccess(response);
			var result = response.Content.ReadAsAsync<ScriptPackage>().Result;
			return result;
			
		}