encode method

void encode(
  1. KeyedArchive object
)
override

Implementation

void encode(KeyedArchive object) {
  super.encode(object);

  object.encode("type", type);
  object.encode("description", description);

  if (type == "basic") {
    /* nothing to do */
  } else if (type == "apiKey") {
    object.encode("name", apiKeyName);
    object.encode("in", APIParameterLocationCodec.encode(apiKeyLocation!));
  } else if (type == "oauth2") {
    object.encode("flow", APISecuritySchemeFlowCodec.encode(oauthFlow!));

    object.encode("authorizationUrl", authorizationURL);
    object.encode("tokenUrl", tokenURL);
    object.encode("scopes", scopes);
  }
}