001/*
002 * Copyright 2017-2024 original authors
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package io.micronaut.maven.jib;
017
018import java.util.List;
019import java.util.Optional;
020import java.util.Set;
021
022/**
023 * Represents the Jib plugin configuration.
024 *
025 * @param from The from configuration.
026 * @param to The to configuration.
027 * @param container The container configuration.
028 * @since 4.7.0
029 */
030public record JibConfiguration(Optional<FromConfiguration> from, Optional<ToConfiguration> to, Optional<ContainerConfiguration> container) {
031
032    /**
033     * Represents the authentication configuration.
034     *
035     * @param username The username.
036     * @param password The password.
037     */
038    public record AuthConfiguration(Optional<String> username, Optional<String> password) { }
039
040    /**
041     * Represents the from configuration.
042     *
043     * @param image The image.
044     * @param auth The authentication configuration.
045     */
046    public record FromConfiguration(Optional<String> image, Optional<AuthConfiguration> auth) { }
047
048    /**
049     * Represents the to configuration.
050     *
051     * @param image The image.
052     * @param tags The tags.
053     * @param auth The authentication configuration.
054     */
055    public record ToConfiguration(Optional<String> image, Set<String> tags, Optional<AuthConfiguration> auth) { }
056
057    /**
058     * Represents the container configuration.
059     *
060     * @param workingDirectory The working directory.
061     * @param ports The ports.
062     * @param args The arguments.
063     * @param labels The labels.
064     */
065    public record ContainerConfiguration(Optional<String> workingDirectory, Set<String> ports, List<String> args, Set<String> labels) { }
066}