code: public static OperationState await(MediaContract service, EntityWithOperationIdentifier entity) throws ServiceException {
          if (entity.hasOperationIdentifier()) {
              return await(service, entity.getOperationId());
          }
          return OperationState.Succeeded;
      }
docs: Awaits for an operation to be completed.
  
  @param service
  the media contract
  @param operation
  the operation id to wait for.
  @return the final state of the operation. If the entity has not operationId, returns OperationState.Succeeded.
  @throws ServiceException