Skip to content

Commit

Permalink
Revert "Removed unwanted id field for create check payment (#29)"
Browse files Browse the repository at this point in the history
This reverts commit 7a5d762.
  • Loading branch information
YegorZh authored Jul 24, 2024
1 parent 7a5d762 commit a554e2f
Show file tree
Hide file tree
Showing 27 changed files with 51 additions and 2,699 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ spotless {
}

test {
environment "access_token", "v2.public.eyJyb2xlIjoiYWRtaW4iLCJ1c2VySWQiOiI0MTQ4Iiwic3ViIjoic29sb21paWFAY29kaWZ5LmlvIiwiZXhwIjoiMjAyNS0wMy0xM1QwODo1MToyNC42ODNaIiwianRpIjoiMzAzMTMzIiwib3JnSWQiOiIxMjYiLCJzY29wZSI6ImFwcGxpY2F0aW9ucyBhcHBsaWNhdGlvbnMtd3JpdGUgY3VzdG9tZXJzIGN1c3RvbWVycy13cml0ZSBjdXN0b21lci10YWdzLXdyaXRlIGN1c3RvbWVyLXRva2VuLXdyaXRlIGFjY291bnRzIGFjY291bnRzLXdyaXRlIGNhcmRzIGNhcmRzLXdyaXRlIGNhcmRzLXNlbnNpdGl2ZSBjYXJkcy1zZW5zaXRpdmUtd3JpdGUgdHJhbnNhY3Rpb25zIHRyYW5zYWN0aW9ucy13cml0ZSBhdXRob3JpemF0aW9ucyBzdGF0ZW1lbnRzIHBheW1lbnRzIHBheW1lbnRzLXdyaXRlIHBheW1lbnRzLXdyaXRlLWNvdW50ZXJwYXJ0eSBwYXltZW50cy13cml0ZS1saW5rZWQtYWNjb3VudCBhY2gtcGF5bWVudHMtd3JpdGUgd2lyZS1wYXltZW50cy13cml0ZSByZXBheW1lbnRzIHJlcGF5bWVudHMtd3JpdGUgcGF5bWVudHMtd3JpdGUtYWNoLWRlYml0IGNvdW50ZXJwYXJ0aWVzIGNvdW50ZXJwYXJ0aWVzLXdyaXRlIGJhdGNoLXJlbGVhc2VzIGJhdGNoLXJlbGVhc2VzLXdyaXRlIGxpbmtlZC1hY2NvdW50cyBsaW5rZWQtYWNjb3VudHMtd3JpdGUgd2ViaG9va3Mgd2ViaG9va3Mtd3JpdGUgZXZlbnRzIGV2ZW50cy13cml0ZSBhdXRob3JpemF0aW9uLXJlcXVlc3RzIGF1dGhvcml6YXRpb24tcmVxdWVzdHMtd3JpdGUgY2FzaC1kZXBvc2l0cyBjYXNoLWRlcG9zaXRzLXdyaXRlIGNoZWNrLWRlcG9zaXRzIGNoZWNrLWRlcG9zaXRzLXdyaXRlIHJlY2VpdmVkLXBheW1lbnRzIHJlY2VpdmVkLXBheW1lbnRzLXdyaXRlIGRpc3B1dGVzIGNoYXJnZWJhY2tzIGNoYXJnZWJhY2tzLXdyaXRlIHJld2FyZHMgcmV3YXJkcy13cml0ZSBjaGVjay1wYXltZW50cyBjaGVjay1wYXltZW50cy13cml0ZSBjcmVkaXQtZGVjaXNpb25zIGNyZWRpdC1kZWNpc2lvbnMtd3JpdGUgbGVuZGluZy1wcm9ncmFtcyBsZW5kaW5nLXByb2dyYW1zLXdyaXRlIGNyZWRpdC1hcHBsaWNhdGlvbnMgY3JlZGl0LWFwcGxpY2F0aW9ucy13cml0ZSIsIm9yZyI6IlNESyIsInNvdXJjZUlwIjoiIiwidXNlclR5cGUiOiJvcmciLCJpc1VuaXRQaWxvdCI6ZmFsc2V9uHGOiLd2BlGfSlsERcvW9xfdtA7iKuU1d-ZPf2z1Xdi8OaG8zPfPqjDatYSpMvm1GNpo6_mHMuv7cADa-GfRCg"
useJUnit()
}
// // Enable JUnit 5 (Gradle 4.6+).
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/unit/java/sdk/api/CreateCheckPaymentApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import unit.java.sdk.ApiResponse;
import unit.java.sdk.Pair;

import unit.java.sdk.model.CreateCheckPaymentRequest;
import unit.java.sdk.model.CreateCheckPayment;
import unit.java.sdk.model.UnitCheckPaymentResponse;

import com.fasterxml.jackson.core.type.TypeReference;
Expand Down Expand Up @@ -85,24 +85,24 @@ private String formatExceptionMessage(String operationId, int statusCode, String
/**
* Create Check Payment
* Create Check Payment via API
* @param createCheckPaymentRequest Create Check Payment Request (required)
* @param createCheckPayment Create Check Payment Request (required)
* @return UnitCheckPaymentResponse
* @throws ApiException if fails to make API call
*/
public UnitCheckPaymentResponse execute(CreateCheckPaymentRequest createCheckPaymentRequest) throws ApiException {
ApiResponse<UnitCheckPaymentResponse> localVarResponse = executeWithHttpInfo(createCheckPaymentRequest);
public UnitCheckPaymentResponse execute(CreateCheckPayment createCheckPayment) throws ApiException {
ApiResponse<UnitCheckPaymentResponse> localVarResponse = executeWithHttpInfo(createCheckPayment);
return localVarResponse.getData();
}

/**
* Create Check Payment
* Create Check Payment via API
* @param createCheckPaymentRequest Create Check Payment Request (required)
* @param createCheckPayment Create Check Payment Request (required)
* @return ApiResponse&lt;UnitCheckPaymentResponse&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<UnitCheckPaymentResponse> executeWithHttpInfo(CreateCheckPaymentRequest createCheckPaymentRequest) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = executeRequestBuilder(createCheckPaymentRequest);
public ApiResponse<UnitCheckPaymentResponse> executeWithHttpInfo(CreateCheckPayment createCheckPayment) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = executeRequestBuilder(createCheckPayment);
try {
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
Expand Down Expand Up @@ -130,10 +130,10 @@ public ApiResponse<UnitCheckPaymentResponse> executeWithHttpInfo(CreateCheckPaym
}
}

private HttpRequest.Builder executeRequestBuilder(CreateCheckPaymentRequest createCheckPaymentRequest) throws ApiException {
// verify the required parameter 'createCheckPaymentRequest' is set
if (createCheckPaymentRequest == null) {
throw new ApiException(400, "Missing the required parameter 'createCheckPaymentRequest' when calling execute");
private HttpRequest.Builder executeRequestBuilder(CreateCheckPayment createCheckPayment) throws ApiException {
// verify the required parameter 'createCheckPayment' is set
if (createCheckPayment == null) {
throw new ApiException(400, "Missing the required parameter 'createCheckPayment' when calling execute");
}

HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
Expand All @@ -146,7 +146,7 @@ private HttpRequest.Builder executeRequestBuilder(CreateCheckPaymentRequest crea
localVarRequestBuilder.header("Accept", "application/vnd.api+json");

try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createCheckPaymentRequest);
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createCheckPayment);
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
} catch (IOException e) {
throw new ApiException(e);
Expand Down
113 changes: 20 additions & 93 deletions src/main/java/unit/java/sdk/model/CreateCheckPayment.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,105 +25,46 @@
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import unit.java.sdk.model.CreateCheckPaymentAttributes;
import unit.java.sdk.model.CreateCheckPaymentRelationships;
import unit.java.sdk.model.CheckPayment;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;


/**
* CreateCheckPayment
*/
@JsonPropertyOrder({
CreateCheckPayment.JSON_PROPERTY_TYPE,
CreateCheckPayment.JSON_PROPERTY_ATTRIBUTES,
CreateCheckPayment.JSON_PROPERTY_RELATIONSHIPS
CreateCheckPayment.JSON_PROPERTY_DATA
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class CreateCheckPayment {
public static final String JSON_PROPERTY_TYPE = "type";
private String type = "checkPayment";

public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
private CreateCheckPaymentAttributes attributes;

public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships";
private CreateCheckPaymentRelationships relationships;
public static final String JSON_PROPERTY_DATA = "data";
private CheckPayment data;

public CreateCheckPayment() {
}

public CreateCheckPayment type(String type) {
this.type = type;
return this;
}

/**
* Get type
* @return type
**/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

public String getType() {
return type;
}


@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setType(String type) {
this.type = type;
}


public CreateCheckPayment attributes(CreateCheckPaymentAttributes attributes) {
this.attributes = attributes;
return this;
}

/**
* Get attributes
* @return attributes
**/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_ATTRIBUTES)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

public CreateCheckPaymentAttributes getAttributes() {
return attributes;
}


@JsonProperty(JSON_PROPERTY_ATTRIBUTES)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setAttributes(CreateCheckPaymentAttributes attributes) {
this.attributes = attributes;
}


public CreateCheckPayment relationships(CreateCheckPaymentRelationships relationships) {
this.relationships = relationships;
public CreateCheckPayment data(CheckPayment data) {
this.data = data;
return this;
}

/**
* Get relationships
* @return relationships
* Get data
* @return data
**/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_RELATIONSHIPS)
@JsonProperty(JSON_PROPERTY_DATA)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

public CreateCheckPaymentRelationships getRelationships() {
return relationships;
public CheckPayment getData() {
return data;
}


@JsonProperty(JSON_PROPERTY_RELATIONSHIPS)
@JsonProperty(JSON_PROPERTY_DATA)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setRelationships(CreateCheckPaymentRelationships relationships) {
this.relationships = relationships;
public void setData(CheckPayment data) {
this.data = data;
}


Expand All @@ -139,23 +80,19 @@ public boolean equals(Object o) {
return false;
}
CreateCheckPayment createCheckPayment = (CreateCheckPayment) o;
return Objects.equals(this.type, createCheckPayment.type) &&
Objects.equals(this.attributes, createCheckPayment.attributes) &&
Objects.equals(this.relationships, createCheckPayment.relationships);
return Objects.equals(this.data, createCheckPayment.data);
}

@Override
public int hashCode() {
return Objects.hash(type, attributes, relationships);
return Objects.hash(data);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateCheckPayment {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down Expand Up @@ -203,19 +140,9 @@ public String toUrlQueryString(String prefix) {

StringJoiner joiner = new StringJoiner("&");

// add `type` to the URL query string
if (getType() != null) {
joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}

// add `attributes` to the URL query string
if (getAttributes() != null) {
joiner.add(getAttributes().toUrlQueryString(prefix + "attributes" + suffix));
}

// add `relationships` to the URL query string
if (getRelationships() != null) {
joiner.add(getRelationships().toUrlQueryString(prefix + "relationships" + suffix));
// add `data` to the URL query string
if (getData() != null) {
joiner.add(getData().toUrlQueryString(prefix + "data" + suffix));
}

return joiner.toString();
Expand Down
Loading

0 comments on commit a554e2f

Please sign in to comment.