src/Common/ServicesBuilder.php
public function createMediaServicesService(MediaServicesSettings $settings)
    {
        $httpClient = new HttpClient();
        $serializer = $this->serializer();
        $uri = Utilities::tryAddUrlScheme(
            $settings->getEndpointUri(),
            Resources::HTTPS_SCHEME
        );

        $mediaServicesWrapper = new MediaServicesRestProxy(
            $httpClient,
            $uri,
            Resources::EMPTY_STRING,
            $serializer
        );

        // Adding headers filter
        $xMSVersion = Resources::MEDIA_SERVICES_API_LATEST_VERSION;
        $dataVersion = Resources::MEDIA_SERVICES_DATA_SERVICE_VERSION_VALUE;
        $dataMaxVersion = Resources::MEDIA_SERVICES_MAX_DATA_SERVICE_VERSION_VALUE;
        $accept = Resources::ACCEPT_HEADER_VALUE;
        $contentType = Resources::ATOM_ENTRY_CONTENT_TYPE;

        $headers = [
            Resources::X_MS_VERSION => $xMSVersion,
            Resources::DATA_SERVICE_VERSION => $dataVersion,
            Resources::MAX_DATA_SERVICE_VERSION => $dataMaxVersion,
            Resources::ACCEPT_HEADER => $accept,
            Resources::CONTENT_TYPE => $contentType,
        ];

        $headersFilter = new HeadersFilter($headers);
        $mediaServicesWrapper = $mediaServicesWrapper->withFilter($headersFilter);

        // Adding Azure Active Directory Authentication filter
        $authenticationFilter = new AuthenticationFilter($settings->getTokenProvider());
        $mediaServicesWrapper = $mediaServicesWrapper->withFilter(
            $authenticationFilter
        );

        return $mediaServicesWrapper;
    }
public function createMediaServicesService(MediaServicesSettings $settings)
    {
        $httpClient = new HttpClient();
        $serializer = $this->serializer();
        $uri = Utilities::tryAddUrlScheme(
            $settings->getEndpointUri(),
            Resources::HTTPS_SCHEME
        );

        $mediaServicesWrapper = new MediaServicesRestProxy(
            $httpClient,
            $uri,
            Resources::EMPTY_STRING,
            $serializer
        );

        // Adding headers filter
        $xMSVersion = Resources::MEDIA_SERVICES_API_LATEST_VERSION;
        $dataVersion = Resources::MEDIA_SERVICES_DATA_SERVICE_VERSION_VALUE;
        $dataMaxVersion = Resources::MEDIA_SERVICES_MAX_DATA_SERVICE_VERSION_VALUE;
        $accept = Resources::ACCEPT_HEADER_VALUE;
        $contentType = Resources::ATOM_ENTRY_CONTENT_TYPE;

        $headers = [
            Resources::X_MS_VERSION => $xMSVersion,
            Resources::DATA_SERVICE_VERSION => $dataVersion,
            Resources::MAX_DATA_SERVICE_VERSION => $dataMaxVersion,
            Resources::ACCEPT_HEADER => $accept,
            Resources::CONTENT_TYPE => $contentType,
        ];

        $headersFilter = new HeadersFilter($headers);
        $mediaServicesWrapper = $mediaServicesWrapper->withFilter($headersFilter);

        // Adding Azure Active Directory Authentication filter
        $authenticationFilter = new AuthenticationFilter($settings->getTokenProvider());
        $mediaServicesWrapper = $mediaServicesWrapper->withFilter(
            $authenticationFilter
        );

        return $mediaServicesWrapper;
    }
public function createMediaServicesService ( MediaServicesSettings $ settings ) { $ httpClient = new HttpClient ( ) ; $ serializer = $ this -> serializer ( ) ; $ uri = Utilities :: tryAddUrlScheme ( $ settings -> getEndpointUri ( ) , Resources :: HTTPS_SCHEME ) ; $ mediaServicesWrapper = new MediaServicesRestProxy ( $ httpClient , $ uri , Resources :: EMPTY_STRING , $ serializer ) ; // Adding headers filter $ xMSVersion = Resources :: MEDIA_SERVICES_API_LATEST_VERSION ; $ dataVersion = Resources :: MEDIA_SERVICES_DATA_SERVICE_VERSION_VALUE ; $ dataMaxVersion = Resources :: MEDIA_SERVICES_MAX_DATA_SERVICE_VERSION_VALUE ; $ accept = Resources :: ACCEPT_HEADER_VALUE ; $ contentType = Resources :: ATOM_ENTRY_CONTENT_TYPE ; $ headers = [ Resources :: X_MS_VERSION => $ xMSVersion , Resources :: DATA_SERVICE_VERSION => $ dataVersion , Resources :: MAX_DATA_SERVICE_VERSION => $ dataMaxVersion , Resources :: ACCEPT_HEADER => $ accept , Resources :: CONTENT_TYPE => $ contentType , ] ; $ headersFilter = new HeadersFilter ( $ headers ) ; $ mediaServicesWrapper = $ mediaServicesWrapper -> withFilter ( $ headersFilter ) ; // Adding Azure Active Directory Authentication filter $ authenticationFilter = new AuthenticationFilter ( $ settings -> getTokenProvider ( ) ) ; $ mediaServicesWrapper = $ mediaServicesWrapper -> withFilter ( $ authenticationFilter ) ; return $ mediaServicesWrapper ; }
Builds a media services object.

@param MediaServicesSettings $settings The media services configuration settings

@return MediaServicesRestProxy
Builds a media services object .