Skip to content

Commit

Permalink
fix removed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanedey committed Feb 13, 2024
1 parent 73f801c commit 83abdf7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 10 additions & 1 deletion firebase_admin/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ def _validate_task_options(
', or underscores (_). The maximum length is 500 characters.')
task.name = self._get_url(
resource, _CLOUD_TASKS_API_RESOURCE_PATH + f'/{opts.task_id}')
if opts.uri is not None:
if not _Validators.is_url(opts.uri):
raise ValueError(
'uri must be a valid RFC3986 URI string using the https or http schema.')
task.http_request['url'] = opts.uri
return task

def _update_task_payload(self, task: Task, resource: Resource, extension_id: str) -> Task:
Expand Down Expand Up @@ -382,12 +387,17 @@ class TaskOptions:
By default, Content-Type is set to 'application/json'.
The size of the headers must be less than 80KB.
uri: The full URL path that the request will be sent to. Must be a valid RFC3986 https or
http URL.
"""
schedule_delay_seconds: Optional[int] = None
schedule_time: Optional[datetime] = None
dispatch_deadline_seconds: Optional[int] = None
task_id: Optional[str] = None
headers: Optional[Dict[str, str]] = None
uri: Optional[str] = None

@dataclass
class Task:
Expand All @@ -407,7 +417,6 @@ class Task:
schedule_time: Optional[str] = None
dispatch_deadline: Optional[str] = None

Task()
@dataclass
class Resource:
"""Contains the parsed address of a resource.
Expand Down
1 change: 0 additions & 1 deletion tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,3 @@ def test_invalid_task_id_error(self, task_id):
'task_id can contain only letters ([A-Za-z]), numbers ([0-9]), '
'hyphens (-), or underscores (_). The maximum length is 500 characters.'
)

0 comments on commit 83abdf7

Please sign in to comment.