public function setPrimaryResource(ResourceInterface $resource, array $options=[]) {
		if ($resource instanceof ResourceDocument) {
			throw new InputException('does not make sense to set a document inside a document, use ResourceObject or ResourceIdentifierObject instead');
		}
		
		$options = array_merge(self::$defaults, $options);
		
		$this->resource = $resource;
		
		if ($options['includeContainedResources'] && $this->resource instanceof RecursiveResourceContainerInterface) {
			$this->addIncludedResourceObject(...$this->resource->getNestedContainedResourceObjects());
		}
	}