3
3
import typing
4
4
from typing import Callable , Optional , Union , Iterable
5
5
6
- from azure .functions import AsgiMiddleware , WsgiMiddleware , Function , \
7
- HttpRequest , Context
8
- from azure .functions .decorators .function_app import FunctionBuilder
9
- from azure .functions .decorators .http import HttpMethod
6
+ from azure .functions import AsgiMiddleware , WsgiMiddleware , Function
10
7
from azure .functions .decorators .core import DataType , \
11
8
AuthLevel , Cardinality , AccessRights
9
+ from azure .functions .decorators .function_app import FunctionBuilder
10
+ from azure .functions .decorators .http import HttpMethod
12
11
13
12
14
13
class FunctionApp :
@@ -33,6 +32,7 @@ class FunctionApp:
33
32
AuthLevel.
34
33
:param kwargs: Extra arguments passed to :func:`__init__`.
35
34
"""
35
+
36
36
pass
37
37
38
38
@property
@@ -44,7 +44,8 @@ class FunctionApp:
44
44
45
45
:return: Script file name.
46
46
"""
47
- return self ._app_script_file
47
+
48
+ pass
48
49
49
50
@property
50
51
def auth_level (self ) -> AuthLevel :
@@ -54,15 +55,14 @@ class FunctionApp:
54
55
:return: Authorization level of the function app.
55
56
"""
56
57
57
- return self . _auth_level
58
+ pass
58
59
59
60
def get_functions (self ) -> typing .List [Function ]:
60
61
"""Get the function objects in the function app.
61
62
62
63
:return: List of functions in the function app.
63
64
"""
64
- return [function_builder .build () for function_builder
65
- in self ._function_builders ]
65
+ pass
66
66
67
67
def _validate_type (self , func : Union [Callable , FunctionBuilder ]) \
68
68
-> FunctionBuilder :
@@ -76,26 +76,15 @@ class FunctionApp:
76
76
:class:`Callable` nor :class:`FunctionBuilder`.
77
77
:return: :class:`FunctionBuilder` object.
78
78
"""
79
- if isinstance (func , FunctionBuilder ):
80
- fb = self ._function_builders .pop ()
81
- elif callable (func ):
82
- fb = FunctionBuilder (func , self ._app_script_file )
83
- else :
84
- raise ValueError (
85
- "Unsupported type for function app decorator found." )
86
- return fb
79
+
80
+ pass
87
81
88
82
def _configure_function_builder (self , wrap ) -> Callable :
89
83
"""Decorator function on user defined function to create and return
90
84
:class:`FunctionBuilder` object from :class:`Callable` func.
91
85
"""
92
86
93
- def decorator (func ):
94
- fb = self ._validate_type (func )
95
- self ._function_builders .append (fb )
96
- return wrap (fb )
97
-
98
- return decorator
87
+ pass
99
88
100
89
def function_name (self , name : str ) -> Callable :
101
90
"""Set name of the :class:`Function` object.
@@ -104,15 +93,7 @@ class FunctionApp:
104
93
:return: Decorator function.
105
94
"""
106
95
107
- @self ._configure_function_builder
108
- def wrap (fb ):
109
- def decorator ():
110
- fb .configure_function_name (name )
111
- return fb
112
-
113
- return decorator ()
114
-
115
- return wrap
96
+ pass
116
97
117
98
def _add_http_app (self ,
118
99
http_middleware : Union [
@@ -125,11 +106,7 @@ class FunctionApp:
125
106
:return: None
126
107
"""
127
108
128
- @self .route (methods = (method for method in HttpMethod ),
129
- auth_level = self .auth_level ,
130
- route = "/{*route}" )
131
- def http_app_func (req : HttpRequest , context : Context ):
132
- return http_middleware .handle (req , context )
109
+ pass
133
110
134
111
def route (self ,
135
112
route : Optional [str ] = None ,
0 commit comments