com.pulumi.kubernetes.admissionregistration.v1beta1.outputs.NamedRuleWithOperations Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kubernetes Show documentation
Show all versions of kubernetes Show documentation
A Pulumi package for creating and managing Kubernetes resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.kubernetes.admissionregistration.v1beta1.outputs;
import com.pulumi.core.annotations.CustomType;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class NamedRuleWithOperations {
/**
* @return APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required.
*
*/
private @Nullable List apiGroups;
/**
* @return APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required.
*
*/
private @Nullable List apiVersions;
/**
* @return Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required.
*
*/
private @Nullable List operations;
/**
* @return ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
*
*/
private @Nullable List resourceNames;
/**
* @return Resources is a list of resources this rule applies to.
*
* For example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*{@literal /}scale' means all scale subresources. '*{@literal /}*' means all resources and their subresources.
*
* If wildcard is present, the validation rule will ensure resources do not overlap with each other.
*
* Depending on the enclosing object, subresources might not be allowed. Required.
*
*/
private @Nullable List resources;
/**
* @return scope specifies the scope of this rule. Valid values are "Cluster", "Namespaced", and "*" "Cluster" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. "Namespaced" means that only namespaced resources will match this rule. "*" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is "*".
*
*/
private @Nullable String scope;
private NamedRuleWithOperations() {}
/**
* @return APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required.
*
*/
public List apiGroups() {
return this.apiGroups == null ? List.of() : this.apiGroups;
}
/**
* @return APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required.
*
*/
public List apiVersions() {
return this.apiVersions == null ? List.of() : this.apiVersions;
}
/**
* @return Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required.
*
*/
public List operations() {
return this.operations == null ? List.of() : this.operations;
}
/**
* @return ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
*
*/
public List resourceNames() {
return this.resourceNames == null ? List.of() : this.resourceNames;
}
/**
* @return Resources is a list of resources this rule applies to.
*
* For example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*{@literal /}scale' means all scale subresources. '*{@literal /}*' means all resources and their subresources.
*
* If wildcard is present, the validation rule will ensure resources do not overlap with each other.
*
* Depending on the enclosing object, subresources might not be allowed. Required.
*
*/
public List resources() {
return this.resources == null ? List.of() : this.resources;
}
/**
* @return scope specifies the scope of this rule. Valid values are "Cluster", "Namespaced", and "*" "Cluster" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. "Namespaced" means that only namespaced resources will match this rule. "*" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is "*".
*
*/
public Optional scope() {
return Optional.ofNullable(this.scope);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(NamedRuleWithOperations defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable List apiGroups;
private @Nullable List apiVersions;
private @Nullable List operations;
private @Nullable List resourceNames;
private @Nullable List resources;
private @Nullable String scope;
public Builder() {}
public Builder(NamedRuleWithOperations defaults) {
Objects.requireNonNull(defaults);
this.apiGroups = defaults.apiGroups;
this.apiVersions = defaults.apiVersions;
this.operations = defaults.operations;
this.resourceNames = defaults.resourceNames;
this.resources = defaults.resources;
this.scope = defaults.scope;
}
@CustomType.Setter
public Builder apiGroups(@Nullable List apiGroups) {
this.apiGroups = apiGroups;
return this;
}
public Builder apiGroups(String... apiGroups) {
return apiGroups(List.of(apiGroups));
}
@CustomType.Setter
public Builder apiVersions(@Nullable List apiVersions) {
this.apiVersions = apiVersions;
return this;
}
public Builder apiVersions(String... apiVersions) {
return apiVersions(List.of(apiVersions));
}
@CustomType.Setter
public Builder operations(@Nullable List operations) {
this.operations = operations;
return this;
}
public Builder operations(String... operations) {
return operations(List.of(operations));
}
@CustomType.Setter
public Builder resourceNames(@Nullable List resourceNames) {
this.resourceNames = resourceNames;
return this;
}
public Builder resourceNames(String... resourceNames) {
return resourceNames(List.of(resourceNames));
}
@CustomType.Setter
public Builder resources(@Nullable List resources) {
this.resources = resources;
return this;
}
public Builder resources(String... resources) {
return resources(List.of(resources));
}
@CustomType.Setter
public Builder scope(@Nullable String scope) {
this.scope = scope;
return this;
}
public NamedRuleWithOperations build() {
final var _resultValue = new NamedRuleWithOperations();
_resultValue.apiGroups = apiGroups;
_resultValue.apiVersions = apiVersions;
_resultValue.operations = operations;
_resultValue.resourceNames = resourceNames;
_resultValue.resources = resources;
_resultValue.scope = scope;
return _resultValue;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy