use of org.eclipse.winery.model.tosca.yaml.tosca.datatypes.Credential in project winery by eclipse.
the class YamlWriter method visit.
public YamlPrinter visit(YTRepositoryDefinition node, Parameter parameter) {
YamlPrinter printer = new YamlPrinter(parameter.getIndent()).printKeyValue(YamlSpecKeywords.DESCRIPTION, node.getDescription()).printKeyValue(YamlSpecKeywords.URL, node.getUrl());
if (Objects.nonNull(node.getCredential())) {
Credential credential = node.getCredential();
printer.printKey(YamlSpecKeywords.CREDENTIAL).indent(INDENT_SIZE).printKeyValue(YamlSpecKeywords.PROTOCOL, credential.getProtocol()).printKeyValue(YamlSpecKeywords.TOKEN_TYPE, credential.getTokenType()).printKeyValue(YamlSpecKeywords.TOKEN, credential.getToken()).printKeyObject(YamlSpecKeywords.KEYS, credential.getKeys()).printKeyValue(YamlSpecKeywords.USER, credential.getUser()).indent(-INDENT_SIZE);
}
return printer;
}
use of org.eclipse.winery.model.tosca.yaml.tosca.datatypes.Credential in project winery by eclipse.
the class Writer method visit.
public Printer visit(TRepositoryDefinition node, Parameter parameter) {
Printer printer = new Printer(parameter.getIndent()).printKeyValue("description", node.getDescription()).printKeyValue("url", node.getUrl());
if (Objects.nonNull(node.getCredential())) {
Credential credential = node.getCredential();
printer.printKey("credential").indent(INDENT_SIZE).printKeyValue("protocol", credential.getProtocol()).printKeyValue("token_type", credential.getTokenType()).printKeyValue("token", credential.getToken()).printKeyObject("keys", credential.getKeys()).printKeyValue("user", credential.getUser()).indent(-INDENT_SIZE);
}
return printer;
}
Aggregations