Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package com.cloudesire.platform.apiclient.dto.model.dto;

import com.cloudesire.platform.apiclient.response.error.ErrorResponseEntry;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;
import java.util.Objects;

@ApiModel( "Bulk import execution result" )
public class BulkImportResultDTO extends DTO
{
@ApiModelProperty( "Bulk import request ID" )
private String requestId;

private UrlEntityDTO executor;

@ApiModelProperty( value = "What kind of import it has been requested", example = "CatalogCloudPricingCsvDTO,CatalogDistributorPricingCsvDTO" )
private String type;

private List<ErrorResponseEntry> errors;

public String getRequestId()
{
return requestId;
}

public void setRequestId( String requestId )
{
this.requestId = requestId;
}

public UrlEntityDTO getExecutor()
{
return executor;
}

public void setExecutor( UrlEntityDTO executor )
{
this.executor = executor;
}

public String getType()
{
return type;
}

public void setType( String type )
{
this.type = type;
}

public List<ErrorResponseEntry> getErrors()
{
return errors;
}

public void setErrors( List<ErrorResponseEntry> errors )
{
this.errors = errors;
}

@Override
public boolean equals( Object o )
{
if ( this == o ) return true;
if ( o == null || getClass() != o.getClass() ) return false;
BulkImportResultDTO that = (BulkImportResultDTO) o;
return Objects.equals( requestId, that.requestId ) && Objects.equals( executor, that.executor )
&& Objects.equals( type, that.type );
}

@Override
public int hashCode()
{
return Objects.hash( requestId, executor, type );
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.cloudesire.platform.apiclient.api;

import com.cloudesire.platform.apiclient.dto.model.dto.BulkImportResultDTO;
import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
Expand All @@ -12,6 +13,7 @@
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;

import java.util.List;
import java.util.Map;

public interface BulkApi
Expand Down Expand Up @@ -60,4 +62,10 @@ public interface BulkApi
@Multipart
@PUT( "bulk/users" )
Call<Void> saveUsers( @Part MultipartBody.Part file );

@GET( "bulk/result" )
Call<List<BulkImportResultDTO>> getResults();

@GET( "bulk/result/{requestId}" )
Call<BulkImportResultDTO> getResult( @Path( "requestId" ) String requestId );
}