FileTaskRunRequest.java
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.containerregistry.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;
/** The request parameters for a scheduling run against a task file. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("FileTaskRunRequest")
@Fluent
public final class FileTaskRunRequest extends RunRequest {
@JsonIgnore private final ClientLogger logger = new ClientLogger(FileTaskRunRequest.class);
/*
* The template/definition file path relative to the source.
*/
@JsonProperty(value = "taskFilePath", required = true)
private String taskFilePath;
/*
* The values/parameters file path relative to the source.
*/
@JsonProperty(value = "valuesFilePath")
private String valuesFilePath;
/*
* The collection of overridable values that can be passed when running a
* task.
*/
@JsonProperty(value = "values")
private List<SetValue> values;
/*
* Run timeout in seconds.
*/
@JsonProperty(value = "timeout")
private Integer timeout;
/*
* The platform properties against which the run has to happen.
*/
@JsonProperty(value = "platform", required = true)
private PlatformProperties platform;
/*
* The machine configuration of the run agent.
*/
@JsonProperty(value = "agentConfiguration")
private AgentProperties agentConfiguration;
/*
* The URL(absolute or relative) of the source context. It can be an URL to
* a tar or git repository.
* If it is relative URL, the relative path should be obtained from calling
* listBuildSourceUploadUrl API.
*/
@JsonProperty(value = "sourceLocation")
private String sourceLocation;
/*
* The properties that describes a set of credentials that will be used
* when this run is invoked.
*/
@JsonProperty(value = "credentials")
private Credentials credentials;
/**
* Get the taskFilePath property: The template/definition file path relative to the source.
*
* @return the taskFilePath value.
*/
public String taskFilePath() {
return this.taskFilePath;
}
/**
* Set the taskFilePath property: The template/definition file path relative to the source.
*
* @param taskFilePath the taskFilePath value to set.
* @return the FileTaskRunRequest object itself.
*/
public FileTaskRunRequest withTaskFilePath(String taskFilePath) {
this.taskFilePath = taskFilePath;
return this;
}
/**
* Get the valuesFilePath property: The values/parameters file path relative to the source.
*
* @return the valuesFilePath value.
*/
public String valuesFilePath() {
return this.valuesFilePath;
}
/**
* Set the valuesFilePath property: The values/parameters file path relative to the source.
*
* @param valuesFilePath the valuesFilePath value to set.
* @return the FileTaskRunRequest object itself.
*/
public FileTaskRunRequest withValuesFilePath(String valuesFilePath) {
this.valuesFilePath = valuesFilePath;
return this;
}
/**
* Get the values property: The collection of overridable values that can be passed when running a task.
*
* @return the values value.
*/
public List<SetValue> values() {
return this.values;
}
/**
* Set the values property: The collection of overridable values that can be passed when running a task.
*
* @param values the values value to set.
* @return the FileTaskRunRequest object itself.
*/
public FileTaskRunRequest withValues(List<SetValue> values) {
this.values = values;
return this;
}
/**
* Get the timeout property: Run timeout in seconds.
*
* @return the timeout value.
*/
public Integer timeout() {
return this.timeout;
}
/**
* Set the timeout property: Run timeout in seconds.
*
* @param timeout the timeout value to set.
* @return the FileTaskRunRequest object itself.
*/
public FileTaskRunRequest withTimeout(Integer timeout) {
this.timeout = timeout;
return this;
}
/**
* Get the platform property: The platform properties against which the run has to happen.
*
* @return the platform value.
*/
public PlatformProperties platform() {
return this.platform;
}
/**
* Set the platform property: The platform properties against which the run has to happen.
*
* @param platform the platform value to set.
* @return the FileTaskRunRequest object itself.
*/
public FileTaskRunRequest withPlatform(PlatformProperties platform) {
this.platform = platform;
return this;
}
/**
* Get the agentConfiguration property: The machine configuration of the run agent.
*
* @return the agentConfiguration value.
*/
public AgentProperties agentConfiguration() {
return this.agentConfiguration;
}
/**
* Set the agentConfiguration property: The machine configuration of the run agent.
*
* @param agentConfiguration the agentConfiguration value to set.
* @return the FileTaskRunRequest object itself.
*/
public FileTaskRunRequest withAgentConfiguration(AgentProperties agentConfiguration) {
this.agentConfiguration = agentConfiguration;
return this;
}
/**
* Get the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar
* or git repository. If it is relative URL, the relative path should be obtained from calling
* listBuildSourceUploadUrl API.
*
* @return the sourceLocation value.
*/
public String sourceLocation() {
return this.sourceLocation;
}
/**
* Set the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar
* or git repository. If it is relative URL, the relative path should be obtained from calling
* listBuildSourceUploadUrl API.
*
* @param sourceLocation the sourceLocation value to set.
* @return the FileTaskRunRequest object itself.
*/
public FileTaskRunRequest withSourceLocation(String sourceLocation) {
this.sourceLocation = sourceLocation;
return this;
}
/**
* Get the credentials property: The properties that describes a set of credentials that will be used when this run
* is invoked.
*
* @return the credentials value.
*/
public Credentials credentials() {
return this.credentials;
}
/**
* Set the credentials property: The properties that describes a set of credentials that will be used when this run
* is invoked.
*
* @param credentials the credentials value to set.
* @return the FileTaskRunRequest object itself.
*/
public FileTaskRunRequest withCredentials(Credentials credentials) {
this.credentials = credentials;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
super.validate();
if (taskFilePath() == null) {
throw logger
.logExceptionAsError(
new IllegalArgumentException("Missing required property taskFilePath in model FileTaskRunRequest"));
}
if (values() != null) {
values().forEach(e -> e.validate());
}
if (platform() == null) {
throw logger
.logExceptionAsError(
new IllegalArgumentException("Missing required property platform in model FileTaskRunRequest"));
} else {
platform().validate();
}
if (agentConfiguration() != null) {
agentConfiguration().validate();
}
if (credentials() != null) {
credentials().validate();
}
}
}