Skip to content

Commit 443e02f

Browse files
author
peterstone2017
committed
update prog spec
1 parent 3468a43 commit 443e02f

File tree

1 file changed

+13
-36
lines changed

1 file changed

+13
-36
lines changed

docs/ProgModelSpec.pyi

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
import typing
44
from typing import Callable, Optional, Union, Iterable
55

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
107
from azure.functions.decorators.core import DataType, \
118
AuthLevel, Cardinality, AccessRights
9+
from azure.functions.decorators.function_app import FunctionBuilder
10+
from azure.functions.decorators.http import HttpMethod
1211

1312

1413
class FunctionApp:
@@ -33,6 +32,7 @@ class FunctionApp:
3332
AuthLevel.
3433
:param kwargs: Extra arguments passed to :func:`__init__`.
3534
"""
35+
3636
pass
3737

3838
@property
@@ -44,7 +44,8 @@ class FunctionApp:
4444
4545
:return: Script file name.
4646
"""
47-
return self._app_script_file
47+
48+
pass
4849

4950
@property
5051
def auth_level(self) -> AuthLevel:
@@ -54,15 +55,14 @@ class FunctionApp:
5455
:return: Authorization level of the function app.
5556
"""
5657

57-
return self._auth_level
58+
pass
5859

5960
def get_functions(self) -> typing.List[Function]:
6061
"""Get the function objects in the function app.
6162
6263
:return: List of functions in the function app.
6364
"""
64-
return [function_builder.build() for function_builder
65-
in self._function_builders]
65+
pass
6666

6767
def _validate_type(self, func: Union[Callable, FunctionBuilder]) \
6868
-> FunctionBuilder:
@@ -76,26 +76,15 @@ class FunctionApp:
7676
:class:`Callable` nor :class:`FunctionBuilder`.
7777
:return: :class:`FunctionBuilder` object.
7878
"""
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
8781

8882
def _configure_function_builder(self, wrap) -> Callable:
8983
"""Decorator function on user defined function to create and return
9084
:class:`FunctionBuilder` object from :class:`Callable` func.
9185
"""
9286

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
9988

10089
def function_name(self, name: str) -> Callable:
10190
"""Set name of the :class:`Function` object.
@@ -104,15 +93,7 @@ class FunctionApp:
10493
:return: Decorator function.
10594
"""
10695

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
11697

11798
def _add_http_app(self,
11899
http_middleware: Union[
@@ -125,11 +106,7 @@ class FunctionApp:
125106
:return: None
126107
"""
127108

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
133110

134111
def route(self,
135112
route: Optional[str] = None,

0 commit comments

Comments
 (0)