Clauses
Clauses are child nodes of statements.
Clause Object
A clause object includes properties that describe the clause in question.
Properties
-
- Name
uuid
- Type
- string
- Description
-
Unique identifier for the clause.
-
- Name
type
- Type
- string
- Description
-
The type of clause i.e. keyword, variable, method call.
-
- Name
value
- Type
- string
- Description
-
The value assigned to the clause (dependant upon the context).
-
- Name
created_at
- Type
- timestamp
- Description
-
Timestamp of when the clause was created.
-
- Name
updated_at
- Type
- timestamp
- Description
-
Timestamp of when the clause was last updated.
POST/v1/clause
Create Clause
This endpoint allows you to create a new clause and attach it to a statement.
Required attributes
-
- Name
statement_id
- Type
- string
- Description
-
The statement in which to create the clause.
Request
POST
/v1/clause
curl https://api.stellify.com/v1/clause \
-H "Authorization: Bearer {token}" \
-d statement_id="78abe81c-1aa1-423a-a9b7-f060678474e9"
import ApiClient from '@stellisoft/js-api-client'
const client = new ApiClient(token)
await client.clause.create({
statement_id: '78abe81c-1aa1-423a-a9b7-f060678474e9',
})
from stellify_api import ApiClient
client = ApiClient(token)
client.clause.create(
statement_id="78abe81c-1aa1-423a-a9b7-f060678474e9",
)
$client = new \Stellify\ApiClient($token);
$client->clause->create([
'statement_id' => '78abe81c-1aa1-423a-a9b7-f060678474e9',
]);
Response
{
"uuid": "4cf369f3-ea7f-4341-976d-31df62120582",
"type": "T_CLOSE_BRACKET"
}
PUT/v1/clause/:id
Update Clause
This endpoint allows you to perform an update on a clause.
Required attributes
-
- Name
Request JSON Body
- Type
- object
- Description
-
The clause object properties as set out above.
Request
PUT
/v1/clause/4cf369f3-ea7f-4341-976d-31df62120582
curl -X PUT https://api.stellify.com/v1/clause/4cf369f3-ea7f-4341-976d-31df62120582 \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d "{\"uuid\":\"4cf369f3-ea7f-4341-976d-31df62120582\",\"type\":"T_OPEN_BRACKET"}"
import ApiClient from '@stellisoft/js-api-client'
const client = new ApiClient(token)
await client.clause.update('4cf369f3-ea7f-4341-976d-31df62120582', {
"uuid": "4cf369f3-ea7f-4341-976d-31df62120582",
"type": "T_OPEN_BRACKET",
});
from stellify_api import ApiClient
client = ApiClient(token)
client.clause.update("4cf369f3-ea7f-4341-976d-31df62120582",
"{\"uuid\":\"4cf369f3-ea7f-4341-976d-31df62120582\",\"type\":"T_OPEN_BRACKET")
$client = new \Stellify\ApiClient($token);
$client->clause->update('4cf369f3-ea7f-4341-976d-31df62120582, [
"uuid" => "4cf369f3-ea7f-4341-976d-31df62120582",
"type" => T_OPEN_BRACKET,
]);
Response
{
"uuid": "78abe81c-1aa1-423a-a9b7-f060678474e9",
"type": "T_OPEN_BRACKET"
}
DELETE/v1/clause/:statement_id/:clause_id
Delete Clause
This endpoint allows you to delete a clause.
Request
DELETE
/v1/clause/78abe81c-1aa1-423a-a9b7-f060678474e9/4cf369f3-ea7f-4341-976d-31df62120582
curl -X DELETE https://api.stellify.com/v1/clause/78abe81c-1aa1-423a-a9b7-f060678474e9/4cf369f3-ea7f-4341-976d-31df62120582 \
-H "Authorization: Bearer {token}"
import ApiClient from '@stellisoft/js-api-client'
const client = new ApiClient(token)
await client.messages.delete('78abe81c-1aa1-423a-a9b7-f060678474e9', '4cf369f3-ea7f-4341-976d-31df62120582')
from stellify_api import ApiClient
client = ApiClient(token)
client.clause.delete("78abe81c-1aa1-423a-a9b7-f060678474e9", "4cf369f3-ea7f-4341-976d-31df62120582")
$client = new \Stellify\ApiClient($token);
$client->clause->delete('78abe81c-1aa1-423a-a9b7-f060678474e9', '4cf369f3-ea7f-4341-976d-31df62120582');