Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cleanup models from #if NET7 directive #96

Open
wants to merge 1 commit into
base: feat/support-net-9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/Sinch/Auth/OAuth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@ public async Task<string> GetAuthToken(bool force = false)
private class AuthResponse
{
[JsonPropertyName("access_token")]
#if NET7_0_OR_GREATER

public required string AccessToken { get; set; }
#else
public string AccessToken { get; set; } = null!;
#endif



/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ public sealed class ConversationChannelCredential
/// <summary>
/// Gets or Sets Channel
/// </summary>
#if NET7_0_OR_GREATER

public required ConversationChannel Channel { get; set; }
#else
public ConversationChannel Channel { get; set; } = null!;
#endif


/// <summary>
/// The secret used to verify the channel callbacks for channels which support callback verification.
Expand Down
12 changes: 4 additions & 8 deletions src/Sinch/Conversation/Apps/Create/CreateAppRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,17 @@ public sealed class CreateAppRequest
/// <summary>
/// An array of channel credentials. The order of the credentials defines the app channel priority.
/// </summary>
#if NET7_0_OR_GREATER

public required List<ConversationChannelCredential> ChannelCredentials { get; set; }
#else
public List<ConversationChannelCredential> ChannelCredentials { get; set; } = null!;
#endif



/// <summary>
/// The display name for the app.
/// </summary>
#if NET7_0_OR_GREATER

public required string DisplayName { get; set; }
#else
public string DisplayName { get; set; } = null!;
#endif



/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@ public sealed class BasicAuthCredential
/// <summary>
/// Basic auth password.
/// </summary>
#if NET7_0_OR_GREATER

public required string Password { get; set; }
#else
public string Password { get; set; } = null!;
#endif



/// <summary>
/// Basic auth username.
/// </summary>
#if NET7_0_OR_GREATER

public required string Username { get; set; }
#else
public string Username { get; set; } = null!;
#endif

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,16 @@ public sealed class KakaoTalkChatCredentials
/// Kakaotalk Plus friend ID.
/// </summary>
[JsonPropertyName("kakaotalk_plus_friend_id")]
#if NET7_0_OR_GREATER

public required string KakaoTalkPlusFriendId { get; set; }
#else
public string KakaoTalkPlusFriendId { get; set; } = null!;
#endif


/// <summary>
/// InfoBank API KEY.
/// </summary>
[JsonPropertyName("api_key")]
#if NET7_0_OR_GREATER

public required string ApiKey { get; set; }
#else
public string ApiKey { get; set; } = null!;
#endif

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ public sealed class KakaoTalkCredentials
/// KakaoTalk Business Channel ID.
/// </summary>
[JsonPropertyName("kakaotalk_plus_friend_id")]
#if NET7_0_OR_GREATER

public required string KakaoTalkPlusFriendId { get; set; }
#else
public string KakaoTalkPlusFriendId { get; set; } = null!;
#endif


[JsonPropertyName("kakaotalk_sender_key")]
#if NET7_0_OR_GREATER

public required string KakaoTalkSenderKey { get; set; }
#else
public string KakaoTalkSenderKey { get; set; } = null!;
#endif

}
}
12 changes: 4 additions & 8 deletions src/Sinch/Conversation/Apps/Credentials/LineCredentials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@ public sealed class LineCredentials
/// <summary>
/// The token for the LINE channel to which you are connecting.
/// </summary>
#if NET7_0_OR_GREATER

public required string Token { get; set; }
#else
public string Token { get; set; } = null!;
#endif



/// <summary>
/// The secret for the LINE channel to which you are connecting.
/// </summary>
#if NET7_0_OR_GREATER

public required string Secret { get; set; }
#else
public string Secret { get; set; } = null!;
#endif

}
}
12 changes: 4 additions & 8 deletions src/Sinch/Conversation/Apps/Credentials/MMSCredentials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@ public sealed class MmsCredentials
/// <summary>
/// MMS Account ID.
/// </summary>
#if NET7_0_OR_GREATER

public required string AccountId { get; set; }
#else
public string AccountId { get; set; } = null!;
#endif



/// <summary>
/// MMS API Key.
/// </summary>
#if NET7_0_OR_GREATER

public required string ApiKey { get; set; }
#else
public string ApiKey { get; set; } = null!;
#endif



/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@ public sealed class StaticBearerCredential
/// <summary>
/// The claimed identity for the channel.
/// </summary>
#if NET7_0_OR_GREATER

public required string ClaimedIdentity { get; set; }
#else
public string ClaimedIdentity { get; set; } = null!;
#endif



/// <summary>
/// The static bearer token for the channel.
/// </summary>
#if NET7_0_OR_GREATER

public required string Token { get; set; }
#else
public string Token { get; set; } = null!;
#endif

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ public sealed class StaticTokenCredential
/// <summary>
/// The static token for the channel.
/// </summary>
#if NET7_0_OR_GREATER

public required string Token { get; set; }
#else
public string Token { get; set; } = null!;
#endif

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ public sealed class TelegramCredentials
/// <summary>
/// The token for the Telegram bot to which you are connecting.
/// </summary>
#if NET7_0_OR_GREATER

public required string Token { get; set; }
#else
public string Token { get; set; } = null!;
#endif

}
}
24 changes: 8 additions & 16 deletions src/Sinch/Conversation/Apps/Credentials/WeChatCredentials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,32 @@ public sealed class WeChatCredentials
/// <summary>
/// The AppID(Developer ID) for the WeChat channel to which you are connecting.
/// </summary>
#if NET7_0_OR_GREATER

public required string AppId { get; set; }
#else
public string AppId { get; set; } = null!;
#endif



/// <summary>
/// The AppSecret(Developer Password) for the WeChat channel to which you are connecting.
/// </summary>
#if NET7_0_OR_GREATER

public required string AppSecret { get; set; }
#else
public string AppSecret { get; set; } = null!;
#endif



/// <summary>
/// The Token for the WeChat channel to which you are connecting.
/// </summary>
#if NET7_0_OR_GREATER

public required string Token { get; set; }
#else
public string Token { get; set; } = null!;
#endif



/// <summary>
/// The Encoding AES Key for the WeChat channel to which you are connecting.
/// </summary>
#if NET7_0_OR_GREATER

public required string AesKey { get; set; }
#else
public string AesKey { get; set; } = null!;
#endif

}
}
6 changes: 2 additions & 4 deletions src/Sinch/Conversation/Apps/Update/UpdateAppRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ public sealed class UpdateAppRequest
/// <summary>
/// The display name for the app.
/// </summary>
#if NET7_0_OR_GREATER

public required string DisplayName { get; set; }
#else
public string DisplayName { get; set; } = null!;
#endif



/// <summary>
Expand Down
12 changes: 4 additions & 8 deletions src/Sinch/Conversation/Capability/LookupCapabilityRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@ public class LookupCapabilityRequest
/// <summary>
/// The ID of the app to use for capability lookup.
/// </summary>
#if NET7_0_OR_GREATER

public required string AppId { get; set; }
#else
public string AppId { get; set; } = null!;
#endif


/// <summary>
/// The recipient to lookup capabilities for. Requires either contact_id or identified_by.
/// </summary>
#if NET7_0_OR_GREATER

public required IRecipient Recipient { get; set; }
#else
public IRecipient Recipient { get; set; } = null!;
#endif


/// <summary>
/// ID for the asynchronous response, will be generated if not set. Currently this field is not used for idempotency.
Expand Down
12 changes: 4 additions & 8 deletions src/Sinch/Conversation/Capability/LookupCapabilityResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@ public class LookupCapabilityResponse
/// <summary>
/// The ID of the app to use for capability lookup.
/// </summary>
#if NET7_0_OR_GREATER

public required string AppId { get; set; }
#else
public string AppId { get; set; } = null!;
#endif


/// <summary>
/// The recipient to lookup capabilities for. Requires either contact_id or identified_by.
/// </summary>
#if NET7_0_OR_GREATER

public required IRecipient Recipient { get; set; }
#else
public IRecipient Recipient { get; set; } = null!;
#endif


/// <summary>
/// ID for the asynchronous response, will be generated if not set. Currently this field is not used for idempotency.
Expand Down
12 changes: 4 additions & 8 deletions src/Sinch/Conversation/Contacts/Create/CreateContactRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,16 @@ public class CreateContactRequest
/// <summary>
/// List of channel identities. Array must contain at least one item.
/// </summary>
#if NET7_0_OR_GREATER

public required List<ChannelIdentity> ChannelIdentities { get; set; }
#else
public List<ChannelIdentity> ChannelIdentities { get; set; } = null!;
#endif


/// <summary>
/// Gets or Sets Language
/// </summary>
#if NET7_0_OR_GREATER

public required string Language { get; set; }
#else
public string Language { get; set; } = null!;
#endif


/// <summary>
/// List of channels defining the channel priority. The channel at the top of the list is tried first.
Expand Down
Loading
Loading