// *** 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.RouteSpecGrpcRouteMatchMetadata;
import com.pulumi.core.annotations.CustomType;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class RouteSpecGrpcRouteMatch {
    /**
     * @return Data to match from the gRPC request.
     * 
     */
    private @Nullable List<RouteSpecGrpcRouteMatchMetadata> metadatas;
    /**
     * @return Method name to match from the request. If you specify a name, you must also specify a `service_name`.
     * 
     */
    private @Nullable String methodName;
    /**
     * @return The port number to match from the request.
     * 
     */
    private @Nullable Integer port;
    /**
     * @return Value sent by the client must begin with the specified characters. Must be between 1 and 255 characters in length.
     * This parameter must always start with /, which by itself matches all requests to the virtual router service name.
     * 
     */
    private @Nullable String prefix;
    /**
     * @return Fully qualified domain name for the service to match from the request.
     * 
     */
    private @Nullable String serviceName;

    private RouteSpecGrpcRouteMatch() {}
    /**
     * @return Data to match from the gRPC request.
     * 
     */
    public List<RouteSpecGrpcRouteMatchMetadata> metadatas() {
        return this.metadatas == null ? List.of() : this.metadatas;
    }
    /**
     * @return Method name to match from the request. If you specify a name, you must also specify a `service_name`.
     * 
     */
    public Optional<String> methodName() {
        return Optional.ofNullable(this.methodName);
    }
    /**
     * @return The port number to match from the request.
     * 
     */
    public Optional<Integer> port() {
        return Optional.ofNullable(this.port);
    }
    /**
     * @return Value sent by the client must begin with the specified characters. Must be between 1 and 255 characters in length.
     * This parameter must always start with /, which by itself matches all requests to the virtual router service name.
     * 
     */
    public Optional<String> prefix() {
        return Optional.ofNullable(this.prefix);
    }
    /**
     * @return Fully qualified domain name for the service to match from the request.
     * 
     */
    public Optional<String> serviceName() {
        return Optional.ofNullable(this.serviceName);
    }

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

    public static Builder builder(RouteSpecGrpcRouteMatch defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable List<RouteSpecGrpcRouteMatchMetadata> metadatas;
        private @Nullable String methodName;
        private @Nullable Integer port;
        private @Nullable String prefix;
        private @Nullable String serviceName;
        public Builder() {}
        public Builder(RouteSpecGrpcRouteMatch defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.metadatas = defaults.metadatas;
    	      this.methodName = defaults.methodName;
    	      this.port = defaults.port;
    	      this.prefix = defaults.prefix;
    	      this.serviceName = defaults.serviceName;
        }

        @CustomType.Setter
        public Builder metadatas(@Nullable List<RouteSpecGrpcRouteMatchMetadata> metadatas) {
            this.metadatas = metadatas;
            return this;
        }
        public Builder metadatas(RouteSpecGrpcRouteMatchMetadata... metadatas) {
            return metadatas(List.of(metadatas));
        }
        @CustomType.Setter
        public Builder methodName(@Nullable String methodName) {
            this.methodName = methodName;
            return this;
        }
        @CustomType.Setter
        public Builder port(@Nullable Integer port) {
            this.port = port;
            return this;
        }
        @CustomType.Setter
        public Builder prefix(@Nullable String prefix) {
            this.prefix = prefix;
            return this;
        }
        @CustomType.Setter
        public Builder serviceName(@Nullable String serviceName) {
            this.serviceName = serviceName;
            return this;
        }
        public RouteSpecGrpcRouteMatch build() {
            final var o = new RouteSpecGrpcRouteMatch();
            o.metadatas = metadatas;
            o.methodName = methodName;
            o.port = port;
            o.prefix = prefix;
            o.serviceName = serviceName;
            return o;
        }
    }
}
