title: How to change course owner using Classroom.Courses.patch()
body: <p>I'm trying to use Apps Script to change the owner of a Google Classroom course.</p>
  
  <p>According to the documentation I can do it using <code>.patch()</code>. This is the relevant script:</p>
  
  <pre><code>   var body = {            
       ownerId: owner
     }
     var mask={
       mask:'ownerId'
     }
         var optArgs = (mask, body); 
  
      var course = {
        name: classname,
        courseState: state,
        description: desc,
        descriptionHeading: descHead,
        room: room,
        section: section
      };
         Classroom.Courses.patch(course, courseId,  optArgs )
  </code></pre>
  
  <p>When I run it to update the owner I get the following error message</p>
  
  <blockquote>
    <p>Could not be updated Invalid JSON payload received. Unknown name "ownerId": Cannot bind query parameter. Field 'ownerId' could not be found in request message.</p>
  </blockquote>
  
  <p>Just to demonstrate a contrast, when I run <code>.update()</code> instead:</p>
  
  <pre><code>Classroom.Courses.update(course, courseId)
  </code></pre>
  
  <p>...the rest of the course details are updated perfectly, however <code>.update()</code> doesn't allow you to change the owner; it has to be a <code>.patch()</code> to do that.</p>