Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
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\Generated\Admin\Edge\EdgeRequestBuilder;
use Microsoft\Graph\Generated\Admin\Exchange\ExchangeRequestBuilder;
use Microsoft\Graph\Generated\Admin\Microsoft365Apps\Microsoft365AppsRequestBuilder;
use Microsoft\Graph\Generated\Admin\People\PeopleRequestBuilder;
use Microsoft\Graph\Generated\Admin\ReportSettings\ReportSettingsRequestBuilder;
Expand All @@ -30,6 +31,13 @@ public function edge(): EdgeRequestBuilder {
return new EdgeRequestBuilder($this->pathParameters, $this->requestAdapter);
}

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

/**
* Provides operations to manage the microsoft365Apps property of the microsoft.graph.admin entity.
*/
Expand Down
152 changes: 152 additions & 0 deletions src/Generated/Admin/Exchange/ExchangeRequestBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<?php

namespace Microsoft\Graph\Generated\Admin\Exchange;

use Exception;
use Http\Promise\Promise;
use Microsoft\Graph\Generated\Admin\Exchange\Tracing\TracingRequestBuilder;
use Microsoft\Graph\Generated\Models\ExchangeAdmin;
use Microsoft\Graph\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 exchange property of the microsoft.graph.admin entity.
*/
class ExchangeRequestBuilder extends BaseRequestBuilder
{
/**
* Provides operations to manage the tracing property of the microsoft.graph.exchangeAdmin entity.
*/
public function tracing(): TracingRequestBuilder {
return new TracingRequestBuilder($this->pathParameters, $this->requestAdapter);
}

/**
* Instantiates a new ExchangeRequestBuilder 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/exchange{?%24expand,%24select}');
if (is_array($pathParametersOrRawUrl)) {
$this->pathParameters = $pathParametersOrRawUrl;
} else {
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
}
}

/**
* Delete navigation property exchange for admin
* @param ExchangeRequestBuilderDeleteRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<void|null>
* @throws Exception
*/
public function delete(?ExchangeRequestBuilderDeleteRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toDeleteRequestInformation($requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendNoContentAsync($requestInfo, $errorMappings);
}

/**
* A container for the Exchange admin functionality. Read-only.
* @param ExchangeRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<ExchangeAdmin|null>
* @throws Exception
*/
public function get(?ExchangeRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendAsync($requestInfo, [ExchangeAdmin::class, 'createFromDiscriminatorValue'], $errorMappings);
}

/**
* Update the navigation property exchange in admin
* @param ExchangeAdmin $body The request body
* @param ExchangeRequestBuilderPatchRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<ExchangeAdmin|null>
* @throws Exception
*/
public function patch(ExchangeAdmin $body, ?ExchangeRequestBuilderPatchRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toPatchRequestInformation($body, $requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendAsync($requestInfo, [ExchangeAdmin::class, 'createFromDiscriminatorValue'], $errorMappings);
}

/**
* Delete navigation property exchange for admin
* @param ExchangeRequestBuilderDeleteRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toDeleteRequestInformation(?ExchangeRequestBuilderDeleteRequestConfiguration $requestConfiguration = null): RequestInformation {
$requestInfo = new RequestInformation();
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
$requestInfo->httpMethod = HttpMethod::DELETE;
if ($requestConfiguration !== null) {
$requestInfo->addHeaders($requestConfiguration->headers);
$requestInfo->addRequestOptions(...$requestConfiguration->options);
}
$requestInfo->tryAddHeader('Accept', "application/json");
return $requestInfo;
}

/**
* A container for the Exchange admin functionality. Read-only.
* @param ExchangeRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toGetRequestInformation(?ExchangeRequestBuilderGetRequestConfiguration $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;
}

/**
* Update the navigation property exchange in admin
* @param ExchangeAdmin $body The request body
* @param ExchangeRequestBuilderPatchRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toPatchRequestInformation(ExchangeAdmin $body, ?ExchangeRequestBuilderPatchRequestConfiguration $requestConfiguration = null): RequestInformation {
$requestInfo = new RequestInformation();
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
$requestInfo->httpMethod = HttpMethod::PATCH;
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 ExchangeRequestBuilder
*/
public function withUrl(string $rawUrl): ExchangeRequestBuilder {
return new ExchangeRequestBuilder($rawUrl, $this->requestAdapter);
}

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

namespace Microsoft\Graph\Generated\Admin\Exchange;

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

/**
* Configuration for the request such as headers, query parameters, and middleware options.
*/
class ExchangeRequestBuilderDeleteRequestConfiguration extends BaseRequestConfiguration
{
/**
* Instantiates a new ExchangeRequestBuilderDeleteRequestConfiguration and sets the default values.
* @param array<string, array<string>|string>|null $headers Request headers
* @param array<RequestOption>|null $options Request options
*/
public function __construct(?array $headers = null, ?array $options = null) {
parent::__construct($headers ?? [], $options ?? []);
}

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

namespace Microsoft\Graph\Generated\Admin\Exchange;

use Microsoft\Kiota\Abstractions\QueryParameter;

/**
* A container for the Exchange admin functionality. Read-only.
*/
class ExchangeRequestBuilderGetQueryParameters
{
/**
* @QueryParameter("%24expand")
* @var array<string>|null $expand Expand related entities
*/
public ?array $expand = null;

/**
* @QueryParameter("%24select")
* @var array<string>|null $select Select properties to be returned
*/
public ?array $select = null;

/**
* Instantiates a new ExchangeRequestBuilderGetQueryParameters and sets the default values.
* @param array<string>|null $expand Expand related entities
* @param array<string>|null $select Select properties to be returned
*/
public function __construct(?array $expand = null, ?array $select = null) {
$this->expand = $expand;
$this->select = $select;
}

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

namespace Microsoft\Graph\Generated\Admin\Exchange;

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

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

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

/**
* Instantiates a new ExchangeRequestBuilderGetQueryParameters.
* @param array<string>|null $expand Expand related entities
* @param array<string>|null $select Select properties to be returned
* @return ExchangeRequestBuilderGetQueryParameters
*/
public static function createQueryParameters(?array $expand = null, ?array $select = null): ExchangeRequestBuilderGetQueryParameters {
return new ExchangeRequestBuilderGetQueryParameters($expand, $select);
}

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

namespace Microsoft\Graph\Generated\Admin\Exchange;

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

/**
* Configuration for the request such as headers, query parameters, and middleware options.
*/
class ExchangeRequestBuilderPatchRequestConfiguration extends BaseRequestConfiguration
{
/**
* Instantiates a new ExchangeRequestBuilderPatchRequestConfiguration and sets the default values.
* @param array<string, array<string>|string>|null $headers Request headers
* @param array<RequestOption>|null $options Request options
*/
public function __construct(?array $headers = null, ?array $options = null) {
parent::__construct($headers ?? [], $options ?? []);
}

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

namespace Microsoft\Graph\Generated\Admin\Exchange\Tracing\MessageTraces\Count;

use Exception;
use Http\Promise\Promise;
use Microsoft\Graph\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 count the resources in the collection.
*/
class CountRequestBuilder extends BaseRequestBuilder
{
/**
* Instantiates a new CountRequestBuilder 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/exchange/tracing/messageTraces/$count{?%24filter,%24search}');
if (is_array($pathParametersOrRawUrl)) {
$this->pathParameters = $pathParametersOrRawUrl;
} else {
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
}
}

/**
* Get the number of the resource
* @param CountRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<int|null>
* @throws Exception
*/
public function get(?CountRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
/** @var Promise<int|null> $result */
$result = $this->requestAdapter->sendPrimitiveAsync($requestInfo, 'int', $errorMappings);
return $result;
}

/**
* Get the number of the resource
* @param CountRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toGetRequestInformation(?CountRequestBuilderGetRequestConfiguration $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', "text/plain;q=0.9");
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 CountRequestBuilder
*/
public function withUrl(string $rawUrl): CountRequestBuilder {
return new CountRequestBuilder($rawUrl, $this->requestAdapter);
}

}
Loading