Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated SearchForOrganizations to better reflect its purpose #236

Merged
merged 2 commits into from
Aug 26, 2016
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
4 changes: 2 additions & 2 deletions src/Tests/OrganizationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public void CanSearchForOrganizations()
var res = api.Organizations.GetOrganizationsStartingWith(Settings.DefaultOrg.Substring(0, 3));
Assert.Greater(res.Count, 0);

var search = api.Organizations.SearchForOrganizations(Settings.DefaultOrg);
Assert.Greater(res.Count, 0);
var search = api.Organizations.SearchForOrganizationsByExternalId(Settings.DefaultExternalId);
Assert.Greater(search.Count, 0);
}

[Test]
Expand Down
2 changes: 2 additions & 0 deletions src/Tests/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public class Settings

public const string Site = "https://csharpapi.zendesk.com/api/v2/";
public const string DefaultOrg = "csharpapi";
public const string DefaultExternalId = "1234abc";

public const string Email = "eric.neifert@gmail.com";
public const string Password = "pa55word";
public const string ApiToken = "R5PXRh5hEwT9Ry3hfSzGF2WKsxPf3ScSCq0suxii";
Expand Down
6 changes: 3 additions & 3 deletions src/ZendeskApi_v2/Requests/Organizations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface IOrganizations : ICore
/// <returns></returns>
GroupOrganizationResponse GetOrganizationsStartingWith(string name);

GroupOrganizationResponse SearchForOrganizations(string searchTerm);
GroupOrganizationResponse SearchForOrganizationsByExternalId(string externalId);
IndividualOrganizationResponse GetOrganization(long id);
IndividualOrganizationResponse CreateOrganization(Organization organization);
IndividualOrganizationResponse UpdateOrganization(Organization organization);
Expand Down Expand Up @@ -94,9 +94,9 @@ public GroupOrganizationResponse GetOrganizationsStartingWith(string name)
return GenericPost<GroupOrganizationResponse>(string.Format("organizations/autocomplete.json?name={0}", name));
}

public GroupOrganizationResponse SearchForOrganizations(string searchTerm)
public GroupOrganizationResponse SearchForOrganizationsByExternalId(string externalId)
{
return GenericGet<GroupOrganizationResponse>(string.Format("organizations/search.json?external_id={0}", searchTerm));
return GenericGet<GroupOrganizationResponse>(string.Format("organizations/search.json?external_id={0}", externalId));
}

public IndividualOrganizationResponse GetOrganization(long id)
Expand Down