
com.microsoft.azure.functions.annotation.EventGridTrigger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-functions-java-library Show documentation
Show all versions of azure-functions-java-library Show documentation
This package contains all Java interfaces and annotations to interact with Microsoft Azure functions runtime.
The newest version!
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.functions.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* Place this on a parameter whose value would come from EventGrid, and causing the method to run when an event is
* arrived. The parameter type can be one of the following:
*
*
* - Any native Java types such as int, String, byte[]
* - Nullable values using Optional<T>
* - Any POJO type
*
*
* The following example shows a Java function that prints out an event:
*
* {@literal @}FunctionName("eventGridMonitor")
* public void logEvent(
* {@literal @}EventGridTrigger(name = "event") String content,
* final ExecutionContext context
* ) {
* context.getLogger().info(content);
* }
*
* @since 1.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER})
public @interface EventGridTrigger {
/**
* The variable name used in function.json.
* @return The variable name used in function.json.
*/
String name();
/**
* Defines how Functions runtime should treat the parameter value. Possible values are:
*
* - "": get the value as a string, and try to deserialize to actual parameter type like POJO
* - string: always get the value as a string
* - binary: get the value as a binary data, and try to deserialize to actual parameter type byte[]
*
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy