Skip to content

Commit cb1c68b

Browse files
Merge pull request #446 from microsoftgraph/kiota/beta/pipelinebuild/210015
Generated beta models and request builders
2 parents 6c6829d + dc73138 commit cb1c68b

399 files changed

Lines changed: 20256 additions & 1217 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.

src/Generated/Admin/AdminRequestBuilder.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Exception;
66
use Http\Promise\Promise;
77
use Microsoft\Graph\Beta\Generated\Admin\AppsAndServices\AppsAndServicesRequestBuilder;
8+
use Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\CloudLicensingRequestBuilder;
89
use Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationManagementRequestBuilder;
910
use Microsoft\Graph\Beta\Generated\Admin\Dynamics\DynamicsRequestBuilder;
1011
use Microsoft\Graph\Beta\Generated\Admin\Edge\EdgeRequestBuilder;
@@ -38,6 +39,13 @@ public function appsAndServices(): AppsAndServicesRequestBuilder {
3839
return new AppsAndServicesRequestBuilder($this->pathParameters, $this->requestAdapter);
3940
}
4041

42+
/**
43+
* Provides operations to manage the cloudLicensing property of the microsoft.graph.admin entity.
44+
*/
45+
public function cloudLicensing(): CloudLicensingRequestBuilder {
46+
return new CloudLicensingRequestBuilder($this->pathParameters, $this->requestAdapter);
47+
}
48+
4149
/**
4250
* Provides operations to manage the configurationManagement property of the microsoft.graph.admin entity.
4351
*/
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments;
4+
5+
use Exception;
6+
use Http\Promise\Promise;
7+
use Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\Count\CountRequestBuilder;
8+
use Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\Item\AllotmentItemRequestBuilder;
9+
use Microsoft\Graph\Beta\Generated\Models\CloudLicensing\Allotment;
10+
use Microsoft\Graph\Beta\Generated\Models\CloudLicensing\AllotmentCollectionResponse;
11+
use Microsoft\Graph\Beta\Generated\Models\ODataErrors\ODataError;
12+
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
13+
use Microsoft\Kiota\Abstractions\HttpMethod;
14+
use Microsoft\Kiota\Abstractions\RequestAdapter;
15+
use Microsoft\Kiota\Abstractions\RequestInformation;
16+
17+
/**
18+
* Provides operations to manage the allotments property of the microsoft.graph.cloudLicensing.adminCloudLicensing entity.
19+
*/
20+
class AllotmentsRequestBuilder extends BaseRequestBuilder
21+
{
22+
/**
23+
* Provides operations to count the resources in the collection.
24+
*/
25+
public function count(): CountRequestBuilder {
26+
return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);
27+
}
28+
29+
/**
30+
* Provides operations to manage the allotments property of the microsoft.graph.cloudLicensing.adminCloudLicensing entity.
31+
* @param string $allotmentId The unique identifier of allotment
32+
* @return AllotmentItemRequestBuilder
33+
*/
34+
public function byAllotmentId(string $allotmentId): AllotmentItemRequestBuilder {
35+
$urlTplParams = $this->pathParameters;
36+
$urlTplParams['allotment%2Did'] = $allotmentId;
37+
return new AllotmentItemRequestBuilder($urlTplParams, $this->requestAdapter);
38+
}
39+
40+
/**
41+
* Instantiates a new AllotmentsRequestBuilder and sets the default values.
42+
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
43+
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
44+
*/
45+
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
46+
parent::__construct($requestAdapter, [], '{+baseurl}/admin/cloudLicensing/allotments{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}');
47+
if (is_array($pathParametersOrRawUrl)) {
48+
$this->pathParameters = $pathParametersOrRawUrl;
49+
} else {
50+
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
51+
}
52+
}
53+
54+
/**
55+
* Get a list of the allotment objects and their properties.
56+
* @param AllotmentsRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
57+
* @return Promise<AllotmentCollectionResponse|null>
58+
* @throws Exception
59+
* @link https://learn.microsoft.com/graph/api/cloudlicensing-admincloudlicensing-list-allotments?view=graph-rest-beta Find more info here
60+
*/
61+
public function get(?AllotmentsRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
62+
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
63+
$errorMappings = [
64+
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
65+
];
66+
return $this->requestAdapter->sendAsync($requestInfo, [AllotmentCollectionResponse::class, 'createFromDiscriminatorValue'], $errorMappings);
67+
}
68+
69+
/**
70+
* Create new navigation property to allotments for admin
71+
* @param Allotment $body The request body
72+
* @param AllotmentsRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
73+
* @return Promise<Allotment|null>
74+
* @throws Exception
75+
*/
76+
public function post(Allotment $body, ?AllotmentsRequestBuilderPostRequestConfiguration $requestConfiguration = null): Promise {
77+
$requestInfo = $this->toPostRequestInformation($body, $requestConfiguration);
78+
$errorMappings = [
79+
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
80+
];
81+
return $this->requestAdapter->sendAsync($requestInfo, [Allotment::class, 'createFromDiscriminatorValue'], $errorMappings);
82+
}
83+
84+
/**
85+
* Get a list of the allotment objects and their properties.
86+
* @param AllotmentsRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
87+
* @return RequestInformation
88+
*/
89+
public function toGetRequestInformation(?AllotmentsRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation {
90+
$requestInfo = new RequestInformation();
91+
$requestInfo->urlTemplate = $this->urlTemplate;
92+
$requestInfo->pathParameters = $this->pathParameters;
93+
$requestInfo->httpMethod = HttpMethod::GET;
94+
if ($requestConfiguration !== null) {
95+
$requestInfo->addHeaders($requestConfiguration->headers);
96+
if ($requestConfiguration->queryParameters !== null) {
97+
$requestInfo->setQueryParameters($requestConfiguration->queryParameters);
98+
}
99+
$requestInfo->addRequestOptions(...$requestConfiguration->options);
100+
}
101+
$requestInfo->tryAddHeader('Accept', "application/json");
102+
return $requestInfo;
103+
}
104+
105+
/**
106+
* Create new navigation property to allotments for admin
107+
* @param Allotment $body The request body
108+
* @param AllotmentsRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
109+
* @return RequestInformation
110+
*/
111+
public function toPostRequestInformation(Allotment $body, ?AllotmentsRequestBuilderPostRequestConfiguration $requestConfiguration = null): RequestInformation {
112+
$requestInfo = new RequestInformation();
113+
$requestInfo->urlTemplate = $this->urlTemplate;
114+
$requestInfo->pathParameters = $this->pathParameters;
115+
$requestInfo->httpMethod = HttpMethod::POST;
116+
if ($requestConfiguration !== null) {
117+
$requestInfo->addHeaders($requestConfiguration->headers);
118+
$requestInfo->addRequestOptions(...$requestConfiguration->options);
119+
}
120+
$requestInfo->tryAddHeader('Accept', "application/json");
121+
$requestInfo->setContentFromParsable($this->requestAdapter, "application/json", $body);
122+
return $requestInfo;
123+
}
124+
125+
/**
126+
* Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
127+
* @param string $rawUrl The raw URL to use for the request builder.
128+
* @return AllotmentsRequestBuilder
129+
*/
130+
public function withUrl(string $rawUrl): AllotmentsRequestBuilder {
131+
return new AllotmentsRequestBuilder($rawUrl, $this->requestAdapter);
132+
}
133+
134+
}

src/Generated/Admin/ConfigurationManagement/ConfigurationApplications/ConfigurationApplicationsRequestBuilderGetQueryParameters.php renamed to src/Generated/Admin/CloudLicensing/Allotments/AllotmentsRequestBuilderGetQueryParameters.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationApplications;
3+
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments;
44

55
use Microsoft\Kiota\Abstractions\QueryParameter;
66

77
/**
8-
* Get configurationApplications from admin
8+
* Get a list of the allotment objects and their properties.
99
*/
10-
class ConfigurationApplicationsRequestBuilderGetQueryParameters
10+
class AllotmentsRequestBuilderGetQueryParameters
1111
{
1212
/**
1313
* @QueryParameter("%24count")
@@ -58,7 +58,7 @@ class ConfigurationApplicationsRequestBuilderGetQueryParameters
5858
public ?int $top = null;
5959

6060
/**
61-
* Instantiates a new ConfigurationApplicationsRequestBuilderGetQueryParameters and sets the default values.
61+
* Instantiates a new AllotmentsRequestBuilderGetQueryParameters and sets the default values.
6262
* @param bool|null $count Include count of items
6363
* @param array<string>|null $expand Expand related entities
6464
* @param string|null $filter Filter items by property values
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments;
4+
5+
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
6+
use Microsoft\Kiota\Abstractions\RequestOption;
7+
8+
/**
9+
* Configuration for the request such as headers, query parameters, and middleware options.
10+
*/
11+
class AllotmentsRequestBuilderGetRequestConfiguration extends BaseRequestConfiguration
12+
{
13+
/**
14+
* @var AllotmentsRequestBuilderGetQueryParameters|null $queryParameters Request query parameters
15+
*/
16+
public ?AllotmentsRequestBuilderGetQueryParameters $queryParameters = null;
17+
18+
/**
19+
* Instantiates a new AllotmentsRequestBuilderGetRequestConfiguration and sets the default values.
20+
* @param array<string, array<string>|string>|null $headers Request headers
21+
* @param array<RequestOption>|null $options Request options
22+
* @param AllotmentsRequestBuilderGetQueryParameters|null $queryParameters Request query parameters
23+
*/
24+
public function __construct(?array $headers = null, ?array $options = null, ?AllotmentsRequestBuilderGetQueryParameters $queryParameters = null) {
25+
parent::__construct($headers ?? [], $options ?? []);
26+
$this->queryParameters = $queryParameters;
27+
}
28+
29+
/**
30+
* Instantiates a new AllotmentsRequestBuilderGetQueryParameters.
31+
* @param bool|null $count Include count of items
32+
* @param array<string>|null $expand Expand related entities
33+
* @param string|null $filter Filter items by property values
34+
* @param array<string>|null $orderby Order items by property values
35+
* @param string|null $search Search items by search phrases
36+
* @param array<string>|null $select Select properties to be returned
37+
* @param int|null $skip Skip the first n items
38+
* @param int|null $top Show only the first n items
39+
* @return AllotmentsRequestBuilderGetQueryParameters
40+
*/
41+
public static function createQueryParameters(?bool $count = null, ?array $expand = null, ?string $filter = null, ?array $orderby = null, ?string $search = null, ?array $select = null, ?int $skip = null, ?int $top = null): AllotmentsRequestBuilderGetQueryParameters {
42+
return new AllotmentsRequestBuilderGetQueryParameters($count, $expand, $filter, $orderby, $search, $select, $skip, $top);
43+
}
44+
45+
}

src/Generated/Admin/ConfigurationManagement/ConfigurationApplications/ConfigurationApplicationsRequestBuilderPostRequestConfiguration.php renamed to src/Generated/Admin/CloudLicensing/Allotments/AllotmentsRequestBuilderPostRequestConfiguration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22

3-
namespace Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationApplications;
3+
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments;
44

55
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
66
use Microsoft\Kiota\Abstractions\RequestOption;
77

88
/**
99
* Configuration for the request such as headers, query parameters, and middleware options.
1010
*/
11-
class ConfigurationApplicationsRequestBuilderPostRequestConfiguration extends BaseRequestConfiguration
11+
class AllotmentsRequestBuilderPostRequestConfiguration extends BaseRequestConfiguration
1212
{
1313
/**
14-
* Instantiates a new ConfigurationApplicationsRequestBuilderPostRequestConfiguration and sets the default values.
14+
* Instantiates a new AllotmentsRequestBuilderPostRequestConfiguration and sets the default values.
1515
* @param array<string, array<string>|string>|null $headers Request headers
1616
* @param array<RequestOption>|null $options Request options
1717
*/

src/Generated/Admin/ConfigurationManagement/ConfigurationApplications/Count/CountRequestBuilder.php renamed to src/Generated/Admin/CloudLicensing/Allotments/Count/CountRequestBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationApplications\Count;
3+
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\Count;
44

55
use Exception;
66
use Http\Promise\Promise;
@@ -21,7 +21,7 @@ class CountRequestBuilder extends BaseRequestBuilder
2121
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
2222
*/
2323
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
24-
parent::__construct($requestAdapter, [], '{+baseurl}/admin/configurationManagement/configurationApplications/$count{?%24filter,%24search}');
24+
parent::__construct($requestAdapter, [], '{+baseurl}/admin/cloudLicensing/allotments/$count{?%24filter,%24search}');
2525
if (is_array($pathParametersOrRawUrl)) {
2626
$this->pathParameters = $pathParametersOrRawUrl;
2727
} else {

src/Generated/Admin/ConfigurationManagement/ConfigurationApplications/Count/CountRequestBuilderGetQueryParameters.php renamed to src/Generated/Admin/CloudLicensing/Allotments/Count/CountRequestBuilderGetQueryParameters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationApplications\Count;
3+
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\Count;
44

55
use Microsoft\Kiota\Abstractions\QueryParameter;
66

src/Generated/Admin/ConfigurationManagement/ConfigurationApplications/Count/CountRequestBuilderGetRequestConfiguration.php renamed to src/Generated/Admin/CloudLicensing/Allotments/Count/CountRequestBuilderGetRequestConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationApplications\Count;
3+
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\Count;
44

55
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
66
use Microsoft\Kiota\Abstractions\RequestOption;

0 commit comments

Comments
 (0)