Skip to content

Commit ea9b912

Browse files
authored
fix(functions): add short and long descriptions to triggers methods (#350)
1 parent 9d3bd03 commit ea9b912

File tree

4 files changed

+150
-16
lines changed

4 files changed

+150
-16
lines changed

scaleway-async/scaleway_async/function/v1beta1/api.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,22 @@ async def create_trigger(
17641764
sqs_config: Optional[CreateTriggerRequestSqsClientConfig] = None,
17651765
) -> Trigger:
17661766
"""
1767+
Create a trigger.
1768+
Create a new trigger for a specified function.
1769+
:param region: Region to target. If none is passed will use default region from the config.
1770+
:param name: Name of the trigger.
1771+
:param function_id: ID of the function to trigger.
1772+
:param description: Description of the trigger.
1773+
:param scw_sqs_config: Configuration for a Scaleway M&Q SQS queue.
1774+
1775+
One-of ('config'): at most one of 'scw_sqs_config', 'scw_nats_config', 'sqs_config' could be set.
1776+
:param scw_nats_config: Configuration for a Scaleway M&Q NATS subject.
1777+
1778+
One-of ('config'): at most one of 'scw_sqs_config', 'scw_nats_config', 'sqs_config' could be set.
1779+
:param sqs_config: Configuration for an AWS SQS queue.
1780+
1781+
One-of ('config'): at most one of 'scw_sqs_config', 'scw_nats_config', 'sqs_config' could be set.
1782+
:return: :class:`Trigger <Trigger>`
17671783
17681784
Usage:
17691785
::
@@ -1805,6 +1821,11 @@ async def get_trigger(
18051821
region: Optional[Region] = None,
18061822
) -> Trigger:
18071823
"""
1824+
Get a trigger.
1825+
Get a trigger with a specified ID.
1826+
:param region: Region to target. If none is passed will use default region from the config.
1827+
:param trigger_id: ID of the trigger to get.
1828+
:return: :class:`Trigger <Trigger>`
18081829
18091830
Usage:
18101831
::
@@ -1872,6 +1893,22 @@ async def list_triggers(
18721893
project_id: Optional[str] = None,
18731894
) -> ListTriggersResponse:
18741895
"""
1896+
List all triggers.
1897+
List all triggers belonging to a specified Organization or Project.
1898+
:param region: Region to target. If none is passed will use default region from the config.
1899+
:param page: Page number to return.
1900+
:param page_size: Maximum number of triggers to return per page.
1901+
:param order_by: Order in which to return results.
1902+
:param function_id: ID of the function the triggers belongs to.
1903+
1904+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
1905+
:param namespace_id: ID of the namespace the triggers belongs to.
1906+
1907+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
1908+
:param project_id: ID of the project the triggers belongs to.
1909+
1910+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
1911+
:return: :class:`ListTriggersResponse <ListTriggersResponse>`
18751912
18761913
Usage:
18771914
::
@@ -1917,6 +1954,21 @@ async def list_triggers_all(
19171954
project_id: Optional[str] = None,
19181955
) -> List[Trigger]:
19191956
"""
1957+
List all triggers.
1958+
List all triggers belonging to a specified Organization or Project.
1959+
:param region: Region to target. If none is passed will use default region from the config.
1960+
:param page: Page number to return.
1961+
:param page_size: Maximum number of triggers to return per page.
1962+
:param order_by: Order in which to return results.
1963+
:param function_id: ID of the function the triggers belongs to.
1964+
1965+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
1966+
:param namespace_id: ID of the namespace the triggers belongs to.
1967+
1968+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
1969+
:param project_id: ID of the project the triggers belongs to.
1970+
1971+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
19201972
:return: :class:`List[ListTriggersResponse] <List[ListTriggersResponse]>`
19211973
19221974
Usage:
@@ -1950,6 +2002,16 @@ async def update_trigger(
19502002
sqs_config: Optional[UpdateTriggerRequestSqsClientConfig] = None,
19512003
) -> Trigger:
19522004
"""
2005+
Update a trigger.
2006+
Update a trigger with a specified ID.
2007+
:param region: Region to target. If none is passed will use default region from the config.
2008+
:param trigger_id: ID of the trigger to update.
2009+
:param name: Name of the trigger.
2010+
:param description: Description of the trigger.
2011+
:param sqs_config: Configuration for an AWS SQS queue.
2012+
2013+
One-of ('config'): at most one of 'sqs_config' could be set.
2014+
:return: :class:`Trigger <Trigger>`
19532015
19542016
Usage:
19552017
::
@@ -1987,6 +2049,11 @@ async def delete_trigger(
19872049
region: Optional[Region] = None,
19882050
) -> Trigger:
19892051
"""
2052+
Delete a trigger.
2053+
Delete a trigger with a specified ID.
2054+
:param region: Region to target. If none is passed will use default region from the config.
2055+
:param trigger_id: ID of the trigger to delete.
2056+
:return: :class:`Trigger <Trigger>`
19902057
19912058
Usage:
19922059
::

scaleway-async/scaleway_async/function/v1beta1/types.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,14 @@ class CreateTriggerRequestMnqNatsClientConfig:
246246
Create trigger request. mnq nats client config.
247247
"""
248248

249-
subject: str
249+
mnq_namespace_id: Optional[str]
250250
"""
251-
Name of the NATS subject the trigger should listen to.
251+
:deprecated
252252
"""
253253

254-
mnq_namespace_id: Optional[str]
254+
subject: str
255255
"""
256-
:deprecated
256+
Name of the NATS subject the trigger should listen to.
257257
"""
258258

259259
mnq_nats_account_id: str
@@ -889,14 +889,14 @@ class TriggerMnqNatsClientConfig:
889889
Trigger. mnq nats client config.
890890
"""
891891

892-
mnq_namespace_id: Optional[str]
892+
subject: str
893893
"""
894-
:deprecated
894+
Name of the NATS subject the trigger listens to.
895895
"""
896896

897-
subject: str
897+
mnq_namespace_id: Optional[str]
898898
"""
899-
Name of the NATS subject the trigger listens to.
899+
:deprecated
900900
"""
901901

902902
mnq_nats_account_id: str
@@ -926,14 +926,14 @@ class TriggerMnqSqsClientConfig:
926926
Trigger. mnq sqs client config.
927927
"""
928928

929-
queue: str
929+
mnq_namespace_id: Optional[str]
930930
"""
931-
Name of the SQS queue the trigger listens to.
931+
:deprecated
932932
"""
933933

934-
mnq_namespace_id: Optional[str]
934+
queue: str
935935
"""
936-
:deprecated
936+
Name of the SQS queue the trigger listens to.
937937
"""
938938

939939
mnq_project_id: str

scaleway/scaleway/function/v1beta1/api.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,6 +1760,22 @@ def create_trigger(
17601760
sqs_config: Optional[CreateTriggerRequestSqsClientConfig] = None,
17611761
) -> Trigger:
17621762
"""
1763+
Create a trigger.
1764+
Create a new trigger for a specified function.
1765+
:param region: Region to target. If none is passed will use default region from the config.
1766+
:param name: Name of the trigger.
1767+
:param function_id: ID of the function to trigger.
1768+
:param description: Description of the trigger.
1769+
:param scw_sqs_config: Configuration for a Scaleway M&Q SQS queue.
1770+
1771+
One-of ('config'): at most one of 'scw_sqs_config', 'scw_nats_config', 'sqs_config' could be set.
1772+
:param scw_nats_config: Configuration for a Scaleway M&Q NATS subject.
1773+
1774+
One-of ('config'): at most one of 'scw_sqs_config', 'scw_nats_config', 'sqs_config' could be set.
1775+
:param sqs_config: Configuration for an AWS SQS queue.
1776+
1777+
One-of ('config'): at most one of 'scw_sqs_config', 'scw_nats_config', 'sqs_config' could be set.
1778+
:return: :class:`Trigger <Trigger>`
17631779
17641780
Usage:
17651781
::
@@ -1801,6 +1817,11 @@ def get_trigger(
18011817
region: Optional[Region] = None,
18021818
) -> Trigger:
18031819
"""
1820+
Get a trigger.
1821+
Get a trigger with a specified ID.
1822+
:param region: Region to target. If none is passed will use default region from the config.
1823+
:param trigger_id: ID of the trigger to get.
1824+
:return: :class:`Trigger <Trigger>`
18041825
18051826
Usage:
18061827
::
@@ -1868,6 +1889,22 @@ def list_triggers(
18681889
project_id: Optional[str] = None,
18691890
) -> ListTriggersResponse:
18701891
"""
1892+
List all triggers.
1893+
List all triggers belonging to a specified Organization or Project.
1894+
:param region: Region to target. If none is passed will use default region from the config.
1895+
:param page: Page number to return.
1896+
:param page_size: Maximum number of triggers to return per page.
1897+
:param order_by: Order in which to return results.
1898+
:param function_id: ID of the function the triggers belongs to.
1899+
1900+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
1901+
:param namespace_id: ID of the namespace the triggers belongs to.
1902+
1903+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
1904+
:param project_id: ID of the project the triggers belongs to.
1905+
1906+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
1907+
:return: :class:`ListTriggersResponse <ListTriggersResponse>`
18711908
18721909
Usage:
18731910
::
@@ -1913,6 +1950,21 @@ def list_triggers_all(
19131950
project_id: Optional[str] = None,
19141951
) -> List[Trigger]:
19151952
"""
1953+
List all triggers.
1954+
List all triggers belonging to a specified Organization or Project.
1955+
:param region: Region to target. If none is passed will use default region from the config.
1956+
:param page: Page number to return.
1957+
:param page_size: Maximum number of triggers to return per page.
1958+
:param order_by: Order in which to return results.
1959+
:param function_id: ID of the function the triggers belongs to.
1960+
1961+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
1962+
:param namespace_id: ID of the namespace the triggers belongs to.
1963+
1964+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
1965+
:param project_id: ID of the project the triggers belongs to.
1966+
1967+
One-of ('scope'): at most one of 'function_id', 'namespace_id', 'project_id' could be set.
19161968
:return: :class:`List[ListTriggersResponse] <List[ListTriggersResponse]>`
19171969
19181970
Usage:
@@ -1946,6 +1998,16 @@ def update_trigger(
19461998
sqs_config: Optional[UpdateTriggerRequestSqsClientConfig] = None,
19471999
) -> Trigger:
19482000
"""
2001+
Update a trigger.
2002+
Update a trigger with a specified ID.
2003+
:param region: Region to target. If none is passed will use default region from the config.
2004+
:param trigger_id: ID of the trigger to update.
2005+
:param name: Name of the trigger.
2006+
:param description: Description of the trigger.
2007+
:param sqs_config: Configuration for an AWS SQS queue.
2008+
2009+
One-of ('config'): at most one of 'sqs_config' could be set.
2010+
:return: :class:`Trigger <Trigger>`
19492011
19502012
Usage:
19512013
::
@@ -1983,6 +2045,11 @@ def delete_trigger(
19832045
region: Optional[Region] = None,
19842046
) -> Trigger:
19852047
"""
2048+
Delete a trigger.
2049+
Delete a trigger with a specified ID.
2050+
:param region: Region to target. If none is passed will use default region from the config.
2051+
:param trigger_id: ID of the trigger to delete.
2052+
:return: :class:`Trigger <Trigger>`
19862053
19872054
Usage:
19882055
::

scaleway/scaleway/function/v1beta1/types.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -926,14 +926,14 @@ class TriggerMnqSqsClientConfig:
926926
Trigger. mnq sqs client config.
927927
"""
928928

929-
queue: str
929+
mnq_namespace_id: Optional[str]
930930
"""
931-
Name of the SQS queue the trigger listens to.
931+
:deprecated
932932
"""
933933

934-
mnq_namespace_id: Optional[str]
934+
queue: str
935935
"""
936-
:deprecated
936+
Name of the SQS queue the trigger listens to.
937937
"""
938938

939939
mnq_project_id: str

0 commit comments

Comments
 (0)