def METHOD_NAME(self, location_name: str, operation_id: str, **kwargs: Any) -> Optional[_models.MediaService]:
    """Get operation result.
    Get media service operation result.
    :param location_name: Location name. Required.
    :type location_name: str
    :param operation_id: Operation Id. Required.
    :type operation_id: str
    :keyword callable cls: A custom type or function that will be passed the direct response
    :return: MediaService or None or the result of cls(response)
    :rtype: ~azure.mgmt.media.models.MediaService or None
    :raises ~azure.core.exceptions.HttpResponseError:
    """
    error_map = {
        401: ClientAuthenticationError,
        404: ResourceNotFoundError,
        409: ResourceExistsError,
        304: ResourceNotModifiedError,
    }
    error_map.update(kwargs.pop("error_map", {}) or {})
    _headers = kwargs.pop("headers", {}) or {}
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
    api_version: Literal["2021-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01"))
    cls: ClsType[Optional[_models.MediaService]] = kwargs.pop("cls", None)
    request = build_get_request(
        location_name=location_name,
        operation_id=operation_id,
        subscription_id=self._config.subscription_id,
        api_version=api_version,
        template_url=self.METHOD_NAME.metadata["url"],
        headers=_headers,
        params=_params,
    )
    request = _convert_request(request)
    request.url = self._client.format_url(request.url)
    pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
        request, stream=False, **kwargs
    )
    response = pipeline_response.http_response
    if response.status_code not in [200, 202]:
        map_error(status_code=response.status_code, response=response, error_map=error_map)
        error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
        raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
    deserialized = None
    response_headers = {}
    if response.status_code == 200:
        deserialized = self._deserialize("MediaService", pipeline_response)
    if response.status_code == 202:
        response_headers["Retry-After"] = self._deserialize("int", response.headers.METHOD_NAME("Retry-After"))
        response_headers["Location"] = self._deserialize("str", response.headers.METHOD_NAME("Location"))
        response_headers["Azure-AsyncOperation"] = self._deserialize(
            "str", response.headers.METHOD_NAME("Azure-AsyncOperation")
        )
    if cls:
        return cls(pipeline_response, deserialized, response_headers)
    return deserialized