Skip to content

Commit 43ff1b1

Browse files
Merge pull request #1004 from microsoftgraph/beta/pipelinebuild/210015
Generated beta models and request builders
2 parents 8f7dd6f + ad547cb commit 43ff1b1

File tree

229 files changed

+13165
-631
lines changed

Some content is hidden

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

229 files changed

+13165
-631
lines changed

msgraph_beta/generated/admin/admin_request_builder.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from ..models.admin import Admin
1818
from ..models.o_data_errors.o_data_error import ODataError
1919
from .apps_and_services.apps_and_services_request_builder import AppsAndServicesRequestBuilder
20+
from .cloud_licensing.cloud_licensing_request_builder import CloudLicensingRequestBuilder
2021
from .configuration_management.configuration_management_request_builder import ConfigurationManagementRequestBuilder
2122
from .dynamics.dynamics_request_builder import DynamicsRequestBuilder
2223
from .edge.edge_request_builder import EdgeRequestBuilder
@@ -133,6 +134,15 @@ def apps_and_services(self) -> AppsAndServicesRequestBuilder:
133134

134135
return AppsAndServicesRequestBuilder(self.request_adapter, self.path_parameters)
135136

137+
@property
138+
def cloud_licensing(self) -> CloudLicensingRequestBuilder:
139+
"""
140+
Provides operations to manage the cloudLicensing property of the microsoft.graph.admin entity.
141+
"""
142+
from .cloud_licensing.cloud_licensing_request_builder import CloudLicensingRequestBuilder
143+
144+
return CloudLicensingRequestBuilder(self.request_adapter, self.path_parameters)
145+
136146
@property
137147
def configuration_management(self) -> ConfigurationManagementRequestBuilder:
138148
"""
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
from __future__ import annotations
2+
from collections.abc import Callable
3+
from dataclasses import dataclass, field
4+
from kiota_abstractions.base_request_builder import BaseRequestBuilder
5+
from kiota_abstractions.base_request_configuration import RequestConfiguration
6+
from kiota_abstractions.default_query_parameters import QueryParameters
7+
from kiota_abstractions.get_path_parameters import get_path_parameters
8+
from kiota_abstractions.method import Method
9+
from kiota_abstractions.request_adapter import RequestAdapter
10+
from kiota_abstractions.request_information import RequestInformation
11+
from kiota_abstractions.request_option import RequestOption
12+
from kiota_abstractions.serialization import Parsable, ParsableFactory
13+
from typing import Any, Optional, TYPE_CHECKING, Union
14+
from warnings import warn
15+
16+
if TYPE_CHECKING:
17+
from ....models.cloud_licensing.allotment import Allotment
18+
from ....models.cloud_licensing.allotment_collection_response import AllotmentCollectionResponse
19+
from ....models.o_data_errors.o_data_error import ODataError
20+
from .count.count_request_builder import CountRequestBuilder
21+
from .item.allotment_item_request_builder import AllotmentItemRequestBuilder
22+
23+
class AllotmentsRequestBuilder(BaseRequestBuilder):
24+
"""
25+
Provides operations to manage the allotments property of the microsoft.graph.cloudLicensing.adminCloudLicensing entity.
26+
"""
27+
def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
28+
"""
29+
Instantiates a new AllotmentsRequestBuilder and sets the default values.
30+
param path_parameters: The raw url or the url-template parameters for the request.
31+
param request_adapter: The request adapter to use to execute the requests.
32+
Returns: None
33+
"""
34+
super().__init__(request_adapter, "{+baseurl}/admin/cloudLicensing/allotments{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", path_parameters)
35+
36+
def by_allotment_id(self,allotment_id: str) -> AllotmentItemRequestBuilder:
37+
"""
38+
Provides operations to manage the allotments property of the microsoft.graph.cloudLicensing.adminCloudLicensing entity.
39+
param allotment_id: The unique identifier of allotment
40+
Returns: AllotmentItemRequestBuilder
41+
"""
42+
if allotment_id is None:
43+
raise TypeError("allotment_id cannot be null.")
44+
from .item.allotment_item_request_builder import AllotmentItemRequestBuilder
45+
46+
url_tpl_params = get_path_parameters(self.path_parameters)
47+
url_tpl_params["allotment%2Did"] = allotment_id
48+
return AllotmentItemRequestBuilder(self.request_adapter, url_tpl_params)
49+
50+
async def get(self,request_configuration: Optional[RequestConfiguration[AllotmentsRequestBuilderGetQueryParameters]] = None) -> Optional[AllotmentCollectionResponse]:
51+
"""
52+
Get a list of the allotment objects and their properties.
53+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
54+
Returns: Optional[AllotmentCollectionResponse]
55+
Find more info here: https://learn.microsoft.com/graph/api/cloudlicensing-admincloudlicensing-list-allotments?view=graph-rest-beta
56+
"""
57+
request_info = self.to_get_request_information(
58+
request_configuration
59+
)
60+
from ....models.o_data_errors.o_data_error import ODataError
61+
62+
error_mapping: dict[str, type[ParsableFactory]] = {
63+
"XXX": ODataError,
64+
}
65+
if not self.request_adapter:
66+
raise Exception("Http core is null")
67+
from ....models.cloud_licensing.allotment_collection_response import AllotmentCollectionResponse
68+
69+
return await self.request_adapter.send_async(request_info, AllotmentCollectionResponse, error_mapping)
70+
71+
async def post(self,body: Allotment, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[Allotment]:
72+
"""
73+
Create new navigation property to allotments for admin
74+
param body: The request body
75+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
76+
Returns: Optional[Allotment]
77+
"""
78+
if body is None:
79+
raise TypeError("body cannot be null.")
80+
request_info = self.to_post_request_information(
81+
body, request_configuration
82+
)
83+
from ....models.o_data_errors.o_data_error import ODataError
84+
85+
error_mapping: dict[str, type[ParsableFactory]] = {
86+
"XXX": ODataError,
87+
}
88+
if not self.request_adapter:
89+
raise Exception("Http core is null")
90+
from ....models.cloud_licensing.allotment import Allotment
91+
92+
return await self.request_adapter.send_async(request_info, Allotment, error_mapping)
93+
94+
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[AllotmentsRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
95+
"""
96+
Get a list of the allotment objects and their properties.
97+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
98+
Returns: RequestInformation
99+
"""
100+
request_info = RequestInformation(Method.GET, self.url_template, self.path_parameters)
101+
request_info.configure(request_configuration)
102+
request_info.headers.try_add("Accept", "application/json")
103+
return request_info
104+
105+
def to_post_request_information(self,body: Allotment, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
106+
"""
107+
Create new navigation property to allotments for admin
108+
param body: The request body
109+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
110+
Returns: RequestInformation
111+
"""
112+
if body is None:
113+
raise TypeError("body cannot be null.")
114+
request_info = RequestInformation(Method.POST, self.url_template, self.path_parameters)
115+
request_info.configure(request_configuration)
116+
request_info.headers.try_add("Accept", "application/json")
117+
request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
118+
return request_info
119+
120+
def with_url(self,raw_url: str) -> AllotmentsRequestBuilder:
121+
"""
122+
Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
123+
param raw_url: The raw URL to use for the request builder.
124+
Returns: AllotmentsRequestBuilder
125+
"""
126+
if raw_url is None:
127+
raise TypeError("raw_url cannot be null.")
128+
return AllotmentsRequestBuilder(self.request_adapter, raw_url)
129+
130+
@property
131+
def count(self) -> CountRequestBuilder:
132+
"""
133+
Provides operations to count the resources in the collection.
134+
"""
135+
from .count.count_request_builder import CountRequestBuilder
136+
137+
return CountRequestBuilder(self.request_adapter, self.path_parameters)
138+
139+
@dataclass
140+
class AllotmentsRequestBuilderGetQueryParameters():
141+
"""
142+
Get a list of the allotment objects and their properties.
143+
"""
144+
def get_query_parameter(self,original_name: str) -> str:
145+
"""
146+
Maps the query parameters names to their encoded names for the URI template parsing.
147+
param original_name: The original query parameter name in the class.
148+
Returns: str
149+
"""
150+
if original_name is None:
151+
raise TypeError("original_name cannot be null.")
152+
if original_name == "count":
153+
return "%24count"
154+
if original_name == "expand":
155+
return "%24expand"
156+
if original_name == "filter":
157+
return "%24filter"
158+
if original_name == "orderby":
159+
return "%24orderby"
160+
if original_name == "search":
161+
return "%24search"
162+
if original_name == "select":
163+
return "%24select"
164+
if original_name == "skip":
165+
return "%24skip"
166+
if original_name == "top":
167+
return "%24top"
168+
return original_name
169+
170+
# Include count of items
171+
count: Optional[bool] = None
172+
173+
# Expand related entities
174+
expand: Optional[list[str]] = None
175+
176+
# Filter items by property values
177+
filter: Optional[str] = None
178+
179+
# Order items by property values
180+
orderby: Optional[list[str]] = None
181+
182+
# Search items by search phrases
183+
search: Optional[str] = None
184+
185+
# Select properties to be returned
186+
select: Optional[list[str]] = None
187+
188+
# Skip the first n items
189+
skip: Optional[int] = None
190+
191+
# Show only the first n items
192+
top: Optional[int] = None
193+
194+
195+
@dataclass
196+
class AllotmentsRequestBuilderGetRequestConfiguration(RequestConfiguration[AllotmentsRequestBuilderGetQueryParameters]):
197+
"""
198+
Configuration for the request such as headers, query parameters, and middleware options.
199+
"""
200+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
201+
202+
@dataclass
203+
class AllotmentsRequestBuilderPostRequestConfiguration(RequestConfiguration[QueryParameters]):
204+
"""
205+
Configuration for the request such as headers, query parameters, and middleware options.
206+
"""
207+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
208+
209+

msgraph_beta/generated/admin/configuration_management/configuration_applications/count/count_request_builder.py renamed to msgraph_beta/generated/admin/cloud_licensing/allotments/count/count_request_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, d
2727
param request_adapter: The request adapter to use to execute the requests.
2828
Returns: None
2929
"""
30-
super().__init__(request_adapter, "{+baseurl}/admin/configurationManagement/configurationApplications/$count{?%24filter,%24search}", path_parameters)
30+
super().__init__(request_adapter, "{+baseurl}/admin/cloudLicensing/allotments/$count{?%24filter,%24search}", path_parameters)
3131

3232
async def get(self,request_configuration: Optional[RequestConfiguration[CountRequestBuilderGetQueryParameters]] = None) -> Optional[int]:
3333
"""

0 commit comments

Comments
 (0)