code: def get_extension_by_id(self, extension_id, version=None, flags=None):
          
          route_values = {}
          if extension_id is not None:
              route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str')
          query_parameters = {}
          if version is not None:
              query_parameters['version'] = self._serialize.query('version', version, 'str')
          if flags is not None:
              query_parameters['flags'] = self._serialize.query('flags', flags, 'str')
          response = self._send(http_method='GET',
                                location_id='a41192c8-9525-4b58-bc86-179fa549d80d',
                                version='5.0-preview.2',
                                route_values=route_values,
                                query_parameters=query_parameters)
          return self._deserialize('PublishedExtension', response)
docs: GetExtensionById.
          [Preview API]
          :param str extension_id:
          :param str version:
          :param str flags:
          :rtype: :class:`<PublishedExtension> <azure.devops.v5_0.gallery.models.PublishedExtension>`