Skip to content

Commit 1d4d846

Browse files
authored
Merge pull request #44 from teesofttech/chore/resolve-nullable-warnings
Resolve nullable warnings
2 parents 20a91b2 + d34467d commit 1d4d846

29 files changed

Lines changed: 209 additions & 121 deletions

src/TableauSharp/Common/Models/ErrorResponse.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace TableauSharp.Common.Models;
55
public class ErrorResponse
66
{
77
[JsonPropertyName("code")]
8-
public string Code { get; set; }
8+
public string Code { get; set; } = string.Empty;
99

1010
[JsonPropertyName("summary")]
11-
public string Summary { get; set; }
11+
public string Summary { get; set; } = string.Empty;
1212

1313
[JsonPropertyName("detail")]
14-
public string Detail { get; set; }
15-
}
14+
public string Detail { get; set; } = string.Empty;
15+
}

src/TableauSharp/Embedding/Models/TrustedTicketRequest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace TableauSharp.Embedding.Models;
22

33
public class TrustedTicketRequest
44
{
5-
public string Username { get; set; }
6-
public string ClientIp { get; set; }
7-
public string TargetSite { get; set; }
8-
}
5+
public string Username { get; set; } = string.Empty;
6+
public string? ClientIp { get; set; }
7+
public string? TargetSite { get; set; }
8+
}

src/TableauSharp/Embedding/Models/TrustedTicketResponse.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace TableauSharp.Embedding.Models;
22

33
public class TrustedTicketResponse
44
{
5-
public string TicketId { get; set; }
6-
public string EmbedUrl { get; set; }
7-
}
5+
public string TicketId { get; set; } = string.Empty;
6+
public string EmbedUrl { get; set; } = string.Empty;
7+
}

src/TableauSharp/Embedding/Services/EmbeddingService.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ public async Task<TrustedTicketResponse> GetTrustedTicketAsync(TrustedTicketRequ
4040

4141
var form = new Dictionary<string, string>
4242
{
43-
{ "username", request.Username },
44-
{ "target_site", request.TargetSite }
43+
{ "username", request.Username }
4544
};
4645

46+
if (!string.IsNullOrEmpty(request.TargetSite))
47+
{
48+
form.Add("target_site", request.TargetSite);
49+
}
50+
4751
if (!string.IsNullOrEmpty(request.ClientIp))
4852
{
4953
form.Add("client_ip", request.ClientIp);

src/TableauSharp/Permissions/Models/PermissionCapabilityAssignment.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ public class PermissionCapabilityAssignment
99
public PermissionCapability Capability { get; set; }
1010

1111
[JsonPropertyName("mode")]
12-
public string Mode { get; set; } // "Allow" or "Deny"
13-
}
12+
public string Mode { get; set; } = string.Empty; // "Allow" or "Deny"
13+
}

src/TableauSharp/Permissions/Models/PermissionSyncRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace TableauSharp.Permissions.Models;
22

33
public class PermissionSyncRequest
44
{
5-
public string TargetId { get; set; }
5+
public string TargetId { get; set; } = string.Empty;
66
public List<TableauPermission> Permissions { get; set; } = new();
7-
}
7+
}

src/TableauSharp/Permissions/Models/TableauPermission.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace TableauSharp.Permissions.Models;
55
public class TableauPermission
66
{
77
[JsonPropertyName("granteeId")]
8-
public string GranteeId { get; set; }
8+
public string GranteeId { get; set; } = string.Empty;
99

1010
[JsonPropertyName("granteeType")]
11-
public string GranteeType { get; set; } // "User" or "Group"
11+
public string GranteeType { get; set; } = string.Empty; // "User" or "Group"
1212

1313
[JsonPropertyName("capabilities")]
1414
public List<PermissionCapabilityAssignment> Capabilities { get; set; } = new();
15-
}
15+
}

src/TableauSharp/Projects/Models/ProjectCreateRequest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace TableauSharp.Projects.Models;
22

33
public class ProjectCreateRequest
44
{
5-
public string Name { get; set; }
6-
public string Description { get; set; }
7-
public string ParentProjectId { get; set; }
8-
}
5+
public string Name { get; set; } = string.Empty;
6+
public string? Description { get; set; }
7+
public string? ParentProjectId { get; set; }
8+
}

src/TableauSharp/Projects/Models/ProjectUpdateRequest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace TableauSharp.Projects.Models;
22

33
public class ProjectUpdateRequest
44
{
5-
public string Name { get; set; }
6-
public string Description { get; set; }
7-
}
5+
public string? Name { get; set; }
6+
public string? Description { get; set; }
7+
}

src/TableauSharp/Projects/Models/TableauProject.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ namespace TableauSharp.Projects.Models;
55
public class TableauProject
66
{
77
[JsonPropertyName("id")]
8-
public string Id { get; set; }
8+
public string Id { get; set; } = string.Empty;
99

1010
[JsonPropertyName("name")]
11-
public string Name { get; set; }
11+
public string Name { get; set; } = string.Empty;
1212

1313
[JsonPropertyName("description")]
14-
public string Description { get; set; }
14+
public string? Description { get; set; }
1515

1616
[JsonPropertyName("parentProjectId")]
17-
public string ParentProjectId { get; set; }
17+
public string? ParentProjectId { get; set; }
1818

1919
[JsonPropertyName("ownerId")]
20-
public string OwnerId { get; set; }
21-
}
20+
public string? OwnerId { get; set; }
21+
}

0 commit comments

Comments
 (0)