org.cdk8s.Yaml Maven / Gradle / Ivy
Show all versions of cdk8s Show documentation
package org.cdk8s;
/**
* YAML utilities.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.88.0 (build eaabd08)", date = "2023-09-04T06:16:31.566Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = org.cdk8s.$Module.class, fqn = "cdk8s.Yaml")
public class Yaml extends software.amazon.jsii.JsiiObject {
protected Yaml(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected Yaml(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @deprecated use stringify(doc[, doc, ...])
* @param docs This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public static @org.jetbrains.annotations.NotNull java.lang.String formatObjects(final @org.jetbrains.annotations.NotNull java.util.List extends java.lang.Object> docs) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.Yaml.class, "formatObjects", software.amazon.jsii.NativeType.forClass(java.lang.String.class), new Object[] { java.util.Objects.requireNonNull(docs, "docs is required") });
}
/**
* Downloads a set of YAML documents (k8s manifest for example) from a URL or a file and returns them as javascript objects.
*
* Empty documents are filtered out.
*
* @return an array of objects, each represents a document inside the YAML
* @param urlOrFile a URL of a file path to load from. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static @org.jetbrains.annotations.NotNull java.util.List load(final @org.jetbrains.annotations.NotNull java.lang.String urlOrFile) {
return java.util.Collections.unmodifiableList(software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.Yaml.class, "load", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class)), new Object[] { java.util.Objects.requireNonNull(urlOrFile, "urlOrFile is required") }));
}
/**
* Saves a set of objects as a multi-document YAML file.
*
* @param filePath The output path. This parameter is required.
* @param docs The set of objects. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static void save(final @org.jetbrains.annotations.NotNull java.lang.String filePath, final @org.jetbrains.annotations.NotNull java.util.List extends java.lang.Object> docs) {
software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.Yaml.class, "save", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(filePath, "filePath is required"), java.util.Objects.requireNonNull(docs, "docs is required") });
}
/**
* Stringify a document (or multiple documents) into YAML.
*
* We convert undefined values to null, but ignore any documents that are
* undefined.
*
* @return a YAML string. Multiple docs are separated by ---
.
* @param docs A set of objects to convert to YAML. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static @org.jetbrains.annotations.NotNull java.lang.String stringify(final @org.jetbrains.annotations.NotNull java.lang.Object... docs) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.Yaml.class, "stringify", software.amazon.jsii.NativeType.forClass(java.lang.String.class), java.util.Arrays.