Skip to content

Commit

Permalink
SharePoint model updated to 16.0.20628.12006, unit tests config (psr-4)
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Nov 14, 2020
1 parent 76cb9ee commit 1c725ac
Show file tree
Hide file tree
Showing 22 changed files with 180 additions and 38 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"autoload-dev": {
"psr-4": {
"Office365\\": ["tests/", "tests/sharepoint/", "tests/outlookservices/", "tests/microsoftgraph/"]
"Office365\\": ["tests/", "tests/common/", "tests/sharepoint/", "tests/onenote/", "tests/onedrive/", "tests/outlookservices/", "tests/directory/"]
}
},
"autoload": {
Expand Down
8 changes: 1 addition & 7 deletions examples/Photo/DownloadPhoto.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@
function acquireToken(AuthenticationContext $authCtx, $clientId, $userName, $password)
{
$resource = "https://graph.microsoft.com";
try {
$authCtx->acquireTokenForPassword($resource,
$clientId,
new UserCredentials($userName, $password));
} catch (Exception $e) {
print("Failed to acquire token");
}
$authCtx->acquireTokenForPassword($resource,$clientId,new UserCredentials($userName, $password));
}

try {
Expand Down
Binary file modified examples/Photo/myprofile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions generator/Settings.SharePoint.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"docsRoot": "https:\/\/docs.microsoft.com\/en-us\/openspecs\/sharepoint_protocols\/ms-csomspt\/",
"rootNamespace": "Office365\\SharePoint",
"entityRootNamespace": "SP",
"version": "16.0.20523.12005",
"timestamp": "2020-10-07T07:21:10+00:00",
"version": "16.0.20628.12006",
"timestamp": "2020-11-13T16:48:07+00:00",
"placeholder": "This file was generated by phpSPO model generator",
"typeMappings": {
"SP.List": "SP.SPList",
Expand Down
2 changes: 1 addition & 1 deletion generator/metadata/SharePoint.xml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/Runtime/Auth/AuthenticationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ public function acquireTokenForPassword($resource, $clientId, $userCredentials)
'client_id' => $clientId,
'username' => $userCredentials->Username,
'password' => $userCredentials->Password,
'scope' => 'user.read openid',
'resource' => $resource
);
$this->accessToken = $this->provider->acquireToken($parameters);
Expand Down
1 change: 1 addition & 0 deletions src/Runtime/Auth/OAuthTokenProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function acquireToken($parameters)
{
$request = $this->prepareTokenRequest($parameters);
$response = Requests::execute($request);
$response->validate();
return $this->normalizeToken($response->getContent());
}

Expand Down
10 changes: 10 additions & 0 deletions src/Runtime/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ public function __construct($content, $headers)
$this->StatusCode = $headers['HttpCode'];
}

/**
*
* @throws RequestException
*/
public function validate(){
if ($this->StatusCode >= 400) {
throw new RequestException($this->Content,$this->StatusCode);
}
}

public function getStatusCode()
{
return $this->StatusCode;
Expand Down
6 changes: 5 additions & 1 deletion src/SharePoint/EnqueueJobInformation.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file was generated by phpSPO model generator 2020-10-07T07:21:11+00:00 16.0.20523.12005
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint;

Expand All @@ -12,4 +12,8 @@ class EnqueueJobInformation extends ClientValue
* @var integer
*/
public $EnqueueJobStatus;
/**
* @var string
*/
public $Message;
}
29 changes: 21 additions & 8 deletions src/SharePoint/Field.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file was generated by phpSPO model generator 2019-11-17T16:07:15+00:00 16.0.19506.12022
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint;

Expand Down Expand Up @@ -29,7 +29,6 @@ public function update()
$this->getContext()->addQueryAndResultObject($qry, $this);
return $this;
}

/**
* @return $this
*/
Expand All @@ -39,7 +38,6 @@ public function deleteObject()
$this->getContext()->addQuery($qry);
return $this;
}

/**
* Sets the value of the ShowInDisplayForm property for this field.
* @param $value true to show the field in the form; otherwise false.
Expand Down Expand Up @@ -1021,8 +1019,7 @@ public function setIndexStatus($value)
public function getDescriptionResource()
{
if (!$this->isPropertyAvailable("DescriptionResource")) {
$this->setProperty("DescriptionResource", new UserResource($this->getContext(),
new ResourcePath("DescriptionResource", $this->getResourcePath())));
$this->setProperty("DescriptionResource", new UserResource($this->getContext(), new ResourcePath("DescriptionResource", $this->getResourcePath())));
}
return $this->getProperty("DescriptionResource");
}
Expand All @@ -1032,9 +1029,25 @@ public function getDescriptionResource()
public function getTitleResource()
{
if (!$this->isPropertyAvailable("TitleResource")) {
$this->setProperty("TitleResource", new UserResource($this->getContext(),
new ResourcePath("TitleResource", $this->getResourcePath())));
$this->setProperty("TitleResource", new UserResource($this->getContext(), new ResourcePath("TitleResource", $this->getResourcePath())));
}
return $this->getProperty("TitleResource");
}
}
/**
* @return bool
*/
public function getIsModern()
{
if (!$this->isPropertyAvailable("IsModern")) {
return null;
}
return $this->getProperty("IsModern");
}
/**
* @var bool
*/
public function setIsModern($value)
{
$this->setProperty("IsModern", $value, true);
}
}
19 changes: 18 additions & 1 deletion src/SharePoint/FieldUser.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file was generated by phpSPO model generator 2019-11-16T20:01:10+00:00 16.0.19506.12022
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint;

Expand Down Expand Up @@ -105,4 +105,21 @@ public function setSelectionMode($value)
{
$this->setProperty("SelectionMode", $value, true);
}
/**
* @return string
*/
public function getUserDisplayOptions()
{
if (!$this->isPropertyAvailable("UserDisplayOptions")) {
return null;
}
return $this->getProperty("UserDisplayOptions");
}
/**
* @var string
*/
public function setUserDisplayOptions($value)
{
$this->setProperty("UserDisplayOptions", $value, true);
}
}
6 changes: 5 additions & 1 deletion src/SharePoint/FileCollectionAddParameters.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file was generated by phpSPO model generator 2019-11-17T14:59:21+00:00 16.0.19506.12022
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint;

Expand All @@ -27,4 +27,8 @@ class FileCollectionAddParameters extends ClientValue
* @var string
*/
public $XorHash;
/**
* @var bool
*/
public $EnsureUniqueFileName;
}
19 changes: 18 additions & 1 deletion src/SharePoint/HubSite.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file was generated by phpSPO model generator 2020-08-05T10:16:13+00:00 16.0.20315.12009
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint;

Expand Down Expand Up @@ -263,4 +263,21 @@ public function setEnforcedECTs($value)
{
$this->setProperty("EnforcedECTs", $value, true);
}
/**
* @return integer
*/
public function getPermissionsSyncTag()
{
if (!$this->isPropertyAvailable("PermissionsSyncTag")) {
return null;
}
return $this->getProperty("PermissionsSyncTag");
}
/**
* @var integer
*/
public function setPermissionsSyncTag($value)
{
$this->setProperty("PermissionsSyncTag", $value, true);
}
}
6 changes: 5 additions & 1 deletion src/SharePoint/HubSiteCreationInformation.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file was generated by phpSPO model generator 2020-04-22T21:18:30+00:00 16.0.20008.12009
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint;

Expand Down Expand Up @@ -60,4 +60,8 @@ class HubSiteCreationInformation extends ClientValue
* @var string
*/
public $EnforcedECTs;
/**
* @var integer
*/
public $PermissionsSyncTag;
}
15 changes: 15 additions & 0 deletions src/SharePoint/ListItemUpdateResults.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

/**
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientValue;
class ListItemUpdateResults extends ClientValue
{
/**
* @var string
*/
public $UpdatedData;
}
15 changes: 14 additions & 1 deletion src/SharePoint/NavigationNode.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

/**
* This file was generated by phpSPO model generator 2020-08-19T18:22:34+00:00 16.0.20405.12008
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientObject;
use Office365\Runtime\ResourcePath;

/**
* Represents
* the URL
Expand Down Expand Up @@ -168,4 +170,15 @@ public function setCurrentLCID($value)
{
$this->setProperty("CurrentLCID", $value, true);
}
/**
* @return UserResource
*/
public function getTitleResource()
{
if (!$this->isPropertyAvailable("TitleResource")) {
$this->setProperty("TitleResource", new UserResource($this->getContext(),
new ResourcePath("TitleResource", $this->getResourcePath())));
}
return $this->getProperty("TitleResource");
}
}
11 changes: 11 additions & 0 deletions src/SharePoint/PinnedItems.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

/**
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientObject;
class PinnedItems extends ClientObject
{
}
6 changes: 5 additions & 1 deletion src/SharePoint/RenderListDataParameters.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file was generated by phpSPO model generator 2020-08-05T10:11:52+00:00 16.0.20315.12009
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint;

Expand Down Expand Up @@ -120,4 +120,8 @@ class RenderListDataParameters extends ClientValue
* @var bool
*/
public $ExpandUserField;
/**
* @var bool
*/
public $FilterOutChannelFoldersInDefaultDocLib;
}
19 changes: 19 additions & 0 deletions src/SharePoint/SPResourceEntry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientValue;
class SPResourceEntry extends ClientValue
{
/**
* @var integer
*/
public $LCID;
/**
* @var string
*/
public $Value;
}
10 changes: 9 additions & 1 deletion src/SharePoint/Sharing/SharingLinkAbilities.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file was generated by phpSPO model generator 2020-08-05T10:16:13+00:00 16.0.20315.12009
* This file was generated by phpSPO model generator 2020-11-13T16:48:11+00:00 16.0.20628.12006
*/
namespace Office365\SharePoint\Sharing;

Expand Down Expand Up @@ -71,4 +71,12 @@ class SharingLinkAbilities extends ClientValue
* @var SharingAbilityStatus
*/
public $trackLinkUsers;
/**
* @var SharingAbilityStatus
*/
public $canGetManageListLink;
/**
* @var SharingAbilityStatus
*/
public $canManageManageListLink;
}
Loading

0 comments on commit 1c725ac

Please sign in to comment.