File tree Expand file tree Collapse file tree 3 files changed +10
-11
lines changed
src/KubernetesClient/Models Expand file tree Collapse file tree 3 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ namespace k8s.Models
3
3
[ JsonConverter ( typeof ( IntOrStringJsonConverter ) ) ]
4
4
public struct IntOrString
5
5
{
6
- [ JsonPropertyName ( "value" ) ]
7
6
public string Value { get ; private init ; }
8
7
9
8
public static implicit operator IntOrString ( int v )
@@ -30,5 +29,10 @@ public override string ToString()
30
29
{
31
30
return Value ;
32
31
}
32
+
33
+ public int ToInt ( )
34
+ {
35
+ return int . Parse ( Value ) ;
36
+ }
33
37
}
34
38
}
Original file line number Diff line number Diff line change @@ -39,18 +39,13 @@ public enum PatchType
39
39
40
40
public V1Patch ( object body , PatchType type )
41
41
{
42
- Content = body ;
43
- Type = type ;
44
-
45
- if ( Content == null )
42
+ if ( type == PatchType . Unknown )
46
43
{
47
- throw new ArgumentNullException ( nameof ( Content ) , "object must be set") ;
44
+ throw new ArgumentException ( "patch type must be set", nameof ( type ) ) ;
48
45
}
49
46
50
- if ( Type == PatchType . Unknown )
51
- {
52
- throw new ArgumentException ( "patch type must be set" , nameof ( Type ) ) ;
53
- }
47
+ Content = body ?? throw new ArgumentNullException ( nameof ( body ) , "object must be set" ) ;
48
+ Type = type ;
54
49
}
55
50
}
56
51
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace k8s . Models
4
4
{
5
- public partial record class V1Status
5
+ public partial record V1Status
6
6
{
7
7
/// <summary>Converts a <see cref="V1Status"/> object into a short description of the status.</summary>
8
8
/// <returns>string description of the status</returns>
You can’t perform that action at this time.
0 commit comments