Skip to content

Commit

Permalink
Merge pull request #901 from microsoftgraph/v1.0/pipelinebuild/163754
Browse files Browse the repository at this point in the history
Generated  models and request builders
  • Loading branch information
shemogumbe authored Sep 18, 2024
2 parents 416fccc + af495fe commit e60d5ba
Show file tree
Hide file tree
Showing 620 changed files with 2,118 additions and 997 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, D
Returns: None
"""
if isinstance(path_parameters, dict):
path_parameters['name'] = str(name)
path_parameters['name'] = name
super().__init__(request_adapter, "{+baseurl}/applications/{application%2Did}/federatedIdentityCredentials(name='{name}'){?%24expand,%24select}", path_parameters)

async def delete(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
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 autoReconcileProxyConflict property
auto_reconcile_proxy_conflict: Optional[bool] = 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]] = {
"autoReconcileProxyConflict": lambda n : setattr(self, 'auto_reconcile_proxy_conflict', n.get_bool_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_bool_value("autoReconcileProxyConflict", self.auto_reconcile_proxy_conflict)
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}/applications/{application%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 application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups cannot be restored. 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 application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups can't be restored. 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-1.0
"""
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 application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups cannot be restored. 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 application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups can't be restored. 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 @@ -29,7 +29,7 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, D
Returns: None
"""
if isinstance(path_parameters, dict):
path_parameters['appId'] = str(app_id)
path_parameters['appId'] = app_id
super().__init__(request_adapter, "{+baseurl}/applications(appId='{appId}'){?%24expand,%24select}", path_parameters)

async def delete(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, D
Returns: None
"""
if isinstance(path_parameters, dict):
path_parameters['uniqueName'] = str(unique_name)
path_parameters['uniqueName'] = unique_name
super().__init__(request_adapter, "{+baseurl}/applications(uniqueName='{uniqueName}'){?%24expand,%24select}", path_parameters)

async def delete(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
Expand Down
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[ConversationMemberItemRequestBuilderGetQueryParameters]] = None) -> Optional[ConversationMember]:
"""
Retrieve a conversationMember from a chat or channel.
Retrieve a conversationMember from a chat.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[ConversationMember]
Find more info here: https://learn.microsoft.com/graph/api/conversationmember-get?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/chat-get-members?view=graph-rest-1.0
"""
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[ConversationMemberItemRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
"""
Retrieve a conversationMember from a chat or channel.
Retrieve a conversationMember from a chat.
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 ConversationMemberItemRequestBuilderDeleteRequestConfiguration(RequestConf
@dataclass
class ConversationMemberItemRequestBuilderGetQueryParameters():
"""
Retrieve a conversationMember from a chat or channel.
Retrieve a conversationMember from a chat.
"""
def get_query_parameter(self,original_name: str) -> str:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ async def get(self,request_configuration: Optional[RequestConfiguration[Messages

async def post(self,body: ChatMessage, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[ChatMessage]:
"""
Send a new chatMessage in the specified channel or a chat.
Send a new chatMessage in the specified chat. This API can't create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[ChatMessage]
Find more info here: https://learn.microsoft.com/graph/api/chatmessage-post?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/chat-post-messages?view=graph-rest-1.0
"""
if body is None:
raise TypeError("body cannot be null.")
Expand Down Expand Up @@ -105,7 +105,7 @@ def to_get_request_information(self,request_configuration: Optional[RequestConfi

def to_post_request_information(self,body: ChatMessage, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
"""
Send a new chatMessage in the specified channel or a chat.
Send a new chatMessage in the specified chat. This API can't create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.
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
Expand Up @@ -31,8 +31,8 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, D
Returns: None
"""
if isinstance(path_parameters, dict):
path_parameters['fromDateTime'] = str(from_date_time)
path_parameters['toDateTime'] = str(to_date_time)
path_parameters['fromDateTime'] = from_date_time
path_parameters['toDateTime'] = to_date_time
super().__init__(request_adapter, "{+baseurl}/communications/callRecords/microsoft.graph.callRecords.getDirectRoutingCalls(fromDateTime={fromDateTime},toDateTime={toDateTime}){?%24count,%24filter,%24search,%24skip,%24top}", path_parameters)

async def get(self,request_configuration: Optional[RequestConfiguration[MicrosoftGraphCallRecordsGetDirectRoutingCallsWithFromDateTimeWithToDateTimeRequestBuilderGetQueryParameters]] = None) -> Optional[GetDirectRoutingCallsWithFromDateTimeWithToDateTimeGetResponse]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, D
Returns: None
"""
if isinstance(path_parameters, dict):
path_parameters['fromDateTime'] = str(from_date_time)
path_parameters['toDateTime'] = str(to_date_time)
path_parameters['fromDateTime'] = from_date_time
path_parameters['toDateTime'] = to_date_time
super().__init__(request_adapter, "{+baseurl}/communications/callRecords/microsoft.graph.callRecords.getPstnCalls(fromDateTime={fromDateTime},toDateTime={toDateTime}){?%24count,%24filter,%24search,%24skip,%24top}", path_parameters)

async def get(self,request_configuration: Optional[RequestConfiguration[MicrosoftGraphCallRecordsGetPstnCallsWithFromDateTimeWithToDateTimeRequestBuilderGetQueryParameters]] = None) -> Optional[GetPstnCallsWithFromDateTimeWithToDateTimeGetResponse]:
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]:
"""
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.
Invite participants to the active call. For more information about how to handle operations, see commsOperation.
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-delete?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/participant-invite?view=graph-rest-1.0
"""
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:
"""
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.
Invite participants to the active call. For more information about how to handle operations, see commsOperation.
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 autoReconcileProxyConflict property
auto_reconcile_proxy_conflict: Optional[bool] = 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]] = {
"autoReconcileProxyConflict": lambda n : setattr(self, 'auto_reconcile_proxy_conflict', n.get_bool_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_bool_value("autoReconcileProxyConflict", self.auto_reconcile_proxy_conflict)
writer.write_additional_data_value(self.additional_data)


Loading

0 comments on commit e60d5ba

Please sign in to comment.