-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
25 changed files
with
1,766 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
language: csharp | ||
solution: MessageMediaLookups.sln | ||
install: | ||
- nuget restore MessageMediaLookups.sln | ||
- nuget install NUnit.Runners -Version 3.2.1 -OutputDirectory testrunner | ||
script: | ||
- xbuild /p:Configuration=Release MessageMediaLookups.sln | ||
- mono ./testrunner/NUnit.ConsoleRunner.3.2.1/tools/nunit3-console.exe ./MessageMediaLookups.Tests/bin/Release/MessageMediaLookups.Tests.dll |
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,13 @@ | ||
node { | ||
stage 'Checkout' | ||
checkout scm | ||
|
||
stage 'Prepare' | ||
bat 'nuget restore "MessageMediaLookups.sln"' | ||
bat 'nuget install NUnit.Runners -Version 3.2.1 -OutputDirectory testrunner' | ||
|
||
stage 'Build' | ||
bat "MSBuild.exe /p:Configuration=Release \"MessageMediaLookups.sln\"" | ||
stage 'Test' | ||
bat "testrunner\\NUnit.ConsoleRunner.3.2.1\\tools\\nunit3-console.exe MessageMediaLookups.Tests\\bin\\Release\MessageMediaLookups.Tests.dll" | ||
} |
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,28 @@ | ||
License: | ||
======== | ||
The MIT License (MIT) | ||
http://opensource.org/licenses/MIT | ||
|
||
Copyright (c) 2014 - 2016 APIMATIC Limited | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
|
||
Trade Mark: | ||
========== | ||
APIMATIC is a trade mark for APIMATIC Limited |
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,19 @@ | ||
using MessageMedia.Lookups.Models; | ||
namespace MessageMedia.Lookups | ||
{ | ||
public partial class Configuration | ||
{ | ||
|
||
//The base Uri for API calls | ||
public static string BaseUri = "https://api.messagemedia.com"; | ||
|
||
//The username to use with basic authentication | ||
//TODO: Replace the BasicAuthUserName with an appropriate value | ||
public static string BasicAuthUserName = "TODO: Replace"; | ||
|
||
//The password to use with basic authentication | ||
//TODO: Replace the BasicAuthPassword with an appropriate value | ||
public static string BasicAuthPassword = "TODO: Replace"; | ||
|
||
} | ||
} |
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,60 @@ | ||
/* | ||
* MessageMediaLookups.PCL | ||
* | ||
* This file was automatically generated for MessageMedia by APIMATIC v2.0 ( https://apimatic.io ) | ||
*/ | ||
using System; | ||
using APIMATIC.SDK.Common; | ||
using APIMATIC.SDK.Http.Client; | ||
using APIMATIC.SDK.Http.Response; | ||
|
||
namespace MessageMedia.Lookups.Controllers | ||
{ | ||
public partial class BaseController | ||
{ | ||
#region shared http client instance | ||
private static object syncObject = new object(); | ||
private static IHttpClient clientInstance = null; | ||
|
||
public static IHttpClient ClientInstance | ||
{ | ||
get | ||
{ | ||
lock(syncObject) | ||
{ | ||
if(null == clientInstance) | ||
{ | ||
clientInstance = new HTTPClient() | ||
; | ||
} | ||
return clientInstance; | ||
} | ||
} | ||
set | ||
{ | ||
lock (syncObject) | ||
{ | ||
if (value is IHttpClient) | ||
{ | ||
clientInstance = value; | ||
} | ||
} | ||
} | ||
} | ||
#endregion shared http client instance | ||
|
||
internal ArrayDeserialization ArrayDeserializationFormat = ArrayDeserialization.Indexed; | ||
internal static char ParameterSeparator = '&'; | ||
|
||
/// <summary> | ||
/// Validates the response against HTTP errors defined at the API level | ||
/// </summary> | ||
/// <param name="_response">The response recieved</param> | ||
/// <param name="_context">Context of the request and the recieved response</param> | ||
internal void ValidateResponse(HttpResponse _response, HttpContext _context) | ||
{ | ||
if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK | ||
throw new APIException(@"HTTP Response Not OK", _context); | ||
} | ||
} | ||
} |
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,89 @@ | ||
/* | ||
* MessageMediaLookups.PCL | ||
* | ||
* This file was automatically generated for MessageMedia by APIMATIC v2.0 ( https://apimatic.io ) | ||
*/ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Dynamic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using APIMATIC.SDK.Common; | ||
using APIMATIC.SDK.Http.Request; | ||
using APIMATIC.SDK.Http.Response; | ||
using APIMATIC.SDK.Http.Client; | ||
|
||
namespace MessageMedia.Lookups.Controllers | ||
{ | ||
public partial interface ILookupsController | ||
{ | ||
/// <summary> | ||
/// Use the Lookups API to find information about a phone number. | ||
/// A request to the lookups API has the following format: | ||
/// ```/v1/lookups/phone/{phone_number}?options={carrier,type}``` | ||
/// The `{phone_number}` parameter is a required field and should be set to the phone number to be looked up. | ||
/// The options query parameter can also be used to request additional information about the phone number. | ||
/// By default, a request will only return the `country_code` and `phone_number` properties in the response. | ||
/// To request details about the the carrier, include `carrier` as a value of the options parameter. | ||
/// To request details about the type, include `type` as a value of the options parameter. To pass multiple values | ||
/// to the options parameter, use a comma separated list, i.e. `carrier,type`. | ||
/// A successful request to the lookups endpoint will return a response body as follows: | ||
/// ```json | ||
/// { | ||
/// "country_code": "AU", | ||
/// "phone_number": "+61491570156", | ||
/// "type": "mobile", | ||
/// "carrier": { | ||
/// "name": "Telstra" | ||
/// } | ||
/// } | ||
/// ``` | ||
/// Each property in the response body is defined as follows: | ||
/// - ```country_code``` ISO ALPHA 2 country code of the phone number | ||
/// - ```phone_number``` E.164 formatted phone number | ||
/// - ```type``` The type of number. This can be ```"mobile"``` or ```"landline"``` | ||
/// - ```carrier``` Holds information about the specific carrier (if available) | ||
/// - ```name``` The carrier's name as reported by the network | ||
/// </summary> | ||
/// <param name="phoneNumber">Required parameter: The phone number to be looked up</param> | ||
/// <param name="options">Optional parameter: Example: </param> | ||
/// <return>Returns the Models.LookupAPhoneNumberResponse response from the API call</return> | ||
Models.LookupAPhoneNumberResponse GetLookupAPhoneNumber(string phoneNumber, string options = null); | ||
|
||
/// <summary> | ||
/// Use the Lookups API to find information about a phone number. | ||
/// A request to the lookups API has the following format: | ||
/// ```/v1/lookups/phone/{phone_number}?options={carrier,type}``` | ||
/// The `{phone_number}` parameter is a required field and should be set to the phone number to be looked up. | ||
/// The options query parameter can also be used to request additional information about the phone number. | ||
/// By default, a request will only return the `country_code` and `phone_number` properties in the response. | ||
/// To request details about the the carrier, include `carrier` as a value of the options parameter. | ||
/// To request details about the type, include `type` as a value of the options parameter. To pass multiple values | ||
/// to the options parameter, use a comma separated list, i.e. `carrier,type`. | ||
/// A successful request to the lookups endpoint will return a response body as follows: | ||
/// ```json | ||
/// { | ||
/// "country_code": "AU", | ||
/// "phone_number": "+61491570156", | ||
/// "type": "mobile", | ||
/// "carrier": { | ||
/// "name": "Telstra" | ||
/// } | ||
/// } | ||
/// ``` | ||
/// Each property in the response body is defined as follows: | ||
/// - ```country_code``` ISO ALPHA 2 country code of the phone number | ||
/// - ```phone_number``` E.164 formatted phone number | ||
/// - ```type``` The type of number. This can be ```"mobile"``` or ```"landline"``` | ||
/// - ```carrier``` Holds information about the specific carrier (if available) | ||
/// - ```name``` The carrier's name as reported by the network | ||
/// </summary> | ||
/// <param name="phoneNumber">Required parameter: The phone number to be looked up</param> | ||
/// <param name="options">Optional parameter: Example: </param> | ||
/// <return>Returns the Models.LookupAPhoneNumberResponse response from the API call</return> | ||
Task<Models.LookupAPhoneNumberResponse> GetLookupAPhoneNumberAsync(string phoneNumber, string options = null); | ||
|
||
} | ||
} |
Oops, something went wrong.