code: func (o *UpdateVMWithStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
  
  	if err := r.SetTimeout(o.timeout); err != nil {
  		return err
  	}
  	var res []error
  
  	if o.Body == nil {
  		o.Body = new(models.VMState)
  	}
  
  	if err := r.SetBodyParam(o.Body); err != nil {
  		return err
  	}
  
  	// path param cid
  	if err := r.SetPathParam("cid", swag.FormatInt32(o.Cid)); err != nil {
  		return err
  	}
  
  	if len(res) > 0 {
  		return errors.CompositeValidationError(res...)
  	}
  	return nil
  }
docs: // WriteToRequest writes these params to a swagger request