Skip to content

Commit

Permalink
Rename AgentCommunicationMode to TentacleCommunicationMode (#796)
Browse files Browse the repository at this point in the history
* Rename TentacleEndpointConfigurationResource

* Fix assent tests

* adjust ctor visibility

* Update assent files
  • Loading branch information
scme0 authored Nov 1, 2023
1 parent e5aa597 commit 7039f12
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6397,13 +6397,6 @@ Octopus.Client.Model.DeploymentTargets
}
Octopus.Client.Model.Endpoints
{
class AgentCommunicationModeResource
IComparable
Octopus.TinyTypes.CaseInsensitiveStringTinyType
{
static Octopus.Client.Model.Endpoints.AgentCommunicationModeResource Listening { get; }
static Octopus.Client.Model.Endpoints.AgentCommunicationModeResource Polling { get; }
}
AzureServiceFabricCredentialType
{
ClientCredential = 0
Expand Down Expand Up @@ -6574,7 +6567,7 @@ Octopus.Client.Model.Endpoints
Octopus.Client.Model.Endpoints.TentacleEndpointConfigurationResource
{
.ctor(String, String)
Octopus.Client.Model.Endpoints.AgentCommunicationModeResource CommunicationMode { get; }
Octopus.Client.Model.Endpoints.TentacleCommunicationModeResource CommunicationMode { get; }
String ProxyId { get; set; }
}
class ListeningTentacleEndpointResource
Expand Down Expand Up @@ -6618,7 +6611,7 @@ Octopus.Client.Model.Endpoints
Octopus.Client.Model.Endpoints.TentacleEndpointConfigurationResource
{
.ctor(String, String)
Octopus.Client.Model.Endpoints.AgentCommunicationModeResource CommunicationMode { get; }
Octopus.Client.Model.Endpoints.TentacleCommunicationModeResource CommunicationMode { get; }
}
class PollingTentacleEndpointResource
Octopus.Client.Extensibility.IResource
Expand Down Expand Up @@ -6681,6 +6674,14 @@ Octopus.Client.Model.Endpoints
Object Inputs { get; set; }
String StepPackageVersion { get; set; }
}
class TentacleCommunicationModeResource
IComparable
Octopus.TinyTypes.CaseInsensitiveStringTinyType
{
.ctor(String)
static Octopus.Client.Model.Endpoints.TentacleCommunicationModeResource Listening { get; }
static Octopus.Client.Model.Endpoints.TentacleCommunicationModeResource Polling { get; }
}
class TentacleDetailsResource
{
.ctor()
Expand All @@ -6694,7 +6695,7 @@ Octopus.Client.Model.Endpoints
Octopus.Client.Model.Endpoints.ITentacleEndpointResource
{
String CertificateSignatureAlgorithm { get; set; }
Octopus.Client.Model.Endpoints.AgentCommunicationModeResource CommunicationMode { get; }
Octopus.Client.Model.Endpoints.TentacleCommunicationModeResource CommunicationMode { get; }
Octopus.Client.Model.Endpoints.TentacleDetailsResource TentacleVersionDetails { get; set; }
String Thumbprint { get; set; }
String Uri { get; set; }
Expand Down Expand Up @@ -7369,7 +7370,6 @@ Octopus.Client.Operations
Octopus.Client.Operations.IRegisterMachineOperationBase
{
.ctor(Octopus.Client.IOctopusClientFactory)
Octopus.Client.Model.Endpoints.AgentCommunicationModeResource AgentCommunicationMode { get; set; }
Boolean AllowOverwrite { get; set; }
Octopus.Client.Model.CommunicationStyle CommunicationStyle { get; set; }
String MachineName { get; set; }
Expand Down Expand Up @@ -9085,7 +9085,7 @@ Octopus.Client.Serialization
static String Serialize(Object)
}
class TentacleConfigurationConverter
Octopus.Client.Serialization.InheritedClassConverter<TentacleEndpointConfigurationResource, AgentCommunicationModeResource>
Octopus.Client.Serialization.InheritedClassConverter<TentacleEndpointConfigurationResource, TentacleCommunicationModeResource>
{
.ctor()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6421,13 +6421,6 @@ Octopus.Client.Model.DeploymentTargets
}
Octopus.Client.Model.Endpoints
{
class AgentCommunicationModeResource
IComparable
Octopus.TinyTypes.CaseInsensitiveStringTinyType
{
static Octopus.Client.Model.Endpoints.AgentCommunicationModeResource Listening { get; }
static Octopus.Client.Model.Endpoints.AgentCommunicationModeResource Polling { get; }
}
AzureServiceFabricCredentialType
{
ClientCredential = 0
Expand Down Expand Up @@ -6598,7 +6591,7 @@ Octopus.Client.Model.Endpoints
Octopus.Client.Model.Endpoints.TentacleEndpointConfigurationResource
{
.ctor(String, String)
Octopus.Client.Model.Endpoints.AgentCommunicationModeResource CommunicationMode { get; }
Octopus.Client.Model.Endpoints.TentacleCommunicationModeResource CommunicationMode { get; }
String ProxyId { get; set; }
}
class ListeningTentacleEndpointResource
Expand Down Expand Up @@ -6642,7 +6635,7 @@ Octopus.Client.Model.Endpoints
Octopus.Client.Model.Endpoints.TentacleEndpointConfigurationResource
{
.ctor(String, String)
Octopus.Client.Model.Endpoints.AgentCommunicationModeResource CommunicationMode { get; }
Octopus.Client.Model.Endpoints.TentacleCommunicationModeResource CommunicationMode { get; }
}
class PollingTentacleEndpointResource
Octopus.Client.Extensibility.IResource
Expand Down Expand Up @@ -6705,6 +6698,14 @@ Octopus.Client.Model.Endpoints
Object Inputs { get; set; }
String StepPackageVersion { get; set; }
}
class TentacleCommunicationModeResource
IComparable
Octopus.TinyTypes.CaseInsensitiveStringTinyType
{
.ctor(String)
static Octopus.Client.Model.Endpoints.TentacleCommunicationModeResource Listening { get; }
static Octopus.Client.Model.Endpoints.TentacleCommunicationModeResource Polling { get; }
}
class TentacleDetailsResource
{
.ctor()
Expand All @@ -6718,7 +6719,7 @@ Octopus.Client.Model.Endpoints
Octopus.Client.Model.Endpoints.ITentacleEndpointResource
{
String CertificateSignatureAlgorithm { get; set; }
Octopus.Client.Model.Endpoints.AgentCommunicationModeResource CommunicationMode { get; }
Octopus.Client.Model.Endpoints.TentacleCommunicationModeResource CommunicationMode { get; }
Octopus.Client.Model.Endpoints.TentacleDetailsResource TentacleVersionDetails { get; set; }
String Thumbprint { get; set; }
String Uri { get; set; }
Expand Down Expand Up @@ -7394,7 +7395,6 @@ Octopus.Client.Operations
Octopus.Client.Operations.IRegisterMachineOperationBase
{
.ctor(Octopus.Client.IOctopusClientFactory)
Octopus.Client.Model.Endpoints.AgentCommunicationModeResource AgentCommunicationMode { get; set; }
Boolean AllowOverwrite { get; set; }
Octopus.Client.Model.CommunicationStyle CommunicationStyle { get; set; }
String MachineName { get; set; }
Expand Down Expand Up @@ -9111,7 +9111,7 @@ Octopus.Client.Serialization
static String Serialize(Object)
}
class TentacleConfigurationConverter
Octopus.Client.Serialization.InheritedClassConverter<TentacleEndpointConfigurationResource, AgentCommunicationModeResource>
Octopus.Client.Serialization.InheritedClassConverter<TentacleEndpointConfigurationResource, TentacleCommunicationModeResource>
{
.ctor()
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public ListeningTentacleEndpointConfigurationResource(string thumbprint, string
{
}

public override AgentCommunicationModeResource CommunicationMode => AgentCommunicationModeResource.Listening;
public override TentacleCommunicationModeResource CommunicationMode => TentacleCommunicationModeResource.Listening;

[Writeable]
public string ProxyId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Octopus.Client.Model.Endpoints
{
public class PollingTentacleEndpointConfigurationResource : TentacleEndpointConfigurationResource, IPollingTentacleEndpointResource
{
public override AgentCommunicationModeResource CommunicationMode => AgentCommunicationModeResource.Polling;
public override TentacleCommunicationModeResource CommunicationMode => TentacleCommunicationModeResource.Polling;

protected PollingTentacleEndpointConfigurationResource()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Newtonsoft.Json;
using Octopus.TinyTypes;

namespace Octopus.Client.Model.Endpoints;

public class TentacleCommunicationModeResource : CaseInsensitiveStringTinyType
{
public static TentacleCommunicationModeResource Polling => new(nameof(Polling));

public static TentacleCommunicationModeResource Listening => new(nameof(Listening));

[JsonConstructor]
public TentacleCommunicationModeResource(string value) : base(value)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected TentacleEndpointConfigurationResource(string thumbprint, string uri)
}


public abstract AgentCommunicationModeResource CommunicationMode { get; }
public abstract TentacleCommunicationModeResource CommunicationMode { get; }

[Required(ErrorMessage = "Please provide a thumbprint for this machine.")]
[Trim]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ public RegisterMachineOperationBase(IOctopusClientFactory clientFactory)
/// </summary>
public CommunicationStyle CommunicationStyle { get; set; }

/// <summary>
/// The communication behaviour that Kubernetes Agent will use;
/// </summary>
public AgentCommunicationModeResource AgentCommunicationMode { get; set; }

public Uri SubscriptionId { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace Octopus.Client.Serialization;

public class TentacleConfigurationConverter: InheritedClassConverter<TentacleEndpointConfigurationResource, AgentCommunicationModeResource>
public class TentacleConfigurationConverter: InheritedClassConverter<TentacleEndpointConfigurationResource, TentacleCommunicationModeResource>
{
static readonly IDictionary<AgentCommunicationModeResource, Type> EndpointTypes =
new Dictionary<AgentCommunicationModeResource, Type>
static readonly IDictionary<TentacleCommunicationModeResource, Type> EndpointTypes =
new Dictionary<TentacleCommunicationModeResource, Type>
{
{AgentCommunicationModeResource.Listening, typeof (ListeningTentacleEndpointConfigurationResource)},
{AgentCommunicationModeResource.Polling, typeof(PollingTentacleEndpointConfigurationResource)}
{TentacleCommunicationModeResource.Listening, typeof (ListeningTentacleEndpointConfigurationResource)},
{TentacleCommunicationModeResource.Polling, typeof(PollingTentacleEndpointConfigurationResource)}
};

protected override IDictionary<AgentCommunicationModeResource, Type> DerivedTypeMappings => EndpointTypes;
protected override IDictionary<TentacleCommunicationModeResource, Type> DerivedTypeMappings => EndpointTypes;
protected override string TypeDesignatingPropertyName => nameof(TentacleEndpointConfigurationResource.CommunicationMode);
}

0 comments on commit 7039f12

Please sign in to comment.