All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.kubernetes.admissionregistration.v1.outputs.RuleWithOperationsPatch Maven / Gradle / Ivy

There is a newer version: 4.19.0-alpha.1730750641
Show newest version
// *** 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.v1.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 RuleWithOperationsPatch {
    /**
     * @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 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 RuleWithOperationsPatch() {}
    /**
     * @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 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(RuleWithOperationsPatch 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 resources;
        private @Nullable String scope;
        public Builder() {}
        public Builder(RuleWithOperationsPatch defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.apiGroups = defaults.apiGroups;
    	      this.apiVersions = defaults.apiVersions;
    	      this.operations = defaults.operations;
    	      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 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 RuleWithOperationsPatch build() {
            final var _resultValue = new RuleWithOperationsPatch();
            _resultValue.apiGroups = apiGroups;
            _resultValue.apiVersions = apiVersions;
            _resultValue.operations = operations;
            _resultValue.resources = resources;
            _resultValue.scope = scope;
            return _resultValue;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy