Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b23cc04
Add Http client factory
Ndiritu Jun 27, 2021
4c3fa35
Update Graph class to use HttpClientFactory
Ndiritu Jun 28, 2021
0293b63
Remove proxy configuration from Graph, GraphRequest and GraphCollecti…
Ndiritu Jun 28, 2021
7231294
Update copyright statement, class and interface php docs
Ndiritu Jun 29, 2021
b6cdb1a
Remove TODO comments
Ndiritu Jun 29, 2021
3665dd2
Set the httpClient on a Graph client only through the constructor
Ndiritu Jun 29, 2021
8762088
Make HttpClientFactory methods static
Ndiritu Jun 29, 2021
719d50c
Undo Windows-style CRLF newlines added by editor
Ndiritu Jun 29, 2021
4dc0e87
Update editorConfig to use Unix-style line endings (LF)
Ndiritu Jun 29, 2021
b95fc51
Restore GraphTest file to LF line endings
Ndiritu Jun 29, 2021
2f161e0
Improve validation of national cloud urls
Ndiritu Jun 30, 2021
b044859
Fix GraphException toString() to use child exception class names if n…
Ndiritu Jun 30, 2021
bca9780
Add reference to Guzzle client configuration documentation
Ndiritu Jun 30, 2021
acd2855
Set default apiVersion and nationalCloud on Graph client if empty str…
Ndiritu Jun 30, 2021
17bb389
Allow non-national cloud but valid hosts to be set as base URL of Gra…
Ndiritu Jun 30, 2021
f11850d
Improve base url and national cloud host validation
Ndiritu Jul 1, 2021
20186f0
Change ClientInitialisationException to GraphClientException
Ndiritu Jul 1, 2021
607d4e8
Renamed Graph to BaseClient
Ndiritu Jul 5, 2021
13112b4
Refactor GraphRequest and GraphCollectionRequest constructors
Ndiritu Jul 7, 2021
bdd2ed5
Make base graph client abstract
Ndiritu Jul 7, 2021
efb8bc8
Fix initialisation of default graph request headers
Ndiritu Jul 7, 2021
bed36da
Update PSR-7 request object when headers or body is updated
Ndiritu Jul 7, 2021
35ce3ff
Support PSR-18 and HttPlug async clients
Ndiritu Jul 8, 2021
8a92a86
GraphCollectionRequest updates
Ndiritu Jul 8, 2021
8583d17
Initialise http request object using init method in constructor
Ndiritu Jul 8, 2021
f1bb80f
Make national cloud host check case-insensitive
Ndiritu Jul 8, 2021
bfb37ca
Fix method access modifiers in AbstractGraphClient
Ndiritu Jul 12, 2021
7606355
Merge pull request #4 from microsoftgraph/philip/feat/graph-request-c…
Ndiritu Aug 18, 2021
018c427
Resolve merge conflicts
Ndiritu Aug 18, 2021
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
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
],
"require": {
"php": "^8.0 || ^7.3",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"guzzlehttp/guzzle": "^7.0",
"php-http/httplug": "^2.2.0",
"php-http/guzzle7-adapter": "^1.0.0",
"ext-json": "*"
},
"require-dev": {
Expand Down
53 changes: 53 additions & 0 deletions src/Core/NationalCloud.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
/**
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* Licensed under the MIT License. See License in the project root
* for license information.
*
* HttpResponse File
* PHP version 7
*
* @category Library
* @package Microsoft.Graph
* @copyright 2020 Microsoft Corporation
* @license https://opensource.org/licenses/MIT MIT License
* @version GIT: 1.13.0
* @link https://graph.microsoft.io/
*/

namespace Microsoft\Graph\Core;

/**
* Class NationalCloud
* Defines Graph Hosts for the various national clouds
* @package Microsoft\Graph\Core
*/
final class NationalCloud
{
const GLOBAL = "https://graph.microsoft.com";
const US_GOV = "https://graph.microsoft.us";
const US_DOD = "https://dod-graph.microsoft.us";
const GERMANY = "https://graph.microsoft.de";
const CHINA = "https://microsoftgraph.chinacloudapi.cn";

/**
* Stores all enum values as list
* Prevents having to do reflection for each call to getValues()
*
* @var array
*/
private static $values = [];

/**
* Returns a list of the constant values
*
* @return array
*/
public static function getValues(): array {
if (!self::$values) {
$reflectedClass = new \ReflectionClass(__CLASS__);
self::$values = array_values($reflectedClass->getConstants());
}
return self::$values;
}
}
10 changes: 10 additions & 0 deletions src/Exception/ClientInitialisationException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php


namespace Microsoft\Graph\Exception;


class ClientInitialisationException extends GraphException
{

}
Loading