Skip to content

Commit

Permalink
fix: removed unwanted id field for create check payment
Browse files Browse the repository at this point in the history
  • Loading branch information
YegorZh committed Jul 23, 2024
1 parent e6d5757 commit 8bf8c29
Show file tree
Hide file tree
Showing 26 changed files with 2,698 additions and 51 deletions.
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.CreateCheckPayment;
import unit.java.sdk.model.CreateCheckPaymentRequest;
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 createCheckPayment Create Check Payment Request (required)
* @param createCheckPaymentRequest Create Check Payment Request (required)
* @return UnitCheckPaymentResponse
* @throws ApiException if fails to make API call
*/
public UnitCheckPaymentResponse execute(CreateCheckPayment createCheckPayment) throws ApiException {
ApiResponse<UnitCheckPaymentResponse> localVarResponse = executeWithHttpInfo(createCheckPayment);
public UnitCheckPaymentResponse execute(CreateCheckPaymentRequest createCheckPaymentRequest) throws ApiException {
ApiResponse<UnitCheckPaymentResponse> localVarResponse = executeWithHttpInfo(createCheckPaymentRequest);
return localVarResponse.getData();
}

/**
* Create Check Payment
* Create Check Payment via API
* @param createCheckPayment Create Check Payment Request (required)
* @param createCheckPaymentRequest Create Check Payment Request (required)
* @return ApiResponse&lt;UnitCheckPaymentResponse&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<UnitCheckPaymentResponse> executeWithHttpInfo(CreateCheckPayment createCheckPayment) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = executeRequestBuilder(createCheckPayment);
public ApiResponse<UnitCheckPaymentResponse> executeWithHttpInfo(CreateCheckPaymentRequest createCheckPaymentRequest) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = executeRequestBuilder(createCheckPaymentRequest);
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(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");
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");
}

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

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


/**
* CreateCheckPayment
*/
@JsonPropertyOrder({
CreateCheckPayment.JSON_PROPERTY_DATA
CreateCheckPayment.JSON_PROPERTY_TYPE,
CreateCheckPayment.JSON_PROPERTY_ATTRIBUTES,
CreateCheckPayment.JSON_PROPERTY_RELATIONSHIPS
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class CreateCheckPayment {
public static final String JSON_PROPERTY_DATA = "data";
private CheckPayment data;
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 CreateCheckPayment() {
}

public CreateCheckPayment data(CheckPayment data) {
this.data = data;
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;
return this;
}

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

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


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


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

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

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateCheckPayment {\n");
sb.append(" data: ").append(toIndentedString(data)).append("\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("}");
return sb.toString();
}
Expand Down Expand Up @@ -140,9 +203,19 @@ public String toUrlQueryString(String prefix) {

StringJoiner joiner = new StringJoiner("&");

// add `data` to the URL query string
if (getData() != null) {
joiner.add(getData().toUrlQueryString(prefix + "data" + suffix));
// 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));
}

return joiner.toString();
Expand Down
Loading

0 comments on commit 8bf8c29

Please sign in to comment.