21
21
22
22
use Google \Cloud \TestUtils \EventuallyConsistentTestTrait ;
23
23
use Google \Cloud \TestUtils \TestTrait ;
24
- use Google \Cloud \Video \Stitcher \V1 \VideoStitcherServiceClient ;
24
+ use Google \Cloud \Video \Stitcher \V1 \Client \VideoStitcherServiceClient ;
25
+ use Google \Cloud \Video \Stitcher \V1 \DeleteCdnKeyRequest ;
26
+ use Google \Cloud \Video \Stitcher \V1 \DeleteLiveConfigRequest ;
27
+ use Google \Cloud \Video \Stitcher \V1 \DeleteSlateRequest ;
28
+ use Google \Cloud \Video \Stitcher \V1 \GetLiveSessionRequest ;
29
+ use Google \Cloud \Video \Stitcher \V1 \ListCdnKeysRequest ;
30
+ use Google \Cloud \Video \Stitcher \V1 \ListLiveConfigsRequest ;
31
+ use Google \Cloud \Video \Stitcher \V1 \ListSlatesRequest ;
25
32
use PHPUnit \Framework \TestCase ;
26
33
27
34
/**
@@ -577,7 +584,9 @@ public function testListLiveAdTagDetails()
577
584
578
585
$ stitcherClient = new VideoStitcherServiceClient ();
579
586
$ formattedName = $ stitcherClient ->liveSessionName (self ::$ projectId , self ::$ location , self ::$ liveSessionId );
580
- $ session = $ stitcherClient ->getLiveSession ($ formattedName );
587
+ $ getLiveSessionRequest = (new GetLiveSessionRequest ())
588
+ ->setName ($ formattedName );
589
+ $ session = $ stitcherClient ->getLiveSession ($ getLiveSessionRequest );
581
590
$ playUri = $ session ->getPlayUri ();
582
591
583
592
$ manifest = file_get_contents ($ playUri );
@@ -621,7 +630,9 @@ private static function deleteOldSlates(): void
621
630
{
622
631
$ stitcherClient = new VideoStitcherServiceClient ();
623
632
$ parent = $ stitcherClient ->locationName (self ::$ projectId , self ::$ location );
624
- $ response = $ stitcherClient ->listSlates ($ parent );
633
+ $ listSlatesRequest = (new ListSlatesRequest ())
634
+ ->setParent ($ parent );
635
+ $ response = $ stitcherClient ->listSlates ($ listSlatesRequest );
625
636
$ slates = $ response ->iterateAllElements ();
626
637
627
638
$ currentTime = time ();
@@ -634,7 +645,9 @@ private static function deleteOldSlates(): void
634
645
$ timestamp = intval (end ($ tmp ));
635
646
636
647
if ($ currentTime - $ timestamp >= $ oneHourInSecs ) {
637
- $ stitcherClient ->deleteSlate ($ slate ->getName ());
648
+ $ deleteSlateRequest = (new DeleteSlateRequest ())
649
+ ->setName ($ slate ->getName ());
650
+ $ stitcherClient ->deleteSlate ($ deleteSlateRequest );
638
651
}
639
652
}
640
653
}
@@ -643,7 +656,9 @@ private static function deleteOldCdnKeys(): void
643
656
{
644
657
$ stitcherClient = new VideoStitcherServiceClient ();
645
658
$ parent = $ stitcherClient ->locationName (self ::$ projectId , self ::$ location );
646
- $ response = $ stitcherClient ->listCdnKeys ($ parent );
659
+ $ listCdnKeysRequest = (new ListCdnKeysRequest ())
660
+ ->setParent ($ parent );
661
+ $ response = $ stitcherClient ->listCdnKeys ($ listCdnKeysRequest );
647
662
$ keys = $ response ->iterateAllElements ();
648
663
649
664
$ currentTime = time ();
@@ -656,7 +671,9 @@ private static function deleteOldCdnKeys(): void
656
671
$ timestamp = intval (end ($ tmp ));
657
672
658
673
if ($ currentTime - $ timestamp >= $ oneHourInSecs ) {
659
- $ stitcherClient ->deleteCdnKey ($ key ->getName ());
674
+ $ deleteCdnKeyRequest = (new DeleteCdnKeyRequest ())
675
+ ->setName ($ key ->getName ());
676
+ $ stitcherClient ->deleteCdnKey ($ deleteCdnKeyRequest );
660
677
}
661
678
}
662
679
}
@@ -665,7 +682,9 @@ private static function deleteOldLiveConfigs(): void
665
682
{
666
683
$ stitcherClient = new VideoStitcherServiceClient ();
667
684
$ parent = $ stitcherClient ->locationName (self ::$ projectId , self ::$ location );
668
- $ response = $ stitcherClient ->listLiveConfigs ($ parent );
685
+ $ listLiveConfigsRequest = (new ListLiveConfigsRequest ())
686
+ ->setParent ($ parent );
687
+ $ response = $ stitcherClient ->listLiveConfigs ($ listLiveConfigsRequest );
669
688
$ liveConfigs = $ response ->iterateAllElements ();
670
689
671
690
$ currentTime = time ();
@@ -678,7 +697,9 @@ private static function deleteOldLiveConfigs(): void
678
697
$ timestamp = intval (end ($ tmp ));
679
698
680
699
if ($ currentTime - $ timestamp >= $ oneHourInSecs ) {
681
- $ stitcherClient ->deleteLiveConfig ($ liveConfig ->getName ());
700
+ $ deleteLiveConfigRequest = (new DeleteLiveConfigRequest ())
701
+ ->setName ($ liveConfig ->getName ());
702
+ $ stitcherClient ->deleteLiveConfig ($ deleteLiveConfigRequest );
682
703
}
683
704
}
684
705
}
0 commit comments