diff --git a/src/Appwrite/Utopia/Response/Model/TemplateFunction.php b/src/Appwrite/Utopia/Response/Model/TemplateFunction.php index f5df10986f..c630880a95 100644 --- a/src/Appwrite/Utopia/Response/Model/TemplateFunction.php +++ b/src/Appwrite/Utopia/Response/Model/TemplateFunction.php @@ -110,6 +110,13 @@ class TemplateFunction extends Model 'default' => [], 'example' => [], 'array' => true + ]) + ->addRule('scopes', [ + 'type' => self::TYPE_STRING, + 'description' => 'Function scopes.', + 'default' => [], + 'example' => 'users.read', + 'array' => true, ]); } diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index 3aaa18594e..2bd6880239 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -881,6 +881,7 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals($expectedTemplates[$i]['vcsProvider'], $templates['body']['templates'][$i]['vcsProvider']); $this->assertEquals($expectedTemplates[$i]['runtimes'], $templates['body']['templates'][$i]['runtimes']); $this->assertEquals($expectedTemplates[$i]['variables'], $templates['body']['templates'][$i]['variables']); + $this->assertEquals($expectedTemplates[$i]['scopes'], $templates['body']['templates'][$i]['scopes']); } $templates_offset = $this->client->call(Client::METHOD_GET, '/functions/templates', array_merge([