public function linkTo(\Thru\TutumApi\Models\Service $service, $alias = null, Stack $stack = null) { $link = new \StdClass(); $link->to_service = $stack instanceof Stack ? $service->getName() . "." . $stack->getName() : $service->name; $link->name = $alias ? $alias : $service->name; $this->linkedToService[] = $link; return $this; }
public function getStackFromResponse($response, Models\Stack &$stack = null) { if ($stack === null) { $stack = new Models\Stack(); } $stack->setDeployedDatetime($response->deployed_datetime); $stack->setDestroyedDatetime($response->destroyed_datetime); $stack->setName($response->name); $stack->setResourceUri($response->resource_uri); $stack->setServices($response->services); $stack->setState($response->state); $stack->setSynchronized($response->synchronized); $stack->setUuid($response->uuid); return $stack; }