2021-12-06 14:12:41 +00:00
< ? php
namespace Appwrite\Utopia\Response\Model ;
use Appwrite\Utopia\Response ;
use Appwrite\Utopia\Response\Model ;
class Build extends Model
{
public function __construct ()
{
$this
-> addRule ( '$id' , [
'type' => self :: TYPE_STRING ,
'description' => 'Build ID.' ,
'default' => '' ,
'example' => '5e5ea5c16897e' ,
])
2022-01-25 16:51:05 +00:00
-> addRule ( 'deploymentId' , [
'type' => self :: TYPE_STRING ,
2022-02-24 14:18:46 +00:00
'description' => 'The deployment that created this build.' ,
2022-01-25 16:51:05 +00:00
'default' => '' ,
'example' => '5e5ea5c16897e' ,
])
2022-01-10 14:01:50 +00:00
// Build Status
2022-01-24 23:31:41 +00:00
// Failed - The deployment build has failed. More details can usually be found in buildStderr
// Ready - The deployment build was successful and the deployment is ready to be deployed
// Processing - The deployment is currently waiting to have a build triggered
// Building - The deployment is currently being built
2021-12-06 14:12:41 +00:00
-> addRule ( 'status' , [
'type' => self :: TYPE_STRING ,
2022-02-24 14:18:46 +00:00
'description' => 'The build status. There are a few different types and each one means something different. \nFailed - The deployment build has failed. More details can usually be found in buildStderr\nReady - The deployment build was successful and the deployment is ready to be deployed\nProcessing - The deployment is currently waiting to have a build triggered\nBuilding - The deployment is currently being built' ,
2021-12-06 14:12:41 +00:00
'default' => '' ,
'example' => 'ready' ,
])
-> addRule ( 'stdout' , [
'type' => self :: TYPE_STRING ,
'description' => 'The stdout of the build.' ,
'default' => '' ,
'example' => '' ,
])
-> addRule ( 'stderr' , [
'type' => self :: TYPE_STRING ,
'description' => 'The stderr of the build.' ,
'default' => '' ,
'example' => '' ,
])
2022-07-11 15:12:41 +00:00
-> addRule ( 'startTime' , [
'type' => self :: TYPE_DATETIME ,
'description' => 'The deployment creation date in Datetime.' ,
'default' => '' ,
'example' => '1975-12-06 13:30:59' ,
])
2022-01-25 16:51:05 +00:00
-> addRule ( 'endTime' , [
2022-07-11 15:12:41 +00:00
'type' => self :: TYPE_DATETIME ,
'description' => 'The time the build was finished in Datetime.' ,
'default' => '' ,
'example' => '1975-12-06 13:30:59' ,
2022-01-25 16:51:05 +00:00
])
-> addRule ( 'duration' , [
2021-12-06 14:12:41 +00:00
'type' => self :: TYPE_INTEGER ,
'description' => 'The build time in seconds.' ,
'default' => 0 ,
'example' => 0 ,
])
;
}
/**
* Get Name
*
* @ return string
*/
2022-02-24 14:18:46 +00:00
public function getName () : string
2021-12-06 14:12:41 +00:00
{
return 'Build' ;
}
/**
2022-02-24 14:18:46 +00:00
* Get Type
2021-12-06 14:12:41 +00:00
*
* @ return string
*/
2022-02-24 14:18:46 +00:00
public function getType () : string
2021-12-06 14:12:41 +00:00
{
return Response :: MODEL_BUILD ;
}
}