from __future__ import annotations
from collections.abc import Callable
from kiota_abstractions.base_request_builder import BaseRequestBuilder
from kiota_abstractions.get_path_parameters import get_path_parameters
from kiota_abstractions.request_adapter import RequestAdapter
from typing import Any, Optional, TYPE_CHECKING, Union

if TYPE_CHECKING:
    from .item.with_version_item_request_builder import WithVersionItemRequestBuilder

class PublishedVersionsRequestBuilder(BaseRequestBuilder):
    """
    Builds and executes requests for operations under /construction/rcm/v1/projects/{projectId}/published-versions
    """
    def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
        """
        Instantiates a new PublishedVersionsRequestBuilder and sets the default values.
        param path_parameters: The raw url or the url-template parameters for the request.
        param request_adapter: The request adapter to use to execute the requests.
        Returns: None
        """
        super().__init__(request_adapter, "{+baseurl}/construction/rcm/v1/projects/{projectId}/published-versions", path_parameters)
    
    def by_version_id(self,version_id: str) -> WithVersionItemRequestBuilder:
        """
        Gets an item from the Autodesk.ACC.construction.rcm.v1.projects.item.publishedVersions.item collection
        param version_id: The URL-encoded version ID (URN) of the published Revit model version for which you want to retrieve linked files.When a Cloud Workshared Revit model is published in BIM 360 or the Autodesk Construction Cloud (ACC), a new version ID is created for each published Revit model version.Every time a model is updated and published, it receives a new unique version ID.You must provide a version ID to retrieve the linked files for that specific published Revit model version.To retrieve the latest (``tip``) version ID, use `GET projects/:project_id/folders/:folder_id/contents </en/docs/data/v2/reference/http/projects-project_id-folders-folder_id-contents-GET>`_. To filter out non-cloud workshared Revit files, use the ``items:autodesk.bim360:C4RModel`` filter .To retrieve a specific past version, use `GET projects/:project_id/items/:item_id/versions </en/docs/data/v2/reference/http/projects-project_id-items-item_id-versions-GET>`_.For more details about retrieving the version ID, see the `Retrieve Signed URLs for Linked RVT Files </en/docs/acc/v1/tutorials/files/rcm-linked-files>`_ tutorial.
        Returns: WithVersionItemRequestBuilder
        """
        if version_id is None:
            raise TypeError("version_id cannot be null.")
        from .item.with_version_item_request_builder import WithVersionItemRequestBuilder

        url_tpl_params = get_path_parameters(self.path_parameters)
        url_tpl_params["versionId"] = version_id
        return WithVersionItemRequestBuilder(self.request_adapter, url_tpl_params)
    

