Skip to content

Commit

Permalink
Method to get tenant project variables
Browse files Browse the repository at this point in the history
  • Loading branch information
tothegills committed Oct 14, 2024
1 parent bbe3931 commit 7882e5a
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7314,6 +7314,18 @@ Octopus.Client.Model.TenantVariables
Octopus.Client.Model.TenantVariables.TenantCommonVariable[] CommonVariables { get; set; }
String TenantId { get; set; }
}
class GetProjectVariablesByTenantIdRequest
{
.ctor(String, String)
String SpaceId { get; set; }
String TenantId { get; set; }
}
class GetProjectVariablesByTenantIdResponse
{
.ctor(String, Octopus.Client.Model.TenantVariables.TenantProjectVariable[])
Octopus.Client.Model.TenantVariables.TenantProjectVariable[] ProjectVariables { get; set; }
String TenantId { get; set; }
}
class ModifyCommonVariablesByTenantIdCommand
{
.ctor(String, String, Octopus.Client.Model.TenantVariables.TenantCommonVariable[])
Expand Down Expand Up @@ -8504,6 +8516,7 @@ Octopus.Client.Repositories
Octopus.Client.Repositories.IGetAll<TenantVariableResource>
{
Octopus.Client.Model.TenantVariables.GetCommonVariablesByTenantIdResponse Get(Octopus.Client.Model.TenantVariables.GetCommonVariablesByTenantIdRequest)
Octopus.Client.Model.TenantVariables.GetProjectVariablesByTenantIdResponse Get(Octopus.Client.Model.TenantVariables.GetProjectVariablesByTenantIdRequest)
List<TenantVariableResource> GetAll(Octopus.Client.Model.ProjectResource)
Octopus.Client.Model.TenantVariables.ModifyCommonVariablesByTenantIdResponse Modify(Octopus.Client.Model.TenantVariables.ModifyCommonVariablesByTenantIdCommand)
Octopus.Client.Model.TenantVariables.ModifyProjectVariablesByTenantIdResponse Modify(Octopus.Client.Model.TenantVariables.ModifyProjectVariablesByTenantIdCommand)
Expand Down Expand Up @@ -9366,6 +9379,7 @@ Octopus.Client.Repositories.Async
Octopus.Client.Repositories.Async.IGetAll<TenantVariableResource>
{
Task<GetCommonVariablesByTenantIdResponse> Get(Octopus.Client.Model.TenantVariables.GetCommonVariablesByTenantIdRequest, CancellationToken)
Task<GetProjectVariablesByTenantIdResponse> Get(Octopus.Client.Model.TenantVariables.GetProjectVariablesByTenantIdRequest, CancellationToken)
Task<List<TenantVariableResource>> GetAll(Octopus.Client.Model.ProjectResource)
Task<ModifyCommonVariablesByTenantIdResponse> Modify(Octopus.Client.Model.TenantVariables.ModifyCommonVariablesByTenantIdCommand, CancellationToken)
Task<ModifyProjectVariablesByTenantIdResponse> Modify(Octopus.Client.Model.TenantVariables.ModifyProjectVariablesByTenantIdCommand, CancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7338,6 +7338,18 @@ Octopus.Client.Model.TenantVariables
Octopus.Client.Model.TenantVariables.TenantCommonVariable[] CommonVariables { get; set; }
String TenantId { get; set; }
}
class GetProjectVariablesByTenantIdRequest
{
.ctor(String, String)
String SpaceId { get; set; }
String TenantId { get; set; }
}
class GetProjectVariablesByTenantIdResponse
{
.ctor(String, Octopus.Client.Model.TenantVariables.TenantProjectVariable[])
Octopus.Client.Model.TenantVariables.TenantProjectVariable[] ProjectVariables { get; set; }
String TenantId { get; set; }
}
class ModifyCommonVariablesByTenantIdCommand
{
.ctor(String, String, Octopus.Client.Model.TenantVariables.TenantCommonVariable[])
Expand Down Expand Up @@ -8529,6 +8541,7 @@ Octopus.Client.Repositories
Octopus.Client.Repositories.IGetAll<TenantVariableResource>
{
Octopus.Client.Model.TenantVariables.GetCommonVariablesByTenantIdResponse Get(Octopus.Client.Model.TenantVariables.GetCommonVariablesByTenantIdRequest)
Octopus.Client.Model.TenantVariables.GetProjectVariablesByTenantIdResponse Get(Octopus.Client.Model.TenantVariables.GetProjectVariablesByTenantIdRequest)
List<TenantVariableResource> GetAll(Octopus.Client.Model.ProjectResource)
Octopus.Client.Model.TenantVariables.ModifyCommonVariablesByTenantIdResponse Modify(Octopus.Client.Model.TenantVariables.ModifyCommonVariablesByTenantIdCommand)
Octopus.Client.Model.TenantVariables.ModifyProjectVariablesByTenantIdResponse Modify(Octopus.Client.Model.TenantVariables.ModifyProjectVariablesByTenantIdCommand)
Expand Down Expand Up @@ -9391,6 +9404,7 @@ Octopus.Client.Repositories.Async
Octopus.Client.Repositories.Async.IGetAll<TenantVariableResource>
{
Task<GetCommonVariablesByTenantIdResponse> Get(Octopus.Client.Model.TenantVariables.GetCommonVariablesByTenantIdRequest, CancellationToken)
Task<GetProjectVariablesByTenantIdResponse> Get(Octopus.Client.Model.TenantVariables.GetProjectVariablesByTenantIdRequest, CancellationToken)
Task<List<TenantVariableResource>> GetAll(Octopus.Client.Model.ProjectResource)
Task<ModifyCommonVariablesByTenantIdResponse> Modify(Octopus.Client.Model.TenantVariables.ModifyCommonVariablesByTenantIdCommand, CancellationToken)
Task<ModifyProjectVariablesByTenantIdResponse> Modify(Octopus.Client.Model.TenantVariables.ModifyProjectVariablesByTenantIdCommand, CancellationToken)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Octopus.Client.Model.TenantVariables;

public class GetProjectVariablesByTenantIdRequest(string tenantId, string spaceId)
{
public string TenantId { get; set; } = tenantId;

public string SpaceId { get; set; } = spaceId;
}

public class GetProjectVariablesByTenantIdResponse(string tenantId, TenantProjectVariable[] projectVariables)
{
public string TenantId { get; set; } = tenantId;

public TenantProjectVariable[] ProjectVariables { get; set; } = projectVariables;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public interface ITenantVariablesRepository : IGetAll<TenantVariableResource>
Task<GetCommonVariablesByTenantIdResponse> Get(GetCommonVariablesByTenantIdRequest request,
CancellationToken cancellationToken);

Task<GetProjectVariablesByTenantIdResponse> Get(GetProjectVariablesByTenantIdRequest request,
CancellationToken cancellationToken);

Task<ModifyCommonVariablesByTenantIdResponse> Modify(ModifyCommonVariablesByTenantIdCommand command,
CancellationToken cancellationToken);

Expand Down Expand Up @@ -42,6 +45,17 @@ public async Task<GetCommonVariablesByTenantIdResponse> Get(GetCommonVariablesBy
return response;
}

public async Task<GetProjectVariablesByTenantIdResponse> Get(GetProjectVariablesByTenantIdRequest request,
CancellationToken cancellationToken)
{
const string link = "/api/{spaceId}/tenants/{tenantId}/projectvariables";

var response =
await Client.Get<GetProjectVariablesByTenantIdResponse>(link, new { request.SpaceId, request.TenantId },
cancellationToken);
return response;
}

public async Task<ModifyCommonVariablesByTenantIdResponse> Modify(
ModifyCommonVariablesByTenantIdCommand command, CancellationToken cancellationToken)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public interface ITenantVariablesRepository : IGetAll<TenantVariableResource>
{
List<TenantVariableResource> GetAll(ProjectResource projectResource);
GetCommonVariablesByTenantIdResponse Get(GetCommonVariablesByTenantIdRequest request);
GetProjectVariablesByTenantIdResponse Get(GetProjectVariablesByTenantIdRequest request);
ModifyCommonVariablesByTenantIdResponse Modify(ModifyCommonVariablesByTenantIdCommand command);
ModifyProjectVariablesByTenantIdResponse Modify(ModifyProjectVariablesByTenantIdCommand command);
}
Expand All @@ -24,6 +25,15 @@ public GetCommonVariablesByTenantIdResponse Get(GetCommonVariablesByTenantIdRequ
return response;
}

public GetProjectVariablesByTenantIdResponse Get(GetProjectVariablesByTenantIdRequest request)
{
const string link = "/api/{spaceId}/tenants/{tenantId}/projectvariables";

var response =
Client.Get<GetProjectVariablesByTenantIdResponse>(link, new { request.SpaceId, request.TenantId });
return response;
}

public ModifyCommonVariablesByTenantIdResponse Modify(ModifyCommonVariablesByTenantIdCommand command)
{
const string link = "/api/{spaceId}/tenants/{tenantId}/commonvariables";
Expand Down

0 comments on commit 7882e5a

Please sign in to comment.