Skip to content

Commit

Permalink
SharePoint model updated to 16.0.21729.12001 version, model generator…
Browse files Browse the repository at this point in the history
… fixes
  • Loading branch information
vgrem committed Oct 9, 2021
1 parent 13116a1 commit dc6c82d
Show file tree
Hide file tree
Showing 32 changed files with 402 additions and 26 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 6 additions & 1 deletion generator/GenerateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Office365\Generator\Documentation\MSGraphDocsService;
use Office365\Generator\Documentation\SharePointSpecsService;
use Office365\Runtime\Auth\UserCredentials;
use Office365\Runtime\Http\RequestException;
use Office365\Runtime\OData\MetadataResolver;
use Office365\Runtime\OData\ODataModel;
use Office365\Runtime\OData\V3\ODataV3Reader;
Expand Down Expand Up @@ -81,7 +82,11 @@ function generateSharePointModel()
{
syncSharePointMetadataFile('./Settings.SharePoint.json');
$options = loadSettingsFromFile('./Settings.SharePoint.json');
$options['docs'] = new SharePointSpecsService($options['docsRoot']);
try {
$options['docs'] = new SharePointSpecsService($options['docsRoot']);
} catch (RequestException $e) {
//ignore
}
$reader = new ODataV3Reader();
$model = $reader->generateModel($options);
generateFiles($model);
Expand Down
11 changes: 6 additions & 5 deletions generator/Settings.SharePoint.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"metadataPath": ".\/metadata\/SharePoint.xml",
"outputPath": "..\/src\/SharePoint",
"templatePath": ".\/templates\/sharepoint\/",
"metadataPath": "./metadata/SharePoint.xml",
"outputPath": "../src/SharePoint",
"templatePath": "./templates/sharepoint/",
"includeDocAnnotations": true,
"docsRoot": "https:\/\/docs.microsoft.com\/en-us\/openspecs\/sharepoint_protocols\/ms-csomspt\/",
"rootNamespace": "Office365\\SharePoint",
"entityRootNamespace": "SP",
"version": "16.0.21221.12006",
"timestamp": "2021-05-05T14:47:20+00:00",
"version": "16.0.21729.12001",
"timestamp": "2021-10-09T12:03:32+03:00",
"placeholder": "This file was generated by phpSPO model generator",
"typeMappings": {
"SP.List": "SP.SPList",
"SP.ResourcePath": "SP.SPResourcePath"
},
"ignoredTypes": [
"SP.KeyValue",
"SP.SimpleDataRow",
"SP.SimpleDataTable",
"SP.MethodInformation",
Expand Down
4 changes: 2 additions & 2 deletions generator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
],
"autoload": {
"psr-4": {
"Office365\\Generator\\": "./generator/",
"Office365\\": "../src/"
"Office365\\": ["../src/"],
"Office365\\Generator\\": ["../generator/"]
}
},
"name": "vgrem/php-office365-sdk-generator",
Expand Down
2 changes: 1 addition & 1 deletion generator/metadata/SharePoint.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Runtime/OData/ODataModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,12 @@ public function getTypeInfo($typeName)
$parts = explode('.', $typeName);
$parts[0] = $this->options['rootNamespace'];
$typeAlias = array_pop($parts);
$namespace = implode(DIRECTORY_SEPARATOR,array_filter($parts));
$namespace = implode("\\",array_filter($parts));
$filePath = implode(DIRECTORY_SEPARATOR,array_filter([str_replace($this->options['rootNamespace'],"",$namespace),$typeAlias . ".php"]));

return array(
'alias' => $typeAlias,
'name' => implode(DIRECTORY_SEPARATOR,[$namespace,$typeAlias]),
'name' => implode("\\",[$namespace,$typeAlias]),
'file' => implode(DIRECTORY_SEPARATOR,[$this->options['outputPath'],$filePath]),
'namespace' => $namespace,
'primitive' => false,
Expand Down
3 changes: 3 additions & 0 deletions src/Runtime/OData/ODataReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ abstract class ODataReader
function generateModel($options)
{
$model = new ODataModel($options);
$model->onTypeResolved(function ($typeSchema){
echo "${typeSchema['name']} type resolved." . PHP_EOL;
});
$edmx = file_get_contents($options['metadataPath']);
$this->parseEdmx($edmx, $model);
return $model;
Expand Down
19 changes: 19 additions & 0 deletions src/SharePoint/ContentAssemblyFileInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* This file was generated by phpSPO model generator 2021-10-09T13:26:01+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientValue;
class ContentAssemblyFileInfo extends ClientValue
{
/**
* @var string
*/
public $FileUrl;
/**
* @var string
*/
public $ServerRedirectedEmbedUrl;
}
19 changes: 19 additions & 0 deletions src/SharePoint/ContentAssemblyFormAnswer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* This file was generated by phpSPO model generator 2021-10-09T13:26:01+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientValue;
class ContentAssemblyFormAnswer extends ClientValue
{
/**
* @var string
*/
public $Answer;
/**
* @var string
*/
public $ContentControlTagName;
}
31 changes: 31 additions & 0 deletions src/SharePoint/ContentControlInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

/**
* This file was generated by phpSPO model generator 2021-10-09T13:26:01+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientValue;
class ContentControlInfo extends ClientValue
{
/**
* @var string
*/
public $ContentControlTagName;
/**
* @var integer
*/
public $EndIndex;
/**
* @var bool
*/
public $IsSingleParargaph;
/**
* @var array
*/
public $ParagraphIds;
/**
* @var integer
*/
public $StartIndex;
}
6 changes: 5 additions & 1 deletion src/SharePoint/CopyMigrationOptions.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 2021-10-09T13:33:47+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint;

Expand Down Expand Up @@ -54,4 +54,8 @@ class CopyMigrationOptions extends ClientValue
* @var bool
*/
public $SameWebCopyMoveOptimization;
/**
* @var array
*/
public $CustomizedItemName;
}
6 changes: 5 additions & 1 deletion src/SharePoint/CurrencyInformation.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-10-12T15:24:30+00:00 16.0.19402.12016
* This file was generated by phpSPO model generator 2021-10-09T13:26:01+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint;

Expand All @@ -26,4 +26,8 @@ class CurrencyInformation extends ClientValue
* @var string
*/
public $LCID;
/**
* @var string
*/
public $LanguageCultureName;
}
27 changes: 27 additions & 0 deletions src/SharePoint/DashboardItemInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* This file was generated by phpSPO model generator 2021-10-09T12:53:17+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientValue;
class DashboardItemInfo extends ClientValue
{
/**
* @var integer
*/
public $ItemId;
/**
* @var string
*/
public $ListId;
/**
* @var string
*/
public $SiteId;
/**
* @var string
*/
public $WebId;
}
23 changes: 23 additions & 0 deletions src/SharePoint/DocumentGenerationInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

/**
* This file was generated by phpSPO model generator 2021-10-09T13:33:47+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientValue;
class DocumentGenerationInfo extends ClientValue
{
/**
* @var string
*/
public $FileName;
/**
* @var bool
*/
public $IsTempFile;
/**
* @var string
*/
public $TempFileUrl;
}
10 changes: 9 additions & 1 deletion src/SharePoint/MediaServiceUpdateParameters.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file was generated by phpSPO model generator 2021-08-22T15:28:03+00:00 16.0.21611.12002
* This file was generated by phpSPO model generator 2021-10-09T13:33:47+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint;

Expand Down Expand Up @@ -88,4 +88,12 @@ class MediaServiceUpdateParameters extends ClientValue
* @var string
*/
public $MediaServiceImageTags;
/**
* @var integer
*/
public $MediaServiceImageHeight;
/**
* @var integer
*/
public $MediaServiceImageWidth;
}
12 changes: 6 additions & 6 deletions src/SharePoint/PortalAndOrgNewsSiteReference.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php

/**
* This file was generated by phpSPO model generator 2019-10-08T21:36:37+00:00 16.0.19325.12009
*/
* This file was generated by phpSPO model generator 2021-10-09T13:02:28+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientValue;
class PortalAndOrgNewsSiteReference extends ClientValue
{
/**
* @var string
/**
* @var string
*/
public $SiteId;
/**
* @var string
/**
* @var string
*/
public $WebId;
}
19 changes: 19 additions & 0 deletions src/SharePoint/ProvisionedTemporaryAzureContainerInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* This file was generated by phpSPO model generator 2021-10-09T13:33:47+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientValue;
class ProvisionedTemporaryAzureContainerInfo extends ClientValue
{
/**
* @var string
*/
public $EncryptionKey;
/**
* @var string
*/
public $Uri;
}
6 changes: 5 additions & 1 deletion src/SharePoint/Publishing/SitePageFieldsData.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file was generated by phpSPO model generator 2021-03-12T16:05:00+00:00 16.0.21103.12002
* This file was generated by phpSPO model generator 2021-10-09T13:33:47+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint\Publishing;

Expand Down Expand Up @@ -52,4 +52,8 @@ class SitePageFieldsData extends ClientValue
* @var string
*/
public $Categories;
/**
* @var string
*/
public $CallToAction;
}
16 changes: 15 additions & 1 deletion src/SharePoint/Publishing/SitePageMetadata.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file was generated by phpSPO model generator 2021-08-22T15:28:03+00:00 16.0.21611.12002
* This file was generated by phpSPO model generator 2021-10-09T13:33:47+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint\Publishing;

Expand Down Expand Up @@ -550,4 +550,18 @@ public function setAssetFolderId($value)
{
return $this->setProperty("AssetFolderId", $value, true);
}
/**
* @return string
*/
public function getCallToAction()
{
return $this->getProperty("CallToAction");
}
/**
* @var string
*/
public function setCallToAction($value)
{
return $this->setProperty("CallToAction", $value, true);
}
}
14 changes: 14 additions & 0 deletions src/SharePoint/RecentListProxy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

/**
* This file was generated by phpSPO model generator 2021-10-09T13:33:47+03:00 16.0.21729.12001
*/
namespace Office365\SharePoint;

use Office365\Runtime\ClientObject;
use Office365\Runtime\Actions\DeleteEntityQuery;
use Office365\Runtime\ResourcePath;
use Office365\Runtime\Actions\UpdateEntityQuery;
class RecentListProxy extends BaseEntity
{
}
Loading

0 comments on commit dc6c82d

Please sign in to comment.