77
88use Office365 \Entity ;
99use Office365 \Runtime \Actions \InvokeMethodQuery ;
10- use Office365 \Runtime \Actions \InvokePostMethodQuery ;
1110use Office365 \Runtime \ClientResult ;
1211use Office365 \Runtime \Http \RequestOptions ;
1312
1413class ReportRoot extends Entity
1514{
15+
1616 /**
17- * Get details about users who have activated Microsoft 365.
17+ * @param $name string
1818 * @return ClientResult
1919 */
20- function getOffice365ActivationsUserDetail (){
21- $ qry = new InvokePostMethodQuery ($ this , "getOffice365ActivationsUserDetail " );
20+ private function addReportQuery ($ name ){
21+ $ qry = new InvokeMethodQuery ($ this , $ name );
22+ $ this ->getContext ()->getPendingRequest ()->beforeExecuteRequestOnce (function (RequestOptions $ request ){
23+ $ request ->FollowLocation = true ;
24+ });
2225 $ reportResult = new ClientResult ($ this ->getContext (),new Report ());
2326 $ this ->getContext ()->addQueryAndResultObject ($ qry , $ reportResult );
2427 return $ reportResult ;
2528 }
2629
30+ /**
31+ * Get details about users who have activated Microsoft 365.
32+ * @return ClientResult
33+ */
34+ function getOffice365ActivationsUserDetail (){
35+ return $ this ->addReportQuery ("getOffice365ActivationsUserDetail " );
36+ }
37+
2738 /**
2839 * Get the count of Microsoft 365 activations on desktops and devices.
2940 * @return ClientResult
3041 */
3142 function getOffice365ActivationCounts (){
32- $ qry = new InvokeMethodQuery ($ this , "getOffice365ActivationCounts " );
33- $ this ->getContext ()->getPendingRequest ()->beforeExecuteRequestOnce (function (RequestOptions $ request ){
34- $ request ->FollowLocation = true ;
35- });
36- $ reportResult = new ClientResult ($ this ->getContext (),new Report ());
37- $ this ->getContext ()->addQueryAndResultObject ($ qry , $ reportResult );
38- return $ reportResult ;
43+ return $ this ->addReportQuery ("getOffice365ActivationCounts " );
3944 }
4045
4146 /**
@@ -44,9 +49,6 @@ function getOffice365ActivationCounts(){
4449 * @return ClientResult
4550 */
4651 function getOffice365ActivationsUserCounts (){
47- $ qry = new InvokePostMethodQuery ($ this , "getOffice365ActivationsUserCounts " );
48- $ reportResult = new ClientResult ($ this ->getContext (),new Report ());
49- $ this ->getContext ()->addQueryAndResultObject ($ qry , $ reportResult );
50- return $ reportResult ;
52+ return $ this ->addReportQuery ("getOffice365ActivationsUserCounts " );
5153 }
5254}
0 commit comments