com.pulumi.digitalocean.outputs.AppSpecServiceImage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of digitalocean Show documentation
Show all versions of digitalocean Show documentation
A Pulumi package for creating and managing DigitalOcean cloud resources.
// *** 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.digitalocean.outputs;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.digitalocean.outputs.AppSpecServiceImageDeployOnPush;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class AppSpecServiceImage {
/**
* @return Configures automatically deploying images pushed to DOCR.
*
*/
private @Nullable List deployOnPushes;
/**
* @return The registry name. Must be left empty for the `DOCR` registry type. Required for the `DOCKER_HUB` registry type.
*
*/
private @Nullable String registry;
/**
* @return The credentials required to access a private Docker Hub or GitHub registry, in the following syntax `<username>:<token>`.
*
*/
private @Nullable String registryCredentials;
/**
* @return The registry type. One of `DOCR` (DigitalOcean container registry) or `DOCKER_HUB`.
*
*/
private String registryType;
/**
* @return The repository name.
*
*/
private String repository;
/**
* @return The repository tag. Defaults to `latest` if not provided.
*
*/
private @Nullable String tag;
private AppSpecServiceImage() {}
/**
* @return Configures automatically deploying images pushed to DOCR.
*
*/
public List deployOnPushes() {
return this.deployOnPushes == null ? List.of() : this.deployOnPushes;
}
/**
* @return The registry name. Must be left empty for the `DOCR` registry type. Required for the `DOCKER_HUB` registry type.
*
*/
public Optional registry() {
return Optional.ofNullable(this.registry);
}
/**
* @return The credentials required to access a private Docker Hub or GitHub registry, in the following syntax `<username>:<token>`.
*
*/
public Optional registryCredentials() {
return Optional.ofNullable(this.registryCredentials);
}
/**
* @return The registry type. One of `DOCR` (DigitalOcean container registry) or `DOCKER_HUB`.
*
*/
public String registryType() {
return this.registryType;
}
/**
* @return The repository name.
*
*/
public String repository() {
return this.repository;
}
/**
* @return The repository tag. Defaults to `latest` if not provided.
*
*/
public Optional tag() {
return Optional.ofNullable(this.tag);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(AppSpecServiceImage defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable List deployOnPushes;
private @Nullable String registry;
private @Nullable String registryCredentials;
private String registryType;
private String repository;
private @Nullable String tag;
public Builder() {}
public Builder(AppSpecServiceImage defaults) {
Objects.requireNonNull(defaults);
this.deployOnPushes = defaults.deployOnPushes;
this.registry = defaults.registry;
this.registryCredentials = defaults.registryCredentials;
this.registryType = defaults.registryType;
this.repository = defaults.repository;
this.tag = defaults.tag;
}
@CustomType.Setter
public Builder deployOnPushes(@Nullable List deployOnPushes) {
this.deployOnPushes = deployOnPushes;
return this;
}
public Builder deployOnPushes(AppSpecServiceImageDeployOnPush... deployOnPushes) {
return deployOnPushes(List.of(deployOnPushes));
}
@CustomType.Setter
public Builder registry(@Nullable String registry) {
this.registry = registry;
return this;
}
@CustomType.Setter
public Builder registryCredentials(@Nullable String registryCredentials) {
this.registryCredentials = registryCredentials;
return this;
}
@CustomType.Setter
public Builder registryType(String registryType) {
if (registryType == null) {
throw new MissingRequiredPropertyException("AppSpecServiceImage", "registryType");
}
this.registryType = registryType;
return this;
}
@CustomType.Setter
public Builder repository(String repository) {
if (repository == null) {
throw new MissingRequiredPropertyException("AppSpecServiceImage", "repository");
}
this.repository = repository;
return this;
}
@CustomType.Setter
public Builder tag(@Nullable String tag) {
this.tag = tag;
return this;
}
public AppSpecServiceImage build() {
final var _resultValue = new AppSpecServiceImage();
_resultValue.deployOnPushes = deployOnPushes;
_resultValue.registry = registry;
_resultValue.registryCredentials = registryCredentials;
_resultValue.registryType = registryType;
_resultValue.repository = repository;
_resultValue.tag = tag;
return _resultValue;
}
}
}