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 .actions.actions_request_builder import ActionsRequestBuilder
    from .action_histories.action_histories_request_builder import ActionHistoriesRequestBuilder
    from .item.with_association_type_item_request_builder import WithAssociationTypeItemRequestBuilder

class WorkflowsRequestBuilder(BaseRequestBuilder):
    """
    Builds and executes requests for operations under /cost/v1/containers/{containerId}/workflows
    """
    def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
        """
        Instantiates a new WorkflowsRequestBuilder 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}/cost/v1/containers/{containerId}/workflows", path_parameters)
    
    def by_association_type(self,association_type: str) -> WithAssociationTypeItemRequestBuilder:
        """
        Gets an item from the Autodesk.ACC.cost.v1.containers.item.workflows.item collection
        param association_type: The type of the item with which the actions are associated. Possible values: ``FormInstance``, ``CostItem``, ``OCO``, ``PCO``, ``RCO``, ``RFQ``, ``SCO``, ``Expense``, ``Contract``, ``CostPayment``, ``BudgetPayment``, ``BudgetTransfer``, ``MainContract``.
        Returns: WithAssociationTypeItemRequestBuilder
        """
        if association_type is None:
            raise TypeError("association_type cannot be null.")
        from .item.with_association_type_item_request_builder import WithAssociationTypeItemRequestBuilder

        url_tpl_params = get_path_parameters(self.path_parameters)
        url_tpl_params["associationType"] = association_type
        return WithAssociationTypeItemRequestBuilder(self.request_adapter, url_tpl_params)
    
    @property
    def action_histories(self) -> ActionHistoriesRequestBuilder:
        """
        The actionHistories property
        """
        from .action_histories.action_histories_request_builder import ActionHistoriesRequestBuilder

        return ActionHistoriesRequestBuilder(self.request_adapter, self.path_parameters)
    
    @property
    def actions(self) -> ActionsRequestBuilder:
        """
        The actions property
        """
        from .actions.actions_request_builder import ActionsRequestBuilder

        return ActionsRequestBuilder(self.request_adapter, self.path_parameters)
    

