Skip to content
Permalink
Browse files
Added ID to the LoadBalancer entity
  • Loading branch information
nacx committed Apr 25, 2017
1 parent 996acec commit 11f3804591bfb24a78d72fccce1fce0e38840051
Showing 3 changed files with 48 additions and 22 deletions.
@@ -26,25 +26,42 @@

@AutoValue
public abstract class LoadBalancer {
@Nullable
public abstract String name();

@Nullable public abstract String id();
@Nullable public abstract String name();
@Nullable public abstract String location();
@Nullable public abstract String etag();
@Nullable public abstract Map<String, String> tags();
@Nullable public abstract LoadBalancerProperties properties();

@Nullable
public abstract String location();

@Nullable
public abstract Map<String, String> tags();

@Nullable
public abstract LoadBalancerProperties properties();
@SerializedNames({ "id", "name", "location", "etag", "tags", "properties", })
public static LoadBalancer create(String id, final String name, final String location, final String etag,
final Map<String, String> tags, final LoadBalancerProperties properties) {
return builder().id(id).name(name).location(location).etag(etag).tags(tags).properties(properties).build();
}

public abstract Builder toBuilder();

@Nullable
public abstract String etag();
public static Builder builder() {
return new AutoValue_LoadBalancer.Builder();
}

@AutoValue.Builder
public abstract static class Builder {
public abstract Builder id(String id);
public abstract Builder name(String name);
public abstract Builder location(String location);
public abstract Builder etag(String etag);
public abstract Builder tags(Map<String, String> tags);
public abstract Builder properties(LoadBalancerProperties properties);

abstract Map<String, String> tags();

@SerializedNames({ "name", "location", "tags", "properties", "etag" })
public static LoadBalancer create(final String name, final String location, final Map<String, String> tags,
final LoadBalancerProperties properties, final String etag) {
return new AutoValue_LoadBalancer(name, location, tags == null ? null : ImmutableMap.copyOf(tags), properties,
etag);
abstract LoadBalancer autoBuild();

public LoadBalancer build() {
tags(tags() != null ? ImmutableMap.copyOf(tags()) : null);
return autoBuild();
}
}
}
@@ -326,9 +326,13 @@ private LoadBalancer newLoadBalancer(final String lbName, final String locationN
.builder().build();
FrontendIPConfigurations frontendIPConfigurations = FrontendIPConfigurations.create("ipConfigs", null,
frontendIPConfigurationsProperties, null);
return LoadBalancer.create(lbName, locationName, null,
LoadBalancerProperties.builder().frontendIPConfigurations(ImmutableList.of(frontendIPConfigurations))
.build(), null);
return LoadBalancer
.builder()
.name(lbName)
.location(locationName)
.properties(
LoadBalancerProperties.builder().frontendIPConfigurations(ImmutableList.of(frontendIPConfigurations))
.build()).build();
}

private void assertResourceDeleted(final URI uri) {
@@ -149,7 +149,12 @@ private LoadBalancer newLoadBalancer() {
.builder().build();
FrontendIPConfigurations frontendIPConfigurations = FrontendIPConfigurations.create("ipConfigs", null,
frontendIPConfigurationsProperties, null);
return LoadBalancer.create(lbName, "westus", null, LoadBalancerProperties.builder()
.frontendIPConfigurations(ImmutableList.of(frontendIPConfigurations)).build(), null);
return LoadBalancer
.builder()
.name(lbName)
.location("westus")
.properties(
LoadBalancerProperties.builder().frontendIPConfigurations(ImmutableList.of(frontendIPConfigurations))
.build()).build();
}
}

0 comments on commit 11f3804

Please sign in to comment.