package io.postman.generator.attributes.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.Map; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1-dev * User agent: apibuilder app.apibuilder.io/apicollective/postman-generator-attributes/0.0.1-dev/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 * * Attribute instructs the generator to add a setup step with the referenced entity creation. This attribute should be attached to the field (that holds an identifier) inside model or to the resource object (that holds operations and a path with an identifier param). */ @JsonIgnoreProperties( ignoreUnknown = true ) public class ObjectReference { private final String relatedServiceNamespace; private final String resourceType; private final io.apibuilder.spec.v0.models.Method operationMethod; private final String operationPath; private final String identifierField; private final Map queryParams; private final String deleteOperationPath; @JsonCreator public ObjectReference(@JsonProperty("related_service_namespace") String relatedServiceNamespace, @JsonProperty("resource_type") String resourceType, @JsonProperty("operation_method") io.apibuilder.spec.v0.models.Method operationMethod, @JsonProperty("operation_path") String operationPath, @JsonProperty("identifier_field") String identifierField, @JsonProperty("query_params") Map queryParams, @JsonProperty("delete_operation_path") String deleteOperationPath) { this.relatedServiceNamespace = relatedServiceNamespace; this.resourceType = resourceType; this.operationMethod = operationMethod; this.operationPath = operationPath; this.identifierField = identifierField; this.queryParams = queryParams; this.deleteOperationPath = deleteOperationPath; } /** * ApiBuilder service's namespace, in which a target operation is specified. */ public String getRelatedServiceNamespace() { return relatedServiceNamespace; } /** * Resource type, that holds a referenced operation. */ public String getResourceType() { return resourceType; } /** * Referenced operation method. */ public io.apibuilder.spec.v0.models.Method getOperationMethod() { return operationMethod; } /** * Operation path corresponding with the selected {{operation_method}}. */ public String getOperationPath() { return operationPath; } /** * A field name. When the referenced operation is called, identifier_field is used to extract the corresponding field from the response JSON. If the response JSON is an array, then a value is extracted from the first object. */ public String getIdentifierField() { return identifierField; } /** * Optionally, the specified query params will be used to execute a referenced operation. */ public Map getQueryParams() { return queryParams; } /** * Optionally, the referenced entity's DELETE operation path can be put here. If specified, the generator will add a cleanup step for the referenced object. */ public String getDeleteOperationPath() { return deleteOperationPath; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ObjectReference that = (ObjectReference) o; if (relatedServiceNamespace != null ? !relatedServiceNamespace.equals(that.relatedServiceNamespace) : that.relatedServiceNamespace != null) return false; if (resourceType != null ? !resourceType.equals(that.resourceType) : that.resourceType != null) return false; if (operationMethod != null ? !operationMethod.equals(that.operationMethod) : that.operationMethod != null) return false; if (operationPath != null ? !operationPath.equals(that.operationPath) : that.operationPath != null) return false; if (identifierField != null ? !identifierField.equals(that.identifierField) : that.identifierField != null) return false; if (queryParams != null ? !queryParams.equals(that.queryParams) : that.queryParams != null) return false; if (deleteOperationPath != null ? !deleteOperationPath.equals(that.deleteOperationPath) : that.deleteOperationPath != null) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (relatedServiceNamespace != null ? relatedServiceNamespace.hashCode() : 0); result = 31 * result + (resourceType != null ? resourceType.hashCode() : 0); result = 31 * result + (operationMethod != null ? operationMethod.hashCode() : 0); result = 31 * result + (operationPath != null ? operationPath.hashCode() : 0); result = 31 * result + (identifierField != null ? identifierField.hashCode() : 0); result = 31 * result + (queryParams != null ? queryParams.hashCode() : 0); result = 31 * result + (deleteOperationPath != null ? deleteOperationPath.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return io.postman.generator.attributes.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static ObjectReference parseJson(String json) throws IOException { return io.postman.generator.attributes.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, ObjectReference.class); } }