-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDK changes for Import Campaign API (#271)
* SDK changes for Import Campaign API * changelog and updated version * minor change * changing importcamp fn name to standard * changelog date updated --------- Co-authored-by: Thumpala Vinay Kumar <[email protected]> Co-authored-by: Sajal Singhal <[email protected]> Co-authored-by: Sajal Singhal <[email protected]>
- Loading branch information
1 parent
2ef6452
commit 7ca18df
Showing
12 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Written manually. | ||
|
||
version=5.38.3 | ||
version=5.39.0 | ||
groupId=com.plivo | ||
artifactId=plivo-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
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
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,39 @@ | ||
package com.plivo.api.models.base; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
import com.plivo.api.PlivoClient; | ||
import com.plivo.api.exceptions.PlivoRestException; | ||
import java.io.IOException; | ||
import retrofit2.Call; | ||
import retrofit2.Response; | ||
|
||
/** | ||
* Creates an instance of a resource. | ||
* | ||
* @param <ImportResponse> The type of the response. | ||
*/ | ||
@JsonInclude(Include.NON_NULL) | ||
public abstract class Importer<ImportResponse extends BaseResponse> extends BaseRequest { | ||
|
||
/** | ||
* Actually import an instance of the resource. | ||
*/ | ||
public ImportResponse import_campaign() throws IOException, PlivoRestException { | ||
validate(); | ||
Response<ImportResponse> response = obtainCall().execute(); | ||
|
||
handleResponse(response); | ||
|
||
return response.body(); | ||
} | ||
|
||
@Override | ||
public Importer<ImportResponse> client(final PlivoClient plivoClient) { | ||
this.plivoClient = plivoClient; | ||
return this; | ||
} | ||
|
||
|
||
protected abstract Call<ImportResponse> obtainCall(); | ||
} |
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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/plivo/api/models/campaign/CampaignImportResponse.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,12 @@ | ||
package com.plivo.api.models.campaign; | ||
|
||
import com.plivo.api.models.base.BaseResponse; | ||
import java.util.List; | ||
|
||
public class CampaignImportResponse extends BaseResponse{ | ||
private String campaignID; | ||
public String getcampaignID(){ | ||
return campaignID; | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/plivo/api/models/campaign/CampaignImporter.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,31 @@ | ||
package com.plivo.api.models.campaign; | ||
|
||
import com.plivo.api.models.base.Importer; | ||
import com.plivo.api.util.Utils; | ||
import retrofit2.Call; | ||
|
||
public class CampaignImporter extends Importer<CampaignImportResponse> { | ||
private String campaignID; | ||
private String campaignAlias; | ||
|
||
CampaignImporter(String campaignID,String campaignAlias) { | ||
|
||
this.campaignID = campaignID; | ||
this.campaignAlias = campaignAlias; | ||
} | ||
|
||
public String campaignID(){ | ||
return this.campaignID; | ||
} | ||
|
||
public String campaignAlias(){ | ||
return this.campaignAlias; | ||
} | ||
|
||
|
||
|
||
@Override | ||
protected Call<CampaignImportResponse> obtainCall() { | ||
return client().getApiService().importCampaign(client().getAuthId(), this); | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
5.38.3 | ||
5.39.0 |
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
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,5 @@ | ||
{ | ||
"api_id": "2c6c5e16-090a-11ed-bb48-0242ac110004", | ||
"campaign_id": "CNTQ0OD", | ||
"message": "Request to import campaign was received and is being processed." | ||
} |