Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, d

async def post(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[DirectoryObject]:
"""
Restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item was accidentally deleted, you can fully restore the item. This isn't applicable to security groups, which are deleted permanently. Also, restoring an application doesn't restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
Restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[DirectoryObject]
Find more info here: https://learn.microsoft.com/graph/api/directory-deleteditems-restore?view=graph-rest-beta
Expand All @@ -53,7 +53,7 @@ async def post(self,request_configuration: Optional[RequestConfiguration[QueryPa

def to_post_request_information(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
"""
Restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item was accidentally deleted, you can fully restore the item. This isn't applicable to security groups, which are deleted permanently. Also, restoring an application doesn't restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
Restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,105 +14,101 @@
from warnings import warn

if TYPE_CHECKING:
from ............models.custom_data_provided_resource_file import CustomDataProvidedResourceFile
from ............models.custom_data_provided_resource_file_collection_response import CustomDataProvidedResourceFileCollectionResponse
from ............models.o_data_errors.o_data_error import ODataError
from ..models.agent import Agent
from ..models.agent_collection_response import AgentCollectionResponse
from ..models.o_data_errors.o_data_error import ODataError
from .count.count_request_builder import CountRequestBuilder
from .item.custom_data_provided_resource_file_name_item_request_builder import CustomDataProvidedResourceFileNameItemRequestBuilder
from .discover_copilot_tools.discover_copilot_tools_request_builder import DiscoverCopilotToolsRequestBuilder
from .item.agent_item_request_builder import AgentItemRequestBuilder

class FilesRequestBuilder(BaseRequestBuilder):
class AgentsRequestBuilder(BaseRequestBuilder):
"""
Provides operations to manage the files property of the microsoft.graph.customDataProvidedResourceUploadSession entity.
Provides operations to manage the collection of agent entities.
"""
def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
"""
Instantiates a new FilesRequestBuilder and sets the default values.
Instantiates a new AgentsRequestBuilder 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}/identityGovernance/entitlementManagement/accessPackages/{accessPackage%2Did}/accessPackageResourceRoleScopes/{accessPackageResourceRoleScope%2Did}/accessPackageResourceRole/accessPackageResource/uploadSessions/{customDataProvidedResourceUploadSession%2Did}/files{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", path_parameters)
super().__init__(request_adapter, "{+baseurl}/agents{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", path_parameters)

def by_custom_data_provided_resource_file_name(self,custom_data_provided_resource_file_name: str) -> CustomDataProvidedResourceFileNameItemRequestBuilder:
def by_agent_id(self,agent_id: str) -> AgentItemRequestBuilder:
"""
Provides operations to manage the files property of the microsoft.graph.customDataProvidedResourceUploadSession entity.
param custom_data_provided_resource_file_name: The unique identifier of customDataProvidedResourceFile
Returns: CustomDataProvidedResourceFileNameItemRequestBuilder
Provides operations to manage the collection of agent entities.
param agent_id: The unique identifier of agent
Returns: AgentItemRequestBuilder
"""
warn("This API is for private preview. as of 2025-07/PrivatePreview:uploadSessions on 2025-07-31 and will be removed 2026-07-31", DeprecationWarning)
if custom_data_provided_resource_file_name is None:
raise TypeError("custom_data_provided_resource_file_name cannot be null.")
from .item.custom_data_provided_resource_file_name_item_request_builder import CustomDataProvidedResourceFileNameItemRequestBuilder
if agent_id is None:
raise TypeError("agent_id cannot be null.")
from .item.agent_item_request_builder import AgentItemRequestBuilder

url_tpl_params = get_path_parameters(self.path_parameters)
url_tpl_params["customDataProvidedResourceFile%2Dname"] = custom_data_provided_resource_file_name
return CustomDataProvidedResourceFileNameItemRequestBuilder(self.request_adapter, url_tpl_params)
url_tpl_params["agent%2Did"] = agent_id
return AgentItemRequestBuilder(self.request_adapter, url_tpl_params)

async def get(self,request_configuration: Optional[RequestConfiguration[FilesRequestBuilderGetQueryParameters]] = None) -> Optional[CustomDataProvidedResourceFileCollectionResponse]:
async def get(self,request_configuration: Optional[RequestConfiguration[AgentsRequestBuilderGetQueryParameters]] = None) -> Optional[AgentCollectionResponse]:
"""
Get files from identityGovernance
Get entities from agents
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[CustomDataProvidedResourceFileCollectionResponse]
Returns: Optional[AgentCollectionResponse]
"""
warn("This API is for private preview. as of 2025-07/PrivatePreview:uploadSessions on 2025-07-31 and will be removed 2026-07-31", DeprecationWarning)
request_info = self.to_get_request_information(
request_configuration
)
from ............models.o_data_errors.o_data_error import ODataError
from ..models.o_data_errors.o_data_error import ODataError

error_mapping: dict[str, type[ParsableFactory]] = {
"XXX": ODataError,
}
if not self.request_adapter:
raise Exception("Http core is null")
from ............models.custom_data_provided_resource_file_collection_response import CustomDataProvidedResourceFileCollectionResponse
from ..models.agent_collection_response import AgentCollectionResponse

return await self.request_adapter.send_async(request_info, CustomDataProvidedResourceFileCollectionResponse, error_mapping)
return await self.request_adapter.send_async(request_info, AgentCollectionResponse, error_mapping)

async def post(self,body: CustomDataProvidedResourceFile, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[CustomDataProvidedResourceFile]:
async def post(self,body: Agent, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[Agent]:
"""
Create new navigation property to files for identityGovernance
Add new entity to agents
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[CustomDataProvidedResourceFile]
Returns: Optional[Agent]
"""
warn("This API is for private preview. as of 2025-07/PrivatePreview:uploadSessions on 2025-07-31 and will be removed 2026-07-31", DeprecationWarning)
if body is None:
raise TypeError("body cannot be null.")
request_info = self.to_post_request_information(
body, request_configuration
)
from ............models.o_data_errors.o_data_error import ODataError
from ..models.o_data_errors.o_data_error import ODataError

error_mapping: dict[str, type[ParsableFactory]] = {
"XXX": ODataError,
}
if not self.request_adapter:
raise Exception("Http core is null")
from ............models.custom_data_provided_resource_file import CustomDataProvidedResourceFile
from ..models.agent import Agent

return await self.request_adapter.send_async(request_info, CustomDataProvidedResourceFile, error_mapping)
return await self.request_adapter.send_async(request_info, Agent, error_mapping)

def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[FilesRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[AgentsRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
"""
Get files from identityGovernance
Get entities from agents
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
warn("This API is for private preview. as of 2025-07/PrivatePreview:uploadSessions on 2025-07-31 and will be removed 2026-07-31", DeprecationWarning)
request_info = RequestInformation(Method.GET, self.url_template, self.path_parameters)
request_info.configure(request_configuration)
request_info.headers.try_add("Accept", "application/json")
return request_info

def to_post_request_information(self,body: CustomDataProvidedResourceFile, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
def to_post_request_information(self,body: Agent, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
"""
Create new navigation property to files for identityGovernance
Add new entity to agents
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
warn("This API is for private preview. as of 2025-07/PrivatePreview:uploadSessions on 2025-07-31 and will be removed 2026-07-31", DeprecationWarning)
if body is None:
raise TypeError("body cannot be null.")
request_info = RequestInformation(Method.POST, self.url_template, self.path_parameters)
Expand All @@ -121,16 +117,15 @@ def to_post_request_information(self,body: CustomDataProvidedResourceFile, reque
request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
return request_info

def with_url(self,raw_url: str) -> FilesRequestBuilder:
def with_url(self,raw_url: str) -> AgentsRequestBuilder:
"""
Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
param raw_url: The raw URL to use for the request builder.
Returns: FilesRequestBuilder
Returns: AgentsRequestBuilder
"""
warn("This API is for private preview. as of 2025-07/PrivatePreview:uploadSessions on 2025-07-31 and will be removed 2026-07-31", DeprecationWarning)
if raw_url is None:
raise TypeError("raw_url cannot be null.")
return FilesRequestBuilder(self.request_adapter, raw_url)
return AgentsRequestBuilder(self.request_adapter, raw_url)

@property
def count(self) -> CountRequestBuilder:
Expand All @@ -141,10 +136,19 @@ def count(self) -> CountRequestBuilder:

return CountRequestBuilder(self.request_adapter, self.path_parameters)

@property
def discover_copilot_tools(self) -> DiscoverCopilotToolsRequestBuilder:
"""
Provides operations to call the discoverCopilotTools method.
"""
from .discover_copilot_tools.discover_copilot_tools_request_builder import DiscoverCopilotToolsRequestBuilder

return DiscoverCopilotToolsRequestBuilder(self.request_adapter, self.path_parameters)

@dataclass
class FilesRequestBuilderGetQueryParameters():
class AgentsRequestBuilderGetQueryParameters():
"""
Get files from identityGovernance
Get entities from agents
"""
def get_query_parameter(self,original_name: str) -> str:
"""
Expand Down Expand Up @@ -198,14 +202,14 @@ def get_query_parameter(self,original_name: str) -> str:


@dataclass
class FilesRequestBuilderGetRequestConfiguration(RequestConfiguration[FilesRequestBuilderGetQueryParameters]):
class AgentsRequestBuilderGetRequestConfiguration(RequestConfiguration[AgentsRequestBuilderGetQueryParameters]):
"""
Configuration for the request such as headers, query parameters, and middleware options.
"""
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)

@dataclass
class FilesRequestBuilderPostRequestConfiguration(RequestConfiguration[QueryParameters]):
class AgentsRequestBuilderPostRequestConfiguration(RequestConfiguration[QueryParameters]):
"""
Configuration for the request such as headers, query parameters, and middleware options.
"""
Expand Down
Loading
Loading