Skip to content

Commit

Permalink
update for API v2.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Cytraen committed Jun 1, 2021
1 parent eca326d commit 0c0c64e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
5 changes: 4 additions & 1 deletion BungieSharper.Entities/Applications/Entities.Applications.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ public enum ApplicationScopes : long
PartnerOfferGrant = 4096,

/// <summary>Allows an app to query sensitive information like unlock flags and values not available through normal methods.</summary>
DestinyUnlockValueQuery = 8192
DestinyUnlockValueQuery = 8192,

/// <summary>Allows an app to query sensitive user PII, most notably email information.</summary>
UserPiiRead = 16384
}

public class ApiUsage
Expand Down
21 changes: 21 additions & 0 deletions BungieSharper.Entities/Destiny/Entities.Destiny.Responses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,13 @@ public class DestinyVendorsResponse
/// </summary>
[JsonPropertyName("currencyLookups")]
public SingleComponentResponseOfDestinyCurrenciesComponent CurrencyLookups { get; set; }

/// <summary>
/// A map of string variable values by hash for this character context.
/// COMPONENT TYPE: StringVariables
/// </summary>
[JsonPropertyName("stringVariables")]
public SingleComponentResponseOfDestinyStringVariablesComponent StringVariables { get; set; }
}

public class PersonalDestinyVendorSaleItemSetComponent
Expand Down Expand Up @@ -563,6 +570,13 @@ public class DestinyVendorResponse
/// </summary>
[JsonPropertyName("currencyLookups")]
public SingleComponentResponseOfDestinyCurrenciesComponent CurrencyLookups { get; set; }

/// <summary>
/// A map of string variable values by hash for this character context.
/// COMPONENT TYPE: StringVariables
/// </summary>
[JsonPropertyName("stringVariables")]
public SingleComponentResponseOfDestinyStringVariablesComponent StringVariables { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -600,6 +614,13 @@ public class DestinyPublicVendorsResponse
/// </summary>
[JsonPropertyName("sales")]
public DictionaryComponentResponseOfuint32AndPublicDestinyVendorSaleItemSetComponent Sales { get; set; }

/// <summary>
/// A set of string variable values by hash for a public vendors context.
/// COMPONENT TYPE: StringVariables
/// </summary>
[JsonPropertyName("stringVariables")]
public SingleComponentResponseOfDestinyStringVariablesComponent StringVariables { get; set; }
}

public class PublicDestinyVendorSaleItemSetComponent
Expand Down
6 changes: 1 addition & 5 deletions BungieSharper.Entities/_ApiResponses.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using BungieSharper.Entities.Exceptions;
using BungieSharper.Entities.Exceptions;
using System.Collections.Generic;
using System.Text.Json.Serialization;

Expand All @@ -21,11 +21,7 @@ public class ApiResponse

public class ApiResponse<T> : ApiResponse
{
#if (NETSTANDARD2_1 || NETCOREAPP2_1 || NETCOREAPP3_1)
public T Response { get; set; }
#else
public T? Response { get; set; }
#endif
}

public class TokenResponse
Expand Down
10 changes: 5 additions & 5 deletions BungieSharper/Client/Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private ContentNotJsonException(HttpResponseMessage httpResponse, string message

internal static ContentNotJsonException NewContentNotJsonException(HttpResponseMessage httpResponse)
{
return new ContentNotJsonException(
return new(
httpResponse,
"The Bungie API returned content that was of type " + httpResponse.Content.Headers.ContentType?.MediaType + " instead of \"application/json\""
);
Expand All @@ -53,7 +53,7 @@ private ContentNullJsonException(HttpResponseMessage httpResponse, string messag

internal static ContentNullJsonException NewContentNullJsonException(HttpResponseMessage httpResponse)
{
return new ContentNullJsonException(
return new(
httpResponse,
"The response contained JSON content that was null or empty."
);
Expand All @@ -68,9 +68,9 @@ private NonRetryErrorCodeException(Entities.ApiResponse apiResponse, string mess

internal static NonRetryErrorCodeException NewNonRetryErrorCodeException(Entities.ApiResponse apiResponse)
{
return new NonRetryErrorCodeException(
return new(
apiResponse,
"The Bungie API returned an error code that will not be retried on."
$"The Bungie API returned an error code ({(int)apiResponse.ErrorCode}: {apiResponse.ErrorCode}) that will not be retried on."
);
}
}
Expand All @@ -83,7 +83,7 @@ private NullResponseException(Entities.ApiResponse apiResponse, string message)

internal static NullResponseException NewNullResponseException(Entities.ApiResponse apiResponse)
{
return new NullResponseException(
return new(
apiResponse,
"The response provided by the Bungie API was null or empty."
);
Expand Down

0 comments on commit 0c0c64e

Please sign in to comment.