Skip to content

Commit

Permalink
feat(generation): update request builders and models
Browse files Browse the repository at this point in the history
Update generated files with build 175190
  • Loading branch information
Microsoft Graph DevX Tooling authored and Microsoft Graph DevX Tooling committed Dec 31, 2024
1 parent 8eab2da commit 22cb5fd
Show file tree
Hide file tree
Showing 98 changed files with 3,144 additions and 216 deletions.
10 changes: 10 additions & 0 deletions msgraph/generated/chats/item/members/members_request_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from .add.add_request_builder import AddRequestBuilder
from .count.count_request_builder import CountRequestBuilder
from .item.conversation_member_item_request_builder import ConversationMemberItemRequestBuilder
from .remove.remove_request_builder import RemoveRequestBuilder

class MembersRequestBuilder(BaseRequestBuilder):
"""
Expand Down Expand Up @@ -146,6 +147,15 @@ def count(self) -> CountRequestBuilder:

return CountRequestBuilder(self.request_adapter, self.path_parameters)

@property
def remove(self) -> RemoveRequestBuilder:
"""
Provides operations to call the remove method.
"""
from .remove.remove_request_builder import RemoveRequestBuilder

return RemoveRequestBuilder(self.request_adapter, self.path_parameters)

@dataclass
class MembersRequestBuilderGetQueryParameters():
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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

if TYPE_CHECKING:
from .....models.conversation_member import ConversationMember

@dataclass
class RemovePostRequestBody(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 values property
values: Optional[List[ConversationMember]] = None

@staticmethod
def create_from_discriminator_value(parse_node: ParseNode) -> RemovePostRequestBody:
"""
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: RemovePostRequestBody
"""
if parse_node is None:
raise TypeError("parse_node cannot be null.")
return RemovePostRequestBody()

def get_field_deserializers(self,) -> Dict[str, Callable[[ParseNode], None]]:
"""
The deserialization information for the current model
Returns: Dict[str, Callable[[ParseNode], None]]
"""
from .....models.conversation_member import ConversationMember

from .....models.conversation_member import ConversationMember

fields: Dict[str, Callable[[Any], None]] = {
"values": lambda n : setattr(self, 'values', n.get_collection_of_object_values(ConversationMember)),
}
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.")
from .....models.conversation_member import ConversationMember

writer.write_collection_of_object_values("values", self.values)
writer.write_additional_data_value(self.additional_data)


Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
from __future__ import annotations
from dataclasses import dataclass, field
from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
from typing import Any, Callable, Dict, List, Optional, TYPE_CHECKING, Union

if TYPE_CHECKING:
from .....models.action_result_part import ActionResultPart
from .....models.base_collection_pagination_count_response import BaseCollectionPaginationCountResponse

from .....models.base_collection_pagination_count_response import BaseCollectionPaginationCountResponse

@dataclass
class RemovePostResponse(BaseCollectionPaginationCountResponse, Parsable):
# The value property
value: Optional[List[ActionResultPart]] = None

@staticmethod
def create_from_discriminator_value(parse_node: ParseNode) -> RemovePostResponse:
"""
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: RemovePostResponse
"""
if parse_node is None:
raise TypeError("parse_node cannot be null.")
return RemovePostResponse()

def get_field_deserializers(self,) -> Dict[str, Callable[[ParseNode], None]]:
"""
The deserialization information for the current model
Returns: Dict[str, Callable[[ParseNode], None]]
"""
from .....models.action_result_part import ActionResultPart
from .....models.base_collection_pagination_count_response import BaseCollectionPaginationCountResponse

from .....models.action_result_part import ActionResultPart
from .....models.base_collection_pagination_count_response import BaseCollectionPaginationCountResponse

fields: Dict[str, Callable[[Any], None]] = {
"value": lambda n : setattr(self, 'value', n.get_collection_of_object_values(ActionResultPart)),
}
super_fields = super().get_field_deserializers()
fields.update(super_fields)
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.")
super().serialize(writer)
from .....models.action_result_part import ActionResultPart
from .....models.base_collection_pagination_count_response import BaseCollectionPaginationCountResponse

writer.write_collection_of_object_values("value", self.value)


Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
from __future__ import annotations
from dataclasses import dataclass, field
from kiota_abstractions.base_request_builder import BaseRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
from kiota_abstractions.default_query_parameters import QueryParameters
from kiota_abstractions.get_path_parameters import get_path_parameters
from kiota_abstractions.method import Method
from kiota_abstractions.request_adapter import RequestAdapter
from kiota_abstractions.request_information import RequestInformation
from kiota_abstractions.request_option import RequestOption
from kiota_abstractions.serialization import Parsable, ParsableFactory
from typing import Any, Callable, Dict, List, Optional, TYPE_CHECKING, Union
from warnings import warn

if TYPE_CHECKING:
from .....models.o_data_errors.o_data_error import ODataError
from .remove_post_request_body import RemovePostRequestBody
from .remove_post_response import RemovePostResponse

class RemoveRequestBuilder(BaseRequestBuilder):
"""
Provides operations to call the remove method.
"""
def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, Dict[str, Any]]) -> None:
"""
Instantiates a new RemoveRequestBuilder 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}/chats/{chat%2Did}/members/remove", path_parameters)

async def post(self,body: RemovePostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[RemovePostResponse]:
"""
Remove multiple members from a team in a single request. The response provides details about which memberships could and couldn't be removed.
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[RemovePostResponse]
Find more info here: https://learn.microsoft.com/graph/api/conversationmember-remove?view=graph-rest-1.0
"""
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

error_mapping: Dict[str, type[ParsableFactory]] = {
"XXX": ODataError,
}
if not self.request_adapter:
raise Exception("Http core is null")
from .remove_post_response import RemovePostResponse

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

def to_post_request_information(self,body: RemovePostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
"""
Remove multiple members from a team in a single request. The response provides details about which memberships could and couldn't be removed.
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) -> RemoveRequestBuilder:
"""
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: RemoveRequestBuilder
"""
if raw_url is None:
raise TypeError("raw_url cannot be null.")
return RemoveRequestBuilder(self.request_adapter, raw_url)

@dataclass
class RemoveRequestBuilderPostRequestConfiguration(RequestConfiguration[QueryParameters]):
"""
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)


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 @@ -49,7 +49,7 @@ async def get(self,request_configuration: Optional[RequestConfiguration[DeviceAp
Read properties and relationships of the deviceAppManagement object.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[DeviceAppManagement]
Find more info here: https://learn.microsoft.com/graph/api/intune-books-deviceappmanagement-get?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/intune-partnerintegration-deviceappmanagement-get?view=graph-rest-1.0
"""
request_info = self.to_get_request_information(
request_configuration
Expand All @@ -71,7 +71,7 @@ async def patch(self,body: DeviceAppManagement, request_configuration: Optional[
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[DeviceAppManagement]
Find more info here: https://learn.microsoft.com/graph/api/intune-partnerintegration-deviceappmanagement-update?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/intune-unlock-deviceappmanagement-update?view=graph-rest-1.0
"""
if body is None:
raise TypeError("body cannot be null.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def by_managed_app_policy_id(self,managed_app_policy_id: str) -> ManagedAppPolic

async def get(self,request_configuration: Optional[RequestConfiguration[ManagedAppPoliciesRequestBuilderGetQueryParameters]] = None) -> Optional[ManagedAppPolicyCollectionResponse]:
"""
List properties and relationships of the targetedManagedAppProtection objects.
List properties and relationships of the managedAppProtection objects.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[ManagedAppPolicyCollectionResponse]
Find more info here: https://learn.microsoft.com/graph/api/intune-mam-targetedmanagedappprotection-list?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/intune-mam-managedappprotection-list?view=graph-rest-1.0
"""
request_info = self.to_get_request_information(
request_configuration
Expand Down Expand Up @@ -92,7 +92,7 @@ async def post(self,body: ManagedAppPolicy, request_configuration: Optional[Requ

def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[ManagedAppPoliciesRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
"""
List properties and relationships of the targetedManagedAppProtection objects.
List properties and relationships of the managedAppProtection objects.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
Expand Down Expand Up @@ -138,7 +138,7 @@ def count(self) -> CountRequestBuilder:
@dataclass
class ManagedAppPoliciesRequestBuilderGetQueryParameters():
"""
List properties and relationships of the targetedManagedAppProtection objects.
List properties and relationships of the managedAppProtection objects.
"""
def get_query_parameter(self,original_name: str) -> str:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ async def delete(self,request_configuration: Optional[RequestConfiguration[Query

async def get(self,request_configuration: Optional[RequestConfiguration[ManagedAppRegistrationItemRequestBuilderGetQueryParameters]] = None) -> Optional[ManagedAppRegistration]:
"""
Read properties and relationships of the androidManagedAppRegistration object.
Read properties and relationships of the iosManagedAppRegistration object.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[ManagedAppRegistration]
Find more info here: https://learn.microsoft.com/graph/api/intune-mam-androidmanagedappregistration-get?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/intune-mam-iosmanagedappregistration-get?view=graph-rest-1.0
"""
request_info = self.to_get_request_information(
request_configuration
Expand Down Expand Up @@ -107,7 +107,7 @@ def to_delete_request_information(self,request_configuration: Optional[RequestCo

def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[ManagedAppRegistrationItemRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
"""
Read properties and relationships of the androidManagedAppRegistration object.
Read properties and relationships of the iosManagedAppRegistration object.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
Expand Down Expand Up @@ -178,7 +178,7 @@ class ManagedAppRegistrationItemRequestBuilderDeleteRequestConfiguration(Request
@dataclass
class ManagedAppRegistrationItemRequestBuilderGetQueryParameters():
"""
Read properties and relationships of the androidManagedAppRegistration object.
Read properties and relationships of the iosManagedAppRegistration object.
"""
def get_query_parameter(self,original_name: str) -> str:
"""
Expand Down
Loading

0 comments on commit 22cb5fd

Please sign in to comment.