Methods
Methods are parents to statements and child nodes of files.
Method Object
A method object includes properties that describe the method including dependencies and enclosed statements.
Properties
-
- Name
name
- Type
- string
- Description
-
Name of the method.
-
- Name
uuid
- Type
- string
- Description
-
Unique identifier for the method.
-
- Name
data
- Type
- array
- Description
-
References to statement uuids.
-
- Name
scope
- Type
- string
- Description
-
The scope of the method.
-
- Name
return-type
- Type
- string
- Description
-
The return type of the method.
-
- Name
created_at
- Type
- timestamp
- Description
-
Timestamp of when the method was created.
-
- Name
updated_at
- Type
- timestamp
- Description
-
Timestamp of when the method was last updated.
Retrieve Method
This endpoint allows you to retrieve a method for a given uuid.
Request
curl -G https://api.stellify.com/v1/method/bb50f9b7-47bb-4740-8db0-33159569f74e \
-H "Authorization: Bearer {token}"
import ApiClient from '@stellisoft/js-api-client'
const client = new ApiClient(token)
await client.method.get('bb50f9b7-47bb-4740-8db0-33159569f74e')
from stellify_api import ApiClient
client = ApiClient(token)
client.method.get('bb50f9b7-47bb-4740-8db0-33159569f74e')
$client = new \Stellify\ApiClient($token);
$client->method->get('bb50f9b7-47bb-4740-8db0-33159569f74e');
Response
{
"uuid": "bb50f9b7-47bb-4740-8db0-33159569f74e",
"type": "php",
"name": "Example method"
}
Create Method
This endpoint allows you to create a new method and attach it to either a page or another method.
Required attributes
-
- Name
file_id
- Type
- string
- Description
-
The file in which to create the method.
Request
curl https://api.stellify.com/v1/method \
-H "Authorization: Bearer {token}" \
-d file_id="3eebb320-1820-4af5-948b-f4ed48e8d257"
import ApiClient from '@stellisoft/js-api-client'
const client = new ApiClient(token)
await client.method.create({
file_id: '3eebb320-1820-4af5-948b-f4ed48e8d257',
})
from stellify_api import ApiClient
client = ApiClient(token)
client.method.create(
file_id="3eebb320-1820-4af5-948b-f4ed48e8d257",
)
$client = new \Stellify\ApiClient($token);
$client->method->create([
'file_id' => '3eebb320-1820-4af5-948b-f4ed48e8d257',
]);
Response
{
"uuid": "bb50f9b7-47bb-4740-8db0-33159569f74e",
"type": "php",
"name": "Example method"
}
Update Method
This endpoint allows you to perform a partial update to a method.
Elective attributes
-
- Name
name
- Type
- string
- Description
The method name.
Request
curl -X PUT https://api.stellify.com/v1/method/13f56e50-77d8-4c5b-8ca8-abed7bed60a1 \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d name="My New Method"
import ApiClient from '@stellisoft/js-api-client'
const client = new ApiClient(token)
await client.method.update('13f56e50-77d8-4c5b-8ca8-abed7bed60a1', {
"name": "My New Method",
});
from stellify_api import ApiClient
client = ApiClient(token)
client.method.update("13f56e50-77d8-4c5b-8ca8-abed7bed60a1", name="My New Method")
$client = new \Stellify\ApiClient($token);
$client->method->update('13f56e50-77d8-4c5b-8ca8-abed7bed60a1, [
"name" => "My New Method",
]);
Response
{
"uuid": "bb50f9b7-47bb-4740-8db0-33159569f74e",
"type": "php",
"name": "My New Method"
}
Delete Method
This endpoint allows you to delete a method and any attached statements and clauses.
Request
curl -X DELETE https://api.stellify.com/v1/method/bb50f9b7-47bb-4740-8db0-33159569f74e \
-H "Authorization: Bearer {token}"
import ApiClient from '@stellisoft/js-api-client'
const client = new ApiClient(token)
await client.messages.delete('bb50f9b7-47bb-4740-8db0-33159569f74e')
from stellify_api import ApiClient
client = ApiClient(token)
client.method.delete("bb50f9b7-47bb-4740-8db0-33159569f74e")
$client = new \Stellify\ApiClient($token);
$client->method->delete('bb50f9b7-47bb-4740-8db0-33159569f74e');