Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions src/Generated/Admin/AdminRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Exception;
use Http\Promise\Promise;
use Microsoft\Graph\Beta\Generated\Admin\AppsAndServices\AppsAndServicesRequestBuilder;
use Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\CloudLicensingRequestBuilder;
use Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationManagementRequestBuilder;
use Microsoft\Graph\Beta\Generated\Admin\Dynamics\DynamicsRequestBuilder;
use Microsoft\Graph\Beta\Generated\Admin\Edge\EdgeRequestBuilder;
Expand Down Expand Up @@ -38,6 +39,13 @@ public function appsAndServices(): AppsAndServicesRequestBuilder {
return new AppsAndServicesRequestBuilder($this->pathParameters, $this->requestAdapter);
}

/**
* Provides operations to manage the cloudLicensing property of the microsoft.graph.admin entity.
*/
public function cloudLicensing(): CloudLicensingRequestBuilder {
return new CloudLicensingRequestBuilder($this->pathParameters, $this->requestAdapter);
}

/**
* Provides operations to manage the configurationManagement property of the microsoft.graph.admin entity.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<?php

namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments;

use Exception;
use Http\Promise\Promise;
use Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\Count\CountRequestBuilder;
use Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\Item\AllotmentItemRequestBuilder;
use Microsoft\Graph\Beta\Generated\Models\CloudLicensing\Allotment;
use Microsoft\Graph\Beta\Generated\Models\CloudLicensing\AllotmentCollectionResponse;
use Microsoft\Graph\Beta\Generated\Models\ODataErrors\ODataError;
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
use Microsoft\Kiota\Abstractions\HttpMethod;
use Microsoft\Kiota\Abstractions\RequestAdapter;
use Microsoft\Kiota\Abstractions\RequestInformation;

/**
* Provides operations to manage the allotments property of the microsoft.graph.cloudLicensing.adminCloudLicensing entity.
*/
class AllotmentsRequestBuilder extends BaseRequestBuilder
{
/**
* Provides operations to count the resources in the collection.
*/
public function count(): CountRequestBuilder {
return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);
}

/**
* Provides operations to manage the allotments property of the microsoft.graph.cloudLicensing.adminCloudLicensing entity.
* @param string $allotmentId The unique identifier of allotment
* @return AllotmentItemRequestBuilder
*/
public function byAllotmentId(string $allotmentId): AllotmentItemRequestBuilder {
$urlTplParams = $this->pathParameters;
$urlTplParams['allotment%2Did'] = $allotmentId;
return new AllotmentItemRequestBuilder($urlTplParams, $this->requestAdapter);
}

/**
* Instantiates a new AllotmentsRequestBuilder and sets the default values.
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
*/
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
parent::__construct($requestAdapter, [], '{+baseurl}/admin/cloudLicensing/allotments{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}');
if (is_array($pathParametersOrRawUrl)) {
$this->pathParameters = $pathParametersOrRawUrl;
} else {
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
}
}

/**
* Get a list of the allotment objects and their properties.
* @param AllotmentsRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<AllotmentCollectionResponse|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/cloudlicensing-admincloudlicensing-list-allotments?view=graph-rest-beta Find more info here
*/
public function get(?AllotmentsRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendAsync($requestInfo, [AllotmentCollectionResponse::class, 'createFromDiscriminatorValue'], $errorMappings);
}

/**
* Create new navigation property to allotments for admin
* @param Allotment $body The request body
* @param AllotmentsRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<Allotment|null>
* @throws Exception
*/
public function post(Allotment $body, ?AllotmentsRequestBuilderPostRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toPostRequestInformation($body, $requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendAsync($requestInfo, [Allotment::class, 'createFromDiscriminatorValue'], $errorMappings);
}

/**
* Get a list of the allotment objects and their properties.
* @param AllotmentsRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toGetRequestInformation(?AllotmentsRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation {
$requestInfo = new RequestInformation();
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
$requestInfo->httpMethod = HttpMethod::GET;
if ($requestConfiguration !== null) {
$requestInfo->addHeaders($requestConfiguration->headers);
if ($requestConfiguration->queryParameters !== null) {
$requestInfo->setQueryParameters($requestConfiguration->queryParameters);
}
$requestInfo->addRequestOptions(...$requestConfiguration->options);
}
$requestInfo->tryAddHeader('Accept', "application/json");
return $requestInfo;
}

/**
* Create new navigation property to allotments for admin
* @param Allotment $body The request body
* @param AllotmentsRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toPostRequestInformation(Allotment $body, ?AllotmentsRequestBuilderPostRequestConfiguration $requestConfiguration = null): RequestInformation {
$requestInfo = new RequestInformation();
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
$requestInfo->httpMethod = HttpMethod::POST;
if ($requestConfiguration !== null) {
$requestInfo->addHeaders($requestConfiguration->headers);
$requestInfo->addRequestOptions(...$requestConfiguration->options);
}
$requestInfo->tryAddHeader('Accept', "application/json");
$requestInfo->setContentFromParsable($this->requestAdapter, "application/json", $body);
return $requestInfo;
}

/**
* Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
* @param string $rawUrl The raw URL to use for the request builder.
* @return AllotmentsRequestBuilder
*/
public function withUrl(string $rawUrl): AllotmentsRequestBuilder {
return new AllotmentsRequestBuilder($rawUrl, $this->requestAdapter);
}

}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationApplications;
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments;

use Microsoft\Kiota\Abstractions\QueryParameter;

/**
* Get configurationApplications from admin
* Get a list of the allotment objects and their properties.
*/
class ConfigurationApplicationsRequestBuilderGetQueryParameters
class AllotmentsRequestBuilderGetQueryParameters
{
/**
* @QueryParameter("%24count")
Expand Down Expand Up @@ -58,7 +58,7 @@ class ConfigurationApplicationsRequestBuilderGetQueryParameters
public ?int $top = null;

/**
* Instantiates a new ConfigurationApplicationsRequestBuilderGetQueryParameters and sets the default values.
* Instantiates a new AllotmentsRequestBuilderGetQueryParameters and sets the default values.
* @param bool|null $count Include count of items
* @param array<string>|null $expand Expand related entities
* @param string|null $filter Filter items by property values
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments;

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

/**
* Configuration for the request such as headers, query parameters, and middleware options.
*/
class AllotmentsRequestBuilderGetRequestConfiguration extends BaseRequestConfiguration
{
/**
* @var AllotmentsRequestBuilderGetQueryParameters|null $queryParameters Request query parameters
*/
public ?AllotmentsRequestBuilderGetQueryParameters $queryParameters = null;

/**
* Instantiates a new AllotmentsRequestBuilderGetRequestConfiguration and sets the default values.
* @param array<string, array<string>|string>|null $headers Request headers
* @param array<RequestOption>|null $options Request options
* @param AllotmentsRequestBuilderGetQueryParameters|null $queryParameters Request query parameters
*/
public function __construct(?array $headers = null, ?array $options = null, ?AllotmentsRequestBuilderGetQueryParameters $queryParameters = null) {
parent::__construct($headers ?? [], $options ?? []);
$this->queryParameters = $queryParameters;
}

/**
* Instantiates a new AllotmentsRequestBuilderGetQueryParameters.
* @param bool|null $count Include count of items
* @param array<string>|null $expand Expand related entities
* @param string|null $filter Filter items by property values
* @param array<string>|null $orderby Order items by property values
* @param string|null $search Search items by search phrases
* @param array<string>|null $select Select properties to be returned
* @param int|null $skip Skip the first n items
* @param int|null $top Show only the first n items
* @return AllotmentsRequestBuilderGetQueryParameters
*/
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 {
return new AllotmentsRequestBuilderGetQueryParameters($count, $expand, $filter, $orderby, $search, $select, $skip, $top);
}

}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

namespace Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationApplications;
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments;

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

/**
* Configuration for the request such as headers, query parameters, and middleware options.
*/
class ConfigurationApplicationsRequestBuilderPostRequestConfiguration extends BaseRequestConfiguration
class AllotmentsRequestBuilderPostRequestConfiguration extends BaseRequestConfiguration
{
/**
* Instantiates a new ConfigurationApplicationsRequestBuilderPostRequestConfiguration and sets the default values.
* Instantiates a new AllotmentsRequestBuilderPostRequestConfiguration and sets the default values.
* @param array<string, array<string>|string>|null $headers Request headers
* @param array<RequestOption>|null $options Request options
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationApplications\Count;
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\Count;

use Exception;
use Http\Promise\Promise;
Expand All @@ -21,7 +21,7 @@ class CountRequestBuilder extends BaseRequestBuilder
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
*/
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
parent::__construct($requestAdapter, [], '{+baseurl}/admin/configurationManagement/configurationApplications/$count{?%24filter,%24search}');
parent::__construct($requestAdapter, [], '{+baseurl}/admin/cloudLicensing/allotments/$count{?%24filter,%24search}');
if (is_array($pathParametersOrRawUrl)) {
$this->pathParameters = $pathParametersOrRawUrl;
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationApplications\Count;
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\Count;

use Microsoft\Kiota\Abstractions\QueryParameter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Microsoft\Graph\Beta\Generated\Admin\ConfigurationManagement\ConfigurationApplications\Count;
namespace Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\Count;

use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
use Microsoft\Kiota\Abstractions\RequestOption;
Expand Down
Loading