@staticmethod
def convert_duration_to_string(duration):
    """Convert a duration object to a duration string (in seconds).

        Args:
            duration (dict): Duration dictionary.

        Returns:
            str: Duration string.
        """
    duration_seconds = 0.0
    if 'seconds' in duration:
        duration_seconds += duration['seconds']
    if 'nanos' in duration:
        duration_seconds += duration['nanos'] * 10 ** -9
    if duration_seconds.is_integer():
        duration_str = int(duration_seconds)
    else:
        duration_str = '{:0.3f}'.format(duration_seconds)
    return str(duration_str) + 's'
