// *** 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.aws.appmesh.outputs;

import com.pulumi.aws.appmesh.outputs.RouteSpecGrpcRoute;
import com.pulumi.aws.appmesh.outputs.RouteSpecHttp2Route;
import com.pulumi.aws.appmesh.outputs.RouteSpecHttpRoute;
import com.pulumi.aws.appmesh.outputs.RouteSpecTcpRoute;
import com.pulumi.core.annotations.CustomType;
import java.lang.Integer;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class RouteSpec {
    /**
     * @return GRPC routing information for the route.
     * 
     */
    private @Nullable RouteSpecGrpcRoute grpcRoute;
    /**
     * @return HTTP/2 routing information for the route.
     * 
     */
    private @Nullable RouteSpecHttp2Route http2Route;
    /**
     * @return HTTP routing information for the route.
     * 
     */
    private @Nullable RouteSpecHttpRoute httpRoute;
    /**
     * @return Priority for the route, between `0` and `1000`.
     * Routes are matched based on the specified value, where `0` is the highest priority.
     * 
     */
    private @Nullable Integer priority;
    /**
     * @return TCP routing information for the route.
     * 
     */
    private @Nullable RouteSpecTcpRoute tcpRoute;

    private RouteSpec() {}
    /**
     * @return GRPC routing information for the route.
     * 
     */
    public Optional<RouteSpecGrpcRoute> grpcRoute() {
        return Optional.ofNullable(this.grpcRoute);
    }
    /**
     * @return HTTP/2 routing information for the route.
     * 
     */
    public Optional<RouteSpecHttp2Route> http2Route() {
        return Optional.ofNullable(this.http2Route);
    }
    /**
     * @return HTTP routing information for the route.
     * 
     */
    public Optional<RouteSpecHttpRoute> httpRoute() {
        return Optional.ofNullable(this.httpRoute);
    }
    /**
     * @return Priority for the route, between `0` and `1000`.
     * Routes are matched based on the specified value, where `0` is the highest priority.
     * 
     */
    public Optional<Integer> priority() {
        return Optional.ofNullable(this.priority);
    }
    /**
     * @return TCP routing information for the route.
     * 
     */
    public Optional<RouteSpecTcpRoute> tcpRoute() {
        return Optional.ofNullable(this.tcpRoute);
    }

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

    public static Builder builder(RouteSpec defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable RouteSpecGrpcRoute grpcRoute;
        private @Nullable RouteSpecHttp2Route http2Route;
        private @Nullable RouteSpecHttpRoute httpRoute;
        private @Nullable Integer priority;
        private @Nullable RouteSpecTcpRoute tcpRoute;
        public Builder() {}
        public Builder(RouteSpec defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.grpcRoute = defaults.grpcRoute;
    	      this.http2Route = defaults.http2Route;
    	      this.httpRoute = defaults.httpRoute;
    	      this.priority = defaults.priority;
    	      this.tcpRoute = defaults.tcpRoute;
        }

        @CustomType.Setter
        public Builder grpcRoute(@Nullable RouteSpecGrpcRoute grpcRoute) {
            this.grpcRoute = grpcRoute;
            return this;
        }
        @CustomType.Setter
        public Builder http2Route(@Nullable RouteSpecHttp2Route http2Route) {
            this.http2Route = http2Route;
            return this;
        }
        @CustomType.Setter
        public Builder httpRoute(@Nullable RouteSpecHttpRoute httpRoute) {
            this.httpRoute = httpRoute;
            return this;
        }
        @CustomType.Setter
        public Builder priority(@Nullable Integer priority) {
            this.priority = priority;
            return this;
        }
        @CustomType.Setter
        public Builder tcpRoute(@Nullable RouteSpecTcpRoute tcpRoute) {
            this.tcpRoute = tcpRoute;
            return this;
        }
        public RouteSpec build() {
            final var o = new RouteSpec();
            o.grpcRoute = grpcRoute;
            o.http2Route = http2Route;
            o.httpRoute = httpRoute;
            o.priority = priority;
            o.tcpRoute = tcpRoute;
            return o;
        }
    }
}
