Skip to content

Commit c1c756b

Browse files
committed
Release 0.0.23
1 parent 49ceb97 commit c1c756b

24 files changed

+581
-1138
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ publishing {
3333
maven(MavenPublication) {
3434
groupId = 'io.github.seamapi'
3535
artifactId = 'java'
36-
version = '0.0.22'
36+
version = '0.0.23'
3737
from components.java
3838
}
3939
}

src/main/java/com/seam/api/types/ConnectedAccountsGetRequest.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public Object get() {
2828

2929
public <T> T visit(Visitor<T> visitor) {
3030
if (this.type == 0) {
31-
return visitor.visit((ConnectedAccountsGetRequestConnectedAccountsGetRequest) this.value);
31+
return visitor.visit((ConnectedAccountsGetRequestConnectedAccountId) this.value);
3232
} else if (this.type == 1) {
33-
return visitor.visit((ConnectedAccountsGetRequestConnectedAccountsGetRequest) this.value);
33+
return visitor.visit((ConnectedAccountsGetRequestEmail) this.value);
3434
}
3535
throw new IllegalStateException("Failed to visit value. This should never happen.");
3636
}
@@ -55,18 +55,18 @@ public String toString() {
5555
return this.value.toString();
5656
}
5757

58-
public static ConnectedAccountsGetRequest of(ConnectedAccountsGetRequestConnectedAccountsGetRequest value) {
58+
public static ConnectedAccountsGetRequest of(ConnectedAccountsGetRequestConnectedAccountId value) {
5959
return new ConnectedAccountsGetRequest(value, 0);
6060
}
6161

62-
public static ConnectedAccountsGetRequest of(ConnectedAccountsGetRequestConnectedAccountsGetRequest value) {
62+
public static ConnectedAccountsGetRequest of(ConnectedAccountsGetRequestEmail value) {
6363
return new ConnectedAccountsGetRequest(value, 1);
6464
}
6565

6666
public interface Visitor<T> {
67-
T visit(ConnectedAccountsGetRequestConnectedAccountsGetRequest value);
67+
T visit(ConnectedAccountsGetRequestConnectedAccountId value);
6868

69-
T visit(ConnectedAccountsGetRequestConnectedAccountsGetRequest value);
69+
T visit(ConnectedAccountsGetRequestEmail value);
7070
}
7171

7272
static final class Deserializer extends StdDeserializer<ConnectedAccountsGetRequest> {
@@ -79,12 +79,11 @@ public ConnectedAccountsGetRequest deserialize(JsonParser p, DeserializationCont
7979
Object value = p.readValueAs(Object.class);
8080
try {
8181
return of(ObjectMappers.JSON_MAPPER.convertValue(
82-
value, ConnectedAccountsGetRequestConnectedAccountsGetRequest.class));
82+
value, ConnectedAccountsGetRequestConnectedAccountId.class));
8383
} catch (IllegalArgumentException e) {
8484
}
8585
try {
86-
return of(ObjectMappers.JSON_MAPPER.convertValue(
87-
value, ConnectedAccountsGetRequestConnectedAccountsGetRequest.class));
86+
return of(ObjectMappers.JSON_MAPPER.convertValue(value, ConnectedAccountsGetRequestEmail.class));
8887
} catch (IllegalArgumentException e) {
8988
}
9089
throw new JsonParseException(p, "Failed to deserialize");
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
package com.seam.api.types;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
5+
import com.fasterxml.jackson.annotation.JsonSetter;
6+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
7+
import java.util.Objects;
8+
9+
@JsonDeserialize(builder = ConnectedAccountsGetRequestConnectedAccountId.Builder.class)
10+
public final class ConnectedAccountsGetRequestConnectedAccountId {
11+
private final String connectedAccountId;
12+
13+
private ConnectedAccountsGetRequestConnectedAccountId(String connectedAccountId) {
14+
this.connectedAccountId = connectedAccountId;
15+
}
16+
17+
@JsonProperty("connected_account_id")
18+
public String getConnectedAccountId() {
19+
return connectedAccountId;
20+
}
21+
22+
@Override
23+
public boolean equals(Object other) {
24+
if (this == other) return true;
25+
return other instanceof ConnectedAccountsGetRequestConnectedAccountId
26+
&& equalTo((ConnectedAccountsGetRequestConnectedAccountId) other);
27+
}
28+
29+
private boolean equalTo(ConnectedAccountsGetRequestConnectedAccountId other) {
30+
return connectedAccountId.equals(other.connectedAccountId);
31+
}
32+
33+
@Override
34+
public int hashCode() {
35+
return Objects.hash(this.connectedAccountId);
36+
}
37+
38+
@Override
39+
public String toString() {
40+
return "ConnectedAccountsGetRequestConnectedAccountId{" + "connectedAccountId: " + connectedAccountId + "}";
41+
}
42+
43+
public static ConnectedAccountIdStage builder() {
44+
return new Builder();
45+
}
46+
47+
public interface ConnectedAccountIdStage {
48+
_FinalStage connectedAccountId(String connectedAccountId);
49+
50+
Builder from(ConnectedAccountsGetRequestConnectedAccountId other);
51+
}
52+
53+
public interface _FinalStage {
54+
ConnectedAccountsGetRequestConnectedAccountId build();
55+
}
56+
57+
@JsonIgnoreProperties(ignoreUnknown = true)
58+
public static final class Builder implements ConnectedAccountIdStage, _FinalStage {
59+
private String connectedAccountId;
60+
61+
private Builder() {}
62+
63+
@Override
64+
public Builder from(ConnectedAccountsGetRequestConnectedAccountId other) {
65+
connectedAccountId(other.getConnectedAccountId());
66+
return this;
67+
}
68+
69+
@Override
70+
@JsonSetter("connected_account_id")
71+
public _FinalStage connectedAccountId(String connectedAccountId) {
72+
this.connectedAccountId = connectedAccountId;
73+
return this;
74+
}
75+
76+
@Override
77+
public ConnectedAccountsGetRequestConnectedAccountId build() {
78+
return new ConnectedAccountsGetRequestConnectedAccountId(connectedAccountId);
79+
}
80+
}
81+
}

src/main/java/com/seam/api/types/ConnectedAccountsGetRequestConnectedAccountsGetRequest.java renamed to src/main/java/com/seam/api/types/ConnectedAccountsGetRequestEmail.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
77
import java.util.Objects;
88

9-
@JsonDeserialize(builder = ConnectedAccountsGetRequestConnectedAccountsGetRequest.Builder.class)
10-
public final class ConnectedAccountsGetRequestConnectedAccountsGetRequest {
9+
@JsonDeserialize(builder = ConnectedAccountsGetRequestEmail.Builder.class)
10+
public final class ConnectedAccountsGetRequestEmail {
1111
private final String email;
1212

13-
private ConnectedAccountsGetRequestConnectedAccountsGetRequest(String email) {
13+
private ConnectedAccountsGetRequestEmail(String email) {
1414
this.email = email;
1515
}
1616

@@ -22,11 +22,10 @@ public String getEmail() {
2222
@Override
2323
public boolean equals(Object other) {
2424
if (this == other) return true;
25-
return other instanceof ConnectedAccountsGetRequestConnectedAccountsGetRequest
26-
&& equalTo((ConnectedAccountsGetRequestConnectedAccountsGetRequest) other);
25+
return other instanceof ConnectedAccountsGetRequestEmail && equalTo((ConnectedAccountsGetRequestEmail) other);
2726
}
2827

29-
private boolean equalTo(ConnectedAccountsGetRequestConnectedAccountsGetRequest other) {
28+
private boolean equalTo(ConnectedAccountsGetRequestEmail other) {
3029
return email.equals(other.email);
3130
}
3231

@@ -37,7 +36,7 @@ public int hashCode() {
3736

3837
@Override
3938
public String toString() {
40-
return "ConnectedAccountsGetRequestConnectedAccountsGetRequest{" + "email: " + email + "}";
39+
return "ConnectedAccountsGetRequestEmail{" + "email: " + email + "}";
4140
}
4241

4342
public static EmailStage builder() {
@@ -47,11 +46,11 @@ public static EmailStage builder() {
4746
public interface EmailStage {
4847
_FinalStage email(String email);
4948

50-
Builder from(ConnectedAccountsGetRequestConnectedAccountsGetRequest other);
49+
Builder from(ConnectedAccountsGetRequestEmail other);
5150
}
5251

5352
public interface _FinalStage {
54-
ConnectedAccountsGetRequestConnectedAccountsGetRequest build();
53+
ConnectedAccountsGetRequestEmail build();
5554
}
5655

5756
@JsonIgnoreProperties(ignoreUnknown = true)
@@ -61,7 +60,7 @@ public static final class Builder implements EmailStage, _FinalStage {
6160
private Builder() {}
6261

6362
@Override
64-
public Builder from(ConnectedAccountsGetRequestConnectedAccountsGetRequest other) {
63+
public Builder from(ConnectedAccountsGetRequestEmail other) {
6564
email(other.getEmail());
6665
return this;
6766
}
@@ -74,8 +73,8 @@ public _FinalStage email(String email) {
7473
}
7574

7675
@Override
77-
public ConnectedAccountsGetRequestConnectedAccountsGetRequest build() {
78-
return new ConnectedAccountsGetRequestConnectedAccountsGetRequest(email);
76+
public ConnectedAccountsGetRequestEmail build() {
77+
return new ConnectedAccountsGetRequestEmail(email);
7978
}
8079
}
8180
}
Lines changed: 48 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,67 @@
11
package com.seam.api.types;
22

33
import com.fasterxml.jackson.annotation.JsonValue;
4-
import com.fasterxml.jackson.core.JsonParseException;
5-
import com.fasterxml.jackson.core.JsonParser;
6-
import com.fasterxml.jackson.databind.DeserializationContext;
7-
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
8-
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
9-
import com.seam.api.core.ObjectMappers;
10-
import java.io.IOException;
11-
import java.util.Objects;
12-
13-
@JsonDeserialize(using = DeviceDeviceType.Deserializer.class)
14-
public final class DeviceDeviceType {
15-
private final Object value;
16-
17-
private final int type;
18-
19-
private DeviceDeviceType(Object value, int type) {
20-
this.value = value;
21-
this.type = type;
22-
}
234

24-
@JsonValue
25-
public Object get() {
26-
return this.value;
27-
}
5+
public enum DeviceDeviceType {
6+
AKUVOX_LOCK("akuvox_lock"),
287

29-
public <T> T visit(Visitor<T> visitor) {
30-
if (this.type == 0) {
31-
return visitor.visit((DeviceDeviceTypeDeviceDeviceType) this.value);
32-
} else if (this.type == 1) {
33-
return visitor.visit((DeviceDeviceTypeDeviceDeviceType) this.value);
34-
} else if (this.type == 2) {
35-
return visitor.visit((DeviceDeviceTypeDeviceDeviceType) this.value);
36-
}
37-
throw new IllegalStateException("Failed to visit value. This should never happen.");
38-
}
8+
AUGUST_LOCK("august_lock"),
399

40-
@Override
41-
public boolean equals(Object other) {
42-
if (this == other) return true;
43-
return other instanceof DeviceDeviceType && equalTo((DeviceDeviceType) other);
44-
}
10+
BRIVO_ACCESS_POINT("brivo_access_point"),
4511

46-
private boolean equalTo(DeviceDeviceType other) {
47-
return value.equals(other.value);
48-
}
12+
BUTTERFLYMX_PANEL("butterflymx_panel"),
4913

50-
@Override
51-
public int hashCode() {
52-
return Objects.hash(this.value);
53-
}
14+
DOORKING_LOCK("doorking_lock"),
5415

55-
@Override
56-
public String toString() {
57-
return this.value.toString();
58-
}
16+
GENIE_DOOR("genie_door"),
5917

60-
public static DeviceDeviceType of(DeviceDeviceTypeDeviceDeviceType value) {
61-
return new DeviceDeviceType(value, 0);
62-
}
18+
IGLOO_LOCK("igloo_lock"),
6319

64-
public static DeviceDeviceType of(DeviceDeviceTypeDeviceDeviceType value) {
65-
return new DeviceDeviceType(value, 1);
66-
}
20+
LINEAR_LOCK("linear_lock"),
6721

68-
public static DeviceDeviceType of(DeviceDeviceTypeDeviceDeviceType value) {
69-
return new DeviceDeviceType(value, 2);
70-
}
22+
LOCKLY_LOCK("lockly_lock"),
23+
24+
KWIKSET_LOCK("kwikset_lock"),
25+
26+
NUKI_LOCK("nuki_lock"),
7127

72-
public interface Visitor<T> {
73-
T visit(DeviceDeviceTypeDeviceDeviceType value);
28+
SALTO_LOCK("salto_lock"),
7429

75-
T visit(DeviceDeviceTypeDeviceDeviceType value);
30+
SCHLAGE_LOCK("schlage_lock"),
7631

77-
T visit(DeviceDeviceTypeDeviceDeviceType value);
32+
SEAM_RELAY("seam_relay"),
33+
34+
SMARTTHINGS_LOCK("smartthings_lock"),
35+
36+
YALE_LOCK("yale_lock"),
37+
38+
TWO_N_INTERCOM("two_n_intercom"),
39+
40+
CONTROLBYWEB_DEVICE("controlbyweb_device"),
41+
42+
TTLOCK_LOCK("ttlock_lock"),
43+
44+
IGLOOHOME_LOCK("igloohome_lock"),
45+
46+
HUBITAT_LOCK("hubitat_lock"),
47+
48+
NOISEAWARE_ACTIVITY_ZONE("noiseaware_activity_zone"),
49+
50+
MINUT_SENSOR("minut_sensor"),
51+
52+
ECOBEE_THERMOSTAT("ecobee_thermostat"),
53+
54+
NEST_THERMOSTAT("nest_thermostat");
55+
56+
private final String value;
57+
58+
DeviceDeviceType(String value) {
59+
this.value = value;
7860
}
7961

80-
static final class Deserializer extends StdDeserializer<DeviceDeviceType> {
81-
Deserializer() {
82-
super(DeviceDeviceType.class);
83-
}
84-
85-
@Override
86-
public DeviceDeviceType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
87-
Object value = p.readValueAs(Object.class);
88-
try {
89-
return of(ObjectMappers.JSON_MAPPER.convertValue(value, DeviceDeviceTypeDeviceDeviceType.class));
90-
} catch (IllegalArgumentException e) {
91-
}
92-
try {
93-
return of(ObjectMappers.JSON_MAPPER.convertValue(value, DeviceDeviceTypeDeviceDeviceType.class));
94-
} catch (IllegalArgumentException e) {
95-
}
96-
try {
97-
return of(ObjectMappers.JSON_MAPPER.convertValue(value, DeviceDeviceTypeDeviceDeviceType.class));
98-
} catch (IllegalArgumentException e) {
99-
}
100-
throw new JsonParseException(p, "Failed to deserialize");
101-
}
62+
@JsonValue
63+
@Override
64+
public String toString() {
65+
return this.value;
10266
}
10367
}

src/main/java/com/seam/api/types/DeviceDeviceTypeDeviceDeviceType.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)