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

feat: Support version in request headers (box/box-codegen#418) #34

Merged
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
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "332479b", "specHash": "b2f7568", "version": "0.1.0" }
{ "engineHash": "be0f8b2", "specHash": "b2f7568", "version": "0.1.0" }
34 changes: 34 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"types": [
{
"type": "feat",
"section": "New Features and Enhancements",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "chore",
"hidden": true
},
{
"type": "docs",
"hidden": true
},
{
"type": "style",
"hidden": true
},
{
"type": "refactor",
"hidden": true
},
{
"type": "test",
"hidden": true
}
]
}
2 changes: 1 addition & 1 deletion Box.Sdk.Gen/Box.Sdk.Gen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>2.0.0</Version>
<Version>0.1.0</Version>
<Description>[Box Platform](https://box.dev) provides functionality to provide access to content stored within [Box](https://box.com). It provides endpoints for basic manipulation of files and folders, management of users within an enterprise, as well as more complex topics such as legal holds and retention policies.</Description>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Nullable>enable</Nullable>
Expand Down
3 changes: 1 addition & 2 deletions Box.Sdk.Gen/Networking/SdkConsts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ namespace Fetch
{
internal static class SdkConsts
{
static string SdkVersion = "0.1.0";
static string RunTimeVersion = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;

static KeyValuePair<string, string> UserAgentHeader = new KeyValuePair<string, string>("User-Agent", $"box-dotnet-generated-sdk/{SdkVersion}");
static KeyValuePair<string, string> UserAgentHeader = new KeyValuePair<string, string>("User-Agent", $"box-dotnet-generated-sdk/{Version.sdkVersion}");
static KeyValuePair<string, string> BoxUAHeader = new KeyValuePair<string, string>("X-Box-UA", $"agent={UserAgentHeader.Value}; env=dotnet/{RunTimeVersion}");

internal static List<KeyValuePair<string, string>> AnalyticsHeaders = new List<KeyValuePair<string, string>>() { UserAgentHeader, BoxUAHeader };
Expand Down
9 changes: 9 additions & 0 deletions Box.Sdk.Gen/Networking/Version.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace Fetch
{
public static class Version
{
public static string sdkVersion = "0.1.0";
}
}
Loading