code: def as_text(self, is_pretty=False):
          
          values = {
              'type': self._type,
              self.SERVICE_ENDPOINT: self._service_endpoint,
          }
          if self._consume_endpoint is not None:
              values[self.CONSUME_ENDPOINT] = self._consume_endpoint
          if self._values:
              # add extra service values to the dictionary
              for name, value in self._values.items():
                  values[name] = value
  
          if is_pretty:
              return json.dumps(values, indent=4, separators=(',', ': '))
  
          return json.dumps(values)
docs: Return the service as a JSON string.