// *** 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.extensions.v1beta1.outputs;

import com.pulumi.core.Either;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.kubernetes.core.v1.outputs.TypedLocalObjectReferencePatch;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class IngressBackendPatch {
    /**
     * @return Resource is an ObjectRef to another Kubernetes resource in the namespace of the Ingress object. If resource is specified, serviceName and servicePort must not be specified.
     * 
     */
    private @Nullable TypedLocalObjectReferencePatch resource;
    /**
     * @return Specifies the name of the referenced service.
     * 
     */
    private @Nullable String serviceName;
    /**
     * @return Specifies the port of the referenced service.
     * 
     */
    private @Nullable Either<Integer,String> servicePort;

    private IngressBackendPatch() {}
    /**
     * @return Resource is an ObjectRef to another Kubernetes resource in the namespace of the Ingress object. If resource is specified, serviceName and servicePort must not be specified.
     * 
     */
    public Optional<TypedLocalObjectReferencePatch> resource() {
        return Optional.ofNullable(this.resource);
    }
    /**
     * @return Specifies the name of the referenced service.
     * 
     */
    public Optional<String> serviceName() {
        return Optional.ofNullable(this.serviceName);
    }
    /**
     * @return Specifies the port of the referenced service.
     * 
     */
    public Optional<Either<Integer,String>> servicePort() {
        return Optional.ofNullable(this.servicePort);
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(IngressBackendPatch defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable TypedLocalObjectReferencePatch resource;
        private @Nullable String serviceName;
        private @Nullable Either<Integer,String> servicePort;
        public Builder() {}
        public Builder(IngressBackendPatch defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.resource = defaults.resource;
    	      this.serviceName = defaults.serviceName;
    	      this.servicePort = defaults.servicePort;
        }

        @CustomType.Setter
        public Builder resource(@Nullable TypedLocalObjectReferencePatch resource) {
            this.resource = resource;
            return this;
        }
        @CustomType.Setter
        public Builder serviceName(@Nullable String serviceName) {
            this.serviceName = serviceName;
            return this;
        }
        @CustomType.Setter
        public Builder servicePort(@Nullable Either<Integer,String> servicePort) {
            this.servicePort = servicePort;
            return this;
        }
        public IngressBackendPatch build() {
            final var o = new IngressBackendPatch();
            o.resource = resource;
            o.serviceName = serviceName;
            o.servicePort = servicePort;
            return o;
        }
    }
}
