Skip to content

Commit 16ce3b2

Browse files
authored
Merge pull request #1122 from microsoftgraph/beta/pipelinebuild/227538
Generated beta models and request builders
2 parents b1829d0 + 9c80da1 commit 16ce3b2

164 files changed

Lines changed: 10466 additions & 207 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

msgraph_beta/generated/admin/exchange/mailboxes/item/folders/folders_request_builder.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from warnings import warn
1515

1616
if TYPE_CHECKING:
17+
from ......models.mailbox_folder import MailboxFolder
1718
from ......models.mailbox_folder_collection_response import MailboxFolderCollectionResponse
1819
from ......models.o_data_errors.o_data_error import ODataError
1920
from .count.count_request_builder import CountRequestBuilder
@@ -70,6 +71,31 @@ async def get(self,request_configuration: Optional[RequestConfiguration[FoldersR
7071

7172
return await self.request_adapter.send_async(request_info, MailboxFolderCollectionResponse, error_mapping)
7273

74+
async def post(self,body: MailboxFolder, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[MailboxFolder]:
75+
"""
76+
Create a new mailboxFolder or child mailboxFolder in a user's mailbox.
77+
param body: The request body
78+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
79+
Returns: Optional[MailboxFolder]
80+
Find more info here: https://learn.microsoft.com/graph/api/mailbox-post-folders?view=graph-rest-beta
81+
"""
82+
warn("Private preview for Import Export APIs as of 2021-08/PrivatePreview:importExport on 2021-08-19 and will be removed 2021-11-15", DeprecationWarning)
83+
if body is None:
84+
raise TypeError("body cannot be null.")
85+
request_info = self.to_post_request_information(
86+
body, request_configuration
87+
)
88+
from ......models.o_data_errors.o_data_error import ODataError
89+
90+
error_mapping: dict[str, type[ParsableFactory]] = {
91+
"XXX": ODataError,
92+
}
93+
if not self.request_adapter:
94+
raise Exception("Http core is null")
95+
from ......models.mailbox_folder import MailboxFolder
96+
97+
return await self.request_adapter.send_async(request_info, MailboxFolder, error_mapping)
98+
7399
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[FoldersRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
74100
"""
75101
Get all the mailboxFolder objects in the specified mailbox, including any search folders.
@@ -82,6 +108,22 @@ def to_get_request_information(self,request_configuration: Optional[RequestConfi
82108
request_info.headers.try_add("Accept", "application/json")
83109
return request_info
84110

111+
def to_post_request_information(self,body: MailboxFolder, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
112+
"""
113+
Create a new mailboxFolder or child mailboxFolder in a user's mailbox.
114+
param body: The request body
115+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
116+
Returns: RequestInformation
117+
"""
118+
warn("Private preview for Import Export APIs as of 2021-08/PrivatePreview:importExport on 2021-08-19 and will be removed 2021-11-15", DeprecationWarning)
119+
if body is None:
120+
raise TypeError("body cannot be null.")
121+
request_info = RequestInformation(Method.POST, self.url_template, self.path_parameters)
122+
request_info.configure(request_configuration)
123+
request_info.headers.try_add("Accept", "application/json")
124+
request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
125+
return request_info
126+
85127
def with_url(self,raw_url: str) -> FoldersRequestBuilder:
86128
"""
87129
Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
@@ -174,4 +216,11 @@ class FoldersRequestBuilderGetRequestConfiguration(RequestConfiguration[FoldersR
174216
"""
175217
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
176218

219+
@dataclass
220+
class FoldersRequestBuilderPostRequestConfiguration(RequestConfiguration[QueryParameters]):
221+
"""
222+
Configuration for the request such as headers, query parameters, and middleware options.
223+
"""
224+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
225+
177226

msgraph_beta/generated/admin/exchange/mailboxes/item/folders/item/child_folders/child_folders_request_builder.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from warnings import warn
1515

1616
if TYPE_CHECKING:
17+
from ........models.mailbox_folder import MailboxFolder
1718
from ........models.mailbox_folder_collection_response import MailboxFolderCollectionResponse
1819
from ........models.o_data_errors.o_data_error import ODataError
1920
from .count.count_request_builder import CountRequestBuilder
@@ -70,6 +71,30 @@ async def get(self,request_configuration: Optional[RequestConfiguration[ChildFol
7071

7172
return await self.request_adapter.send_async(request_info, MailboxFolderCollectionResponse, error_mapping)
7273

74+
async def post(self,body: MailboxFolder, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[MailboxFolder]:
75+
"""
76+
Create new navigation property to childFolders for admin
77+
param body: The request body
78+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
79+
Returns: Optional[MailboxFolder]
80+
"""
81+
warn("Private preview for Import Export APIs as of 2021-08/PrivatePreview:importExport on 2021-08-19 and will be removed 2021-11-15", DeprecationWarning)
82+
if body is None:
83+
raise TypeError("body cannot be null.")
84+
request_info = self.to_post_request_information(
85+
body, request_configuration
86+
)
87+
from ........models.o_data_errors.o_data_error import ODataError
88+
89+
error_mapping: dict[str, type[ParsableFactory]] = {
90+
"XXX": ODataError,
91+
}
92+
if not self.request_adapter:
93+
raise Exception("Http core is null")
94+
from ........models.mailbox_folder import MailboxFolder
95+
96+
return await self.request_adapter.send_async(request_info, MailboxFolder, error_mapping)
97+
7398
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[ChildFoldersRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
7499
"""
75100
Get the mailboxFolder collection under the specified mailboxFolder in a mailbox.
@@ -82,6 +107,22 @@ def to_get_request_information(self,request_configuration: Optional[RequestConfi
82107
request_info.headers.try_add("Accept", "application/json")
83108
return request_info
84109

110+
def to_post_request_information(self,body: MailboxFolder, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
111+
"""
112+
Create new navigation property to childFolders for admin
113+
param body: The request body
114+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
115+
Returns: RequestInformation
116+
"""
117+
warn("Private preview for Import Export APIs as of 2021-08/PrivatePreview:importExport on 2021-08-19 and will be removed 2021-11-15", DeprecationWarning)
118+
if body is None:
119+
raise TypeError("body cannot be null.")
120+
request_info = RequestInformation(Method.POST, self.url_template, self.path_parameters)
121+
request_info.configure(request_configuration)
122+
request_info.headers.try_add("Accept", "application/json")
123+
request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
124+
return request_info
125+
85126
def with_url(self,raw_url: str) -> ChildFoldersRequestBuilder:
86127
"""
87128
Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
@@ -174,4 +215,11 @@ class ChildFoldersRequestBuilderGetRequestConfiguration(RequestConfiguration[Chi
174215
"""
175216
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
176217

218+
@dataclass
219+
class ChildFoldersRequestBuilderPostRequestConfiguration(RequestConfiguration[QueryParameters]):
220+
"""
221+
Configuration for the request such as headers, query parameters, and middleware options.
222+
"""
223+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
224+
177225

msgraph_beta/generated/admin/exchange/mailboxes/item/folders/item/child_folders/item/mailbox_folder_item_request_builder.py

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, d
3131
"""
3232
super().__init__(request_adapter, "{+baseurl}/admin/exchange/mailboxes/{mailbox%2Did}/folders/{mailboxFolder%2Did}/childFolders/{mailboxFolder%2Did1}{?%24expand,%24select}", path_parameters)
3333

34+
async def delete(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
35+
"""
36+
Delete navigation property childFolders for admin
37+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
38+
Returns: None
39+
"""
40+
warn("Private preview for Import Export APIs as of 2021-08/PrivatePreview:importExport on 2021-08-19 and will be removed 2021-11-15", DeprecationWarning)
41+
request_info = self.to_delete_request_information(
42+
request_configuration
43+
)
44+
from .........models.o_data_errors.o_data_error import ODataError
45+
46+
error_mapping: dict[str, type[ParsableFactory]] = {
47+
"XXX": ODataError,
48+
}
49+
if not self.request_adapter:
50+
raise Exception("Http core is null")
51+
return await self.request_adapter.send_no_response_content_async(request_info, error_mapping)
52+
3453
async def get(self,request_configuration: Optional[RequestConfiguration[MailboxFolderItemRequestBuilderGetQueryParameters]] = None) -> Optional[MailboxFolder]:
3554
"""
3655
The collection of child folders in this folder.
@@ -52,6 +71,42 @@ async def get(self,request_configuration: Optional[RequestConfiguration[MailboxF
5271

5372
return await self.request_adapter.send_async(request_info, MailboxFolder, error_mapping)
5473

74+
async def patch(self,body: MailboxFolder, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[MailboxFolder]:
75+
"""
76+
Update the navigation property childFolders in admin
77+
param body: The request body
78+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
79+
Returns: Optional[MailboxFolder]
80+
"""
81+
warn("Private preview for Import Export APIs as of 2021-08/PrivatePreview:importExport on 2021-08-19 and will be removed 2021-11-15", DeprecationWarning)
82+
if body is None:
83+
raise TypeError("body cannot be null.")
84+
request_info = self.to_patch_request_information(
85+
body, request_configuration
86+
)
87+
from .........models.o_data_errors.o_data_error import ODataError
88+
89+
error_mapping: dict[str, type[ParsableFactory]] = {
90+
"XXX": ODataError,
91+
}
92+
if not self.request_adapter:
93+
raise Exception("Http core is null")
94+
from .........models.mailbox_folder import MailboxFolder
95+
96+
return await self.request_adapter.send_async(request_info, MailboxFolder, error_mapping)
97+
98+
def to_delete_request_information(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
99+
"""
100+
Delete navigation property childFolders for admin
101+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
102+
Returns: RequestInformation
103+
"""
104+
warn("Private preview for Import Export APIs as of 2021-08/PrivatePreview:importExport on 2021-08-19 and will be removed 2021-11-15", DeprecationWarning)
105+
request_info = RequestInformation(Method.DELETE, self.url_template, self.path_parameters)
106+
request_info.configure(request_configuration)
107+
request_info.headers.try_add("Accept", "application/json")
108+
return request_info
109+
55110
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[MailboxFolderItemRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
56111
"""
57112
The collection of child folders in this folder.
@@ -64,6 +119,22 @@ def to_get_request_information(self,request_configuration: Optional[RequestConfi
64119
request_info.headers.try_add("Accept", "application/json")
65120
return request_info
66121

122+
def to_patch_request_information(self,body: MailboxFolder, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
123+
"""
124+
Update the navigation property childFolders in admin
125+
param body: The request body
126+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
127+
Returns: RequestInformation
128+
"""
129+
warn("Private preview for Import Export APIs as of 2021-08/PrivatePreview:importExport on 2021-08-19 and will be removed 2021-11-15", DeprecationWarning)
130+
if body is None:
131+
raise TypeError("body cannot be null.")
132+
request_info = RequestInformation(Method.PATCH, self.url_template, self.path_parameters)
133+
request_info.configure(request_configuration)
134+
request_info.headers.try_add("Accept", "application/json")
135+
request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
136+
return request_info
137+
67138
def with_url(self,raw_url: str) -> MailboxFolderItemRequestBuilder:
68139
"""
69140
Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
@@ -84,6 +155,13 @@ def items(self) -> ItemsRequestBuilder:
84155

85156
return ItemsRequestBuilder(self.request_adapter, self.path_parameters)
86157

158+
@dataclass
159+
class MailboxFolderItemRequestBuilderDeleteRequestConfiguration(RequestConfiguration[QueryParameters]):
160+
"""
161+
Configuration for the request such as headers, query parameters, and middleware options.
162+
"""
163+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
164+
87165
@dataclass
88166
class MailboxFolderItemRequestBuilderGetQueryParameters():
89167
"""
@@ -117,4 +195,11 @@ class MailboxFolderItemRequestBuilderGetRequestConfiguration(RequestConfiguratio
117195
"""
118196
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
119197

198+
@dataclass
199+
class MailboxFolderItemRequestBuilderPatchRequestConfiguration(RequestConfiguration[QueryParameters]):
200+
"""
201+
Configuration for the request such as headers, query parameters, and middleware options.
202+
"""
203+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
204+
120205

0 commit comments

Comments
 (0)