@Override public String toString() { return "Action{" + "type='" + type + '\'' + ", resource=" + (resource != null ? resource.getUri() : "-") + '}'; } }
public String message(String value) { if (type == null) { type = STRING; } return type.message(this, value); } }
static Usage.Action actionUsage(Usage usage, Action action) { return usage.resource(action.getResource().getUri()).action(action.getType().name()); }
public static String buildResourceMethodName(final Action action, final MimeType bodyMimeType) { final String methodBaseName = buildJavaFriendlyName(action.getResource() .getUri() .replace("{", " By ")); return action.getType().toString().toLowerCase() + buildMimeTypeInfix(bodyMimeType) + methodBaseName; }
private String actionString() { return new Message("action", action.getType(), action.getResource().getUri()).toString(); } }
/** * Create a placeholder {@link Action} associated with the given {@code Resource}, which is used to procreate an * AnyActionBuilder for the {@code Resource}. */ private static Action asAnyAction(final Resource resource) { final Action anyAction = new Action(); anyAction.setResource(resource); return anyAction; }
/** * Returns the name of the method for getting an {@link com.sap.cloud.yaas.rammler.commons.builder.ActionBuilder}, * e.g. " {@code prepareDelete}". * * @param ramlAction the action for which the method name should be built * @return the name of the method for getting the action builder */ public static String buildActionBuilderMethodName(final Action ramlAction) { if (ramlAction == null) { return null; } return "prepare" + buildName(ramlAction.getType() != null ? ramlAction.getType().toString() : "Any"); }
public void action(Action action) { this.resource = action.getResource(); this.action = action; requestMime = null; responseCode = null; responseMime = null; }
public Map<String, QueryParameter> queryParameters(SecurityScheme scheme) { return scheme.getDescribedBy() == null ? Collections.<String, QueryParameter>emptyMap() : scheme.getDescribedBy().getQueryParameters(); }
public Map<String, Header> headers(SecurityScheme scheme) { return scheme.getDescribedBy() == null ? Collections.<String, Header>emptyMap() : scheme.getDescribedBy().getHeaders(); }
public Map<String, Response> responses(SecurityScheme scheme) { return scheme.getDescribedBy() == null ? Collections.<String, Response>emptyMap() : scheme.getDescribedBy().getResponses(); }
private List<Protocol> findProtocols(Action action, String fallback) { List<Protocol> protocols = action.getProtocols(); if (protocols == null || protocols.isEmpty()) { protocols = config.raml.getProtocols(); } if (protocols == null || protocols.isEmpty()) { protocols = Collections.singletonList(Protocol.valueOf(fallback.toUpperCase(Locale.ENGLISH))); } return protocols; }
@Override public void check(SecurityScheme scheme, RamlViolations violations) { final SecuritySettings settings = scheme.getSettings(); violations.addIf(settings == null || settings.getRequestTokenUri() == null, "oauth10.requestTokenUri.missing"); violations.addIf(settings == null || settings.getAuthorizationUri() == null, "oauth10.authorizationUri.missing"); violations.addIf(settings == null || settings.getTokenCredentialsUri() == null, "oauth10.tokenCredentialsUri.missing"); } },
/** * <p>buildResourceMethodName.</p> * * @param action a {@link org.raml.model.Action} object. * @param bodyMimeType a {@link org.raml.model.MimeType} object. * @return a {@link java.lang.String} object. */ public static String buildResourceMethodName(final Action action, final MimeType bodyMimeType) { final String methodBaseName = buildJavaFriendlyName(action.getResource() .getUri() .replace("{", " By ")); return action.getType().toString().toLowerCase() + buildMimeTypeInfix(bodyMimeType) + methodBaseName; }
@Override public String toString() { return "Resource{displayName='" + displayName + '\'' + ", uri='" + (parentUri != null ? getUri() : "-") + "'}"; }
/** * Build a suitable Java type name for an {@link com.sap.cloud.yaas.rammler.commons.builder.ActionBuilder}, e.g. " * {@code GetActionBuilder}". * * @param ramlAction the RAML {@link Action} * @return a corresponding Java type name */ public static String buildActionBuilderName(final Action ramlAction) { return ramlAction != null ? buildName(ramlAction.getType().toString()) + "ActionBuilder" : null; }
public String message(String value) { if (type == null) { type = STRING; } return type.message(this, value); } }
@Override public String toString() { return "Action{" + "type='" + type + '\'' + ", resource=" + (resource != null ? resource.getUri() : "-") + '}'; } }
@Override public String toString() { return "Resource{displayName='" + displayName + '\'' + ", uri='" + (parentUri != null ? getUri() : "-") + "'}"; }