Skip to content

Commit

Permalink
Fix: Unrecognized field "resource_id" (kafka-ops#307) (kafka-ops#309)
Browse files Browse the repository at this point in the history
* Added resourceId to ServiceAccount.java to support ccloud v1.28.0+

* Added @JsonProperty to match resource_id in service account json
  • Loading branch information
mvanbrummen authored and sverrehu committed Aug 19, 2021
1 parent 9b4f4b1 commit 8b3283f
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.purbon.kafka.topology.model.cluster;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;

public class ServiceAccount {
Expand All @@ -8,14 +9,22 @@ public class ServiceAccount {
private String name;
private String description;

@JsonProperty("resource_id")
private String resourceId;

public ServiceAccount() {
this(-1, "", "");
this(-1, "", "", "");
}

public ServiceAccount(int id, String name, String description) {
this(id, name, description, "");
}

public ServiceAccount(int id, String name, String description, String resourceId) {
this.id = id;
this.name = name;
this.description = description;
this.resourceId = resourceId;
}

public int getId() {
Expand All @@ -30,11 +39,16 @@ public String getDescription() {
return description;
}

public String getResourceId() {
return resourceId;
}

@Override
public String toString() {
final StringBuffer sb = new StringBuffer("ServiceAccount{");
sb.append("id=").append(id);
sb.append(", name='").append(name).append('\'');
sb.append(", resourceId='").append(resourceId).append('\'');
sb.append('}');
return sb.toString();
}
Expand All @@ -53,6 +67,6 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(getId(), getName(), getDescription());
return Objects.hash(getId(), getName(), getDescription(), getResourceId());
}
}

0 comments on commit 8b3283f

Please sign in to comment.