@param string $id
@param array  $headers

@throws Exception

@return array|string
557584
public function delete(string $id, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/delete', $id);

        return $this->post($url, [], $headers);
    }
1279992
public function in($id, array $ids)
    {
        $allParents = $this->getHierarchy($id);

        /**
         * To increase the efficiency, we can index the results of the parent.
         */
        $allParentsIndexed = [];
        foreach ($allParents as $parent) {
            $allParentsIndexed[$parent->getId()] = $parent;
        }

        foreach ($ids as $possibleParentId) {
            if (isset($allParentsIndexed[$possibleParentId])) {
                return true;
            }
        }

        return false;
    }
595121
public function findAsPdf(string $id, array $headers = [])
    {
        $url = $this->url('invoices/%s/pdf', $id);

        return $this->get($url, [], $headers);
    }
1279677
public function changeTermEnd(string $id, array $data, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/change_term_end', $id);

        return $this->post($url, $data, $headers);
    }
437308
public function removeScheduledChanges(string $id, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/remove_scheduled_changes', $id);

        return $this->post($url, [], $headers);
    }
132489
public function getItemStatus($id, $mediaId, array $parameters = [], array $headers = [])
    {
        return $this->getFactory()->createItemStatus(
            $this->getApi()->getItemStatus($id, $mediaId, $parameters, $headers)
        );
    }
549256
public function logout(string $id, array $headers = [])
    {
        $url = $this->url('portal_sessions/%s/logout', $id);

        return $this->post($url, [], $headers);
    }
61504
public function removePayment(string $id, array $data, array $headers = [])
    {
        $url = $this->url('invoices/%s/remove_payment', $id);

        return $this->post($url, $data, $headers);
    }
1005129
public function in($id, array $ids)
    {
        $url = $this->buildUrlByMethodName(
            'getInUrl',
            [
                'id' => $id,
                'ids' => implode(',', $ids),
            ]
        );

        $response = $this->resolveApiUrl($url);

        return $response['result'];
    }
799176
private static function withCorsHeaders(ResponseInterface $response, array $headers): ResponseInterface
	{
		foreach ($headers as $name => $value) {
			$response = $response->withHeader($name, $value);
		}

		return $response;
	}
386953
public function show($id)
    {
        if(Request::isAjax()){
            $user = null;
            $message = '';

            try{
                $user = Sentry::findUserById($id);
            }catch(Exception $e){
                $message = $e->getMessage();
            }


            Response::headers()->set('Content-Type', 'application/json');
            Response::setBody(json_encode(
                array(
                    'success'   => !is_null($user),
                    'data'      => !is_null($user) ? $user->toArray() : $user,
                    'message'   => $message,
                    'code'      => is_null($user) ? 404 : 200
                )
            ));
        }else{

        }
    }
826981
public function addContact(string $id, array $data, array $headers = [])
    {
        $url = $this->url('customers/%s/add_contact', $id);

        return $this->post($url, $data, $headers);
    }
720496
public function load($id, array $parameters = [], array $headers = [])
    {
        return $this->loadCollection($parameters, $headers)->filterId($id);
    }
646809
public function load($id, array $parameters = [], array $headers = [])
    {
        return $this->getFactory()->create(
            $this->getApi()->getList($id, $parameters, $headers)
        );
    }
902748
public function stopDunning(string $id, array $headers = [])
    {
        $url = $this->url('invoices/%s/stop_dunning', $id);

        return $this->post($url, [], $headers);
    }
837075
public function getById(string $id, array $params = [])
    {
        return $this->executeRequest(
            RequestMethodEnum::GET,
            ResourceMethodEnum::GET_BY_ID,
            $params,
            $id
        );
    }
63038
public function software($id, $scopes = []) {
        if (!$this->id) {
            throw new Exception("The server has no ID, can\'t get software");
        }

        $software = new Software($this->patrol);

        $software->defaults([
            'server_id' => $this->id
        ]);

        return $software->find($id, $scopes);
    }