Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/jp/ne/paypay/api/ApiNameConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ public class ApiNameConstants {
public static final String GET_CASHBACK_DETAILS = "v2_getCashbackDetails";
public static final String CREATE_REVERSE_CASHBACK_REQUEST = "v2_createReverseCashBackRequest";
public static final String GET_REVERSED_CASHBACK_DETAILS = "v2_getReversedCashBackDetails";
public static final String GET_USER_CASHBACK_SETTING_STATUS = "v1_userCashbackSettingStatus";
public static final String UPDATE_USER_CASHBACK_USE_STATUS = "v1_updateUserCashbackUseStatus";
public static final String UPDATE_USER_CASHBACK_AUTO_INVESTMENT = "v1_updateUserCashbackAutoInvestment";
}
111 changes: 111 additions & 0 deletions src/main/java/jp/ne/paypay/api/UserApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
import jp.ne.paypay.ApiResponse;
import jp.ne.paypay.Configuration;
import jp.ne.paypay.Pair;
import jp.ne.paypay.Validator;
import jp.ne.paypay.model.MaskedUserProfileResponse;
import jp.ne.paypay.model.NotDataResponse;
import jp.ne.paypay.model.UserAuthorizationStatus;
import jp.ne.paypay.model.UserCashbackAutoInvestment;
import jp.ne.paypay.model.UserCashbackSettingStatus;
import jp.ne.paypay.model.UserCashbackUseStatus;

import java.lang.reflect.Type;

Expand All @@ -18,6 +22,8 @@
public class UserApi {
private ApiClient apiClient;

private final Validator validator = Validator.getInstance();

public UserApi() {
this(new Configuration().getDefaultApiClient());
}
Expand Down Expand Up @@ -131,4 +137,109 @@ protected ApiResponse<NotDataResponse> unlinkUserWithHttpInfo(String userAuthori
Type localVarReturnType = new TypeToken<NotDataResponse>(){}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.UNLINK_USER);
}

/**
* Get user cashback setting status
* Get cashback setting state of specified user **Timeout: 15s**
* @param userAuthorizationId (required)
* @return UserCashbackSettingStatus
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body

*/
public UserCashbackSettingStatus getUserCashbackSettingStatus(String userAuthorizationId) throws ApiException {
ApiResponse<UserCashbackSettingStatus> resp = getUserCashbackSettingStatusWithHttpInfo(userAuthorizationId);
return resp.getData();
}

/**
* Get user cashback setting status
* Get cashback setting state of specified user **Timeout: 15s**
* @param userAuthorizationId (required)
* @return ApiResponse&lt;UserCashbackSettingStatus&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body

*/
protected ApiResponse<UserCashbackSettingStatus> getUserCashbackSettingStatusWithHttpInfo(String userAuthorizationId) throws ApiException {
Call call = getUserCashbackSettingStatusValidateBeforeCall(userAuthorizationId);
Type localVarReturnType = new TypeToken<UserCashbackSettingStatus>(){}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.GET_USER_CASHBACK_SETTING_STATUS);
}

private Call getUserCashbackSettingStatusValidateBeforeCall(String userAuthorizationId) throws ApiException {
return ApiUtil.getCallObject(apiClient, "/v1/user/cashback_setting_state/{userAuthorizationId}", new Pair(ApiConstants.USER_AUTHORIZATION_ID,
userAuthorizationId), "GET");
}

/**
* Set useCashback flag
* Set the useCashback flag of specified user. **Timeout: 15s**
*
* @param body UserCashbackUseStatus
* @return NotDataResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public NotDataResponse updateUserCashbackUseStatus(UserCashbackUseStatus body) throws ApiException {
String message = validator.validate(body);
if (message != null) {
throw new IllegalArgumentException(message);
}
ApiResponse<NotDataResponse> resp = updateUserCashbackUseStatusWithHttpInfo(body);
return resp.getData();
}

/**
* Set useCashback flag
* Set the useCashback flag of specified user. **Timeout: 15s**
*
* @param body UserCashbackUseStatus
* @return ApiResponse&lt;NotDataResponse&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
protected ApiResponse<NotDataResponse> updateUserCashbackUseStatusWithHttpInfo(Object body) throws ApiException {
Call call = updateUserCashbackUseStatusBeforeCall(body);
Type localVarReturnType = new TypeToken<NotDataResponse>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.UPDATE_USER_CASHBACK_USE_STATUS);
}

private Call updateUserCashbackUseStatusBeforeCall(Object body) throws ApiException {
return ApiUtil.postCallObject(apiClient, "/v1/user/use_cashback", body, null);
}

/**
* Set cashbackAutoInvestment flag
* Set cashbackAutoInvestment flag of specified user. **Timeout: 15s**
*
* @param body UserCashbackAutoInvestment
* @return NotDataResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public NotDataResponse updateUserCashbackAutoInvestment(UserCashbackAutoInvestment body) throws ApiException {
String message = validator.validate(body);
if (message != null) {
throw new IllegalArgumentException(message);
}
ApiResponse<NotDataResponse> resp = updateUserCashbackAutoInvestmentWithHttpInfo(body);
return resp.getData();
}

/**
* Set cashbackAutoInvestment flag
* Set cashbackAutoInvestment flag of specified user. **Timeout: 15s**
*
* @param body UserCashbackAutoInvestment
* @return ApiResponse&lt;NotDataResponse&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
protected ApiResponse<NotDataResponse> updateUserCashbackAutoInvestmentWithHttpInfo(Object body) throws ApiException {
Call call = updateUserCashbackAutoInvestmentBeforeCall(body);
Type localVarReturnType = new TypeToken<NotDataResponse>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.UPDATE_USER_CASHBACK_AUTO_INVESTMENT);
}

private Call updateUserCashbackAutoInvestmentBeforeCall(Object body) throws ApiException {
return ApiUtil.postCallObject(apiClient, "/v1/user/cashback_auto_investment", body, null);
}

}
113 changes: 113 additions & 0 deletions src/main/java/jp/ne/paypay/model/UserCashbackAutoInvestment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
package jp.ne.paypay.model;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

import java.time.Instant;
import java.util.Objects;

/**
* UserCashbackAutoInvestment
*/

public class UserCashbackAutoInvestment {

@SerializedName("userAuthorizationId")
@NotEmpty(message = "userAuthorizationId is required")
@Size(max = 64, message = "maximum 64 characters are allowed for userAuthorizationId")
private String userAuthorizationId = null;

@SerializedName("cashbackAutoInvestment")
@NotNull(message = "cashbackAutoInvestment is required")
private Boolean cashbackAutoInvestment = null;

@SerializedName("updatedAt")
private Long updatedAt = Instant.now().getEpochSecond();

/**
* Get userAuthorizationId
* @return userAuthorizationId
**/
@ApiModelProperty(value = "")
public String getUserAuthorizationId() {
return userAuthorizationId;
}

public void setUserAuthorizationId(String userAuthorizationId) {
this.userAuthorizationId = userAuthorizationId;
}

/**
* Get cashbackAutoInvestment
* @return cashbackAutoInvestment
**/
@ApiModelProperty(value = "")
public Boolean getCashbackAutoInvestment() {
return cashbackAutoInvestment;
}

public void setCashbackAutoInvestment(Boolean cashbackAutoInvestment) {
this.cashbackAutoInvestment = cashbackAutoInvestment;
}

/**
* Get updatedAt
* @return updatedAt
**/
@ApiModelProperty(value = "")
public Long getUpdatedAt() {
return updatedAt;
}

public void setUpdatedAt(Long updatedAt) {
this.updatedAt = updatedAt;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UserCashbackAutoInvestment userCashbackAutoInvestment = (UserCashbackAutoInvestment) o;
return Objects.equals(this.userAuthorizationId, userCashbackAutoInvestment.userAuthorizationId) &&
Objects.equals(this.cashbackAutoInvestment, userCashbackAutoInvestment.cashbackAutoInvestment) &&
Objects.equals(this.updatedAt, userCashbackAutoInvestment.updatedAt);
}

@Override
public int hashCode() {
return Objects.hash(userAuthorizationId, cashbackAutoInvestment, updatedAt);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UserCashbackAutoInvestment {\n");
sb.append(" userAuthorizationId: ").append(toIndentedString(userAuthorizationId)).append("\n");
sb.append(" useCashback: ").append(toIndentedString(cashbackAutoInvestment)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

}



98 changes: 98 additions & 0 deletions src/main/java/jp/ne/paypay/model/UserCashbackSettingStatus.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package jp.ne.paypay.model;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModelProperty;

import java.util.Objects;

/**
* UserCashbackSettingStatus
*/

public class UserCashbackSettingStatus {

@SerializedName("resultInfo")
private ResultInfo resultInfo = null;

@SerializedName("data")
private UserCashbackStatus data = null;

public UserCashbackSettingStatus resultInfo(ResultInfo resultInfo) {
this.resultInfo = resultInfo;
return this;
}


/**
* Get resultInfo
* @return resultInfo
**/
@ApiModelProperty(value = "")
public ResultInfo getResultInfo() {
return resultInfo;
}
public void setResultInfo(ResultInfo resultInfo) {
this.resultInfo = resultInfo;
}

public UserCashbackSettingStatus data(UserCashbackStatus data) {
this.data = data;
return this;
}


/**
* Get data
* @return data
**/
@ApiModelProperty(value = "")
public UserCashbackStatus getData() {
return data;
}
public void setData(UserCashbackStatus data) {
this.data = data;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UserCashbackSettingStatus userCashbackSettingStatus = (UserCashbackSettingStatus) o;
return Objects.equals(this.resultInfo, userCashbackSettingStatus.resultInfo) &&
Objects.equals(this.data, userCashbackSettingStatus.data);
}

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

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UserCashbackSettingStatus {\n");
sb.append(" resultInfo: ").append(toIndentedString(resultInfo)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

}



Loading