def enhanced_stage(env: 'test',
                       sites: nil,
                       email_site_status: false,
                       wipe_target_environment: false,
                       synchronize_all_users: true)
      raise InvalidApiVersion, staging_versions unless staging_versions.include? 2

      payload = { 'to_env' => env, 'sites' => sites,
                  'detailed_status' => email_site_status,
                  'wipe_target_environment' => wipe_target_environment,
                  'synchronize_all_users' => synchronize_all_users }.to_json
      @conn.post('/api/v2/stage', payload)
    end
def enhanced_stage(env: 'test',
                       sites: nil,
                       email_site_status: false,
                       wipe_target_environment: false,
                       synchronize_all_users: true)
      raise InvalidApiVersion, staging_versions unless staging_versions.include? 2

      payload = { 'to_env' => env, 'sites' => sites,
                  'detailed_status' => email_site_status,
                  'wipe_target_environment' => wipe_target_environment,
                  'synchronize_all_users' => synchronize_all_users }.to_json
      @conn.post('/api/v2/stage', payload)
    end
Stage a site using the new method
 @param [String] to_env the name of of target env. defaults to test
 @param [Array] sites Array of site nids to stage
 @param [Boolean] email_site_status send an email about the staging status of each site
 @param [Boolean] wipe_target_environment recreate the target stage wiping all data
 @param [synchronize_all_users] only stage the user accounts required for the related collections and groups

 @return [Integer] Id of the staging task created.