Skip to content

Commit

Permalink
Merge pull request #187 from OctopusDeploy/bug-release-filter-3533
Browse files Browse the repository at this point in the history
Added support to filter/search project releases
  • Loading branch information
Rob Pearson authored Jul 11, 2017
2 parents 69fca0a + 716ed5b commit 82c12b9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3762,7 +3762,7 @@ Octopus.Client.Repositories.Async
Task<ResourceCollection<ChannelResource>> GetChannels(Octopus.Client.Model.ProjectResource)
Task<ProgressionResource> GetProgression(Octopus.Client.Model.ProjectResource)
Task<ReleaseResource> GetReleaseByVersion(Octopus.Client.Model.ProjectResource, String)
Task<ResourceCollection<ReleaseResource>> GetReleases(Octopus.Client.Model.ProjectResource, Int32, Nullable<Int32>)
Task<ResourceCollection<ReleaseResource>> GetReleases(Octopus.Client.Model.ProjectResource, Int32, Nullable<Int32>, String)
Task<ResourceCollection<ProjectTriggerResource>> GetTriggers(Octopus.Client.Model.ProjectResource)
Task SetLogo(Octopus.Client.Model.ProjectResource, String, Stream)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4168,7 +4168,7 @@ Octopus.Client.Repositories
Octopus.Client.Model.ResourceCollection<ChannelResource> GetChannels(Octopus.Client.Model.ProjectResource)
Octopus.Client.Model.ProgressionResource GetProgression(Octopus.Client.Model.ProjectResource)
Octopus.Client.Model.ReleaseResource GetReleaseByVersion(Octopus.Client.Model.ProjectResource, String)
Octopus.Client.Model.ResourceCollection<ReleaseResource> GetReleases(Octopus.Client.Model.ProjectResource, Int32, Nullable<Int32>)
Octopus.Client.Model.ResourceCollection<ReleaseResource> GetReleases(Octopus.Client.Model.ProjectResource, Int32, Nullable<Int32>, String)
Octopus.Client.Model.ResourceCollection<ProjectTriggerResource> GetTriggers(Octopus.Client.Model.ProjectResource)
void SetLogo(Octopus.Client.Model.ProjectResource, String, Stream)
}
Expand Down Expand Up @@ -4612,7 +4612,7 @@ Octopus.Client.Repositories.Async
Task<ResourceCollection<ChannelResource>> GetChannels(Octopus.Client.Model.ProjectResource)
Task<ProgressionResource> GetProgression(Octopus.Client.Model.ProjectResource)
Task<ReleaseResource> GetReleaseByVersion(Octopus.Client.Model.ProjectResource, String)
Task<ResourceCollection<ReleaseResource>> GetReleases(Octopus.Client.Model.ProjectResource, Int32, Nullable<Int32>)
Task<ResourceCollection<ReleaseResource>> GetReleases(Octopus.Client.Model.ProjectResource, Int32, Nullable<Int32>, String)
Task<ResourceCollection<ProjectTriggerResource>> GetTriggers(Octopus.Client.Model.ProjectResource)
Task SetLogo(Octopus.Client.Model.ProjectResource, String, Stream)
}
Expand Down
16 changes: 4 additions & 12 deletions source/Octopus.Client/Repositories/Async/ProjectRepository.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Threading.Tasks;
Expand All @@ -10,14 +9,7 @@ namespace Octopus.Client.Repositories.Async

public interface IProjectRepository : IFindByName<ProjectResource>, IGet<ProjectResource>, ICreate<ProjectResource>, IModify<ProjectResource>, IDelete<ProjectResource>, IGetAll<ProjectResource>
{
/// <summary>
///
/// </summary>
/// <param name="project"></param>
/// <param name="skip">Number of records to skip</param>
/// <param name="take">Number of records to take (First supported in Server 3.14.15)</param>
/// <returns></returns>
Task<ResourceCollection<ReleaseResource>> GetReleases(ProjectResource project, int skip = 0, int? take = null);
Task<ResourceCollection<ReleaseResource>> GetReleases(ProjectResource project, int skip = 0, int? take = null, string searchByVersion = null);
Task<IReadOnlyList<ReleaseResource>> GetAllReleases(ProjectResource project);
Task<ReleaseResource> GetReleaseByVersion(ProjectResource project, string version);
Task<ResourceCollection<ChannelResource>> GetChannels(ProjectResource project);
Expand All @@ -35,12 +27,12 @@ public ProjectRepository(IOctopusAsyncClient client)
{
}

public Task<ResourceCollection<ReleaseResource>> GetReleases(ProjectResource project, int skip = 0, int? take = null)
public Task<ResourceCollection<ReleaseResource>> GetReleases(ProjectResource project, int skip = 0, int? take = null, string searchByVersion = null)
{
return Client.List<ReleaseResource>(project.Link("Releases"), new { skip, take });
return Client.List<ReleaseResource>(project.Link("Releases"), new { skip, take, searchByVersion });
}

public Task<IReadOnlyList<ReleaseResource>> GetAllReleases(ProjectResource project)
public Task<IReadOnlyList<ReleaseResource>> GetAllReleases(ProjectResource project)
{
return Client.ListAll<ReleaseResource>(project.Link("Releases"));
}
Expand Down
14 changes: 3 additions & 11 deletions source/Octopus.Client/Repositories/ProjectRepository.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using Octopus.Client.Editors;
Expand All @@ -8,14 +7,7 @@ namespace Octopus.Client.Repositories
{
public interface IProjectRepository : IFindByName<ProjectResource>, IGet<ProjectResource>, ICreate<ProjectResource>, IModify<ProjectResource>, IDelete<ProjectResource>, IGetAll<ProjectResource>
{
/// <summary>
///
/// </summary>
/// <param name="project"></param>
/// <param name="skip">Number of records to skip</param>
/// <param name="take">Number of records to take (First supported in Server 3.14.159)</param>
/// <returns></returns>
ResourceCollection<ReleaseResource> GetReleases(ProjectResource project, int skip = 0, int? take = null);
ResourceCollection<ReleaseResource> GetReleases(ProjectResource project, int skip = 0, int? take = null, string searchByVersion = null);
IReadOnlyList<ReleaseResource> GetAllReleases(ProjectResource project);
ReleaseResource GetReleaseByVersion(ProjectResource project, string version);
ResourceCollection<ChannelResource> GetChannels(ProjectResource project);
Expand All @@ -33,9 +25,9 @@ public ProjectRepository(IOctopusClient client)
{
}

public ResourceCollection<ReleaseResource> GetReleases(ProjectResource project, int skip = 0, int? take = null)
public ResourceCollection<ReleaseResource> GetReleases(ProjectResource project, int skip = 0, int? take = null, string searchByVersion = null)
{
return Client.List<ReleaseResource>(project.Link("Releases"), new { skip, take });
return Client.List<ReleaseResource>(project.Link("Releases"), new { skip, take, searchByVersion });
}

public IReadOnlyList<ReleaseResource> GetAllReleases(ProjectResource project)
Expand Down

0 comments on commit 82c12b9

Please sign in to comment.