Class AzureComputePlan
Implements
Namespace: Neon.Kube.Clients
Assembly: Neon.Kube.dll
Syntax
public class AzureComputePlan : IRoundtripData
Constructors
AzureComputePlan()
Constructs an uninitialized instance.
Declaration
public AzureComputePlan()
AzureComputePlan(JObject)
Protected constructor used internally to initialize derived classes.
Declaration
protected AzureComputePlan(JObject jObject)
Parameters
| Type | Name | Description |
|---|---|---|
| JObject | jObject | The backing Newtonsoft.Json.Linq.JObject. |
Properties
Name
Declaration
[JsonProperty(PropertyName = "Name", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, Required = Required.Always, Order = 0)]
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Product
Declaration
[JsonProperty(PropertyName = "Product", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, Required = Required.Always, Order = 0)]
public string Product { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Publisher
Declaration
[JsonProperty(PropertyName = "Publisher", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, Required = Required.Always, Order = 0)]
public string Publisher { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
__O
INTERNAL USE ONLY: This is the Newtonsoft.Json.Linq.JObject is used to back all serialized round-trip. This was made public for advanced unit testing but its use should generally be avoided for other purposes. Use ToJObject(). instead. "__O" is short for "object".
Declaration
[JsonIgnore]
public JObject __O { get; set; }
Property Value
| Type | Description |
|---|---|
| JObject |
Methods
CreateFrom(JsonResponse)
Deserializes an instance from a JsonResponse.
Declaration
public static AzureComputePlan CreateFrom(JsonResponse response)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonResponse | response | The input JsonResponse. |
Returns
| Type | Description |
|---|---|
| AzureComputePlan | The deserialized AzureComputePlan. |
CreateFrom(JObject)
Deserializes an instance from a Newtonsoft.Json.Linq.JObject.
Declaration
public static AzureComputePlan CreateFrom(JObject jObject)
Parameters
| Type | Name | Description |
|---|---|---|
| JObject | jObject | The input Newtonsoft.Json.Linq.JObject. |
Returns
| Type | Description |
|---|---|
| AzureComputePlan | The deserialized AzureComputePlan. |
CreateFrom(byte[])
Deserializes an instance from a UTF-8 encoded byte array.
Declaration
public static AzureComputePlan CreateFrom(byte[] bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bytes | The input byte array. |
Returns
| Type | Description |
|---|---|
| AzureComputePlan | The deserialized AzureComputePlan. |
CreateFrom(Stream, Encoding)
Deserializes an instance from a Stream.
Declaration
public static AzureComputePlan CreateFrom(Stream stream, Encoding encoding = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The input Stream. |
| Encoding | encoding | Optionally specifies the inout encoding. This defaults to UTF8. |
Returns
| Type | Description |
|---|---|
| AzureComputePlan | The deserialized AzureComputePlan. |
CreateFrom(string)
Deserializes an instance from JSON text.
Declaration
public static AzureComputePlan CreateFrom(string jsonText)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jsonText | The JSON text input. |
Returns
| Type | Description |
|---|---|
| AzureComputePlan | The deserialized AzureComputePlan. |
CreateFromAsync(Stream, Encoding)
Asynchronously deserializes an instance from a Stream.
Declaration
public static Task<object> CreateFromAsync(Stream stream, Encoding encoding = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The input Stream. |
| Encoding | encoding | Optionally specifies the inout encoding. This defaults to UTF8. |
Returns
| Type | Description |
|---|---|
| Task<object> | The deserialized AzureComputePlan. |
DeepClone()
Returns a deep clone of the instance.
Declaration
public AzureComputePlan DeepClone()
Returns
| Type | Description |
|---|---|
| AzureComputePlan | The cloned instance. |
Equals(object)
Determines whether the current instance equals another object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The other object instance or |
Returns
| Type | Description |
|---|---|
| bool |
|
Overrides
GetHashCode()
Calculates the hash code for the instance.
note
At least one of the class properties must be tagged with a [HashSource] for this to work.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | The calculated hash code. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when no class properties are tagged with a |
ToBytes()
Renders the instance as UTF-8 encoded JSON.
Declaration
public virtual byte[] ToBytes()
Returns
| Type | Description |
|---|---|
| byte[] | The serialized JSON bytes. |
ToDerived<T>(bool)
Used to convert a base data model class into a derived class.
Declaration
public T ToDerived<T>(bool noClone = false) where T : AzureComputePlan, IRoundtripData
Parameters
| Type | Name | Description |
|---|---|---|
| bool | noClone | By default, this method will create a deep clone of the underlying Newtonsoft.Json.Linq.JObject
and use this new instance when constructing the new object. This is the safest
approach but will cause a performance hit. You can pass |
Returns
| Type | Description |
|---|---|
| T | The converted instance of type |
Type Parameters
| Name | Description |
|---|---|
| T | The desired derived type. |
ToJObject()
Renders the instance as a new Newtonsoft.Json.Linq.JObject.
Declaration
public JObject ToJObject()
Returns
| Type | Description |
|---|---|
| JObject | The rendered Newtonsoft.Json.Linq.JObject. |
ToString()
Renders the instance as JSON text.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The serialized JSON string. |
Overrides
ToString(bool)
Renders the instance as JSON text, optionally formatting the output.
Declaration
public string ToString(bool indented)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | indented | Optionally pass |
Returns
| Type | Description |
|---|---|
| string | The serialized JSON string. |
WriteJsonTo(Stream)
Writes the instance as JSON to a Stream.
Declaration
public virtual void WriteJsonTo(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream |
WriteJsonToAsync(Stream)
Asynchronously writes the instance as JSON to a Stream.
Declaration
public virtual Task WriteJsonToAsync(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream |
Returns
| Type | Description |
|---|---|
| Task | The tracking Task. |
__Load(JObject, bool)
Loads the entity properties from the backing Newtonsoft.Json.Linq.JObject or from the optional Newtonsoft.Json.Linq.JObject passed.
Declaration
public virtual void __Load(JObject source = null, bool isDerived = false)
Parameters
| Type | Name | Description |
|---|---|---|
| JObject | source | The optional source Newtonsoft.Json.Linq.JObject. |
| bool | isDerived | Optionally indicates that were deserializing a derived class. |
__Save()
Persists the properties from this instance to the backing Newtonsoft.Json.Linq.JObject.
Declaration
public virtual JObject __Save()
Returns
| Type | Description |
|---|---|
| JObject | The backing Newtonsoft.Json.Linq.JObject. |
Operators
operator ==(AzureComputePlan, AzureComputePlan)
Compares two instances for equality by performing a deep comparision of all object
properties including any hidden properties. Note that you may pass null.
Declaration
public static bool operator ==(AzureComputePlan value1, AzureComputePlan value2)
Parameters
| Type | Name | Description |
|---|---|---|
| AzureComputePlan | value1 | The first value or |
| AzureComputePlan | value2 | The second value or |
Returns
| Type | Description |
|---|---|
| bool |
|
operator !=(AzureComputePlan, AzureComputePlan)
Compares two instances for inequality by performing a deep comparision of all object
properties including any hidden properties. Note that you may pass null.
Declaration
public static bool operator !=(AzureComputePlan value1, AzureComputePlan value2)
Parameters
| Type | Name | Description |
|---|---|---|
| AzureComputePlan | value1 | The first value or |
| AzureComputePlan | value2 | The second value or |
Returns
| Type | Description |
|---|---|
| bool |
|