diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..027f6bc --- /dev/null +++ b/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + com.microsoft.azure + azure-functions-java-core + 1.0.0-beta-2 + jar + + Microsoft Azure Functions Java Core Types + This package contains all Java interfaces and annotations to interact with Microsoft Azure functions runtime. + https://azure.microsoft.com/en-us/services/functions + + + UTF-8 + + + + + MIT License + https://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/azure-functions-java-worker + scm:git:git@github.com:Azure/azure-functions-java-worker + https://github.com/Azure/azure-functions-java-worker + HEAD + + + + + junyi + Junyi Yi + junyi@microsoft.com + + + xscript + Kevin Zhao + kevinzha@microsoft.com + + + + + + + + + + maven-compiler-plugin + 3.7.0 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.0.0-M1 + + + attach-javadocs + + jar + + + + + + + + diff --git a/src/main/java/com/microsoft/azure/serverless/functions/ExecutionContext.java b/src/main/java/com/microsoft/azure/serverless/functions/ExecutionContext.java new file mode 100644 index 0000000..29e3049 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/ExecutionContext.java @@ -0,0 +1,9 @@ +package com.microsoft.azure.serverless.functions; + +import java.util.logging.Logger; + +public interface ExecutionContext { + Logger getLogger(); + String getInvocationId(); + String getFunctionName(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/HttpRequestMessage.java b/src/main/java/com/microsoft/azure/serverless/functions/HttpRequestMessage.java new file mode 100644 index 0000000..9d689b1 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/HttpRequestMessage.java @@ -0,0 +1,14 @@ +package com.microsoft.azure.serverless.functions; + +import java.net.URI; +import java.util.Map; + +public interface HttpRequestMessage { + URI getUri(); + String getMethod(); + Map getHeaders(); + Map getQueryParameters(); + T getBody(); + + HttpResponseMessage createResponse(int status, R body); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/HttpResponseMessage.java b/src/main/java/com/microsoft/azure/serverless/functions/HttpResponseMessage.java new file mode 100644 index 0000000..c852eb9 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/HttpResponseMessage.java @@ -0,0 +1,10 @@ +package com.microsoft.azure.serverless.functions; + +public interface HttpResponseMessage { + int getStatus(); + void setStatus(int status); + void addHeader(String key, String value); + String getHeader(String key); + T getBody(); + void setBody(T body); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/OutputBinding.java b/src/main/java/com/microsoft/azure/serverless/functions/OutputBinding.java new file mode 100644 index 0000000..b65c5ee --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/OutputBinding.java @@ -0,0 +1,6 @@ +package com.microsoft.azure.serverless.functions; + +public interface OutputBinding { + T getValue(); + void setValue(T value); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/AccessRights.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/AccessRights.java new file mode 100644 index 0000000..9e0c50c --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/AccessRights.java @@ -0,0 +1,12 @@ +/** + * 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.serverless.functions.annotation; + +public enum AccessRights { + MANAGE, + LISTEN +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/ApiHubFileInput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ApiHubFileInput.java new file mode 100644 index 0000000..3016d3f --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ApiHubFileInput.java @@ -0,0 +1,24 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface ApiHubFileInput { + String name(); + + String dataType() default ""; + + String path(); + + String connection(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/ApiHubFileOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ApiHubFileOutput.java new file mode 100644 index 0000000..217f274 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ApiHubFileOutput.java @@ -0,0 +1,24 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface ApiHubFileOutput { + String name(); + + String dataType() default ""; + + String path(); + + String connection(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/ApiHubFileTrigger.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ApiHubFileTrigger.java new file mode 100644 index 0000000..be1a03e --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ApiHubFileTrigger.java @@ -0,0 +1,24 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface ApiHubFileTrigger { + String name(); + + String dataType() default ""; + + String path(); + + String connection(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/AuthorizationLevel.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/AuthorizationLevel.java new file mode 100644 index 0000000..b475568 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/AuthorizationLevel.java @@ -0,0 +1,13 @@ +/** + * 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.serverless.functions.annotation; + +public enum AuthorizationLevel { + ANONYMOUS, + FUNCTION, + ADMIN +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/BindingName.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/BindingName.java new file mode 100644 index 0000000..68fb70c --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/BindingName.java @@ -0,0 +1,12 @@ +package com.microsoft.azure.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.PARAMETER) +@Retention(RetentionPolicy.RUNTIME) +public @interface BindingName { + String value(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/BlobInput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/BlobInput.java new file mode 100644 index 0000000..2df6c15 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/BlobInput.java @@ -0,0 +1,24 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface BlobInput { + String name(); + + String dataType() default ""; + + String path(); + + String connection() default ""; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/BlobOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/BlobOutput.java new file mode 100644 index 0000000..dee51a1 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/BlobOutput.java @@ -0,0 +1,24 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface BlobOutput { + String name(); + + String dataType() default ""; + + String path(); + + String connection() default ""; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/BlobTrigger.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/BlobTrigger.java new file mode 100644 index 0000000..ae1b8a5 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/BlobTrigger.java @@ -0,0 +1,24 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface BlobTrigger { + String name(); + + String dataType() default ""; + + String path(); + + String connection() default ""; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/DocumentDBInput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/DocumentDBInput.java new file mode 100644 index 0000000..f359f18 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/DocumentDBInput.java @@ -0,0 +1,30 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface DocumentDBInput { + String name(); + + String dataType() default ""; + + String databaseName(); + + String collectionName(); + + String id() default ""; + + String sqlQuery() default ""; + + String connection(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/DocumentDBOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/DocumentDBOutput.java new file mode 100644 index 0000000..971f130 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/DocumentDBOutput.java @@ -0,0 +1,28 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface DocumentDBOutput { + String name(); + + String dataType() default ""; + + String databaseName(); + + String collectionName(); + + boolean createIfNotExists() default false; + + String connection(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/EventHubOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/EventHubOutput.java new file mode 100644 index 0000000..286e69d --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/EventHubOutput.java @@ -0,0 +1,24 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface EventHubOutput { + String name(); + + String dataType() default ""; + + String eventHubName(); + + String connection(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/EventHubTrigger.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/EventHubTrigger.java new file mode 100644 index 0000000..63feb2b --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/EventHubTrigger.java @@ -0,0 +1,26 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface EventHubTrigger { + String name(); + + String dataType() default ""; + + String eventHubName(); + + String consumerGroup() default "$Default"; + + String connection(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/FunctionName.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/FunctionName.java new file mode 100644 index 0000000..f7b53b8 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/FunctionName.java @@ -0,0 +1,18 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface FunctionName { + String value(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/HttpOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/HttpOutput.java new file mode 100644 index 0000000..1852481 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/HttpOutput.java @@ -0,0 +1,20 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface HttpOutput { + String name(); + + String dataType() default ""; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/HttpTrigger.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/HttpTrigger.java new file mode 100644 index 0000000..4f6c580 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/HttpTrigger.java @@ -0,0 +1,28 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface HttpTrigger { + String name(); + + String dataType() default ""; + + String route() default ""; + + String[] methods() default {}; + + AuthorizationLevel authLevel() default AuthorizationLevel.FUNCTION; + + String webHookType() default ""; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/MobileTableInput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/MobileTableInput.java new file mode 100644 index 0000000..54073de --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/MobileTableInput.java @@ -0,0 +1,28 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface MobileTableInput { + String name(); + + String dataType() default ""; + + String tableName(); + + String id(); + + String connection(); + + String apiKey(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/MobileTableOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/MobileTableOutput.java new file mode 100644 index 0000000..a24b27a --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/MobileTableOutput.java @@ -0,0 +1,26 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface MobileTableOutput { + String name(); + + String dataType() default ""; + + String tableName(); + + String connection(); + + String apiKey(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/NotificationHubOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/NotificationHubOutput.java new file mode 100644 index 0000000..1129d60 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/NotificationHubOutput.java @@ -0,0 +1,28 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface NotificationHubOutput { + String name(); + + String dataType() default ""; + + String tagExpression() default ""; + + String hubName(); + + String connection(); + + String platform() default ""; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/QueueOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/QueueOutput.java new file mode 100644 index 0000000..11bf79f --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/QueueOutput.java @@ -0,0 +1,24 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface QueueOutput { + String name(); + + String dataType() default ""; + + String queueName(); + + String connection() default ""; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/QueueTrigger.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/QueueTrigger.java new file mode 100644 index 0000000..8c33bc1 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/QueueTrigger.java @@ -0,0 +1,24 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface QueueTrigger { + String name(); + + String dataType() default ""; + + String queueName(); + + String connection() default ""; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/SendGridOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/SendGridOutput.java new file mode 100644 index 0000000..b094538 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/SendGridOutput.java @@ -0,0 +1,30 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface SendGridOutput { + String name(); + + String dataType() default ""; + + String apiKey(); + + String to(); + + String from(); + + String subject(); + + String text(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusQueueOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusQueueOutput.java new file mode 100644 index 0000000..4a657ec --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusQueueOutput.java @@ -0,0 +1,26 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface ServiceBusQueueOutput { + String name(); + + String dataType() default ""; + + String queueName(); + + String connection(); + + AccessRights access() default AccessRights.MANAGE; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusQueueTrigger.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusQueueTrigger.java new file mode 100644 index 0000000..b7a8312 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusQueueTrigger.java @@ -0,0 +1,26 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface ServiceBusQueueTrigger { + String name(); + + String dataType() default ""; + + String queueName(); + + String connection(); + + AccessRights access() default AccessRights.MANAGE; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusTopicOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusTopicOutput.java new file mode 100644 index 0000000..66f19c4 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusTopicOutput.java @@ -0,0 +1,28 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface ServiceBusTopicOutput { + String name(); + + String dataType() default ""; + + String topicName(); + + String subscriptionName(); + + String connection(); + + AccessRights access() default AccessRights.MANAGE; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusTopicTrigger.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusTopicTrigger.java new file mode 100644 index 0000000..91d9223 --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/ServiceBusTopicTrigger.java @@ -0,0 +1,28 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface ServiceBusTopicTrigger { + String name(); + + String dataType() default ""; + + String topicName(); + + String subscriptionName(); + + String connection(); + + AccessRights access() default AccessRights.MANAGE; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/StorageAccount.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/StorageAccount.java new file mode 100644 index 0000000..0a09afb --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/StorageAccount.java @@ -0,0 +1,18 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface StorageAccount { + String value(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/TableInput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/TableInput.java new file mode 100644 index 0000000..3d697bc --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/TableInput.java @@ -0,0 +1,32 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface TableInput { + String name(); + + String dataType() default ""; + + String tableName(); + + String partitionKey() default ""; + + String rowKey() default ""; + + String filter() default ""; + + String take() default ""; + + String connection() default ""; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/TableOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/TableOutput.java new file mode 100644 index 0000000..8347c5e --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/TableOutput.java @@ -0,0 +1,28 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface TableOutput { + String name(); + + String dataType() default ""; + + String tableName(); + + String partitionKey() default ""; + + String rowKey() default ""; + + String connection() default ""; +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/TimerTrigger.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/TimerTrigger.java new file mode 100644 index 0000000..75355ef --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/TimerTrigger.java @@ -0,0 +1,22 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface TimerTrigger { + String name(); + + String dataType() default ""; + + String schedule(); +} diff --git a/src/main/java/com/microsoft/azure/serverless/functions/annotation/TwilioSmsOutput.java b/src/main/java/com/microsoft/azure/serverless/functions/annotation/TwilioSmsOutput.java new file mode 100644 index 0000000..7a610fc --- /dev/null +++ b/src/main/java/com/microsoft/azure/serverless/functions/annotation/TwilioSmsOutput.java @@ -0,0 +1,30 @@ +/** + * 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.serverless.functions.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface TwilioSmsOutput { + String name(); + + String dataType() default ""; + + String accountSid(); + + String authToken(); + + String to(); + + String from(); + + String body(); +}