Skip to content

Commit

Permalink
Generated from 26b9d065093c4fc9699979698ca1d2fd78ad63c0
Browse files Browse the repository at this point in the history
Migrate TaskRun to ProxyResource.
  • Loading branch information
SDK Automation committed Jun 24, 2020
1 parent f406914 commit 8364086
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ public interface TaskRun extends HasInner<TaskRunInner>, Indexable, Refreshable<
*/
IdentityProperties identity();

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

/**
* @return the name value.
*/
Expand All @@ -63,11 +58,6 @@ public interface TaskRun extends HasInner<TaskRunInner>, Indexable, Refreshable<
*/
Run runResult();

/**
* @return the tags value.
*/
Map<String, String> tags();

/**
* @return the type value.
*/
Expand All @@ -76,7 +66,7 @@ public interface TaskRun extends HasInner<TaskRunInner>, Indexable, Refreshable<
/**
* The entirety of the TaskRun definition.
*/
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithCreate {
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithCreate {
}

/**
Expand All @@ -99,19 +89,7 @@ interface WithRegistry {
* @param registryName The name of the container registry
* @return the next definition stage
*/
WithLocation withExistingRegistry(String resourceGroupName, String registryName);
}

/**
* The stage of the taskrun definition allowing to specify Location.
*/
interface WithLocation {
/**
* Specifies location.
* @param location The location of the resource. This cannot be changed after the resource is created
* @return the next definition stage
*/
WithCreate withLocation(String location);
WithCreate withExistingRegistry(String resourceGroupName, String registryName);
}

/**
Expand Down Expand Up @@ -150,24 +128,12 @@ interface WithRunRequest {
WithCreate withRunRequest(RunRequest runRequest);
}

/**
* The stage of the taskrun definition allowing to specify Tags.
*/
interface WithTags {
/**
* Specifies tags.
* @param tags The tags of the resource
* @return the next definition stage
*/
WithCreate withTags(Map<String, String> tags);
}

/**
* The stage of the definition which contains all the minimum required inputs for
* the resource to be created (via {@link WithCreate#create()}), but also allows
* for any other optional settings to be specified.
*/
interface WithCreate extends Creatable<TaskRun>, DefinitionStages.WithForceUpdateTag, DefinitionStages.WithIdentity, DefinitionStages.WithRunRequest, DefinitionStages.WithTags {
interface WithCreate extends Creatable<TaskRun>, DefinitionStages.WithForceUpdateTag, DefinitionStages.WithIdentity, DefinitionStages.WithRunRequest {
}
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ public IdentityProperties identity() {
return this.inner().identity();
}

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

@Override
public String name() {
return this.inner().name();
Expand All @@ -141,11 +136,6 @@ public Run runResult() {
}
}

@Override
public Map<String, String> tags() {
return this.inner().getTags();
}

@Override
public String type() {
return this.inner().type();
Expand All @@ -159,8 +149,8 @@ public TaskRunImpl withExistingRegistry(String resourceGroupName, String registr
}

@Override
public TaskRunImpl withLocation(String location) {
this.inner().withLocation(location);
public TaskRunImpl withTags(Map<String, String> tags) {
this.updateParameter.withTags(tags);
return this;
}

Expand Down Expand Up @@ -194,14 +184,4 @@ public TaskRunImpl withRunRequest(RunRequest runRequest) {
return this;
}

@Override
public TaskRunImpl withTags(Map<String, String> tags) {
if (isInCreateMode()) {
this.inner().withTags(tags);
} else {
this.updateParameter.withTags(tags);
}
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunRequest;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.azure.Resource;
import com.microsoft.azure.ProxyResource;

/**
* The task run that has the ARM resource and properties.
* The task run will have the information of request and result of a run.
*/
@JsonFlatten
public class TaskRunInner extends Resource {
public class TaskRunInner extends ProxyResource {
/**
* Identity for the resource.
*/
Expand Down

0 comments on commit 8364086

Please sign in to comment.