Skip to content

Commit 19519b3

Browse files
committed
fix AutomodBehaviourType not having non-null string requirement + fix formatting
1 parent 871dcbf commit 19519b3

12 files changed

Lines changed: 99 additions & 91 deletions

Assets/Plugins/StreamChat/Core/LowLevelClient/Models/AutomodBehaviourType.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,25 @@ namespace StreamChat.Core.LowLevelClient.Models
66
ILoadableFrom<AutomodBehaviourTypeInternalDTO, AutomodBehaviourType>,
77
ISavableTo<AutomodBehaviourTypeInternalDTO>
88
{
9-
public AutomodBehaviourType(string value)
10-
{
11-
_value = value ?? throw new System.ArgumentNullException(nameof(value));
12-
}
13-
149
public static readonly AutomodBehaviourType Flag = new AutomodBehaviourType("flag");
1510
public static readonly AutomodBehaviourType Block = new AutomodBehaviourType("block");
1611
public static readonly AutomodBehaviourType ShadowBlock = new AutomodBehaviourType("shadow_block");
1712

13+
public AutomodBehaviourType(string value)
14+
{
15+
_value = value;
16+
}
17+
1818
public override string ToString() => _value;
1919

2020
public bool Equals(AutomodBehaviourType other) => _value == other._value;
2121

22-
AutomodBehaviourType ILoadableFrom<AutomodBehaviourTypeInternalDTO, AutomodBehaviourType>.LoadFromDto(AutomodBehaviourTypeInternalDTO dto)
22+
AutomodBehaviourType ILoadableFrom<AutomodBehaviourTypeInternalDTO, AutomodBehaviourType>.
23+
LoadFromDto(AutomodBehaviourTypeInternalDTO dto)
2324
=> new AutomodBehaviourType(dto.Value);
2425

25-
AutomodBehaviourTypeInternalDTO ISavableTo<AutomodBehaviourTypeInternalDTO>.SaveToDto() => new AutomodBehaviourTypeInternalDTO(_value);
26+
AutomodBehaviourTypeInternalDTO ISavableTo<AutomodBehaviourTypeInternalDTO>.SaveToDto()
27+
=> new AutomodBehaviourTypeInternalDTO(_value);
2628

2729
public override bool Equals(object obj) => obj is AutomodBehaviourType other && Equals(other);
2830

Assets/Plugins/StreamChat/Core/LowLevelClient/Models/AutomodType.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
namespace StreamChat.Core.LowLevelClient.Models
44
{
5-
public readonly struct AutomodType : System.IEquatable<AutomodType>, ILoadableFrom<AutomodTypeInternalDTO, AutomodType>, ISavableTo<AutomodTypeInternalDTO>
5+
public readonly struct AutomodType : System.IEquatable<AutomodType>,
6+
ILoadableFrom<AutomodTypeInternalDTO, AutomodType>, ISavableTo<AutomodTypeInternalDTO>
67
{
8+
public static readonly AutomodType Disabled = new AutomodType("disabled");
9+
public static readonly AutomodType Simple = new AutomodType("simple");
10+
public static readonly AutomodType AI = new AutomodType("AI");
11+
712
public AutomodType(string value)
813
{
914
_value = value;
1015
}
1116

12-
public static readonly AutomodType Disabled = new AutomodType("disabled");
13-
public static readonly AutomodType Simple = new AutomodType("simple");
14-
public static readonly AutomodType AI = new AutomodType("AI");
15-
1617
public override string ToString() => _value;
1718

1819
public bool Equals(AutomodType other) => _value == other._value;
@@ -28,12 +29,12 @@ public AutomodType(string value)
2829
public static implicit operator AutomodType(string value) => new AutomodType(value);
2930

3031
public static implicit operator string(AutomodType type) => type._value;
31-
32+
3233
AutomodType ILoadableFrom<AutomodTypeInternalDTO, AutomodType>.LoadFromDto(AutomodTypeInternalDTO dto)
3334
=> new AutomodType(dto.Value);
3435

3536
AutomodTypeInternalDTO ISavableTo<AutomodTypeInternalDTO>.SaveToDto() => new AutomodTypeInternalDTO(_value);
36-
37+
3738
private readonly string _value;
3839
}
39-
}
40+
}

Assets/Plugins/StreamChat/Core/LowLevelClient/Models/ImageCropType.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22

33
namespace StreamChat.Core.LowLevelClient.Models
44
{
5-
public readonly struct ImageCropType : System.IEquatable<ImageCropType>, ILoadableFrom<ImageCropTypeInternalDTO, ImageCropType>, ISavableTo<ImageCropTypeInternalDTO>
5+
public readonly struct ImageCropType : System.IEquatable<ImageCropType>,
6+
ILoadableFrom<ImageCropTypeInternalDTO, ImageCropType>, ISavableTo<ImageCropTypeInternalDTO>
67
{
7-
public ImageCropType(string value)
8-
{
9-
_value = value;
10-
}
11-
128
public static readonly ImageCropType Top = new ImageCropType("top");
139
public static readonly ImageCropType Bottom = new ImageCropType("bottom");
1410
public static readonly ImageCropType Left = new ImageCropType("left");
1511
public static readonly ImageCropType Right = new ImageCropType("right");
1612
public static readonly ImageCropType Center = new ImageCropType("center");
1713

14+
public ImageCropType(string value)
15+
{
16+
_value = value;
17+
}
18+
1819
public override string ToString() => _value;
1920

2021
public bool Equals(ImageCropType other) => _value == other._value;
@@ -30,12 +31,13 @@ public ImageCropType(string value)
3031
public static implicit operator ImageCropType(string value) => new ImageCropType(value);
3132

3233
public static implicit operator string(ImageCropType type) => type._value;
33-
34+
3435
ImageCropType ILoadableFrom<ImageCropTypeInternalDTO, ImageCropType>.LoadFromDto(ImageCropTypeInternalDTO dto)
3536
=> new ImageCropType(dto.Value);
3637

37-
ImageCropTypeInternalDTO ISavableTo<ImageCropTypeInternalDTO>.SaveToDto() => new ImageCropTypeInternalDTO(_value);
38-
38+
ImageCropTypeInternalDTO ISavableTo<ImageCropTypeInternalDTO>.SaveToDto()
39+
=> new ImageCropTypeInternalDTO(_value);
40+
3941
private readonly string _value;
4042
}
41-
}
43+
}

Assets/Plugins/StreamChat/Core/LowLevelClient/Models/ImageResizeType.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ namespace StreamChat.Core.LowLevelClient.Models
66
ILoadableFrom<ImageResizeTypeInternalDTO, ImageResizeType>,
77
ISavableTo<ImageResizeTypeInternalDTO>
88
{
9-
public ImageResizeType(string value)
10-
{
11-
_value = value;
12-
}
13-
149
public static readonly ImageResizeType Clip = new ImageResizeType("clip");
1510
public static readonly ImageResizeType Crop = new ImageResizeType("crop");
1611
public static readonly ImageResizeType Scale = new ImageResizeType("scale");
1712
public static readonly ImageResizeType Fill = new ImageResizeType("fill");
1813

14+
public ImageResizeType(string value)
15+
{
16+
_value = value;
17+
}
18+
1919
public override string ToString() => _value;
2020

2121
public bool Equals(ImageResizeType other) => _value == other._value;
@@ -31,13 +31,14 @@ public ImageResizeType(string value)
3131
public static implicit operator ImageResizeType(string value) => new ImageResizeType(value);
3232

3333
public static implicit operator string(ImageResizeType type) => type._value;
34-
34+
3535
ImageResizeType ILoadableFrom<ImageResizeTypeInternalDTO, ImageResizeType>.
36-
LoadFromDto(ImageResizeTypeInternalDTO dto) => new ImageResizeType(dto.Value);
36+
LoadFromDto(ImageResizeTypeInternalDTO dto)
37+
=> new ImageResizeType(dto.Value);
3738

3839
ImageResizeTypeInternalDTO ISavableTo<ImageResizeTypeInternalDTO>.SaveToDto()
3940
=> new ImageResizeTypeInternalDTO(_value);
40-
41+
4142
private readonly string _value;
4243
}
43-
}
44+
}

Assets/Plugins/StreamChat/Core/LowLevelClient/Models/MessageType.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ public struct MessageType : System.IEquatable<MessageType>,
66
ILoadableFrom<MessageTypeInternalDTO, MessageType>,
77
ISavableTo<MessageTypeInternalDTO>
88
{
9-
public MessageType(string value)
10-
{
11-
_value = value;
12-
}
13-
149
public static readonly MessageType Regular = new MessageType("regular");
1510
public static readonly MessageType Ephemeral = new MessageType("ephemeral");
1611
public static readonly MessageType Error = new MessageType("error");
1712
public static readonly MessageType Reply = new MessageType("reply");
1813
public static readonly MessageType System = new MessageType("system");
1914
public static readonly MessageType Deleted = new MessageType("deleted");
2015

16+
public MessageType(string value)
17+
{
18+
_value = value;
19+
}
20+
2121
public override string ToString() => _value;
2222

2323
public bool Equals(MessageType other) => _value == other._value;
@@ -33,13 +33,13 @@ public MessageType(string value)
3333
public static implicit operator MessageType(string value) => new MessageType(value);
3434

3535
public static implicit operator string(MessageType type) => type._value;
36-
36+
3737
MessageType ILoadableFrom<MessageTypeInternalDTO, MessageType>.
38-
LoadFromDto(MessageTypeInternalDTO dto) => new MessageType(dto.Value);
38+
LoadFromDto(MessageTypeInternalDTO dto)
39+
=> new MessageType(dto.Value);
40+
41+
MessageTypeInternalDTO ISavableTo<MessageTypeInternalDTO>.SaveToDto() => new MessageTypeInternalDTO(_value);
3942

40-
MessageTypeInternalDTO ISavableTo<MessageTypeInternalDTO>.SaveToDto()
41-
=> new MessageTypeInternalDTO(_value);
42-
4343
private readonly string _value;
4444
}
45-
}
45+
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
using StreamChat.Core.InternalDTO.Models;
32

43
namespace StreamChat.Core.LowLevelClient.Models
@@ -7,16 +6,16 @@ namespace StreamChat.Core.LowLevelClient.Models
76
ILoadableFrom<PushProviderTypeInternalDTO, PushProviderType>,
87
ISavableTo<PushProviderTypeInternalDTO>
98
{
10-
public PushProviderType(string value)
11-
{
12-
_value = value;
13-
}
14-
159
public static readonly PushProviderType Firebase = new PushProviderType("firebase");
1610
public static readonly PushProviderType Apn = new PushProviderType("apn");
1711
public static readonly PushProviderType Huawei = new PushProviderType("huawei");
1812
public static readonly PushProviderType Xiaomi = new PushProviderType("xiaomi");
1913

14+
public PushProviderType(string value)
15+
{
16+
_value = value;
17+
}
18+
2019
public override string ToString() => _value;
2120

2221
public bool Equals(PushProviderType other) => _value == other._value;
@@ -32,14 +31,14 @@ public PushProviderType(string value)
3231
public static implicit operator PushProviderType(string value) => new PushProviderType(value);
3332

3433
public static implicit operator string(PushProviderType type) => type._value;
35-
34+
3635
PushProviderType ILoadableFrom<PushProviderTypeInternalDTO, PushProviderType>.
3736
LoadFromDto(PushProviderTypeInternalDTO dto)
3837
=> new PushProviderType(dto.Value);
3938

4039
PushProviderTypeInternalDTO ISavableTo<PushProviderTypeInternalDTO>.SaveToDto()
4140
=> new PushProviderTypeInternalDTO(_value);
42-
41+
4342
private readonly string _value;
4443
}
45-
}
44+
}

Assets/Plugins/StreamChat/Core/Models/StreamAutomodBehaviourType.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ namespace StreamChat.Core.Models
77
ILoadableFrom<AutomodBehaviourTypeInternalDTO, StreamAutomodBehaviourType>,
88
ISavableTo<AutomodBehaviourTypeInternalDTO>
99
{
10+
public static readonly StreamAutomodBehaviourType Flag = new StreamAutomodBehaviourType("flag");
11+
public static readonly StreamAutomodBehaviourType Block = new StreamAutomodBehaviourType("block");
12+
public static readonly StreamAutomodBehaviourType ShadowBlock = new StreamAutomodBehaviourType("shadow_block");
13+
1014
public StreamAutomodBehaviourType(string value)
1115
{
1216
_value = value;
1317
}
1418

15-
public static readonly StreamAutomodBehaviourType Flag = new StreamAutomodBehaviourType("flag");
16-
public static readonly StreamAutomodBehaviourType Block = new StreamAutomodBehaviourType("block");
17-
public static readonly StreamAutomodBehaviourType ShadowBlock = new StreamAutomodBehaviourType("shadow_block");
18-
1919
public override string ToString() => _value;
2020

2121
public bool Equals(StreamAutomodBehaviourType other) => _value == other._value;
@@ -34,7 +34,7 @@ public static implicit operator StreamAutomodBehaviourType(string value)
3434
=> new StreamAutomodBehaviourType(value);
3535

3636
public static implicit operator string(StreamAutomodBehaviourType type) => type._value;
37-
37+
3838
StreamAutomodBehaviourType ILoadableFrom<AutomodBehaviourTypeInternalDTO, StreamAutomodBehaviourType>.
3939
LoadFromDto(AutomodBehaviourTypeInternalDTO dto)
4040
=> new StreamAutomodBehaviourType(dto.Value);

Assets/Plugins/StreamChat/Core/Models/StreamAutomodType.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ namespace StreamChat.Core.Models
66
public readonly struct StreamAutomodType : System.IEquatable<StreamAutomodType>,
77
ILoadableFrom<AutomodTypeInternalDTO, StreamAutomodType>, ISavableTo<AutomodTypeInternalDTO>
88
{
9+
public static readonly StreamAutomodType Disabled = new StreamAutomodType("disabled");
10+
public static readonly StreamAutomodType Simple = new StreamAutomodType("simple");
11+
public static readonly StreamAutomodType AI = new StreamAutomodType("AI");
12+
913
public StreamAutomodType(string value)
1014
{
1115
_value = value;
1216
}
1317

14-
public static readonly StreamAutomodType Disabled = new StreamAutomodType("disabled");
15-
public static readonly StreamAutomodType Simple = new StreamAutomodType("simple");
16-
public static readonly StreamAutomodType AI = new StreamAutomodType("AI");
17-
1818
public override string ToString() => _value;
1919

2020
public bool Equals(StreamAutomodType other) => _value == other._value;

Assets/Plugins/StreamChat/Core/Models/StreamMessageType.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ namespace StreamChat.Core.Models
77
public readonly struct StreamMessageType : IEquatable<StreamMessageType>,
88
ILoadableFrom<MessageTypeInternalDTO, StreamMessageType>, ISavableTo<MessageTypeInternalDTO>
99
{
10-
public StreamMessageType(string value)
11-
{
12-
_value = value;
13-
}
14-
1510
public static readonly StreamMessageType Regular = new StreamMessageType("regular");
1611
public static readonly StreamMessageType Ephemeral = new StreamMessageType("ephemeral");
1712
public static readonly StreamMessageType Error = new StreamMessageType("error");
1813
public static readonly StreamMessageType Reply = new StreamMessageType("reply");
1914
public static readonly StreamMessageType System = new StreamMessageType("system");
2015
public static readonly StreamMessageType Deleted = new StreamMessageType("deleted");
16+
17+
public StreamMessageType(string value)
18+
{
19+
_value = value;
20+
}
2121

2222
public override string ToString() => _value;
2323

Assets/Plugins/StreamChat/Core/Models/StreamPushProviderType.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ namespace StreamChat.Core.Models
77
ILoadableFrom<PushProviderTypeInternalDTO, StreamPushProviderType>,
88
ISavableTo<PushProviderTypeInternalDTO>
99
{
10-
public StreamPushProviderType(string value)
11-
{
12-
_value = value;
13-
}
14-
1510
public static readonly StreamPushProviderType Firebase = new StreamPushProviderType("firebase");
1611
public static readonly StreamPushProviderType Apn = new StreamPushProviderType("apn");
1712
public static readonly StreamPushProviderType Huawei = new StreamPushProviderType("huawei");
1813
public static readonly StreamPushProviderType Xiaomi = new StreamPushProviderType("xiaomi");
14+
15+
public StreamPushProviderType(string value)
16+
{
17+
_value = value;
18+
}
1919

2020
public override string ToString() => _value;
2121

0 commit comments

Comments
 (0)