Skip to content

Commit

Permalink
Generated from c05b5bdb8b5f7853b472b3ed1c7a9bc24474ca06
Browse files Browse the repository at this point in the history
Update Swagger for

1. Add name validation to agentpool and taskrun
2. Template for storing log artifact
3. Allow creation of quicktask resource
  • Loading branch information
SDK Automation committed Aug 7, 2020
1 parent 4f322da commit 755257b
Show file tree
Hide file tree
Showing 9 changed files with 236 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.microsoft.rest.serializer.JsonFlatten;

/**
* The parameters for updating an agent pool.
* The parameters for updating an agentpool.
*/
@JsonFlatten
public class AgentPoolUpdateParameters {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public interface Run extends HasInner<RunInner>, Indexable, Refreshable<Run>, Up
*/
DateTime lastUpdatedTime();

/**
* @return the logArtifact value.
*/
ImageDescriptor logArtifact();

/**
* @return the name value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ public class RunRequest {
@JsonProperty(value = "agentPoolName")
private String agentPoolName;

/**
* The template that describes the repository and tag information for run
* log artifact.
*/
@JsonProperty(value = "logTemplate")
private String logTemplate;

/**
* Get the value that indicates whether archiving is enabled for the run or not.
*
Expand Down Expand Up @@ -78,4 +85,24 @@ public RunRequest withAgentPoolName(String agentPoolName) {
return this;
}

/**
* Get the template that describes the repository and tag information for run log artifact.
*
* @return the logTemplate value
*/
public String logTemplate() {
return this.logTemplate;
}

/**
* Set the template that describes the repository and tag information for run log artifact.
*
* @param logTemplate the logTemplate value to set
* @return the RunRequest object itself.
*/
public RunRequest withLogTemplate(String logTemplate) {
this.logTemplate = logTemplate;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,21 @@ public interface Task extends HasInner<TaskInner>, Indexable, Refreshable<Task>,
*/
IdentityProperties identity();

/**
* @return the isSystemTask value.
*/
Boolean isSystemTask();

/**
* @return the location value.
*/
String location();

/**
* @return the logTemplate value.
*/
String logTemplate();

/**
* @return the name value.
*/
Expand Down Expand Up @@ -107,7 +117,7 @@ public interface Task extends HasInner<TaskInner>, Indexable, Refreshable<Task>,
/**
* The entirety of the Task definition.
*/
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithPlatform, DefinitionStages.WithStep, DefinitionStages.WithCreate {
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithCreate {
}

/**
Expand Down Expand Up @@ -142,31 +152,7 @@ interface WithLocation {
* @param location The location of the resource. This cannot be changed after the resource is created
* @return the next definition stage
*/
WithPlatform withLocation(String location);
}

/**
* The stage of the task definition allowing to specify Platform.
*/
interface WithPlatform {
/**
* Specifies platform.
* @param platform The platform properties against which the run has to happen
* @return the next definition stage
*/
WithStep withPlatform(PlatformProperties platform);
}

/**
* The stage of the task definition allowing to specify Step.
*/
interface WithStep {
/**
* Specifies step.
* @param step The properties of a task step
* @return the next definition stage
*/
WithCreate withStep(TaskStepProperties step);
WithCreate withLocation(String location);
}

/**
Expand Down Expand Up @@ -217,6 +203,42 @@ interface WithIdentity {
WithCreate withIdentity(IdentityProperties identity);
}

/**
* The stage of the task definition allowing to specify IsSystemTask.
*/
interface WithIsSystemTask {
/**
* Specifies isSystemTask.
* @param isSystemTask The value of this property indicates whether the task resource is system task or not
* @return the next definition stage
*/
WithCreate withIsSystemTask(Boolean isSystemTask);
}

/**
* The stage of the task definition allowing to specify LogTemplate.
*/
interface WithLogTemplate {
/**
* Specifies logTemplate.
* @param logTemplate The template that describes the repository and tag information for run log artifact
* @return the next definition stage
*/
WithCreate withLogTemplate(String logTemplate);
}

/**
* The stage of the task definition allowing to specify Platform.
*/
interface WithPlatform {
/**
* Specifies platform.
* @param platform The platform properties against which the run has to happen
* @return the next definition stage
*/
WithCreate withPlatform(PlatformProperties platform);
}

/**
* The stage of the task definition allowing to specify Status.
*/
Expand All @@ -229,6 +251,18 @@ interface WithStatus {
WithCreate withStatus(TaskStatus status);
}

/**
* The stage of the task definition allowing to specify Step.
*/
interface WithStep {
/**
* Specifies step.
* @param step The properties of a task step
* @return the next definition stage
*/
WithCreate withStep(TaskStepProperties step);
}

/**
* The stage of the task definition allowing to specify Tags.
*/
Expand Down Expand Up @@ -270,13 +304,13 @@ interface WithTrigger {
* the resource to be created (via {@link WithCreate#create()}), but also allows
* for any other optional settings to be specified.
*/
interface WithCreate extends Creatable<Task>, DefinitionStages.WithAgentConfiguration, DefinitionStages.WithAgentPoolName, DefinitionStages.WithCredentials, DefinitionStages.WithIdentity, DefinitionStages.WithStatus, DefinitionStages.WithTags, DefinitionStages.WithTimeout, DefinitionStages.WithTrigger {
interface WithCreate extends Creatable<Task>, DefinitionStages.WithAgentConfiguration, DefinitionStages.WithAgentPoolName, DefinitionStages.WithCredentials, DefinitionStages.WithIdentity, DefinitionStages.WithIsSystemTask, DefinitionStages.WithLogTemplate, DefinitionStages.WithPlatform, DefinitionStages.WithStatus, DefinitionStages.WithStep, DefinitionStages.WithTags, DefinitionStages.WithTimeout, DefinitionStages.WithTrigger {
}
}
/**
* The template for a Task update operation, containing all the settings that can be modified.
*/
interface Update extends Appliable<Task>, UpdateStages.WithAgentConfiguration, UpdateStages.WithAgentPoolName, UpdateStages.WithCredentials, UpdateStages.WithIdentity, UpdateStages.WithPlatform, UpdateStages.WithStatus, UpdateStages.WithStep, UpdateStages.WithTags, UpdateStages.WithTimeout, UpdateStages.WithTrigger {
interface Update extends Appliable<Task>, UpdateStages.WithAgentConfiguration, UpdateStages.WithAgentPoolName, UpdateStages.WithCredentials, UpdateStages.WithIdentity, UpdateStages.WithLogTemplate, UpdateStages.WithPlatform, UpdateStages.WithStatus, UpdateStages.WithStep, UpdateStages.WithTags, UpdateStages.WithTimeout, UpdateStages.WithTrigger {
}

/**
Expand Down Expand Up @@ -331,6 +365,18 @@ interface WithIdentity {
Update withIdentity(IdentityProperties identity);
}

/**
* The stage of the task update allowing to specify LogTemplate.
*/
interface WithLogTemplate {
/**
* Specifies logTemplate.
* @param logTemplate The template that describes the repository and tag information for run log artifact
* @return the next update stage
*/
Update withLogTemplate(String logTemplate);
}

/**
* The stage of the task update allowing to specify Platform.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ public class TaskUpdateParameters {
@JsonProperty(value = "properties.credentials")
private Credentials credentials;

/**
* The template that describes the repository and tag information for run
* log artifact.
*/
@JsonProperty(value = "properties.logTemplate")
private String logTemplate;

/**
* The ARM resource tags.
*/
Expand Down Expand Up @@ -259,6 +266,26 @@ public TaskUpdateParameters withCredentials(Credentials credentials) {
return this;
}

/**
* Get the template that describes the repository and tag information for run log artifact.
*
* @return the logTemplate value
*/
public String logTemplate() {
return this.logTemplate;
}

/**
* Set the template that describes the repository and tag information for run log artifact.
*
* @param logTemplate the logTemplate value to set
* @return the TaskUpdateParameters object itself.
*/
public TaskUpdateParameters withLogTemplate(String logTemplate) {
this.logTemplate = logTemplate;
return this;
}

/**
* Get the ARM resource tags.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ public DateTime lastUpdatedTime() {
return this.inner().lastUpdatedTime();
}

@Override
public ImageDescriptor logArtifact() {
return this.inner().logArtifact();
}

@Override
public String name() {
return this.inner().name();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ public class RunInner extends ProxyResource {
@JsonProperty(value = "properties.updateTriggerToken")
private String updateTriggerToken;

/**
* The image description for the log artifact.
*/
@JsonProperty(value = "properties.logArtifact", access = JsonProperty.Access.WRITE_ONLY)
private ImageDescriptor logArtifact;

/**
* The provisioning state of a run. Possible values include: 'Creating',
* 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'.
Expand Down Expand Up @@ -531,6 +537,15 @@ public RunInner withUpdateTriggerToken(String updateTriggerToken) {
return this;
}

/**
* Get the image description for the log artifact.
*
* @return the logArtifact value
*/
public ImageDescriptor logArtifact() {
return this.logArtifact;
}

/**
* Get the provisioning state of a run. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,21 @@ public IdentityProperties identity() {
return this.inner().identity();
}

@Override
public Boolean isSystemTask() {
return this.inner().isSystemTask();
}

@Override
public String location() {
return this.inner().location();
}

@Override
public String logTemplate() {
return this.inner().logTemplate();
}

@Override
public String name() {
return this.inner().name();
Expand Down Expand Up @@ -197,6 +207,12 @@ public TaskImpl withLocation(String location) {
return this;
}

@Override
public TaskImpl withIsSystemTask(Boolean isSystemTask) {
this.inner().withIsSystemTask(isSystemTask);
return this;
}

@Override
public TaskImpl withPlatform(PlatformProperties platform) {
this.inner().withPlatform(platform);
Expand Down Expand Up @@ -273,6 +289,16 @@ public TaskImpl withIdentity(IdentityProperties identity) {
return this;
}

@Override
public TaskImpl withLogTemplate(String logTemplate) {
if (isInCreateMode()) {
this.inner().withLogTemplate(logTemplate);
} else {
this.updateParameter.withLogTemplate(logTemplate);
}
return this;
}

@Override
public TaskImpl withStatus(TaskStatus status) {
if (isInCreateMode()) {
Expand Down
Loading

0 comments on commit 755257b

Please sign in to comment.