/// <summary>
 /// Sends a PUT to '/api/externalsystem/{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 UpdateExternalSystem(string id, CreateOrUpdateExternalSystem model, string expand = null)
 {
     return new RestOperation("PUT", "api/externalsystem/" + id + "")
         {
             Content = model,                    QueryParams =
                 {
                      {"$expand", expand},
                 }
         };
 }
partial         void CopyExtraPropertiesToClone(CreateOrUpdateExternalSystem clone, bool includeLocalProperties);
		/// <summary>
        /// Sends a POST to '/api/externalsystems'  (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<ExternalSystem> CreateExternalSystemAsync(CreateOrUpdateExternalSystem model, string expand = null)
        {
            var operation = Operations.CreateExternalSystem(model, expand);
			var response = await _client.SendAsync(operation.BuildRequest(_client));
			EnsureSuccess(response);
			var result = await response.Content.ReadAsAsync<ExternalSystem>();
			return result;
						
		}
 public CreateOrUpdateExternalSystem Clone(bool includeLocalProperties)
 {
     var c = new CreateOrUpdateExternalSystem
             {
                 Enabled = Enabled,
                 FieldValues = FieldValues,
                 Name = Name,
                 OrganisationId = OrganisationId,
                 Type = Type,
             };
     CopyExtraPropertiesToClone(c, includeLocalProperties);
     return c;
 }
        /// <summary>
        /// Sends a PUT to '/api/externalsystem/{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 ExternalSystem UpdateExternalSystem(string id, CreateOrUpdateExternalSystem model, string expand = null)
        {
            var operation = Operations.UpdateExternalSystem(id, model, expand);
			var response = _client.SendAsync(operation.BuildRequest(_client)).Result;
			EnsureSuccess(response);
			var result = response.Content.ReadAsAsync<ExternalSystem>().Result;
			return result;
			
		}