# Int32OrStringV1

- Kind: `record`
- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Version: `13.3.0-preview.1.26254.5`
- Namespace: `Aspire.Hosting.Kubernetes.Resources`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/Int32OrStringV1.cs)
- Implements: `IEquatable<Int32OrStringV1>`, `IEquatable<int>`, `IEquatable<string>`

Represents a value that can be either a 32-bit integer or a string.

## Definition

```csharp
namespace Aspire.Hosting.Kubernetes.Resources;

public sealed record Int32OrStringV1
    : System.IEquatable<Aspire.Hosting.Kubernetes.Resources.Int32OrStringV1>,
      System.IEquatable<int>,
      System.IEquatable<string>
{
    // ...
}
```

## Remarks

This class provides functionality to handle values that could be either an integer or a string. It supports implicit and explicit conversions, equality comparisons, and YAML serialization/deserialization handling.

## Constructors

- [Int32OrStringV1(int?, string?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/constructors.md#constructor-int-string) -- Represents a value that can be either a 32-bit integer or a string.
- [Int32OrStringV1(int)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/constructors.md#constructor-int) -- Initializes a new instance of the [Int32OrStringV1](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1.md) class with a 32-bit integer value.
- [Int32OrStringV1(string?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/constructors.md#constructor-string) -- Initializes a new instance of the [Int32OrStringV1](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1.md) class with a string value.

## Properties

- [Number](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/properties.md#number) : `int?` `get; init`
- [Text](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/properties.md#text) : `string?` `get; init`
- [Value](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/properties.md#value) : `string?` `get` -- Gets the string value if the instance represents a string; otherwise, returns the string representation of the 32-bit integer value if the instance represents an integer.

## Methods

- [<Clone>$](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#clone) : [Int32OrStringV1](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1.md)
- [Deconstruct(int?, string?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#deconstruct-int-string)
- [Equals(int)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#equals-int) : `bool` -- Determines whether the current instance is equal to another integer.
- [Equals(string?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#equals-string) : `bool` -- Determines whether the current instance is equal to another string.
- [Equals(object?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#equals-object) : `bool` -- Determines whether the specified object is equal to the current object.
- [Equals(Int32OrStringV1?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#equals-int32orstringv1) : `bool` -- Indicates whether the current object is equal to another object of the same type.
- [GetHashCode](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#gethashcode) : `int` -- Serves as the default hash function.
- [op_Equality(Int32OrStringV1?, int)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#op-equality-int32orstringv1-int) : `bool` `static` -- Compares an instance of Int32OrStringV1 to an integer for equality.
- [op_Equality(Int32OrStringV1?, string?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#op-equality-int32orstringv1-string) : `bool` `static` -- Compares an instance of Int32OrStringV1 to a string for equality.
- [op_Equality(Int32OrStringV1?, Int32OrStringV1?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#op-equality-int32orstringv1-int32orstringv1) : `bool` `static`
- [op_Explicit(Int32OrStringV1)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#op-explicit-int32orstringv1) : `int` `static` -- Gets the value as a 32-bit integer.
- [op_Explicit(Int32OrStringV1?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#op-explicit-int32orstringv1) : `string?` `static` -- Gets the value as a string.
- [op_Implicit(int)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#op-implicit-int) : [Int32OrStringV1](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1.md) `static` -- Gets the integer value as a Int32OrStringV1 instance.
- [op_Implicit(string?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#op-implicit-string) : [Int32OrStringV1?](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1.md) `static` -- Gets the string value as a Int32OrStringV1 instance.
- [op_Inequality(Int32OrStringV1?, int)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#op-inequality-int32orstringv1-int) : `bool` `static` -- Compares an instance of Int32OrStringV1 to an integer for equality.
- [op_Inequality(Int32OrStringV1?, string?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#op-inequality-int32orstringv1-string) : `bool` `static` -- Compares an instance of Int32OrStringV1 to a string for equality.
- [op_Inequality(Int32OrStringV1?, Int32OrStringV1?)](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#op-inequality-int32orstringv1-int32orstringv1) : `bool` `static`
- [ToString](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1/methods.md#tostring) : `string?` -- Returns a string representation of the current instance.
