-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ed03e0
commit 4509768
Showing
45 changed files
with
3,704 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
src/main/java/com/courier/api/resources/automations/types/AccessorType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.courier.api.resources.automations.types; | ||
|
||
import com.courier.api.core.ObjectMappers; | ||
import com.fasterxml.jackson.annotation.JsonAnyGetter; | ||
import com.fasterxml.jackson.annotation.JsonAnySetter; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonSetter; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
@JsonDeserialize(builder = AccessorType.Builder.class) | ||
public final class AccessorType { | ||
private final String ref; | ||
|
||
private final Map<String, Object> additionalProperties; | ||
|
||
private AccessorType(String ref, Map<String, Object> additionalProperties) { | ||
this.ref = ref; | ||
this.additionalProperties = additionalProperties; | ||
} | ||
|
||
@JsonProperty("$ref") | ||
public String getRef() { | ||
return ref; | ||
} | ||
|
||
@java.lang.Override | ||
public boolean equals(Object other) { | ||
if (this == other) return true; | ||
return other instanceof AccessorType && equalTo((AccessorType) other); | ||
} | ||
|
||
@JsonAnyGetter | ||
public Map<String, Object> getAdditionalProperties() { | ||
return this.additionalProperties; | ||
} | ||
|
||
private boolean equalTo(AccessorType other) { | ||
return ref.equals(other.ref); | ||
} | ||
|
||
@java.lang.Override | ||
public int hashCode() { | ||
return Objects.hash(this.ref); | ||
} | ||
|
||
@java.lang.Override | ||
public String toString() { | ||
return ObjectMappers.stringify(this); | ||
} | ||
|
||
public static RefStage builder() { | ||
return new Builder(); | ||
} | ||
|
||
public interface RefStage { | ||
_FinalStage ref(String ref); | ||
|
||
Builder from(AccessorType other); | ||
} | ||
|
||
public interface _FinalStage { | ||
AccessorType build(); | ||
} | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public static final class Builder implements RefStage, _FinalStage { | ||
private String ref; | ||
|
||
@JsonAnySetter | ||
private Map<String, Object> additionalProperties = new HashMap<>(); | ||
|
||
private Builder() {} | ||
|
||
@java.lang.Override | ||
public Builder from(AccessorType other) { | ||
ref(other.getRef()); | ||
return this; | ||
} | ||
|
||
@java.lang.Override | ||
@JsonSetter("$ref") | ||
public _FinalStage ref(String ref) { | ||
this.ref = ref; | ||
return this; | ||
} | ||
|
||
@java.lang.Override | ||
public AccessorType build() { | ||
return new AccessorType(ref, additionalProperties); | ||
} | ||
} | ||
} |
94 changes: 94 additions & 0 deletions
94
...in/java/com/courier/api/resources/automations/types/AutomationAddToBatchMaxItemsType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.courier.api.resources.automations.types; | ||
|
||
import com.courier.api.core.ObjectMappers; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import com.fasterxml.jackson.core.JsonParseException; | ||
import com.fasterxml.jackson.core.JsonParser; | ||
import com.fasterxml.jackson.databind.DeserializationContext; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer; | ||
import java.io.IOException; | ||
import java.util.Objects; | ||
|
||
@JsonDeserialize(using = AutomationAddToBatchMaxItemsType.Deserializer.class) | ||
public final class AutomationAddToBatchMaxItemsType { | ||
private final Object value; | ||
|
||
private final int type; | ||
|
||
private AutomationAddToBatchMaxItemsType(Object value, int type) { | ||
this.value = value; | ||
this.type = type; | ||
} | ||
|
||
@JsonValue | ||
public Object get() { | ||
return this.value; | ||
} | ||
|
||
public <T> T visit(Visitor<T> visitor) { | ||
if (this.type == 0) { | ||
return visitor.visit((String) this.value); | ||
} else if (this.type == 1) { | ||
return visitor.visit((int) this.value); | ||
} | ||
throw new IllegalStateException("Failed to visit value. This should never happen."); | ||
} | ||
|
||
@java.lang.Override | ||
public boolean equals(Object other) { | ||
if (this == other) return true; | ||
return other instanceof AutomationAddToBatchMaxItemsType && equalTo((AutomationAddToBatchMaxItemsType) other); | ||
} | ||
|
||
private boolean equalTo(AutomationAddToBatchMaxItemsType other) { | ||
return value.equals(other.value); | ||
} | ||
|
||
@java.lang.Override | ||
public int hashCode() { | ||
return Objects.hash(this.value); | ||
} | ||
|
||
@java.lang.Override | ||
public String toString() { | ||
return this.value.toString(); | ||
} | ||
|
||
public static AutomationAddToBatchMaxItemsType of(String value) { | ||
return new AutomationAddToBatchMaxItemsType(value, 0); | ||
} | ||
|
||
public static AutomationAddToBatchMaxItemsType of(int value) { | ||
return new AutomationAddToBatchMaxItemsType(value, 1); | ||
} | ||
|
||
public interface Visitor<T> { | ||
T visit(String value); | ||
|
||
T visit(int value); | ||
} | ||
|
||
static final class Deserializer extends StdDeserializer<AutomationAddToBatchMaxItemsType> { | ||
Deserializer() { | ||
super(AutomationAddToBatchMaxItemsType.class); | ||
} | ||
|
||
@java.lang.Override | ||
public AutomationAddToBatchMaxItemsType deserialize(JsonParser p, DeserializationContext ctxt) | ||
throws IOException { | ||
Object value = p.readValueAs(Object.class); | ||
try { | ||
return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); | ||
} catch (IllegalArgumentException e) { | ||
} | ||
if (value instanceof Integer) { | ||
return of((Integer) value); | ||
} | ||
throw new JsonParseException(p, "Failed to deserialize"); | ||
} | ||
} | ||
} |
Oops, something went wrong.