/**
 * Copyright 2016 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package com.example.helloworld;

import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
import com.google.api.server.spi.config.ApiNamespace;

import javax.inject.Named;

//[START all]
/** An endpoint class we are exposing */
@Api(name = "myApi",
    version = "v1",
    namespace = @ApiNamespace(ownerDomain = "helloworld.example.com",
        ownerName = "helloworld.example.com",
        packagePath = ""))
public class YourFirstAPI {

  /** A simple endpoint method that takes a name and says Hi back */
  @ApiMethod(name = "sayHi")
  public MyBean sayHi(@Named("name") String name) {
    MyBean response = new MyBean();
    response.setData("Hi, " + name);

    return response;
  }

}
//[END all]

@@ -634,16 +634,67 @@
 world;%0A%0A
+import com.google.api.server.spi.auth.common.User;%0A
 import c
@@ -834,16 +834,106 @@
 mespace;
+%0Aimport com.google.appengine.api.oauth.OAuthRequestException;%0A%0Aimport java.io.IOException;
 %0A%0Aimport
@@ -960,18 +960,22 @@
 %0A%0A//
+ 
 %5BSTART 
-all
+header
 %5D%0A/*
@@ -1197,16 +1197,33 @@
  = %22%22))%0A
+// %5BEND header%5D%0A%0A
 public c
@@ -1243,16 +1243,32 @@
 tAPI %7B%0A%0A
+  // %5BSTART hi%5D%0A
   /** A 
@@ -1512,19 +1512,406 @@
   %7D%0A
-%0A%7D%0A//%5BEND all%5D
+  //%5BEND hi%5D%0A%0A  // %5BSTART hi_user%5D%0A  /** A simple endpoint method that takes a name and says Hi back */%0A  @ApiMethod(name = %22sayHiUser%22)%0A  public MyBean sayHiUser(@Named(%22name%22) String name, User user)%0A      throws OAuthRequestException, IOException %7B%0A    MyBean response = new MyBean();%0A    response.setData(%22Hi, %22 + name + %22(%22 + user.getEmail() + %22)%22);%0A%0A    return response;%0A  %7D%0A  //%5BEND hi_user%5D%0A%0A%7D
 %0A

Add auth