Search in sources :

Example 1 with Credential

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;
}
Also used : Credential(org.eclipse.winery.model.tosca.yaml.tosca.datatypes.Credential)

Example 2 with Credential

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;
}
Also used : Credential(org.eclipse.winery.model.tosca.yaml.tosca.datatypes.Credential) Printer(org.eclipse.winery.yaml.common.writer.yaml.support.Printer)

Aggregations

Credential (org.eclipse.winery.model.tosca.yaml.tosca.datatypes.Credential)2 Printer (org.eclipse.winery.yaml.common.writer.yaml.support.Printer)1