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

Dev #9

Merged
merged 2 commits into from
Oct 12, 2023
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
2 changes: 1 addition & 1 deletion src/ArgoCD.Client/IGPKKeyClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using ArgoCD.Client.Models.Session.Responses;
using ArgoCD.Client.Models.GPKKey.Responses;
using ArgoCD.Client.Models.GPKKey.Requests;
using ArgoCD.Client.Internal.Queries;
using ArgoCD.Client.Internal.Builders;
using ArgoCD.Client.Models;

namespace ArgoCD.Client
Expand Down
2 changes: 1 addition & 1 deletion src/ArgoCD.Client/Impl/ApplicationSetClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using ArgoCD.Client.Models.ApplicationSet.Requests;
using ArgoCD.Client.Models.ApplicationSet.Reponses;
using ArgoCD.Client.Models;
using ArgoCD.Client.Internal.Queries;
using ArgoCD.Client.Internal.Builders;
using ArgoCD.Client.Internal.Http;
using ArgoCD.Client.Internal.Utilities;
using System.Xml.Linq;
Expand Down
2 changes: 1 addition & 1 deletion src/ArgoCD.Client/Impl/ArgoCDClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using ArgoCD.Client.Internal.Http;
using ArgoCD.Client.Internal.Http.Serialization;
using ArgoCD.Client.Internal.Queries;
using ArgoCD.Client.Internal.Builders;
using ArgoCD.Client.Internal.Utilities;

namespace ArgoCD.Client.Impl
Expand Down
2 changes: 1 addition & 1 deletion src/ArgoCD.Client/Impl/CertificateClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading;
using System.Threading.Tasks;
using ArgoCD.Client.Internal.Http;
using ArgoCD.Client.Internal.Queries;
using ArgoCD.Client.Internal.Builders;
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models;
using ArgoCD.Client.Models.Certificate.Reponses;
Expand Down
2 changes: 1 addition & 1 deletion src/ArgoCD.Client/Impl/ClusterClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading;
using ArgoCD.Client.Models.Cluster.Responses;
using ArgoCD.Client.Models.Cluster.Requests;
using ArgoCD.Client.Internal.Queries;
using ArgoCD.Client.Internal.Builders;
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Internal.Http;
using ArgoCD.Client.Models;
Expand Down
2 changes: 1 addition & 1 deletion src/ArgoCD.Client/Impl/GPKKeyClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using ArgoCD.Client.Internal.Queries;
using ArgoCD.Client.Internal.Builders;
using ArgoCD.Client.Models.GPKKey.Responses;
using ArgoCD.Client.Models.GPKKey.Requests;
using ArgoCD.Client.Internal.Http;
Expand Down
2 changes: 1 addition & 1 deletion src/ArgoCD.Client/Impl/ProjectClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading;
using ArgoCD.Client.Models.Project.Responses;
using ArgoCD.Client.Models.Project.Requests;
using ArgoCD.Client.Internal.Queries;
using ArgoCD.Client.Internal.Builders;
using System.Xml.Linq;
using ArgoCD.Client.Internal.Http;
using ArgoCD.Client.Internal.Utilities;
Expand Down
2 changes: 1 addition & 1 deletion src/ArgoCD.Client/Impl/RepoCredsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading;
using ArgoCD.Client.Models.RepoCreds.Responses;
using ArgoCD.Client.Models.RepoCreds.Requests;
using ArgoCD.Client.Internal.Queries;
using ArgoCD.Client.Internal.Builders;
using ArgoCD.Client.Internal.Http;
using ArgoCD.Client.Models;
using ArgoCD.Client.Internal.Utilities;
Expand Down
2 changes: 1 addition & 1 deletion src/ArgoCD.Client/Impl/RepositoryClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading;
using ArgoCD.Client.Models.Repository.Responses;
using ArgoCD.Client.Models.Repository.Requests;
using ArgoCD.Client.Internal.Queries;
using ArgoCD.Client.Internal.Builders;
using Microsoft.Extensions.Options;
using ArgoCD.Client.Internal.Http;
using ArgoCD.Client.Internal.Utilities;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Project.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal class AppProjectQueryBuilder : QueryBuilder<AppProjectQueryOptions>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Application.Requests;

namespace ArgoCD.Client.Internal.Builders
{
internal sealed class ApplicationCreateOrUpdateBuilder : QueryBuilder<CreateApplicationOptions>
{
protected override void BuildCore(Query query, CreateApplicationOptions options)
{
query.Add("upsert",options.Upsert.ToLowerCaseString());
query.Add("validate",options.Validate.ToLowerCaseString());
}
}
}
41 changes: 41 additions & 0 deletions src/ArgoCD.Client/Internal/Builders/ApplicationListQueryBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Text;
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Application.Requests;

namespace ArgoCD.Client.Internal.Builders
{
internal sealed class ApplicationListQueryBuilder : QueryBuilder<ApplicationListQueryOptions>
{
protected override void BuildCore(Query query, ApplicationListQueryOptions options)
{
if (options.Name.IsNotNullOrEmpty())
query.Add("name",options.Name);

if (options.Refresh.IsNotNullOrEmpty())
query.Add("refresh", options.Refresh);

if (options.ResourceVersion.IsNotNullOrEmpty())
query.Add("resourceVersion", options.ResourceVersion);

if (options.Selector.IsNotNullOrEmpty())
query.Add("selector", options.Selector);

if (options.Repo.IsNotNullOrEmpty())
query.Add("repo", options.Repo);

if (options.AppNamespace.IsNotNullOrEmpty())
query.Add("appNamespace", options.AppNamespace);

foreach (string item in options.Projects)
{
query.Add("projects",item);
}
foreach (string item in options.Project)
{
query.Add("project", item);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.ApplicationSet.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{

internal class ApplicationSetListQueryBuilder : QueryBuilder<ApplicationSetListQueryOptions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.ApplicationSet.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal class ApplicationSetQueryBuilder : QueryBuilder<ApplicationSetQueryOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Certificate.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal class CertificateQueryBuilder : QueryBuilder<CertificateQueryOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Cluster.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal sealed class ClusterQueryBuilder : QueryBuilder<ClusterQueryOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Cluster.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal sealed class ClusterUpdateBuilder : QueryBuilder<UpdateClusterOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Repository.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal sealed class CreateRepositoryBuilder : QueryBuilder<CreateRepositoryOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.GPKKey.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal class GPKKeyDeleteBuilder : QueryBuilder<DeleteGPGKeyOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Project.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal class ProjectTokenDeleteBuilder : QueryBuilder<DeleteProjectTokenOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal abstract class QueryBuilder<T>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.RepoCreds.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal sealed class RepoCredsListQueryBuilder : QueryBuilder<RepoCredsQueryOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Repository.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal sealed class RepositoryQueryAppBuilder : QueryBuilder<RepositoryQueryAppOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Repository.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal sealed class RepositoryQueryBuilder : QueryBuilder<RepositoryQueryOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text;
using ArgoCD.Client.Models.Repository.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal sealed class RepositoryRefreshBuilder : QueryBuilder<RepositoryRefreshOptions>
{
Expand Down
35 changes: 35 additions & 0 deletions src/ArgoCD.Client/Internal/Builders/ResourcesQueryBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Text;
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Application.Requests;

namespace ArgoCD.Client.Internal.Builders
{
internal sealed class ResourcesQueryBuilder : QueryBuilder<ManagedResourcesQueryOptions>
{
protected override void BuildCore(Query query, ManagedResourcesQueryOptions options)
{
if (options.Namespace.IsNotNullOrEmpty())
query.Add("namespace", options.Namespace);

if (options.Name.IsNotNullOrEmpty())
query.Add("name", options.Name);

if (options.Version.IsNotNullOrEmpty())
query.Add("version", options.Version);

if (options.Group.IsNotNullOrEmpty())
query.Add("group", options.Group);

if (options.Kind.IsNotNullOrEmpty())
query.Add("kind", options.Kind);

if (options.AppNamespace.IsNotNullOrEmpty())
query.Add("appNamespace", options.AppNamespace);

if (options.Project.IsNotNullOrEmpty())
query.Add("project", options.Project);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal class UpsertBuilder : QueryBuilder<UpsertOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using ArgoCD.Client.Internal.Utilities;
using ArgoCD.Client.Models.Repository.Requests;

namespace ArgoCD.Client.Internal.Queries
namespace ArgoCD.Client.Internal.Builders
{
internal sealed class ValidateAccessBuilder : QueryBuilder<ValidateAccessOptions>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace ArgoCD.Client.Models.Application.Reponses
{
public class ApplicationManagedResources
{
public ApplicationManagedResources() { }

public V1alpha1ResourceDiff[] Items { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using System.Xml.Linq;

namespace ArgoCD.Client.Models.Application.Reponses
{
public class RepositoryManifest
{

public string[] Manifests { get; set; }


public string VarNamespace { get; set; }


public string Revision { get; set; }


public string Server { get; set; }


public string SourceType { get; set; }


public string VerifyResult { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Xml.Linq;

namespace ArgoCD.Client.Models.Application.Reponses
{
/// <summary>
/// LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.
/// </summary>
public class V1LoadBalancerIngress
{

public string Hostname { get; set; }


public string Ip { get; set; }


public V1PortStatus[] Ports { get; set; }
}
}
Loading