Skip to content

Commit 1a29ac5

Browse files
committed
rename to connectors
1 parent 91f89cc commit 1a29ac5

3 files changed

Lines changed: 24 additions & 4 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
from typing import Optional
4+
5+
from azure.functions.decorators.core import Trigger, \
6+
DataType
7+
8+
9+
class ConnectorTrigger(Trigger):
10+
11+
@staticmethod
12+
def get_binding_name():
13+
from azure.functions.decorators.constants import CONNECTOR_TRIGGER
14+
return CONNECTOR_TRIGGER
15+
16+
def __init__(self,
17+
name: str,
18+
data_type: Optional[DataType] = None,
19+
**kwargs):
20+
from azure.functions.decorators.constants import CONNECTOR_TRIGGER
21+
super().__init__(name=name, data_type=data_type, type=CONNECTOR_TRIGGER)

azure/functions/decorators/function_app.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
from azure.functions.decorators.utils import parse_singular_param_to_enum, \
4444
parse_iterable_param_to_enums, StringifyEnumJsonEncoder
4545
from azure.functions.http import HttpRequest
46-
from .generic import GenericInputBinding, GenericTrigger, GenericOutputBinding, ConnectorTrigger
46+
from .connectors import ConnectorTrigger
47+
from .generic import GenericInputBinding, GenericTrigger, GenericOutputBinding
4748
from .openai import _AssistantSkillTrigger, OpenAIModels, _TextCompletionInput, \
4849
_AssistantCreateOutput, \
4950
_AssistantQueryInput, _AssistantPostInput, InputType, _EmbeddingsInput, \
@@ -1573,8 +1574,6 @@ def connector_trigger(self,
15731574
All optional fields will be given default values by the function host when
15741575
they are parsed.
15751576
1576-
Ref: https://aka.ms/azure-function-binding-custom
1577-
15781577
:param arg_name: The name of the trigger parameter in the function code.
15791578
:param data_type: Defines how the Functions runtime should treat the
15801579
parameter value.

tests/decorators/test_connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from azure.functions.decorators.constants import CONNECTOR_TRIGGER
66
from azure.functions.decorators.core import BindingDirection, DataType
7-
from azure.functions.decorators.generic import ConnectorTrigger
7+
from azure.functions.decorators.connectors import ConnectorTrigger
88

99

1010
class TestConnectorTrigger(unittest.TestCase):

0 commit comments

Comments
 (0)