Skip to content

Commit

Permalink
tollfree verification field in get numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
kapilp93 committed Sep 16, 2022
1 parent 3bdea94 commit cc0c156
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/Plivo/Client/SystemHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public SystemHttpClient(BasicAuth basicAuth, Dictionary<string, string> proxySer
);
_client.DefaultRequestHeaders.Authorization = authHeader;
_client.DefaultRequestHeaders.Add("User-Agent", "plivo-dotnet/" + ThisAssembly.AssemblyFileVersion);
var baseServerUri = string.IsNullOrEmpty(baseUri) ? "https://api.plivo.com/" + Version.ApiVersion : baseUri;
// var baseServerUri = string.IsNullOrEmpty(baseUri) ? "https://api.plivo.com/" + Version.ApiVersion : baseUri;
var baseServerUri = string.IsNullOrEmpty(baseUri) ? "https://api.numbers.plivodev.com/" + Version.ApiVersion : baseUri;
_client.BaseAddress = new Uri(baseServerUri + "/");

_voiceBaseUriClient = new System.Net.Http.HttpClient(httpClientHandler);
Expand Down
3 changes: 3 additions & 0 deletions src/Plivo/Resource/RentedNumber/RentedNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class RentedNumber : Resource
public string ComplianceStatus {get; set;}
public string TendlcCampaignId {get; set;}
public string TendlcRegistrationStatus {get; set;}
public string TollFreeSmsVerification {get; set;}

public override string ToString()
{
Expand Down Expand Up @@ -63,6 +64,7 @@ public override string ToString()
"ComplianceStatus: " + ComplianceStatus + "\n" +
"TendlcCampaignId: " + TendlcCampaignId + "\n" +
"TendlcRegistrationStatus: " + TendlcRegistrationStatus + "\n" +
"TollFreeSMSVerification: " + TollFreeSmsVerification + "\n" +
"VoiceRate: " + VoiceRate + "\n";
}
return
Expand All @@ -83,6 +85,7 @@ public override string ToString()
"VoiceEnabled: " + VoiceEnabled + "\n" +
"TendlcCampaignId: " + TendlcCampaignId + "\n" +
"TendlcRegistrationStatus: " + TendlcRegistrationStatus + "\n" +
"TollFreeSMSVerification: " + TollFreeSmsVerification + "\n" +
"VoiceRate: " + VoiceRate + "\n";
}

Expand Down
3 changes: 3 additions & 0 deletions src/Plivo/Resource/RentedNumber/RentedNumberInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ public async Task<RentedNumber> GetAsync(string number)
/// <param name="offset">Offset.</param>
/// <param name="tendlcCampaignId">TenDlc Campaign ID.</param>
/// <param name="tendlcRegistrationStatus">TenDLC Registration Status.</param>
/// <param name="tollFreeSMSVerification">TenDLC Registration Status.</param>
public ListResponse<RentedNumber> List(
string type = null, string numberStartswith = null,
string subaccount = null, string alias = null,
string services = null,
string tendlcCampaignId = null, string tendlcRegistrationStatus = null,
string tollFreeSmsVerification = null,
uint? limit = null, uint? offset = null)
{
var mandatoryParams = new List<string> {""};
Expand All @@ -84,6 +86,7 @@ public ListResponse<RentedNumber> List(
services,
tendlcCampaignId,
tendlcRegistrationStatus,
tollFreeSmsVerification,
limit,
offset
});
Expand Down
3 changes: 2 additions & 1 deletion tests/Plivo.Test/Mocks/numberGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"voice_enabled": true,
"voice_rate": "0.00850",
"tendlc_campaign_id": "ACB1234",
"tendlc_registration_status": "COMPLETED"
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": "verified"
}
9 changes: 6 additions & 3 deletions tests/Plivo.Test/Mocks/numberListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"voice_enabled": true,
"voice_rate": "0.00850",
"tendlc_campaign_id": "ACB1234",
"tendlc_registration_status": "COMPLETED"
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": "verified"
},
{
"added_on": "2013-01-01",
Expand All @@ -42,7 +43,8 @@
"voice_enabled": true,
"voice_rate": "0.00850",
"tendlc_campaign_id": "ACB1234",
"tendlc_registration_status": "COMPLETED"
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": "verified"
},
{
"added_on": "2013-03-25",
Expand All @@ -60,7 +62,8 @@
"voice_enabled": true,
"voice_rate": "0.00850",
"tendlc_campaign_id": "ACB1234",
"tendlc_registration_status": "COMPLETED"
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": "verified"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"voice_enabled": true,
"voice_rate": "0.00850",
"tendlc_campaign_id": "ACB1234",
"tendlc_registration_status": "COMPLETED"
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": "verified"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"voice_enabled": true,
"voice_rate": "0.00850",
"tendlc_campaign_id" : "ABC1234",
"tendlc_registration_status": "completed"
"tendlc_registration_status": "completed",
"toll_free_sms_verification": "verified"
},
{
"added_on": "2013-01-01",
Expand All @@ -42,7 +43,8 @@
"voice_enabled": true,
"voice_rate": "0.00850",
"tendlc_campaign_id" : "ABC1235",
"tendlc_registration_status": "completed"
"tendlc_registration_status": "completed",
"toll_free_sms_verification": "verified"
},
{
"added_on": "2013-03-25",
Expand All @@ -60,7 +62,8 @@
"voice_enabled": true,
"voice_rate": "0.00850",
"tendlc_campaign_id" : "ABC1235",
"tendlc_registration_status": "completed"
"tendlc_registration_status": "completed",
"toll_free_sms_verification": "verified"
}
]
}

0 comments on commit cc0c156

Please sign in to comment.