Skip to content

Commit

Permalink
Merge pull request #701 from microsoftgraph/beta/pipelinebuild/175190
Browse files Browse the repository at this point in the history
Generated beta models and request builders
  • Loading branch information
Ndiritu authored Jan 2, 2025
2 parents b0c7c62 + b08a379 commit 9b5a128
Show file tree
Hide file tree
Showing 296 changed files with 5,281 additions and 2,036 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ async def delete(self,request_configuration: Optional[RequestConfiguration[Query

async def get(self,request_configuration: Optional[RequestConfiguration[ResourceConnectionItemRequestBuilderGetQueryParameters]] = None) -> Optional[ResourceConnection]:
"""
Read the properties and relationships of an operationalInsightsConnection object.
Read the properties and relationships of a resourceConnection object.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[ResourceConnection]
Find more info here: https://learn.microsoft.com/graph/api/windowsupdates-operationalinsightsconnection-get?view=graph-rest-beta
Find more info here: https://learn.microsoft.com/graph/api/windowsupdates-resourceconnection-get?view=graph-rest-beta
"""
request_info = self.to_get_request_information(
request_configuration
Expand Down Expand Up @@ -105,7 +105,7 @@ def to_delete_request_information(self,request_configuration: Optional[RequestCo

def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[ResourceConnectionItemRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
"""
Read the properties and relationships of an operationalInsightsConnection object.
Read the properties and relationships of a resourceConnection object.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
Expand Down Expand Up @@ -149,7 +149,7 @@ class ResourceConnectionItemRequestBuilderDeleteRequestConfiguration(RequestConf
@dataclass
class ResourceConnectionItemRequestBuilderGetQueryParameters():
"""
Read the properties and relationships of an operationalInsightsConnection object.
Read the properties and relationships of a resourceConnection object.
"""
def get_query_parameter(self,original_name: str) -> str:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, D

async def delete(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
"""
Delete an updatableAsset object.
Delete an azureADDevice object. When a Microsoft Entra device is deleted, it is unregistered and automatically unenrolled from management for all update categories, as well as removed from every deploymentAudience and updatableAssetGroup.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: None
Find more info here: https://learn.microsoft.com/graph/api/windowsupdates-updatableasset-delete?view=graph-rest-beta
Find more info here: https://learn.microsoft.com/graph/api/windowsupdates-azureaddevice-delete?view=graph-rest-beta
"""
request_info = self.to_delete_request_information(
request_configuration
Expand All @@ -54,10 +54,10 @@ async def delete(self,request_configuration: Optional[RequestConfiguration[Query

async def get(self,request_configuration: Optional[RequestConfiguration[UpdatableAssetItemRequestBuilderGetQueryParameters]] = None) -> Optional[UpdatableAsset]:
"""
Read the properties and relationships of an updatableAsset object.
Read the properties and relationships of an updatableAssetGroup object.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[UpdatableAsset]
Find more info here: https://learn.microsoft.com/graph/api/windowsupdates-updatableasset-get?view=graph-rest-beta
Find more info here: https://learn.microsoft.com/graph/api/windowsupdates-updatableassetgroup-get?view=graph-rest-beta
"""
request_info = self.to_get_request_information(
request_configuration
Expand Down Expand Up @@ -98,7 +98,7 @@ async def patch(self,body: UpdatableAsset, request_configuration: Optional[Reque

def to_delete_request_information(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
"""
Delete an updatableAsset object.
Delete an azureADDevice object. When a Microsoft Entra device is deleted, it is unregistered and automatically unenrolled from management for all update categories, as well as removed from every deploymentAudience and updatableAssetGroup.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
Expand All @@ -109,7 +109,7 @@ def to_delete_request_information(self,request_configuration: Optional[RequestCo

def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[UpdatableAssetItemRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
"""
Read the properties and relationships of an updatableAsset object.
Read the properties and relationships of an updatableAssetGroup object.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
Expand Down Expand Up @@ -189,7 +189,7 @@ class UpdatableAssetItemRequestBuilderDeleteRequestConfiguration(RequestConfigur
@dataclass
class UpdatableAssetItemRequestBuilderGetQueryParameters():
"""
Read the properties and relationships of an updatableAsset object.
Read the properties and relationships of an updatableAssetGroup object.
"""
def get_query_parameter(self,original_name: str) -> str:
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
from __future__ import annotations
from dataclasses import dataclass, field
from kiota_abstractions.serialization import AdditionalDataHolder, Parsable, ParseNode, SerializationWriter
from kiota_abstractions.store import BackedModel, BackingStore, BackingStoreFactorySingleton
from typing import Any, Callable, Dict, List, Optional, TYPE_CHECKING, Union

@dataclass
class RestorePostRequestBody(AdditionalDataHolder, BackedModel, Parsable):
# Stores model information.
backing_store: BackingStore = field(default_factory=BackingStoreFactorySingleton(backing_store_factory=None).backing_store_factory.create_backing_store, repr=False)

# Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additional_data: Dict[str, Any] = field(default_factory=dict)
# The newUserPrincipalName property
new_user_principal_name: Optional[str] = None

@staticmethod
def create_from_discriminator_value(parse_node: ParseNode) -> RestorePostRequestBody:
"""
Creates a new instance of the appropriate class based on discriminator value
param parse_node: The parse node to use to read the discriminator value and create the object
Returns: RestorePostRequestBody
"""
if parse_node is None:
raise TypeError("parse_node cannot be null.")
return RestorePostRequestBody()

def get_field_deserializers(self,) -> Dict[str, Callable[[ParseNode], None]]:
"""
The deserialization information for the current model
Returns: Dict[str, Callable[[ParseNode], None]]
"""
fields: Dict[str, Callable[[Any], None]] = {
"newUserPrincipalName": lambda n : setattr(self, 'new_user_principal_name', n.get_str_value()),
}
return fields

def serialize(self,writer: SerializationWriter) -> None:
"""
Serializes information the current object
param writer: Serialization writer to use to serialize this model
Returns: None
"""
if writer is None:
raise TypeError("writer cannot be null.")
writer.write_str_value("newUserPrincipalName", self.new_user_principal_name)
writer.write_additional_data_value(self.additional_data)


Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
if TYPE_CHECKING:
from ....models.directory_object import DirectoryObject
from ....models.o_data_errors.o_data_error import ODataError
from .restore_post_request_body import RestorePostRequestBody

class RestoreRequestBuilder(BaseRequestBuilder):
"""
Expand All @@ -29,15 +30,18 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, D
"""
super().__init__(request_adapter, "{+baseurl}/administrativeUnits/{administrativeUnit%2Did}/restore", path_parameters)

async def post(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[DirectoryObject]:
async def post(self,body: RestorePostRequestBody, 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](../resources/certificateauthoritydetail.md- 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.
param body: The request body
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
"""
if body is None:
raise TypeError("body cannot be null.")
request_info = self.to_post_request_information(
request_configuration
body, request_configuration
)
from ....models.o_data_errors.o_data_error import ODataError

Expand All @@ -50,15 +54,19 @@ async def post(self,request_configuration: Optional[RequestConfiguration[QueryPa

return await self.request_adapter.send_async(request_info, DirectoryObject, error_mapping)

def to_post_request_information(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
def to_post_request_information(self,body: RestorePostRequestBody, 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](../resources/certificateauthoritydetail.md- 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.
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
if body is None:
raise TypeError("body cannot be null.")
request_info = RequestInformation(Method.POST, self.url_template, self.path_parameters)
request_info.configure(request_configuration)
request_info.headers.try_add("Accept", "application/json")
request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
return request_info

def with_url(self,raw_url: str) -> RestoreRequestBuilder:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, D

async def post(self,body: InvitePostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[InviteParticipantsOperation]:
"""
Invite participants to the active call. For more information about how to handle operations, see commsOperation.
Delete a specific participant in a call. In some situations, it is appropriate for an application to remove a participant from an active call. This action can be done before or after the participant answers the call. When an active caller is removed, they are immediately dropped from the call with no pre- or post-removal notification. When an invited participant is removed, any outstanding add participant request is canceled.
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[InviteParticipantsOperation]
Find more info here: https://learn.microsoft.com/graph/api/participant-invite?view=graph-rest-beta
Find more info here: https://learn.microsoft.com/graph/api/participant-delete?view=graph-rest-beta
"""
if body is None:
raise TypeError("body cannot be null.")
Expand All @@ -56,7 +56,7 @@ async def post(self,body: InvitePostRequestBody, request_configuration: Optional

def to_post_request_information(self,body: InvitePostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
"""
Invite participants to the active call. For more information about how to handle operations, see commsOperation.
Delete a specific participant in a call. In some situations, it is appropriate for an application to remove a participant from an active call. This action can be done before or after the participant answers the call. When an active caller is removed, they are immediately dropped from the call with no pre- or post-removal notification. When an invited participant is removed, any outstanding add participant request is canceled.
param body: The request body
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
@@ -0,0 +1,49 @@
from __future__ import annotations
from dataclasses import dataclass, field
from kiota_abstractions.serialization import AdditionalDataHolder, Parsable, ParseNode, SerializationWriter
from kiota_abstractions.store import BackedModel, BackingStore, BackingStoreFactorySingleton
from typing import Any, Callable, Dict, List, Optional, TYPE_CHECKING, Union

@dataclass
class RestorePostRequestBody(AdditionalDataHolder, BackedModel, Parsable):
# Stores model information.
backing_store: BackingStore = field(default_factory=BackingStoreFactorySingleton(backing_store_factory=None).backing_store_factory.create_backing_store, repr=False)

# Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additional_data: Dict[str, Any] = field(default_factory=dict)
# The newUserPrincipalName property
new_user_principal_name: Optional[str] = None

@staticmethod
def create_from_discriminator_value(parse_node: ParseNode) -> RestorePostRequestBody:
"""
Creates a new instance of the appropriate class based on discriminator value
param parse_node: The parse node to use to read the discriminator value and create the object
Returns: RestorePostRequestBody
"""
if parse_node is None:
raise TypeError("parse_node cannot be null.")
return RestorePostRequestBody()

def get_field_deserializers(self,) -> Dict[str, Callable[[ParseNode], None]]:
"""
The deserialization information for the current model
Returns: Dict[str, Callable[[ParseNode], None]]
"""
fields: Dict[str, Callable[[Any], None]] = {
"newUserPrincipalName": lambda n : setattr(self, 'new_user_principal_name', n.get_str_value()),
}
return fields

def serialize(self,writer: SerializationWriter) -> None:
"""
Serializes information the current object
param writer: Serialization writer to use to serialize this model
Returns: None
"""
if writer is None:
raise TypeError("writer cannot be null.")
writer.write_str_value("newUserPrincipalName", self.new_user_principal_name)
writer.write_additional_data_value(self.additional_data)


Loading

0 comments on commit 9b5a128

Please sign in to comment.