title: How to use protection setWarningOnly(warningOnly) in google spreadsheet
body: <p>I saw google developers release Note here.
  <a href="https://developers.google.com/apps-script/releases/" rel="nofollow">https://developers.google.com/apps-script/releases/</a>
  at August 4, 2015 they say "Added the following methods to the Spreadsheet service to let scripts control "warning-based" protection for spreadsheet ranges "</p>
  
  <p>*Protection.isWarningOnly()
  *Protection.setWarningOnly(warningOnly)</p>
  
  <p>Im trying to make warning based protection sheet with google apps script.(and it should be have some unprotected cells)</p>
  
  <p>i tried like this but it doesn't work.</p>
  
  <pre><code>  var sheet = SpreadsheetApp.getActiveSheet();
   var protection = sheet.protect().setDescription('Sample protected sheet').isWarningOnly()
   var unprotected = sheet.getRange('B2:C5');
   protection.setUnprotectedRanges([unprotected]);
   protection.setWarningOnly(warningOnly)
  </code></pre>
  
  <p>does anyone success to use warningOnly methods?
  please tell me how to use this.</p>