Skip to content

Commit

Permalink
Onenote namespace fluent api improvements, Teams API methods
Browse files Browse the repository at this point in the history
  • Loading branch information
vvgrem@gmail.com authored and vvgrem@gmail.com committed May 15, 2021
1 parent bd7ba37 commit c4409e8
Show file tree
Hide file tree
Showing 35 changed files with 159 additions and 192 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ A REST/OData based client library for Office 365.
### Usage

1. [Installation](#Installation)
1. [Working with SharePoint API](#Working-with-SharePoint-API)
2. [Working with Outlook API](#Working-with-Outlook-API)
3. [Working with OneDrive API](#Working-with-OneDrive-API)
2. [Working with SharePoint API](#Working-with-SharePoint-API)
3. [Working with Teams API](#Working-with-Teams-API)
4. [Working with Outlook API](#Working-with-Outlook-API)
5. [Working with OneDrive API](#Working-with-OneDrive-API)


### Status
Expand Down Expand Up @@ -195,6 +196,9 @@ $client->executeQuery();
```


### Working with Teams API



### Working with Outlook API

Expand Down
8 changes: 4 additions & 4 deletions src/Common/Alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,18 @@ public function setComments($value)
*/
public function getConfidence()
{
if (!$this->isPropertyAvailable("Confidence")) {
return null;
}
return $this->getProperty("Confidence");
}

/**
* Confidence of the detection logic (percentage between 1-100).
*
* @return self
* @var integer
*/
public function setConfidence($value)
{
$this->setProperty("Confidence", $value, true);
return $this->setProperty("Confidence", $value, true);
}
/**
* Alert description.
Expand Down
41 changes: 9 additions & 32 deletions src/Common/Invitation.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@
*/
namespace Office365\Common;

use Office365\Runtime\ClientObject;
use Office365\Entity;
use Office365\Runtime\ResourcePath;
class Invitation extends ClientObject
class Invitation extends Entity
{
/**
* The display name of the user being invited.
* @return string
*/
public function getInvitedUserDisplayName()
{
if (!$this->isPropertyAvailable("InvitedUserDisplayName")) {
return null;
}
return $this->getProperty("InvitedUserDisplayName");
}
/**
Expand All @@ -34,9 +31,6 @@ public function setInvitedUserDisplayName($value)
*/
public function getInvitedUserType()
{
if (!$this->isPropertyAvailable("InvitedUserType")) {
return null;
}
return $this->getProperty("InvitedUserType");
}
/**
Expand All @@ -53,9 +47,6 @@ public function setInvitedUserType($value)
*/
public function getInvitedUserEmailAddress()
{
if (!$this->isPropertyAvailable("InvitedUserEmailAddress")) {
return null;
}
return $this->getProperty("InvitedUserEmailAddress");
}
/**
Expand All @@ -72,9 +63,6 @@ public function setInvitedUserEmailAddress($value)
*/
public function getSendInvitationMessage()
{
if (!$this->isPropertyAvailable("SendInvitationMessage")) {
return null;
}
return $this->getProperty("SendInvitationMessage");
}
/**
Expand All @@ -91,9 +79,6 @@ public function setSendInvitationMessage($value)
*/
public function getInviteRedirectUrl()
{
if (!$this->isPropertyAvailable("InviteRedirectUrl")) {
return null;
}
return $this->getProperty("InviteRedirectUrl");
}
/**
Expand All @@ -110,9 +95,6 @@ public function setInviteRedirectUrl($value)
*/
public function getInviteRedeemUrl()
{
if (!$this->isPropertyAvailable("InviteRedeemUrl")) {
return null;
}
return $this->getProperty("InviteRedeemUrl");
}
/**
Expand All @@ -129,29 +111,26 @@ public function setInviteRedeemUrl($value)
*/
public function getStatus()
{
if (!$this->isPropertyAvailable("Status")) {
return null;
}
return $this->getProperty("Status");
}

/**
* The status of the invitation. Possible values: PendingAcceptance, Completed, InProgress, and Error
*
* @return self
* @var string
*/
public function setStatus($value)
{
$this->setProperty("Status", $value, true);
return $this->setProperty("Status", $value, true);
}
/**
* Additional configuration for the message being sent to the invited user, including customizing message text, language and cc recipient list.
* @return InvitedUserMessageInfo
*/
public function getInvitedUserMessageInfo()
{
if (!$this->isPropertyAvailable("InvitedUserMessageInfo")) {
return null;
}
return $this->getProperty("InvitedUserMessageInfo");
return $this->getProperty("InvitedUserMessageInfo",new InvitedUserMessageInfo());
}
/**
* Additional configuration for the message being sent to the invited user, including customizing message text, language and cc recipient list.
Expand All @@ -167,9 +146,7 @@ public function setInvitedUserMessageInfo($value)
*/
public function getInvitedUser()
{
if (!$this->isPropertyAvailable("InvitedUser")) {
$this->setProperty("InvitedUser", new User($this->getContext(), new ResourcePath("InvitedUser", $this->getResourcePath())));
}
return $this->getProperty("InvitedUser");
return $this->getProperty("InvitedUser",
new User($this->getContext(), new ResourcePath("InvitedUser", $this->getResourcePath())));
}
}
8 changes: 4 additions & 4 deletions src/EntityCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePat
}

/**
* @param string $id
* @return Entity
* @param string $id Entity Id
* @return ClientObject
*/
function getById($id)
{
return new Entity($this->getContext(),new ResourcePath($id, $this->getResourcePath()));
return $this->createType(new ResourcePath($id, $this->getResourcePath()));
}

/**
Expand Down Expand Up @@ -58,7 +58,7 @@ public function offsetGet($offset)
{
if(is_int($offset))
return parent::offsetGet($offset);
return new Entity($this->getContext(),new ResourcePath($offset, $this->getResourcePath()));
return $this->getById($offset);
}

}
2 changes: 1 addition & 1 deletion src/OneNote/CopyNotebookModel.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:12:31+00:00
* Modified: 2020-05-26T22:12:31+00:00
*/
namespace Office365\OneNote;

Expand Down
2 changes: 1 addition & 1 deletion src/OneNote/ExternalLink.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:10:14+00:00
* Modified: 2020-05-26T22:10:14+00:00
*/
namespace Office365\OneNote;

Expand Down
29 changes: 10 additions & 19 deletions src/OneNote/Notebook.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:12:31+00:00
* Modified: 2020-05-26T22:12:31+00:00
*/
namespace Office365\OneNote;

Expand All @@ -17,9 +17,6 @@ class Notebook extends OnenoteEntityHierarchyModel
*/
public function getIsDefault()
{
if (!$this->isPropertyAvailable("IsDefault")) {
return null;
}
return $this->getProperty("IsDefault");
}
/**
Expand All @@ -36,9 +33,6 @@ public function setIsDefault($value)
*/
public function getIsShared()
{
if (!$this->isPropertyAvailable("IsShared")) {
return null;
}
return $this->getProperty("IsShared");
}
/**
Expand All @@ -55,9 +49,6 @@ public function setIsShared($value)
*/
public function getSectionsUrl()
{
if (!$this->isPropertyAvailable("SectionsUrl")) {
return null;
}
return $this->getProperty("SectionsUrl");
}
/**
Expand All @@ -74,36 +65,36 @@ public function setSectionsUrl($value)
*/
public function getSectionGroupsUrl()
{
if (!$this->isPropertyAvailable("SectionGroupsUrl")) {
return null;
}
return $this->getProperty("SectionGroupsUrl");
}

/**
* The URL for the `sectionGroups` navigation property, which returns all the section groups in the notebook. Read-only.
*
* @return self
* @var string
*/
public function setSectionGroupsUrl($value)
{
$this->setProperty("SectionGroupsUrl", $value, true);
return $this->setProperty("SectionGroupsUrl", $value, true);
}
/**
* Links for opening the notebook. The `oneNoteClientURL` link opens the notebook in the OneNote native client if it's installed. The `oneNoteWebURL` link opens the notebook in OneNote on the web.
* @return NotebookLinks
*/
public function getLinks()
{
if (!$this->isPropertyAvailable("Links")) {
return null;
}
return $this->getProperty("Links");
return $this->getProperty("Links", new NotebookLinks());
}

/**
* Links for opening the notebook. The `oneNoteClientURL` link opens the notebook in the OneNote native client if it's installed. The `oneNoteWebURL` link opens the notebook in OneNote on the web.
*
* @return self
* @var NotebookLinks
*/
public function setLinks($value)
{
$this->setProperty("Links", $value, true);
return $this->setProperty("Links", $value, true);
}
}
2 changes: 1 addition & 1 deletion src/OneNote/NotebookLinks.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:12:31+00:00
* Modified: 2020-05-26T22:12:31+00:00
*/
namespace Office365\OneNote;

Expand Down
2 changes: 1 addition & 1 deletion src/OneNote/Onenote.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-27T08:42:11+00:00
* Modified: 2020-05-27T08:42:11+00:00
*/
namespace Office365\OneNote;

Expand Down
2 changes: 1 addition & 1 deletion src/OneNote/OnenoteEntityBaseModel.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:10:14+00:00
* Modified: 2020-05-26T22:10:14+00:00
*/
namespace Office365\OneNote;

Expand Down
2 changes: 1 addition & 1 deletion src/OneNote/OnenoteEntityHierarchyModel.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:10:14+00:00
* Modified: 2020-05-26T22:10:14+00:00
*/
namespace Office365\OneNote;

Expand Down
2 changes: 1 addition & 1 deletion src/OneNote/OnenoteEntitySchemaObjectModel.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:10:14+00:00
* Modified: 2020-05-26T22:10:14+00:00
*/
namespace Office365\OneNote;

Expand Down
2 changes: 1 addition & 1 deletion src/OneNote/OnenoteOperation.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:12:31+00:00
* Modified: 2020-05-26T22:12:31+00:00
*/
namespace Office365\OneNote;

Expand Down
2 changes: 1 addition & 1 deletion src/OneNote/OnenoteOperationError.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:10:14+00:00
* Modified: 2020-05-26T22:10:14+00:00
*/
namespace Office365\OneNote;

Expand Down
2 changes: 1 addition & 1 deletion src/OneNote/OnenotePage.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:12:31+00:00
* Modified: 2020-05-26T22:12:31+00:00
*/
namespace Office365\OneNote;

Expand Down
2 changes: 1 addition & 1 deletion src/OneNote/OnenotePagePreview.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:12:31+00:00
* Modified: 2020-05-26T22:12:31+00:00
*/
namespace Office365\OneNote;

Expand Down
2 changes: 1 addition & 1 deletion src/OneNote/OnenotePagePreviewLinks.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:12:31+00:00
* Modified: 2020-05-26T22:12:31+00:00
*/
namespace Office365\OneNote;

Expand Down
2 changes: 1 addition & 1 deletion src/OneNote/OnenotePatchContentCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Generated by phpSPO model generator 2020-05-26T22:10:14+00:00
* Modified: 2020-05-26T22:10:14+00:00
*/
namespace Office365\OneNote;

Expand Down
Loading

0 comments on commit c4409e8

Please sign in to comment.