See Also: registerResponse()

        Args:
          node:
          vendorSpecific:

        Returns:
494106
def register(self, node, vendorSpecific=None):
        
        response = self.registerResponse(node, vendorSpecific)
        return self._read_boolean_response(response)
845929
function register(app, targetEndpoint) {
  var builder = new Builder(app, targetEndpoint);

  // create and update APIs
  app.put('/apiql/apis/:name', bodyParsers(), function (req, res, done) {
    builder.buildAPI(req.params.name, req.headers['content-type'], req.body, function (err) {
      if (err) {
        res.sendStatus(400);
      } else {
        res.sendStatus(204);
      }
      done();
    });
  });

  app.get('/apiql/apis', function (req, res, done) {
    API.listAPIs(function (err, apis) {
      if (err) {
        console.log(err);
      }
      res.format({
        json: function () {
          res.json({ items: _.map(apis, (api) => api.toJson()) }); // returns empty array even with error
        },
        default: function () {
          res.sendStatus(406);
        }
      });
      done();
    });
  });

  app.get('/apiql/apis/:name', function (req, res, done) {
    API.findByName(req.params.name, function (err, api) {
      if (err) {
        res.sendStatus(404);
      } else {
        res.format({
          html: function () {
            res.send(docs({ name: req.params.name, description: api.description }));
          },
          json: function () {
            res.json(api.toJson());
          },
          'application/openapi+json': function () {
            res.json(api.formattedDescription(OPENAPI_JSON));
          },
          'application/openapi+yaml': function () {
            res.send(api.formattedDescription(OPENAPI_YAML));
          },
          default: function () {
            res.sendStatus(406);
          }
        });
      }
      done();
    });
  });

  app.delete('/apiql/apis/:name', function (req, res, done) {
    builder.removeExistingAPI(req.params.name)(function (err) {
      if (err) {
        if (err.message == NOT_FOUND) {
          res.sendStatus(404);
        } else {
          res.status(500).send(err.message);
        }
      } else {
        res.sendStatus(204); // return the deleted item
      }
      done();
    });
  });

  // returns apiql OpenApi 3.0 API Description document or rendered documentation via conneg
  app.get('/apiql/api-description', function (req, res, done) {
    var description;

    try {
      description = yaml.safeLoad(fs.readFileSync(descriptionFilePath, 'utf8'));
    } catch (err) {
      console.log(err);
      res.status(500).send(err.message);
    }

    res.format({
      html: function () {
        res.send(docs({ name: 'APIQL Docs', description: description }));
      },
      'application/openapi+json': function () {
        res.send(description);
      },
      'application/openapi+yaml': function () {
        res.send(yaml.safeDump(description));
      },
      default: function () {
        res.sendStatus(406);
      }
    });
    done();
  });
}
733513
def denyMapIdentity(self, subject, vendorSpecific=None):
        
        response = self.denyMapIdentityResponse(subject, vendorSpecific)
        return self._read_boolean_response(response)
361595
def register(subject, schema, **params)
      lookup_subject_schema(subject, schema)
    rescue Excon::Errors::NotFound
      register_without_lookup(subject, schema, params)
    end
654451
async def certify(client: Client, certification_signed_raw: str) -> ClientResponse:
    
    return await client.post(MODULE + '/certify', {'cert': certification_signed_raw}, rtype=RESPONSE_AIOHTTP)
996010
def handleResponse(self, response):
        
        requestId = KafkaCodec.get_response_correlation_id(response)
        # Protect against responses coming back we didn't expect
        tReq = self.requests.pop(requestId, None)
        if tReq is None:
            # This could happen if we've sent it, are waiting on the response
            # when it's cancelled, causing us to remove it from self.requests
            log.warning('Unexpected response with correlationId=%d: %r',
                        requestId, reprlib.repr(response))
        else:
            tReq.d.callback(response)
366230
def vendor_id(self, vendor_id):
        
        if vendor_id is not None and len(vendor_id) > 255:
            raise ValueError("Invalid value for `vendor_id`, length must be less than or equal to `255`")

        self._vendor_id = vendor_id
1071070
protected void registerResponse(Swagger swagger, Operation operation, Return aReturn) {
        Response response = new Response();
        response.setDescription(translate(aReturn.descriptionKey(), aReturn.description()));

        Class<?> resultType = aReturn.onResult();
        if (Exception.class.isAssignableFrom(resultType)) {
            Property errorProperty = registerErrorModel(swagger);
            response.setSchema(errorProperty);
        } else if (Void.class != resultType) {
            // Return type
            if (resultType.isArray()) {
                // ARRAY[]
                Class<?> componentClass = resultType.getComponentType();
                ArrayProperty arrayProperty = new ArrayProperty();
                Property componentProperty = getSwaggerProperty(swagger, componentClass);
                arrayProperty.setItems(componentProperty);
                response.setSchema(arrayProperty);
            } else {
                // Object
                Property returnProperty = getSwaggerProperty(swagger, resultType);
                response.setSchema(returnProperty);
            }
        }

        for (Class<? extends ReturnHeader> returnHeader : aReturn.headers()) {
            Tag headerTag = getModelTag(returnHeader);
            ReturnHeader header = ClassUtil.newInstance(returnHeader);
            Property property = getSwaggerProperty(swagger, header.getHeaderType());
            if (property instanceof ArrayProperty) {
                // FIXME swagger-core has incomplete response header specification methods :(
                ArrayProperty arrayProperty = (ArrayProperty) property;
            }
            property.setName(headerTag.getName());
            property.setDescription(headerTag.getDescription());
            response.addHeader(property.getName(), property);
        }

        operation.response(aReturn.code(), response);
    }
1131709
def reserveIdentifier(self, pid, vendorSpecific=None):
        
        response = self.reserveIdentifierResponse(pid, vendorSpecific)
        return self._read_dataone_type_response(response, 'Identifier', vendorSpecific)
315520
def updateNodeCapabilities(self, nodeId, node, vendorSpecific=None):
        
        response = self.updateNodeCapabilitiesResponse(nodeId, node, vendorSpecific)
        return self._read_boolean_response(response)
1241604
def synchronizeResponse(self, pid, vendorSpecific=None):
        
        mmp_dict = {'pid': pid}
        return self.POST(['synchronize'], fields=mmp_dict, headers=vendorSpecific)
939404
def query(self, queryEngine, query=None, vendorSpecific=None, **kwargs):
        
        response = self.queryResponse(queryEngine, query, vendorSpecific, **kwargs)
        return self._read_stream_response(response)
1305933
def hasReservation(self, pid, subject, vendorSpecific=None):
        
        response = self.hasReservationResponse(pid, subject, vendorSpecific)
        return self._read_boolean_404_response(response)
256650
def register_request(self, valid_responses):
        
        uuid = str(uuid4())
        self._response[uuid] = []
        for action in valid_responses:
            self._request[action] = uuid
        return uuid
171190
function registerApi(isApp, apiObject) {

  if (isApp) {
    return function (req, res, next) {
      res.__api = apiObject;
      return next();
    };
  };
  
  return function (req, res, next) {
    res.__modelAPI = apiObject;
    return next();
  };
}
860675
def register_onRsp(self, req):
        
        def wrapper(_callback):
            callbackList = self._req_callbacks.setdefault(req, [])
            callbackList.append(_callback)
            return _callback
        return wrapper
1156892
def register(**kwargs):
    
    def decorator(func):
        _CALL_REGISTRY[kwargs.get(API_SYM, func.__name__)] = func
        return func

    return decorator