File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -521,6 +521,42 @@ public function buildUrl()
521521 return $ url ;
522522 }
523523
524+ /**
525+ * Sets the request type to "urls" to retrieve the URL Report
526+ * URL for understanding diagnostic data of URLs
527+ *
528+ * @return $this
529+ */
530+ public function getUrlReportUrl ($ num = null )
531+ {
532+ $ this ->otherOptions ['type ' ] = 'urls ' ;
533+
534+ if (!empty ($ num ) && is_numeric ($ num )) {
535+ $ this ->otherOptions ['num ' ] = $ num ;
536+ }
537+
538+ // Setup data endpoint
539+ $ url = $ this ->apiUrl . '/data ' ;
540+
541+ // Add token
542+ $ url .= '?token= ' . $ this ->diffbot ->getToken ();
543+
544+ if ($ this ->getName ()) {
545+ // Add name
546+ $ url .= '&name= ' . $ this ->getName ();
547+
548+ // Add other options
549+ if (!empty ($ this ->otherOptions )) {
550+ foreach ($ this ->otherOptions as $ option => $ value ) {
551+ $ url .= '& ' . $ option . '= ' . $ value ;
552+ }
553+ }
554+ }
555+
556+ return $ url ;
557+
558+ }
559+
524560 /**
525561 * @return string
526562 */
You can’t perform that action at this time.
0 commit comments