From fcd677c54a26042ecf15da9a34c9f74574b6138e Mon Sep 17 00:00:00 2001 From: sburman Date: Fri, 24 Nov 2023 23:40:29 +0530 Subject: [PATCH] dotnet formats --- src/SendGrid/Permissions/ScopeOptions.cs | 2 +- .../SendGridPermissionsBuilder.Scopes.cs | 60 +++++++++---------- src/SendGrid/SendGridClient.cs | 2 +- tests/SendGrid.Tests/Integration.cs | 2 +- tests/SendGrid.Tests/LicenseTests.cs | 10 ++-- .../SendGrid.Tests/PermissionsBuilderTests.cs | 2 +- .../Reliability/ReliabilitySettingsTests.cs | 4 +- .../SendGrid.Tests/RequiredFilesExistTest.cs | 3 +- .../SendgridEmailClientTests.cs | 6 -- 9 files changed, 43 insertions(+), 48 deletions(-) diff --git a/src/SendGrid/Permissions/ScopeOptions.cs b/src/SendGrid/Permissions/ScopeOptions.cs index 855327b2f..50cea6d23 100644 --- a/src/SendGrid/Permissions/ScopeOptions.cs +++ b/src/SendGrid/Permissions/ScopeOptions.cs @@ -14,6 +14,6 @@ public enum ScopeOptions /// /// Read-only scopes. When fitlering scopes this will include only those that end with ".read" /// - ReadOnly + ReadOnly } } diff --git a/src/SendGrid/Permissions/SendGridPermissionsBuilder.Scopes.cs b/src/SendGrid/Permissions/SendGridPermissionsBuilder.Scopes.cs index 62d8588e6..344e79c3a 100644 --- a/src/SendGrid/Permissions/SendGridPermissionsBuilder.Scopes.cs +++ b/src/SendGrid/Permissions/SendGridPermissionsBuilder.Scopes.cs @@ -296,17 +296,17 @@ partial class SendGridPermissionsBuilder #endregion #region Mail ,{ SendGridPermission.Mail, new[] - { + { "mail.batch.create", "mail.batch.delete", "mail.batch.read", "mail.batch.update", "mail.send" - }} + }} #endregion #region Mail Settings ,{ SendGridPermission.MailSettings, new[] - { + { "mail_settings.address_whitelist.read", "mail_settings.address_whitelist.update", "mail_settings.bounce_purge.read", @@ -319,56 +319,56 @@ partial class SendGridPermissionsBuilder "mail_settings.forward_spam.update", "mail_settings.template.read", "mail_settings.template.update" - }} + }} #endregion #region Marketing Campaigns ,{ SendGridPermission.MarketingCampaigns, new[] - { + { "marketing_campaigns.create", "marketing_campaigns.delete", "marketing_campaigns.read", "marketing_campaigns.update" - }} + }} #endregion #region Newsletter ,{ SendGridPermission.Newsletter, new[] - { + { "newsletter.create", "newsletter.delete", "newsletter.read", "newsletter.update" - }} + }} #endregion #region PartnerSettings ,{ SendGridPermission.PartnerSettings, new[] - { + { "partner_settings.new_relic.read", "partner_settings.new_relic.update", "partner_settings.read" - }} + }} #endregion #region Reverse DNS ,{ SendGridPermission.ReverseDNS, new[] - { + { "access_settings.activity.read", "access_settings.whitelist.create", "access_settings.whitelist.delete", "access_settings.whitelist.read", "access_settings.whitelist.update" - }} + }} #endregion #region Scheduled Sends ,{ SendGridPermission.ScheduledSends, new[] - { + { "user.scheduled_sends.create", "user.scheduled_sends.delete", "user.scheduled_sends.read", "user.scheduled_sends.update" - }} + }} #endregion #region Stats ,{ SendGridPermission.Stats, new[] - { + { "email_activity.read", "stats.read", "stats.global.read", @@ -381,11 +381,11 @@ partial class SendGridPermissionsBuilder "clients.stats.read", "clients.tablet.stats.read", "clients.webmail.stats.read" - }} + }} #endregion #region Subusers ,{ SendGridPermission.Subusers, new[] - { + { "subusers.create", "subusers.delete", "subusers.read", @@ -407,11 +407,11 @@ partial class SendGridPermissionsBuilder "subusers.stats.monthly.read", "subusers.stats.sums.read", "subusers.summary.read" - }} + }} #endregion #region Suppressions ,{ SendGridPermission.Suppressions, new[] - { + { "suppression.create", "suppression.delete", "suppression.read", @@ -436,20 +436,20 @@ partial class SendGridPermissionsBuilder "suppression.unsubscribes.read", "suppression.unsubscribes.update", "suppression.unsubscribes.delete" - }} + }} #endregion #region Teammates ,{ SendGridPermission.Teammates, new[] - { + { "teammates.create", "teammates.read", "teammates.update", "teammates.delete" - }} + }} #endregion #region Templates ,{ SendGridPermission.Templates, new[] - { + { "templates.create", "templates.delete", "templates.read", @@ -462,11 +462,11 @@ partial class SendGridPermissionsBuilder "templates.versions.delete", "templates.versions.read", "templates.versions.update" - }} + }} #endregion #region Tracking ,{ SendGridPermission.Tracking, new[] - { + { "tracking_settings.click.read", "tracking_settings.click.update", "tracking_settings.google_analytics.read", @@ -476,11 +476,11 @@ partial class SendGridPermissionsBuilder "tracking_settings.read", "tracking_settings.subscription.read", "tracking_settings.subscription.update" - }} + }} #endregion #region User Settings ,{ SendGridPermission.UserSettings, new[] - { + { "user.account.read", "user.credits.read", "user.email.create", @@ -501,11 +501,11 @@ partial class SendGridPermissionsBuilder "user.timezone.update", "user.username.read", "user.username.update" - }} + }} #endregion #region Webhooks ,{ SendGridPermission.Webhook, new[] - { + { "user.webhooks.event.settings.read", "user.webhooks.event.settings.update", "user.webhooks.event.test.create", @@ -516,7 +516,7 @@ partial class SendGridPermissionsBuilder "user.webhooks.parse.settings.read", "user.webhooks.parse.settings.update", "user.webhooks.parse.stats.read" - }} + }} #endregion }; } diff --git a/src/SendGrid/SendGridClient.cs b/src/SendGrid/SendGridClient.cs index 8b1c35cfe..3bcd15dd5 100644 --- a/src/SendGrid/SendGridClient.cs +++ b/src/SendGrid/SendGridClient.cs @@ -91,6 +91,6 @@ private static SendGridClientOptions buildOptions(string apiKey, string host, Di HttpErrorAsException = httpErrorAsException }; } - + } } diff --git a/tests/SendGrid.Tests/Integration.cs b/tests/SendGrid.Tests/Integration.cs index f5db6f4bc..b80ae8582 100644 --- a/tests/SendGrid.Tests/Integration.cs +++ b/tests/SendGrid.Tests/Integration.cs @@ -6123,7 +6123,7 @@ public async Task TestRetryBehaviourSucceedsOnSecondAttempt() [Fact] public async void TestHttpErrorAsExceptionWhenSetInOptions() { - await TestHttpErrorAsException((client, apiKey) => new SendGridClient(client, new SendGridClientOptions {ApiKey = apiKey, HttpErrorAsException = true})); + await TestHttpErrorAsException((client, apiKey) => new SendGridClient(client, new SendGridClientOptions { ApiKey = apiKey, HttpErrorAsException = true })); } [Fact] diff --git a/tests/SendGrid.Tests/LicenseTests.cs b/tests/SendGrid.Tests/LicenseTests.cs index 534b352d8..bd44c7f68 100644 --- a/tests/SendGrid.Tests/LicenseTests.cs +++ b/tests/SendGrid.Tests/LicenseTests.cs @@ -1,10 +1,10 @@ namespace SendGrid.Tests { - using System; - using System.IO; - using System.Linq; - using System.Reflection; - using Xunit; + using System; + using System.IO; + using System.Linq; + using System.Reflection; + using Xunit; public class LicenseTests { diff --git a/tests/SendGrid.Tests/PermissionsBuilderTests.cs b/tests/SendGrid.Tests/PermissionsBuilderTests.cs index 9dad60617..06517f185 100644 --- a/tests/SendGrid.Tests/PermissionsBuilderTests.cs +++ b/tests/SendGrid.Tests/PermissionsBuilderTests.cs @@ -78,7 +78,7 @@ public void IncludeThrowsIfAnyScopeParamIsInvalid() public void IncludeThrowsIfAnyScopeIsInvalid() { var sb = new SendGridPermissionsBuilder(); - Assert.Throws(() => sb.Include(new [] {"alert.create", "bad.scope" })); + Assert.Throws(() => sb.Include(new[] { "alert.create", "bad.scope" })); } [Fact] diff --git a/tests/SendGrid.Tests/Reliability/ReliabilitySettingsTests.cs b/tests/SendGrid.Tests/Reliability/ReliabilitySettingsTests.cs index 10bd62978..c63675775 100644 --- a/tests/SendGrid.Tests/Reliability/ReliabilitySettingsTests.cs +++ b/tests/SendGrid.Tests/Reliability/ReliabilitySettingsTests.cs @@ -9,8 +9,8 @@ public class ReliabilitySettingsTests [Fact] public void ShouldNotAllowNegativeRetryCount() { - var exception = Assert.Throws(() => - new ReliabilitySettings(-1, + var exception = Assert.Throws(() => + new ReliabilitySettings(-1, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1))); diff --git a/tests/SendGrid.Tests/RequiredFilesExistTest.cs b/tests/SendGrid.Tests/RequiredFilesExistTest.cs index 8e5230d7c..86916eda5 100644 --- a/tests/SendGrid.Tests/RequiredFilesExistTest.cs +++ b/tests/SendGrid.Tests/RequiredFilesExistTest.cs @@ -7,7 +7,8 @@ public class TestRequiredFilesExist { // ./Docker or docker/Docker - public void checkDockerExists() { + public void checkDockerExists() + { bool dockerExists = File.Exists("./Dockerfile") || File.Exists("./docker/Dockerfile"); Assert.True(dockerExists); diff --git a/tests/SendGrid.Tests/SendgridEmailClientTests.cs b/tests/SendGrid.Tests/SendgridEmailClientTests.cs index 828b1c6a9..292c1116b 100644 --- a/tests/SendGrid.Tests/SendgridEmailClientTests.cs +++ b/tests/SendGrid.Tests/SendgridEmailClientTests.cs @@ -35,9 +35,6 @@ public void TestClientOptionsSetViaSendgridClient() options.SetDataResidency("eu"); var sg = new SendGridClient(options); Assert.Equal("https://api.eu.sendgrid.com/", options.Host); - Console.WriteLine("HERE"); - Console.WriteLine(sg.UrlPath); - //Assert.Equal("https://api.eu.sendgrid.com/", sg.UrlPath); } [Fact] @@ -46,9 +43,6 @@ public void TestErrorClientOptions() var options = new SendGridClientOptions(); Assert.Throws(() => options.SetDataResidency("")); Assert.Throws(() => options.SetDataResidency(null)); - } - - } }