com.google.api.server.spi.config.ApiMethod.HttpMethod Java Examples

The following examples show how to use com.google.api.server.spi.config.ApiMethod.HttpMethod. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AdSearchEndpoints.java    From AdSearch_Endpoints with Apache License 2.0 6 votes vote down vote up
@ApiMethod(name = "getTokens", path = "getTokens",
        httpMethod = HttpMethod.GET)
public List<String> getTokens(@Named("name") String queryString) {

	// add Ads data
	AdsData ads1 = new AdsData((long) 1231, (long) 66, "basketball kobe shoe nike", 0.37f, 6.0f);
	ofy().save().entity(ads1).now();
	AdsData ads2 = new AdsData((long) 1232, (long) 66, "soccer shoe nike", 0.23f, 4.0f);
	ofy().save().entity(ads2).now();
	AdsData ads3 = new AdsData((long) 1233, (long) 67, "running shoe adidas", 0.53f, 7.5f);
	ofy().save().entity(ads3).now();
	AdsData ads4 = new AdsData((long) 1234, (long) 67, "soccer shoe adidas", 0.19f, 3.5f);
	ofy().save().entity(ads4).now();
	AdsData ads5 = new AdsData((long) 1235, (long) 67, "basketball shoe adidas", 0.29f, 5.5f);
	ofy().save().entity(ads5).now();
	
	// add Campaign data
	CampaignData cmp1 = new CampaignData((long) 66, 1500f);
	ofy().save().entity(cmp1).now();    	
	CampaignData cmp2 = new CampaignData((long) 67, 2800f);
	ofy().save().entity(cmp2).now();       	
	CampaignData cmp3 = new CampaignData((long) 68, 900f);
	ofy().save().entity(cmp3).now();   
	
    return QUERY_PARSER.parseQuery(queryString);
}
 
Example #2
Source File: BlobEndpoint.java    From io2014-codelabs with Apache License 2.0 6 votes vote down vote up
/**
 * Gets a signed URL that can be used to upload a blob.
 *
 * @param bucketName  Google Cloud Storage bucket to use for upload.
 * @param objectPath  path to the object in the bucket.
 * @param accessMode  controls how the uploaded blob can be accessed.
 * @param contentType the MIME type of the object of be uploaded. Can be null.
 * @param user        the user making the request.
 * @throws com.google.api.server.spi.response.UnauthorizedException if the user is not authorized.
 * @throws com.google.api.server.spi.response.BadRequestException   if the bucketName or objectPath are not valid.
 */
@ApiMethod(httpMethod = HttpMethod.GET, path = "blobs/uploads/{bucketName}/{objectPath}")
public BlobAccess getUploadUrl(@Named("bucketName") String bucketName,
                               @Named("objectPath") String objectPath, @Named("accessMode") BlobAccessMode accessMode,
                               @Nullable @Named("contentType") String contentType, User user)
  throws UnauthorizedException, BadRequestException {
  validateUser(user);

  validateBucketAndObjectPath(bucketName, objectPath);

  if (!reserveNameIfAvailable(bucketName, objectPath, accessMode, user)) {
    throw new UnauthorizedException("You don't have permissions to upload this object");
  }

  return getBlobUrlForUpload(
    bucketName, objectPath, accessMode, contentType != null ? contentType : "");
}
 
Example #3
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns a collection of Conference Object that the user is going to attend.
 *
 * @param user An user who invokes this method, null when the user is not signed in.
 * @return a Collection of Conferences that the user is going to attend.
 * @throws UnauthorizedException when the User object is null.
 */
@ApiMethod(
        name = "getConferencesToAttend",
        path = "getConferencesToAttend",
        httpMethod = HttpMethod.GET
)
public Collection<Conference> getConferencesToAttend(final User user)
        throws UnauthorizedException, NotFoundException {
    // If not signed in, throw a 401 error.
    if (user == null) {
        throw new UnauthorizedException("Authorization required");
    }
    Profile profile = ofy().load().key(Key.create(Profile.class, getUserId(user))).now();
    if (profile == null) {
        throw new NotFoundException("Profile doesn't exist.");
    }
    List<String> keyStringsToAttend = profile.getConferenceKeysToAttend();
    List<Key<Conference>> keysToAttend = new ArrayList<>();
    for (String keyString : keyStringsToAttend) {
        keysToAttend.add(Key.<Conference>create(keyString));
    }
    return ofy().load().keys(keysToAttend).values();
}
 
Example #4
Source File: BlobEndpoint.java    From solutions-mobile-backend-starter-java with Apache License 2.0 6 votes vote down vote up
/**
 * Deletes a blob.
 *
 * @param bucketName Google Cloud Storage bucket where the object was uploaded.
 * @param objectPath path to the object in the bucket.
 * @param user the user making the request.
 * @throws UnauthorizedException if the user is not authorized.
 * @throws BadRequestException if the bucketName or objectPath are not valid.
 * @throws InternalServerErrorException when the operation failed.
 */
@ApiMethod(httpMethod = HttpMethod.DELETE, path = "blobs/{bucketName}/{objectPath}")
public void deleteBlob(
    @Named("bucketName") String bucketName, @Named("objectPath") String objectPath, User user)
    throws UnauthorizedException, BadRequestException, InternalServerErrorException {
  validateUser(user);

  validateBucketAndObjectPath(bucketName, objectPath);

  boolean blobExists = checkDeletePermissions(bucketName, objectPath, user);

  if (!blobExists) {
    // DELETE operation is idempotent. The object doesn't exist, so there is no more work to do.
    return;
  }

  if (!deleteAllBlobInformation(bucketName, objectPath)) {
    throw new InternalServerErrorException("Deleting blob failed. You can retry.");
  }
}
 
Example #5
Source File: BlobEndpoint.java    From io2014-codelabs with Apache License 2.0 6 votes vote down vote up
/**
 * Deletes a blob.
 *
 * @param bucketName Google Cloud Storage bucket where the object was uploaded.
 * @param objectPath path to the object in the bucket.
 * @param user       the user making the request.
 * @throws com.google.api.server.spi.response.UnauthorizedException        if the user is not authorized.
 * @throws com.google.api.server.spi.response.BadRequestException          if the bucketName or objectPath are not valid.
 * @throws com.google.api.server.spi.response.InternalServerErrorException when the operation failed.
 */
@ApiMethod(httpMethod = HttpMethod.DELETE, path = "blobs/{bucketName}/{objectPath}")
public void deleteBlob(
  @Named("bucketName") String bucketName, @Named("objectPath") String objectPath, User user)
  throws UnauthorizedException, BadRequestException, InternalServerErrorException {
  validateUser(user);

  validateBucketAndObjectPath(bucketName, objectPath);

  boolean blobExists = checkDeletePermissions(bucketName, objectPath, user);

  if (!blobExists) {
    // DELETE operation is idempotent. The object doesn't exist, so there is no more work to do.
    return;
  }

  if (!deleteAllBlobInformation(bucketName, objectPath)) {
    throw new InternalServerErrorException("Deleting blob failed. You can retry.");
  }
}
 
Example #6
Source File: Endpoint1.java    From endpoints-java with Apache License 2.0 6 votes vote down vote up
@ApiMethod(
    name = "foos.list",
    path = "foos",
    httpMethod = HttpMethod.GET,
    cacheControl = @ApiMethodCacheControl(
        noCache = true,
        maxAge = 1
    ),
    scopes = {"s0", "s1 s2"},
    audiences = {"a0", "a1"},
    clientIds = {"c0", "c1"},
    authenticators = { FailAuthenticator.class },
    peerAuthenticators = { FailPeerAuthenticator.class }
)
public List<Foo> listFoos() {
  return null;
}
 
Example #7
Source File: WaxEndpoint.java    From endpoints-java with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new session from {@link WaxNewSessionRequest}.
 *
 * @return {@link WaxNewSessionResponse} with the created session id
 * @throws InternalServerErrorException if the session creation failed
 * @throws BadRequestException if the requested session name is bad
 */
@ApiMethod(
    name = "sessions.create",
    path = "newsession",
    httpMethod = HttpMethod.POST)
public WaxNewSessionResponse createSession(WaxNewSessionRequest request)
    throws InternalServerErrorException, BadRequestException {
  if (Strings.isNullOrEmpty(request.getSessionName())) {
    throw new BadRequestException("Name must be non-empty");
  }
  String sessionId =
      store.createSession(request.getSessionName(), request.getDurationInMillis());
  if (sessionId != null) {
    return new WaxNewSessionResponse(sessionId);
  }
  throw new InternalServerErrorException("Error while adding session");
}
 
Example #8
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns a collection of Conference Object that the user is going to attend.
 *
 * @param user An user who invokes this method, null when the user is not signed in.
 * @return a Collection of Conferences that the user is going to attend.
 * @throws UnauthorizedException when the User object is null.
 */
@ApiMethod(
        name = "getConferencesToAttend",
        path = "getConferencesToAttend",
        httpMethod = HttpMethod.GET
)
public Collection<Conference> getConferencesToAttend(final User user)
        throws UnauthorizedException, NotFoundException {
    // If not signed in, throw a 401 error.
    if (user == null) {
        throw new UnauthorizedException("Authorization required");
    }
    Profile profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
    if (profile == null) {
        throw new NotFoundException("Profile doesn't exist.");
    }
    List<String> keyStringsToAttend = profile.getConferenceKeysToAttend();
    List<Key<Conference>> keysToAttend = new ArrayList<>();
    for (String keyString : keyStringsToAttend) {
        keysToAttend.add(Key.<Conference>create(keyString));
    }
    return ofy().load().keys(keysToAttend).values();
}
 
Example #9
Source File: TestEndpoint.java    From endpoints-java with Apache License 2.0 6 votes vote down vote up
@ApiMethod(httpMethod = HttpMethod.GET, path = "testparamsquery")
public FieldContainer testParamsQuery(
    @Named("anint") Integer anInt,
    @Named("along") Long aLong,
    @Named("afloat") Float aFloat,
    @Named("adouble") Double aDouble,
    @Named("aboolean") Boolean aBoolean,
    @Named("astring") String aString,
    @Named("asimpledate") SimpleDate aSimpleDate,
    @Named("adateandtime") DateAndTime aDateAndTime,
    @Named("adate") Date aDate,
    @Named("anenum") TestEnum anEnum) {
  FieldContainer ret = new FieldContainer();
  ret.anInt = anInt;
  ret.aLong = aLong;
  ret.aFloat = aFloat;
  ret.aDouble = aDouble;
  ret.aBoolean = aBoolean;
  ret.aString = aString;
  ret.aSimpleDate = aSimpleDate;
  ret.aDateAndTime = aDateAndTime;
  ret.aDate = aDate;
  ret.anEnum = anEnum;
  return ret;
}
 
Example #10
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns a Conference object with the given conferenceId.
 *
 * @param websafeConferenceKey The String representation of the Conference Key.
 * @return a Conference object with the given conferenceId.
 * @throws NotFoundException when there is no Conference with the given conferenceId.
 */
@ApiMethod(
        name = "getConference",
        path = "conference/{websafeConferenceKey}",
        httpMethod = HttpMethod.GET
)
public Conference getConference(
        @Named("websafeConferenceKey") final String websafeConferenceKey)
        throws NotFoundException {
    Key<Conference> conferenceKey = Key.create(websafeConferenceKey);
    Conference conference = ofy().load().key(conferenceKey).now();
    if (conference == null) {
        throw new NotFoundException("No Conference found with key: " + websafeConferenceKey);
    }
    return conference;
}
 
Example #11
Source File: BlobEndpoint.java    From io2014-codelabs with Apache License 2.0 6 votes vote down vote up
@ApiMethod(httpMethod = ApiMethod.HttpMethod.POST,
  path = "images/process/{bucketName}/{objectPath}")
public BlobAccess transformImage(@Named("bucketName") String bucketName,
                                 @Named("objectPath") String objectPath,
                                 @Named("accessMode") BlobAccessMode accessMode,
                                 User user)
  throws BadRequestException, UnauthorizedException, InternalServerErrorException, NotFoundException {
  validateUser(user);
  checkDeletePermissions(bucketName, objectPath, user);
  BlobMetadata metadata = BlobManager.getBlobMetadata(bucketName, objectPath);
  String transformedObjectPath = String.valueOf("transformed-cloudguestbook-picture-" + System.currentTimeMillis());
  BlobAccess blobAccess = getBlobUrlForUpload(bucketName, transformedObjectPath, metadata.getAccessMode(), "");

  if (!reserveNameIfAvailable(bucketName, transformedObjectPath, accessMode, user)) {
    throw new UnauthorizedException("You don't have permissions to upload the transformed image");
  }

  // This method is incomplete.
  // Implement the rest of the method.
  // Complete example is located at MobileBackend/snippets/BlobEndpoints.java
  throw new NotFoundException("This method is not implemented yet.");
}
 
Example #12
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns a list of Conferences that the user created.
 * In order to receive the websafeConferenceKey via the JSON params, uses a POST method.
 *
 * @param user A user who invokes this method, null when the user is not signed in.
 * @return a list of Conferences that the user created.
 * @throws UnauthorizedException when the user is not signed in.
 */
@ApiMethod(
        name = "getConferencesCreated",
        path = "getConferencesCreated",
        httpMethod = HttpMethod.POST
)
public List<Conference> getConferencesCreated(final User user) throws UnauthorizedException {
    // If not signed in, throw a 401 error.
    if (user == null) {
        throw new UnauthorizedException("Authorization required");
    }
    String userId = user.getUserId();
    Key<Profile> userKey = Key.create(Profile.class, userId);
    return ofy().load().type(Conference.class)
            .ancestor(userKey)
            .order("name").list();
}
 
Example #13
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns a Conference object with the given conferenceId.
 *
 * @param websafeConferenceKey The String representation of the Conference Key.
 * @return a Conference object with the given conferenceId.
 * @throws NotFoundException when there is no Conference with the given conferenceId.
 */
@ApiMethod(
        name = "getConference",
        path = "conference/{websafeConferenceKey}",
        httpMethod = HttpMethod.GET
)
public Conference getConference(
        @Named("websafeConferenceKey") final String websafeConferenceKey)
        throws NotFoundException {
    Key<Conference> conferenceKey = Key.create(websafeConferenceKey);
    Conference conference = ofy().load().key(conferenceKey).now();
    if (conference == null) {
        throw new NotFoundException("No Conference found with key: " + websafeConferenceKey);
    }
    return conference;
}
 
Example #14
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns a collection of Conference Object that the user is going to attend.
 *
 * @param user An user who invokes this method, null when the user is not signed in.
 * @return a Collection of Conferences that the user is going to attend.
 * @throws UnauthorizedException when the User object is null.
 */
@ApiMethod(
        name = "getConferencesToAttend",
        path = "getConferencesToAttend",
        httpMethod = HttpMethod.GET
)
public Collection<Conference> getConferencesToAttend(final User user)
        throws UnauthorizedException, NotFoundException {
    // If not signed in, throw a 401 error.
    if (user == null) {
        throw new UnauthorizedException("Authorization required");
    }
    Profile profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
    if (profile == null) {
        throw new NotFoundException("Profile doesn't exist.");
    }
    List<String> keyStringsToAttend = profile.getConferenceKeysToAttend();
    List<Key<Conference>> keysToAttend = new ArrayList<>();
    for (String keyString : keyStringsToAttend) {
        keysToAttend.add(Key.<Conference>create(keyString));
    }
    return ofy().load().keys(keysToAttend).values();
}
 
Example #15
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
@ApiMethod(
        name = "getAnnouncement",
        path = "announcement",
        httpMethod = HttpMethod.GET
)
public Announcement getAnnouncement() {
    MemcacheService memcacheService = MemcacheServiceFactory.getMemcacheService();
    Object message = memcacheService.get(Constants.MEMCACHE_ANNOUNCEMENTS_KEY);
    if (message != null) {
        return new Announcement(message.toString());
    }
    return null;
}
 
Example #16
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns a Profile object associated with the given user object. The cloud
 * endpoints system automatically inject the User object.
 *
 * @param user
 *            A User object injected by the cloud endpoints.
 * @return Profile object.
 * @throws UnauthorizedException
 *             when the User object is null.
 */
@ApiMethod(name = "getProfile", path = "profile", httpMethod = HttpMethod.GET)
public Profile getProfile(final User user) throws UnauthorizedException {
    if (user == null) {
        throw new UnauthorizedException("Authorization required");
    }

    // TODO
    // load the Profile Entity
    String userId = user.getUserId();
    Key key = Key.create(Profile.class, userId);

    Profile profile = (Profile) ofy().load().key(key).now();
    return profile;
}
 
Example #17
Source File: Endpoint1.java    From endpoints-java with Apache License 2.0 5 votes vote down vote up
@ApiMethod(
    name = "foos.insert",
    path = "foos",
    httpMethod = HttpMethod.POST,
    cacheControl = @ApiMethodCacheControl(
        noCache = false,
        maxAge = 3
    )
)
public Foo insertFoo(Foo r) {
  return null;
}
 
Example #18
Source File: ReferenceOverridingEndpoint.java    From endpoints-java with Apache License 2.0 5 votes vote down vote up
@ApiMethod(
    name = "foos.get3",
    path = "foos/{id}",
    httpMethod = HttpMethod.GET,
    cacheControl = @ApiMethodCacheControl(
        noCache = false,
        maxAge = 2
    )
)
@Override
public Foo getFoo(@Named("id") String id) {
  return null;
}
 
Example #19
Source File: Endpoint1.java    From endpoints-java with Apache License 2.0 5 votes vote down vote up
@ApiMethod(
    name = "foos.update",
    path = "foos/{id}",
    httpMethod = HttpMethod.PUT,
    cacheControl = @ApiMethodCacheControl(
        noCache = false,
        maxAge = 4
    )
)
public Foo updateFoo(@Named("id") String id, Foo r) {
  return null;
}
 
Example #20
Source File: BridgeInheritanceEndpoint.java    From endpoints-java with Apache License 2.0 5 votes vote down vote up
@ApiMethod(
    name = "api6.foos.fn2",
    path = "fn2",
    httpMethod = HttpMethod.GET
)
public Object fn2() {
  return null;
}
 
Example #21
Source File: Endpoint1.java    From endpoints-java with Apache License 2.0 5 votes vote down vote up
@ApiMethod(
    name = "foos.remove",
    path = "foos/{id}",
    httpMethod = HttpMethod.DELETE,
    cacheControl = @ApiMethodCacheControl(
        noCache = false,
        maxAge = 5
    )
)
public void removeFoo(@Named("id") String id) {
}
 
Example #22
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
@ApiMethod(
        name = "getAnnouncement",
        path = "announcement",
        httpMethod = HttpMethod.GET
)
public Announcement getAnnouncement() {
    MemcacheService memcacheService = MemcacheServiceFactory.getMemcacheService();
    Object message = memcacheService.get(Constants.MEMCACHE_ANNOUNCEMENTS_KEY);
    if (message != null) {
        return new Announcement(message.toString());
    }
    return null;
}
 
Example #23
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
/** Code to add at the start of querying for conferences **/


    @ApiMethod(
            name = "queryConferences_nofilters",
            path = "queryConferences_nofilters",
            httpMethod = HttpMethod.POST
    )
    public List<Conference> queryConferences_nofilters() {
        // Find all entities of type Conference
        Query<Conference> query = ofy().load().type(Conference.class).order("name");

        return query.list();
    }
 
Example #24
Source File: BlobEndpoint.java    From io2014-codelabs with Apache License 2.0 5 votes vote down vote up
/**
 * Gets a signed URL that can be used to download a blob.
 *
 * @param bucketName Google Cloud Storage bucket where the object was uploaded.
 * @param objectPath path to the object in the bucket.
 * @param user       the user making the request.
 * @throws com.google.api.server.spi.response.UnauthorizedException if the user is not authorized.
 * @throws com.google.api.server.spi.response.BadRequestException   if the bucketName or objectPath are not valid.
 * @throws com.google.api.server.spi.response.NotFoundException     if the object doesn't exist.
 */
@ApiMethod(httpMethod = HttpMethod.GET, path = "blobs/downloads/{bucketName}/{objectPath}")
public BlobAccess getDownloadUrl(
  @Named("bucketName") String bucketName, @Named("objectPath") String objectPath, User user)
  throws UnauthorizedException, BadRequestException, NotFoundException {
  validateUser(user);

  validateBucketAndObjectPath(bucketName, objectPath);

  checkReadObjectPermissions(bucketName, objectPath, user);

  return getBlobUrlForDownload(bucketName, objectPath);
}
 
Example #25
Source File: WaxEndpoint.java    From endpoints-java with Apache License 2.0 5 votes vote down vote up
/**
 * Remove an existing session.
 * <p>
 * Clients that create sessions without a duration (will last forever) will need to call this
 * method on their own to clean up the session.
 *
 * @return {@link WaxRemoveSessionResponse} with the deleted session id
 * @throws InternalServerErrorException if the session deletion failed
 */
@ApiMethod(
    name = "sessions.remove",
    path = "removesession",
    httpMethod = HttpMethod.POST)
public WaxRemoveSessionResponse removeSession(@Named("sessionId") String sessionId)
    throws InternalServerErrorException {
  try {
    store.deleteSession(sessionId);
    return new WaxRemoveSessionResponse(sessionId);
  } catch (InvalidSessionException e) {
    throw new InternalServerErrorException(e.getMessage());
  }
}
 
Example #26
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns a Profile object associated with the given user object. The cloud
 * endpoints system automatically inject the User object.
 *
 * @param user
 *            A User object injected by the cloud endpoints.
 * @return Profile object.
 * @throws UnauthorizedException
 *             when the User object is null.
 */
@ApiMethod(name = "getProfile", path = "profile", httpMethod = HttpMethod.GET)
public Profile getProfile(final User user) throws UnauthorizedException {
	if (user == null) {
		throw new UnauthorizedException("Authorization required");
	}

	// TODO
	// load the Profile Entity
	String userId = ""; // TODO
	Key key = null; // TODO
	Profile profile = null; // TODO load the Profile entity
	return profile;
}
 
Example #27
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns a Profile object associated with the given user object. The cloud
 * endpoints system automatically inject the User object.
 *
 * @param user
 *            A User object injected by the cloud endpoints.
 * @return Profile object.
 * @throws UnauthorizedException
 *             when the User object is null.
 */
@ApiMethod(name = "getProfile", path = "profile", httpMethod = HttpMethod.GET)
public Profile getProfile(final User user) throws UnauthorizedException {
    if (user == null) {
        throw new UnauthorizedException("Authorization required");
    }

    // TODO
    // load the Profile Entity
    String userId = user.getUserId();
    Key key = Key.create(Profile.class, userId);

    Profile profile = (Profile) ofy().load().key(key).now();
    return profile;
}
 
Example #28
Source File: ConferenceApi.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
@ApiMethod(
        name = "queryConferences_nofilters",
        path = "queryConferences_nofilters",
        httpMethod = HttpMethod.POST
)
public List<Conference> queryConferences_nofilters() {
    // Find all entities of type Conference
    Query<Conference> query = ofy().load().type(Conference.class).order("name");

    return query.list();
}
 
Example #29
Source File: BridgeInheritanceEndpoint.java    From endpoints-java with Apache License 2.0 5 votes vote down vote up
@Override
@ApiMethod(
    name = "api6.foos.fn1",
    path = "fn1",
    httpMethod = HttpMethod.GET
)
public Object fn1() {
  return null;
}
 
Example #30
Source File: TestEndpoint.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@ApiMethod(httpMethod = HttpMethod.GET, path = "collidingpath/{id}")
public StringValue getCollidingPath(@Named("id") String id) {
  return new StringValue(id);
}