package io.apibuilder.spec.v0.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.util.Arrays; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.16.74 * User agent: apibuilder app.apibuilder.io/apicollective/apibuilder-spec/0.16.74/android_client * * WARNING: not all features (notably unions) and data types work with android generator yet. * Android generator is designed to be used in an android application, but should work in any java codebase as long as you import jackson and retrofit2 libraries. * If you are considering using this library, would like to request/discuss features, or would like to share how you're using it, please contact android-feedback@gilt.com * */ @JsonIgnoreProperties( ignoreUnknown = true ) public class Service { private final Apidoc apidoc; private final String name; private final Organization organization; private final Application application; private final String namespace; private final String version; private final String baseUrl; private final String description; private final Info info; private final Header[] headers; private final Import[] imports; private final Enum[] enums; private final Interface[] interfaces; private final Union[] unions; private final Model[] models; private final Resource[] resources; private final Attribute[] attributes; private final Annotation[] annotations; @JsonCreator public Service(@JsonProperty("apidoc") Apidoc apidoc, @JsonProperty("name") String name, @JsonProperty("organization") Organization organization, @JsonProperty("application") Application application, @JsonProperty("namespace") String namespace, @JsonProperty("version") String version, @JsonProperty("base_url") String baseUrl, @JsonProperty("description") String description, @JsonProperty("info") Info info, @JsonProperty("headers") Header[] headers, @JsonProperty("imports") Import[] imports, @JsonProperty("enums") Enum[] enums, @JsonProperty("interfaces") Interface[] interfaces, @JsonProperty("unions") Union[] unions, @JsonProperty("models") Model[] models, @JsonProperty("resources") Resource[] resources, @JsonProperty("attributes") Attribute[] attributes, @JsonProperty("annotations") Annotation[] annotations) { this.apidoc = apidoc; this.name = name; this.organization = organization; this.application = application; this.namespace = namespace; this.version = version; this.baseUrl = baseUrl; this.description = description; this.info = info; this.headers = headers; this.imports = imports; this.enums = enums; this.interfaces = interfaces; this.unions = unions; this.models = models; this.resources = resources; this.attributes = attributes; this.annotations = annotations; } /** * Documents that this is an apibuilder document, noting the specific version used. Internally the version is then used for backwards compatibility when applicable as new features are added to apibuilder. Note naming refers to the original name of this project, 'apidoc', and is left here to avoid a breaking change for preexisting services. */ public Apidoc getApidoc() { return apidoc; } public String getName() { return name; } public Organization getOrganization() { return organization; } public Application getApplication() { return application; } /** * Fully qualified namespace for this service */ public String getNamespace() { return namespace; } public String getVersion() { return version; } public String getBaseUrl() { return baseUrl; } public String getDescription() { return description; } public Info getInfo() { return info; } public Header[] getHeaders() { return headers; } public Import[] getImports() { return imports; } public Enum[] getEnums() { return enums; } public Interface[] getInterfaces() { return interfaces; } public Union[] getUnions() { return unions; } public Model[] getModels() { return models; } public Resource[] getResources() { return resources; } public Attribute[] getAttributes() { return attributes; } public Annotation[] getAnnotations() { return annotations; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Service that = (Service) o; if (apidoc != null ? !apidoc.equals(that.apidoc) : that.apidoc != null) return false; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (organization != null ? !organization.equals(that.organization) : that.organization != null) return false; if (application != null ? !application.equals(that.application) : that.application != null) return false; if (namespace != null ? !namespace.equals(that.namespace) : that.namespace != null) return false; if (version != null ? !version.equals(that.version) : that.version != null) return false; if (baseUrl != null ? !baseUrl.equals(that.baseUrl) : that.baseUrl != null) return false; if (description != null ? !description.equals(that.description) : that.description != null) return false; if (info != null ? !info.equals(that.info) : that.info != null) return false; if (!Arrays.equals(headers, that.headers)) return false; if (!Arrays.equals(imports, that.imports)) return false; if (!Arrays.equals(enums, that.enums)) return false; if (!Arrays.equals(interfaces, that.interfaces)) return false; if (!Arrays.equals(unions, that.unions)) return false; if (!Arrays.equals(models, that.models)) return false; if (!Arrays.equals(resources, that.resources)) return false; if (!Arrays.equals(attributes, that.attributes)) return false; if (!Arrays.equals(annotations, that.annotations)) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (apidoc != null ? apidoc.hashCode() : 0); result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (organization != null ? organization.hashCode() : 0); result = 31 * result + (application != null ? application.hashCode() : 0); result = 31 * result + (namespace != null ? namespace.hashCode() : 0); result = 31 * result + (version != null ? version.hashCode() : 0); result = 31 * result + (baseUrl != null ? baseUrl.hashCode() : 0); result = 31 * result + (description != null ? description.hashCode() : 0); result = 31 * result + (info != null ? info.hashCode() : 0); result = 31 * result + (headers != null ? headers.hashCode() : 0); result = 31 * result + (imports != null ? imports.hashCode() : 0); result = 31 * result + (enums != null ? enums.hashCode() : 0); result = 31 * result + (interfaces != null ? interfaces.hashCode() : 0); result = 31 * result + (unions != null ? unions.hashCode() : 0); result = 31 * result + (models != null ? models.hashCode() : 0); result = 31 * result + (resources != null ? resources.hashCode() : 0); result = 31 * result + (attributes != null ? attributes.hashCode() : 0); result = 31 * result + (annotations != null ? annotations.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return io.apibuilder.spec.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static Service parseJson(String json) throws IOException { return io.apibuilder.spec.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, Service.class); } }