-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Teams API methods, prepare for 2.5.0 release
- Loading branch information
1 parent
c4409e8
commit a3ffafa
Showing
9 changed files
with
136 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,13 @@ | |
*/ | ||
namespace Office365\Teams; | ||
|
||
use Office365\Common\DirectoryObject; | ||
use Office365\Common\User; | ||
use Office365\Entity; | ||
use Office365\EntityCollection; | ||
use Office365\Runtime\Actions\InvokePostMethodQuery; | ||
use Office365\Runtime\Http\RequestOptions; | ||
use Office365\Runtime\ResourcePath; | ||
|
||
|
||
/** | ||
|
@@ -129,9 +134,42 @@ public function setFunSettings($value) | |
return $this->setProperty("FunSettings", $value, true); | ||
} | ||
|
||
/** | ||
* @return EntityCollection | ||
*/ | ||
public function getMembers() | ||
{ | ||
return $this->getProperty("Members", | ||
new EntityCollection($this->getContext(), | ||
new ResourcePath("Members",$this->getResourcePath()),DirectoryObject::class)); | ||
} | ||
|
||
|
||
/** | ||
* @param User $user | ||
* @param string[] $roles | ||
* @return Entity | ||
*/ | ||
public function addMember($user, $roles){ | ||
$returnType = new Entity($this->getContext()); | ||
$this->getMembers()->addChild($returnType); | ||
|
||
$user->ensureProperty("Id",function () use ($user, $returnType, $roles){ | ||
$payload = array( | ||
"@odata.type" => "#microsoft.graph.aadUserConversationMember", | ||
"roles" => $roles, | ||
"[email protected]" => "https://graph.microsoft.com/v1.0/users('{$user->getId()}')" | ||
); | ||
$qry = new InvokePostMethodQuery($this->getMembers(),null,null,null,$payload); | ||
$this->getContext()->addQueryAndResultObject($qry, $returnType); | ||
|
||
}); | ||
return $returnType; | ||
} | ||
|
||
/** | ||
* Deletes a Team | ||
* @return Team | ||
* @return self | ||
*/ | ||
public function deleteObject() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters