-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matteo Giordano
committed
May 3, 2019
1 parent
841b90c
commit 1ccc626
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...t-dto/src/main/java/com/cloudesire/platform/apiclient/dto/model/dto/BackupPricingDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.cloudesire.platform.apiclient.dto.model.dto; | ||
|
||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
|
||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotNull; | ||
import java.math.BigDecimal; | ||
|
||
@ApiModel( description = "Defines pricing of a backup of a VM" ) | ||
public class BackupPricingDTO extends BaseEntityDTO | ||
{ | ||
@NotNull | ||
@Valid | ||
private UrlEntityDTO cloudProvider; | ||
|
||
@ApiModelProperty( "Chosen price" ) | ||
@NotNull | ||
private BigDecimal price; | ||
|
||
public UrlEntityDTO getCloudProvider() | ||
{ | ||
return cloudProvider; | ||
} | ||
|
||
public void setCloudProvider( UrlEntityDTO cloudProvider ) | ||
{ | ||
this.cloudProvider = cloudProvider; | ||
} | ||
|
||
public BigDecimal getPrice() | ||
{ | ||
return price; | ||
} | ||
|
||
public void setPrice( BigDecimal price ) | ||
{ | ||
this.price = price; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...sire-api-client/src/main/java/com/cloudesire/platform/apiclient/api/BackupPricingApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.cloudesire.platform.apiclient.api; | ||
|
||
import com.cloudesire.platform.apiclient.dto.model.dto.BackupPricingDTO; | ||
import com.cloudesire.platform.apiclient.dto.model.dto.PricingPatchDTO; | ||
import retrofit2.Call; | ||
import retrofit2.http.Body; | ||
import retrofit2.http.DELETE; | ||
import retrofit2.http.GET; | ||
import retrofit2.http.PATCH; | ||
import retrofit2.http.POST; | ||
import retrofit2.http.PUT; | ||
import retrofit2.http.Path; | ||
import retrofit2.http.Query; | ||
|
||
import java.util.List; | ||
|
||
public interface BackupPricingApi | ||
{ | ||
@POST( "backupPricing" ) | ||
Call<BackupPricingDTO> create( @Body BackupPricingDTO resource ); | ||
|
||
@GET( "backupPricing" ) | ||
Call<List<BackupPricingDTO>> getAll( @Query( "cloudProvider" ) int cloudProvider ); | ||
|
||
@GET( "backupPricing/{id}" ) | ||
Call<BackupPricingDTO> get( @Path( "id" ) int id ); | ||
|
||
@PUT( "backupPricing/{id}" ) | ||
Call<BackupPricingDTO> update( @Path( "id" ) int id, @Body BackupPricingDTO pricing ); | ||
|
||
@PATCH( "backupPricing/{id}" ) | ||
Call<Void> patch( @Path( "id" ) int id, @Body PricingPatchDTO price ); | ||
|
||
@DELETE( "backupPricing/{id}" ) | ||
Call<Void> delete( @Path( "id" ) int id ); | ||
} |