Skip to content

Commit

Permalink
dotnet formats
Browse files Browse the repository at this point in the history
  • Loading branch information
shrutiburman committed Nov 24, 2023
1 parent 4be136a commit fcd677c
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/SendGrid/Permissions/ScopeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ public enum ScopeOptions
/// <summary>
/// Read-only scopes. When fitlering scopes this will include only those that end with ".read"
/// </summary>
ReadOnly
ReadOnly
}
}
60 changes: 30 additions & 30 deletions src/SendGrid/Permissions/SendGridPermissionsBuilder.Scopes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -516,7 +516,7 @@ partial class SendGridPermissionsBuilder
"user.webhooks.parse.settings.read",
"user.webhooks.parse.settings.update",
"user.webhooks.parse.stats.read"
}}
}}
#endregion
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/SendGrid/SendGridClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ private static SendGridClientOptions buildOptions(string apiKey, string host, Di
HttpErrorAsException = httpErrorAsException
};
}

}
}
2 changes: 1 addition & 1 deletion tests/SendGrid.Tests/Integration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
10 changes: 5 additions & 5 deletions tests/SendGrid.Tests/LicenseTests.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion tests/SendGrid.Tests/PermissionsBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void IncludeThrowsIfAnyScopeParamIsInvalid()
public void IncludeThrowsIfAnyScopeIsInvalid()
{
var sb = new SendGridPermissionsBuilder();
Assert.Throws<InvalidOperationException>(() => sb.Include(new [] {"alert.create", "bad.scope" }));
Assert.Throws<InvalidOperationException>(() => sb.Include(new[] { "alert.create", "bad.scope" }));
}

[Fact]
Expand Down
4 changes: 2 additions & 2 deletions tests/SendGrid.Tests/Reliability/ReliabilitySettingsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public class ReliabilitySettingsTests
[Fact]
public void ShouldNotAllowNegativeRetryCount()
{
var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
new ReliabilitySettings(-1,
var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
new ReliabilitySettings(-1,
TimeSpan.FromSeconds(1),
TimeSpan.FromSeconds(1),
TimeSpan.FromSeconds(1)));
Expand Down
3 changes: 2 additions & 1 deletion tests/SendGrid.Tests/RequiredFilesExistTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 0 additions & 6 deletions tests/SendGrid.Tests/SendgridEmailClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -46,9 +43,6 @@ public void TestErrorClientOptions()
var options = new SendGridClientOptions();
Assert.Throws<ArgumentNullException>(() => options.SetDataResidency(""));
Assert.Throws<ArgumentNullException>(() => options.SetDataResidency(null));

}


}
}

0 comments on commit fcd677c

Please sign in to comment.