Skip to content

Commit

Permalink
GHES 3.13: Changes in generated code (#25)
Browse files Browse the repository at this point in the history
* New updates to generated code

* New updates to generated code

* New updates to generated code
  • Loading branch information
octokitbot authored Jul 30, 2024
1 parent a0db023 commit ed0a505
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 49 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/add_to_octokit_project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Add PRs and issues to Octokit org project

on:
issues:
types: [reopened, opened]
pull_request_target:
types: [reopened, opened]

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/add-to-project@v1.0.1
with:
project-url: https://github.com/orgs/octokit/projects/10
github-token: ${{ secrets.OCTOKITBOT_PROJECT_ACTION_TOKEN }}
labeled: "Status: Stale"
label-operator: NOT
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Build and test .NET SDK"

on:
pull_request:
workflow_dispatch:
push:
branches:
- 3.13

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x.x'

- name: Build the project
run: dotnet build src/GitHub.Octokit.GHES.SDK.csproj

- name: Format
run: dotnet format --verify-no-changes

- name: Test SDK
run: dotnet test -p:CollectCoverage=true -p:CoverletOutput=TestResults/ -p:CoverletOutputFormat=opencover -p:ExcludeByFile="**/GitHub/**/*.cs"

- name: Build and strong name sign
run: dotnet build src/GitHub.Octokit.GHES.SDK.csproj --no-incremental /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=../key.snk
29 changes: 29 additions & 0 deletions .github/workflows/immediate-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Issue/PR response
permissions:
issues: write
pull-requests: write
on:
issues:
types:
- opened
pull_request_target:
types:
- opened
jobs:
respond-to-issue:
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && github.actor != 'githubactions[bot]' && github.actor != 'octokitbot' }}
runs-on: ubuntu-latest
steps:
- name: Determine issue or PR number
id: extract
run: echo "NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"

- name: Respond to issue or PR
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ steps.extract.outputs.NUMBER }}
body: >
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday!
We have a [process in place](https://github.com/octokit/.github/blob/main/community/prioritization_response.md#overview) for prioritizing and responding to your input.
Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with `Status: Up for grabs`.
You & others like you are the reason all of this works! So thank you & happy coding! 🚀
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Release to NuGet

on:
release:
types: [published]

defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x.x

- name: Build and strong name
run: dotnet build --configuration Release --no-incremental -p:version=${GITHUB_REF#refs/*/v} -p:SignAssembly=true -p:AssemblyOriginatorKeyFile=../key.snk

- name: Pack SDK
run: dotnet pack -p:version=${GITHUB_REF#refs/*/v} -o ./publish

- name: Ship to NuGet
run: dotnet nuget push ./publish/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate
6 changes: 3 additions & 3 deletions src/GitHub/Manage/V1/Access/Ssh/SshRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public SshRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(r
}
/// <summary>
/// Deletes a SSH key from the `authorized_keys` file for your GitHub Enterprise Server instance. This will remove access via SSH to your instance. For more information, see &quot;[Accessing the administrative shell (SSH)](https://docs.github.com/enterprise-server@3.13/admin/administering-your-instance/administering-your-instance-from-the-command-line/accessing-the-administrative-shell-ssh).&quot;
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#delete-ssh-key" />
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#delete-a-ssh-key" />
/// </summary>
/// <returns>A List&lt;GhesDeleteSshResponse&gt;</returns>
/// <param name="body">The request body</param>
Expand All @@ -54,7 +54,7 @@ public async Task<List<GhesDeleteSshResponse>> DeleteAsync(GhesDeleteSshRequest
}
/// <summary>
/// Gets the configured SSH keys on all available nodes. For more information, see &quot;[Accessing the administrative shell (SSH)](https://docs.github.com/enterprise-server@3.13/admin/administering-your-instance/administering-your-instance-from-the-command-line/accessing-the-administrative-shell-ssh).&quot;
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#get-ssh-keys" />
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys" />
/// </summary>
/// <returns>A List&lt;GhesGetSsh&gt;</returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
Expand All @@ -74,7 +74,7 @@ public async Task<List<GhesGetSsh>> GetAsync(Action<RequestConfiguration<Default
}
/// <summary>
/// Adds a SSH key to the `authorized_keys` file for your GitHub Enterprise Server instance. This will grant access via SSH to your instance. For more information, see &quot;[Accessing the administrative shell (SSH)](https://docs.github.com/enterprise-server@3.13/admin/administering-your-instance/administering-your-instance-from-the-command-line/accessing-the-administrative-shell-ssh).&quot;
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#set-ssh-key" />
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key" />
/// </summary>
/// <returns>A List&lt;GhesSetSshResponse&gt;</returns>
/// <param name="body">The request body</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public SystemRequirementsRequestBuilder(string rawUrl, IRequestAdapter requestAd
}
/// <summary>
/// Checks if the minimum requirements for system hardware resources are met on each configured cluster node.This endpoint may take several seconds to reply.
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#get-system-requirements-check-results-on-configured-nodes" />
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes" />
/// </summary>
/// <returns>A <see cref="GhesChecksSystemRequirements"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
Expand Down
4 changes: 2 additions & 2 deletions src/GitHub/Manage/V1/Config/Apply/ApplyRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ApplyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base
}
/// <summary>
/// Displays the current status of `ghe-config-apply` in the environment or the status of a historical run by ID.
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#get-config-apply-status" />
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run" />
/// </summary>
/// <returns>A <see cref="ApplyGetResponse"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
Expand All @@ -56,7 +56,7 @@ public async Task<ApplyGetResponse> GetAsync(Action<RequestConfiguration<ApplyRe
}
/// <summary>
/// Triggers a run of `ghe-config-apply` from the `ghes-manage` agent on your Nomad Delegate instance.You can provide a run ID or allow one to be generated randomly.
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#run-config-apply" />
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run" />
/// </summary>
/// <returns>A <see cref="ApplyPostResponse"/></returns>
/// <param name="body">The request body</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public EventsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : bas
}
/// <summary>
/// Lists events from an in-process `ghe-config-apply` run on your Github Enterprise Server instance.
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#get-config-apply-events" />
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply" />
/// </summary>
/// <returns>A <see cref="EventsGetResponse"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public SettingsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : b
}
/// <summary>
/// Gets a list of settings for a GitHub Enterprise Server instance.
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#get-settings" />
/// API method documentation <see href="https://docs.github.com/enterprise-server@3.13/rest/enterprise-admin/manage-ghes#get-the-ghes-settings" />
/// </summary>
/// <returns>A <see cref="GhesGetSettings"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
Expand Down
54 changes: 14 additions & 40 deletions src/GitHub/Models/Users.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,23 @@ public class Users : IAdditionalDataHolder, IParsable
{
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>The fragment property</summary>
/// <summary>Whether this email address is the primary address.</summary>
public bool? Primary { get; set; }
/// <summary>The type of email address.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Fragment { get; set; }
public string? Type { get; set; }
#nullable restore
#else
public string Fragment { get; set; }
public string Type { get; set; }
#endif
/// <summary>The matches property</summary>
/// <summary>The email address.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public List<Users_matches>? Matches { get; set; }
public string? Value { get; set; }
#nullable restore
#else
public List<Users_matches> Matches { get; set; }
#endif
/// <summary>The object_type property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? ObjectType { get; set; }
#nullable restore
#else
public string ObjectType { get; set; }
#endif
/// <summary>The object_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? ObjectUrl { get; set; }
#nullable restore
#else
public string ObjectUrl { get; set; }
#endif
/// <summary>The property property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Property { get; set; }
#nullable restore
#else
public string Property { get; set; }
public string Value { get; set; }
#endif
/// <summary>
/// Instantiates a new <see cref="Users"/> and sets the default values.
Expand All @@ -76,11 +54,9 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{"fragment", n => { Fragment = n.GetStringValue(); } },
{"matches", n => { Matches = n.GetCollectionOfObjectValues<Users_matches>(Users_matches.CreateFromDiscriminatorValue)?.ToList(); } },
{"object_type", n => { ObjectType = n.GetStringValue(); } },
{"object_url", n => { ObjectUrl = n.GetStringValue(); } },
{"property", n => { Property = n.GetStringValue(); } },
{"primary", n => { Primary = n.GetBoolValue(); } },
{"type", n => { Type = n.GetStringValue(); } },
{"value", n => { Value = n.GetStringValue(); } },
};
}
/// <summary>
Expand All @@ -90,11 +66,9 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
public virtual void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("fragment", Fragment);
writer.WriteCollectionOfObjectValues<Users_matches>("matches", Matches);
writer.WriteStringValue("object_type", ObjectType);
writer.WriteStringValue("object_url", ObjectUrl);
writer.WriteStringValue("property", Property);
writer.WriteBoolValue("primary", Primary);
writer.WriteStringValue("type", Type);
writer.WriteStringValue("value", Value);
writer.WriteAdditionalData(AdditionalData);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "9D9A184D00A85E32AA409023B479F72D6F31F52FC7BBAFE4E311CBE737AB5A931FC721CE7D3C8D43AAA356E53C3F52A89B3C4DEBDC19AF3E0E2DDF65B9729511",
"descriptionHash": "93E33BEBE290E954E622695CA7444705EF459A88105981311FA1B8D8CA99C4E8F1FF19DBB0AFE3050ACA1465BE3F3BF36AB22F85D601E01AF406C137BAB42E9A",
"descriptionLocation": "../../../../../schemas/ghes-3.13.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.14.0",
Expand Down

0 comments on commit ed0a505

Please sign in to comment.