def by_o_auth2_permission_grant_id(self,o_auth2_permission_grant_id: str) -> OAuth2PermissionGrantItemRequestBuilder:
        """
        Provides operations to manage the oauth2PermissionGrants property of the microsoft.graph.servicePrincipal entity.
        param o_auth2_permission_grant_id: The unique identifier of oAuth2PermissionGrant
        Returns: OAuth2PermissionGrantItemRequestBuilder
        """
        if o_auth2_permission_grant_id is None:
            raise TypeError("o_auth2_permission_grant_id cannot be null.")
        from .item.o_auth2_permission_grant_item_request_builder import OAuth2PermissionGrantItemRequestBuilder

        url_tpl_params = get_path_parameters(self.path_parameters)
        url_tpl_params["oAuth2PermissionGrant%2Did"] = o_auth2_permission_grant_id
        return OAuth2PermissionGrantItemRequestBuilder(self.request_adapter, url_tpl_params)

        Provides operations to manage the oauth2PermissionGrants property of the microsoft.graph.servicePrincipal entity.
        param o_auth2_permission_grant_id: The unique identifier of oAuth2PermissionGrant
        Returns: OAuth2PermissionGrantItemRequestBuilder
        
msgraph/generated/service_principals/item/oauth2_permission_grants/oauth2_permission_grants_request_builder.py